/* All product styles are scoped to this plugin's portal or admin wrapper. */
.astpp-page { margin: 0; background: #f4f6f7; color: #20313b; }
.astpp-shell, .astpp-admin { font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; font-size: 16px; line-height: 1.75; color: #20313b; }
.astpp-shell *, .astpp-admin * { box-sizing: border-box; }
.astpp-shell { width: 100%; min-height: 100vh; overflow-wrap: anywhere; }
.astpp-shell h1, .astpp-shell h2, .astpp-shell p, .astpp-admin h2, .astpp-admin p { padding: 0; background: none; border: 0; }
.astpp-shell h1::before, .astpp-shell h1::after, .astpp-shell h2::before, .astpp-shell h2::after { content: none; }
.astpp-shell h1 { margin: 0 0 12px; font-size: clamp(23px, 3vw, 30px); font-weight: 700; line-height: 1.5; letter-spacing: .02em; }
.astpp-shell h2, .astpp-admin h2 { margin: 0 0 16px; font-size: 20px; font-weight: 650; line-height: 1.6; }
.astpp-shell p, .astpp-admin p { margin: 0 0 12px; }
.astpp-shell a { color: #15576b; text-decoration: none; }
.astpp-shell a:hover { text-decoration: underline; }
.astpp-shell a:focus-visible, .astpp-shell button:focus-visible, .astpp-shell input:focus-visible, .astpp-shell textarea:focus-visible, .astpp-shell select:focus-visible { outline: 3px solid #247f9b; outline-offset: 3px; }
.astpp-header { width: 100%; min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px max(24px, calc((100% - 1040px) / 2)); background: #fff; border-bottom: 1px solid #dce3e8; }
.astpp-brand { display: flex; flex-direction: column; flex-shrink: 0; color: #17394a !important; line-height: 1.25; }
.astpp-brand strong { font-size: 22px; letter-spacing: .14em; }
.astpp-brand span { margin-top: 5px; font-size: 12px; letter-spacing: .13em; }
.astpp-brand:hover { text-decoration: none !important; }
.astpp-account { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; min-width: 0; }
.astpp-account form { margin: 0; }
.astpp-shell .astpp-link { padding: 8px 0; border: 0; background: none; color: #52646f; min-height: 44px; font: inherit; text-decoration: underline; cursor: pointer; }
.astpp-main { width: min(100% - 48px, 1040px); margin: 40px auto 64px; }
.astpp-card { min-width: 0; background: #fff; border: 1px solid #dde4e9; border-radius: 12px; padding: 28px; margin-bottom: 20px; box-shadow: 0 2px 5px #17394a03; }
.astpp-page-heading { display: flex; gap: 24px; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.astpp-eyebrow { color: #436576; font-size: 14px; font-weight: 650; margin-bottom: 8px !important; }
.astpp-muted { color: #576976; }
.astpp-small { font-size: 13px; }
.astpp-projects { display: grid; gap: 16px; }
.astpp-project-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0; }
.astpp-project-card h2 { margin-bottom: 12px; font-size: 21px; }
.astpp-project-info { min-width: 0; }
.astpp-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; color: #576976; font-size: 13px; }
.astpp-badge { display: inline-flex; padding: 3px 11px; border-radius: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.astpp-status-active { background: #e7f2f3; color: #176070; }
.astpp-status-complete { background: #edf0f2; color: #4a5965; }
.astpp-status-on_hold { background: #faf0dc; color: #765619; }
.astpp-shell .astpp-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0; min-height: 48px; max-width: 100%; padding: 11px 23px; border: 1px solid #173e50; border-radius: 7px; background: #173e50; color: #fff; font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1.5; text-decoration: none; cursor: pointer; }
.astpp-shell .astpp-button:hover { background: #245469; text-decoration: none; }
.astpp-shell .astpp-button:disabled { opacity: .6; cursor: wait; }
.astpp-shell .astpp-secondary { background: #fff; color: #173e50; border-color: #c3d1d8; }
.astpp-shell .astpp-secondary:hover { background: #f0f5f7; }
.astpp-back { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0 20px; font-size: 14px; }
.astpp-project-heading { border-top: 3px solid #254b5b; }
.astpp-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 32px 0 18px; }
.astpp-section-heading h2 { margin: 0; }
.astpp-section-heading a { font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; }
.astpp-message { margin: 0 0 18px; border-left: 4px solid #c5d2dc; scroll-margin-top: 24px; }
.astpp-from-astronaut { border-left-color: #2d697b; }
.astpp-message-header { display: flex; justify-content: space-between; gap: 12px 24px; align-items: baseline; flex-wrap: wrap; margin-bottom: 18px; }
.astpp-message-header > div { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.astpp-author-side { font-size: 11px; color: #526779; letter-spacing: .035em; padding: 2px 7px; border-radius: 3px; background: #edf1f4; }
.astpp-from-astronaut .astpp-author-side { color: #235769; background: #e9f2f4; }
.astpp-message-header strong { font-size: 15px; }
.astpp-message-header time { font-size: 12px; color: #60717d; }
.astpp-message-body { line-height: 1.95; white-space: normal; overflow-wrap: anywhere; }
.astpp-shell .astpp-files, .astpp-admin .astpp-files { list-style: none; margin: 20px 0 0; padding: 0; }
.astpp-files li { list-style: none; margin: 7px 0 0; padding: 0; }
.astpp-files a { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; min-height: 52px; background: #f5f7f9; padding: 12px; border: 1px solid #dfe7ec; border-radius: 6px; text-decoration: none; }
.astpp-file-name { min-width: 0; flex: 1; font-size: 14px; overflow-wrap: anywhere; }
.astpp-file-type { flex-shrink: 0; color: #486171; font-size: 10px; font-weight: 700; border: 1px solid #ccd8df; background: #fff; border-radius: 3px; padding: 3px 5px; }
.astpp-file-size { flex-shrink: 0; font-size: 12px; color: #536775; }
.astpp-pagination { display: flex; justify-content: center; gap: 24px; align-items: center; flex-wrap: wrap; margin: 26px 0; font-size: 14px; }
.astpp-pagination a { display: inline-flex; align-items: center; min-height: 44px; }
.astpp-compose { margin-top: 36px; scroll-margin-top: 24px; }
.astpp-shell form { min-width: 0; }
.astpp-shell label, .astpp-admin-form > label { display: block; font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
.astpp-shell input[type="text"], .astpp-shell input[type="password"], .astpp-shell textarea, .astpp-shell select { display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #b9c9d3; border-radius: 6px; background: #fff; color: #20313b; font: inherit; box-shadow: none; }
.astpp-shell textarea { resize: vertical; line-height: 1.8; }
.astpp-required { margin-left: 6px; font-size: 11px; color: #9d3e37; }
.astpp-shell input[type="file"] { display: block; max-width: 100%; width: 100%; padding: 10px 0; color: #526674; font-size: 13px; }
.astpp-shell input[type="file"]::file-selector-button { padding: 10px 16px; margin-right: 10px; min-height: 44px; background: #edf2f5; border: 1px solid #cbd7df; border-radius: 5px; color: #294956; cursor: pointer; }
.astpp-compose-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 26px; }
.astpp-compose-footer p { margin: 0; }
.astpp-alert { border: 1px solid #bad6c9; background: #edf7f0; color: #2d5940; padding: 15px 20px; border-radius: 8px; margin: 0 0 24px; font-size: 14px; }
.astpp-error { background: #fff3ef; border-color: #e9c1b5; color: #8a3425; }
.astpp-hidden-label { color: #974934; font-size: 13px; }
.astpp-login { width: min(100%, 500px); margin: 70px auto; padding: 40px; }
.astpp-login .astpp-button { width: 100%; margin: 8px 0 24px; }
.astpp-check { display: flex !important; align-items: center; gap: 8px; min-height: 44px; font-weight: 400 !important; }
.astpp-check input { width: 18px; height: 18px; margin: 0; }
.astpp-shell .astpp-check input, .astpp-admin .astpp-check input { flex-shrink: 0; }
.astpp-shell input[type="email"] { display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 48px; padding: 11px 13px; border: 1px solid #b9c9d3; border-radius: 6px; background: #fff; color: #20313b; font: inherit; }
.astpp-admin .astpp-recipients { margin-top: 24px; padding: 16px; border: 1px solid #dce3e8; overflow-wrap: anywhere; }
.astpp-admin .astpp-recipients legend { font-weight: 600; }
.astpp-admin [data-astpp-recipient-company][hidden] { display: none; }
.astpp-filter { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.astpp-filter label { margin: 0 !important; flex-shrink: 0; }
.astpp-filter select { max-width: 360px; }
.astpp-footer { width: calc(100% - 40px); margin: 0 auto; padding: 0 0 30px; text-align: center; font-size: 11px; color: #627481; }
.astpp-sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.astpp-skip { position: absolute; left: 20px; top: -100px; background: #fff; padding: 12px; z-index: 9999; }
.astpp-skip:focus { top: 8px; }
.astpp-admin { max-width: 1180px; font-size: 14px; }
.astpp-admin .astpp-card { margin-top: 24px; }
.astpp-admin-form { max-width: 640px; }
.astpp-admin-form > input:not([type="hidden"]), .astpp-admin-form > select { width: 100%; max-width: 100%; min-height: 40px; }
.astpp-admin-form .submit { margin-bottom: 0; padding-bottom: 0; }
.astpp-table-wrap { overflow-x: auto; }
.astpp-admin table { min-width: 600px; }
.astpp-admin td { overflow-wrap: anywhere; max-width: 420px; }
.astpp-admin pre { white-space: pre-wrap; font-size: 12px; }
.astpp-settings { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 12px 18px; }
.astpp-settings dt { font-weight: 600; }
.astpp-settings dd { margin: 0; overflow-wrap: anywhere; }
.astpp-moderate { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid #dfe6ea; }
@media (max-width: 600px) {
    .astpp-header { padding: 18px 20px; gap: 14px; align-items: flex-start; }
    .astpp-brand strong { font-size: 18px; }
    .astpp-brand span { font-size: 10px; }
    .astpp-account { gap: 0 10px; font-size: 12px; }
    .astpp-account > span { max-width: 150px; }
    .astpp-main { width: calc(100% - 32px); margin-top: 28px; }
    .astpp-card { padding: 20px; border-radius: 9px; }
    .astpp-page-heading { display: block; margin-bottom: 24px; }
    .astpp-page-heading > a { margin-top: 8px; }
    .astpp-project-card { display: block; }
    .astpp-project-card .astpp-button { width: 100%; margin-top: 20px; }
    .astpp-project-card h2 { font-size: 19px; }
    .astpp-message-header { gap: 8px; margin-bottom: 16px; }
    .astpp-message-header time { width: 100%; }
    .astpp-files a { flex-wrap: wrap; gap: 6px 9px; padding: 11px; }
    .astpp-file-name { flex: 1 1 calc(100% - 60px); }
    .astpp-file-size { margin-left: auto; }
    .astpp-compose-footer { display: block; }
    .astpp-compose-footer .astpp-button { width: 100%; margin-top: 16px; }
    .astpp-login { margin: 32px auto; padding: 26px 22px; }
    .astpp-login h1 { font-size: 24px; }
    .astpp-filter { flex-wrap: wrap; }
    .astpp-filter select { flex: 1; }
    .astpp-filter label { width: 100%; }
    .astpp-settings { grid-template-columns: 1fr; gap: 4px; }
    .astpp-settings dd { margin-bottom: 12px; }
}
/* Shared spaces and protected document gallery. */
.astpp-shell [hidden], .astpp-admin [hidden] { display: none !important; }
.astpp-tabs { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; }
.astpp-tabs a { display: flex; align-items: center; padding: 10px 18px; min-height: 48px; border-radius: 7px; border: 1px solid #c3d1d8; }
.astpp-tabs a[aria-current] { background: #173e50; color: #fff; }
.astpp-space-switch { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 12px; margin-bottom: 16px; }
.astpp-space-switch label { grid-column: 1 / -1; margin: 0; }
.astpp-scope { font-size: 13px; padding: 12px !important; border-radius: 5px; background: #edf3f6 !important; overflow-wrap: anywhere; }
.astpp-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.astpp-document { padding: 16px; margin: 0; overflow-wrap: anywhere; }
.astpp-document h3 { font-size: 15px; margin: 12px 0; line-height: 1.6; }
.astpp-document img { display: block; width: 100%; height: 180px; object-fit: contain; background: #f3f6f8; border-radius: 5px; }
.astpp-pdf-mark { display: grid; place-content: center; height: 180px; background: #f3f6f8; font-size: 32px; color: #496774; }
.astpp-document > a { display: inline-flex; min-height: 44px; align-items: center; }
.astpp-lightbox { width: min(96vw, 1100px); max-height: 95vh; overflow: auto; padding: 18px; border: 0; border-radius: 8px; }
.astpp-lightbox::backdrop { background: #132733d9; }
.astpp-lightbox img { display: block; max-width: 100%; height: auto; margin: auto; }
.astpp-lightbox p { overflow-wrap: anywhere; margin: 10px 0; }
.astpp-upload-queue { padding-left: 24px; overflow-wrap: anywhere; }
.astpp-upload-queue li { padding: 6px 0; }
@media (max-width: 800px) { .astpp-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) {
    .astpp-gallery { grid-template-columns: minmax(0, 1fr); }
    .astpp-space-switch { grid-template-columns: minmax(0, 1fr); }
    .astpp-space-switch .astpp-button { width: 100%; }
}

/* Photo navigation and long Japanese labels on narrow screens. */
.astpp-shell .astpp-photo-entrances .astpp-tabs {display:flex;flex-wrap:wrap;gap:8px}
.astpp-shell .astpp-tabs a,.astpp-shell .astpp-pagination a {min-height:44px;display:inline-flex;align-items:center;padding:10px 14px;box-sizing:border-box;overflow-wrap:anywhere}
.astpp-shell .astpp-project-card {flex-wrap:wrap}
.astpp-shell .astpp-project-info {min-width:0;flex:1 1 100%}
.astpp-shell select,.astpp-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),.astpp-shell button {max-width:100%;min-height:44px}
.astpp-shell h1,.astpp-shell h2,.astpp-shell h3,.astpp-shell p,.astpp-shell li,.astpp-shell a,.astpp-shell button {overflow-wrap:anywhere}
.astpp-shell [data-astpp-documents] select {width:100%}
.astpp-shell .astpp-lightbox {box-sizing:border-box;max-height:90dvh;max-width:95vw;padding:12px;overscroll-behavior:contain}
.astpp-shell .astpp-lightbox [data-astpp-close] {position:sticky;top:0;z-index:1}
.astpp-shell .astpp-lightbox img {max-height:72dvh;object-fit:contain}
@media(max-width:480px){.astpp-shell .astpp-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}.astpp-shell .astpp-document{padding:10px}.astpp-shell .astpp-document h3{font-size:15px}.astpp-shell .astpp-photo img{height:140px}.astpp-shell .astpp-space-switch{display:flex;flex-wrap:wrap}.astpp-shell .astpp-space-switch select{min-width:0;width:100%}}

.astpp-shell .astpp-document > .astpp-photo{display:block;width:100%;min-width:0}

/* Document organization stays within the existing portal. */
.astpp-doc-select { min-height:44px; align-items:center; gap:.6rem; cursor:pointer; }
.astpp-doc-select:not([hidden]) { display:flex; }
.astpp-doc-select input { width:24px; height:24px; flex:none; }
.astpp-selecting { outline:2px solid #61758b; }
.astpp-selecting .astpp-photo { cursor:pointer; }
.astpp-selection-bar { position:sticky; top:0; z-index:5; background:#fff; padding:.6rem; border:1px solid #ccd4dd; border-radius:8px; }
.astpp-selection-bar button, [data-purge-confirm] button { min-height:44px; padding:.6rem .8rem; margin:.2rem; white-space:normal; }
[data-purge-confirm] { scroll-margin-top:1rem; overflow-wrap:anywhere; }
[data-purge-confirm] label { display:block; padding:.6rem 0; }
[data-purge-confirm] input[type=checkbox] { width:24px; height:24px; vertical-align:middle; }
[data-purge-confirm] input[name=confirmation] { display:block; max-width:100%; }
[data-selection-controls] p { margin:.3rem 0; }
[data-selection-result], [data-purge-items] { overflow-wrap:anywhere; }

.astpp-selection-active .astpp-selection-bar { position:fixed; top:auto; bottom:0; left:8px; right:8px; max-height:40vh; overflow:auto; box-shadow:0 -2px 10px #0002; }
body.astpp-organizing { padding-bottom:240px; }
.astpp-selection-active [data-purge-confirm] { margin-bottom:240px; }

/* Unified document entrances: bounded grid, wrapping labels and touch-sized controls. */
.astpp-shell .astpp-material-entrances{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;max-width:780px}
.astpp-shell .astpp-material-entrances a{display:flex;align-items:center;justify-content:center;min-height:52px;padding:12px;border:1px solid var(--astpp-border,#d7e0e7);border-radius:10px;text-align:center;font-weight:600;overflow-wrap:anywhere;line-height:1.5;text-decoration:none;background:#f5f8fb}
.astpp-shell .astpp-scope-filter,.astpp-shell .astpp-management{margin:12px 0}
.astpp-shell .astpp-scope-filter summary,.astpp-shell .astpp-management summary{cursor:pointer;min-height:44px;padding:10px 4px;box-sizing:border-box}
.astpp-shell .astpp-management{font-size:.92rem;color:#526174}
@media(max-width:600px){.astpp-shell .astpp-material-entrances{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.astpp-shell .astpp-material-entrances a{padding:10px 6px;font-size:1rem}}
