:root{--pink:#ec4899;--ink:#1f2937;--muted:#6b7280;--line:#e5e7eb;--bg:#ffffff;--soft:#f9fafb;--nav-h:64px;}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent!important;}
body{margin:0;background:var(--bg);color:var(--ink);font-family:'Zen Maru Gothic',sans-serif;overflow-x:hidden;}
body[data-access="pending"] .top-links,
body[data-access="pending"] main.wrap > .panel,
body[data-access="pending"] .train-layout,
body[data-access="pending"] .tab-panel,
body[data-access="pending"] .blog-bottom-bar,
body[data-access="denied"] .top-links,
body[data-access="denied"] main.wrap > .panel:not(.access-panel),
body[data-access="denied"] .train-layout,
body[data-access="denied"] .tab-panel,
body[data-access="denied"] .blog-bottom-bar{display:none;}
.astra-header{position:fixed;top:0;left:0;right:0;z-index:80;height:var(--nav-h);display:flex;align-items:center;background:#fff;border-bottom:1px solid #f3f4f6;}
.astra-brand{width:min(980px,100%);margin:0 auto;padding:0 18px;display:flex;align-items:center;gap:10px;color:#1f2937;text-decoration:none;min-width:0;}
.astra-brand img{width:38px;height:38px;object-fit:contain;border:none;background:transparent;display:block;}
.astra-brand span{display:grid;gap:1px;min-width:0;}
.astra-brand strong{font-size:.92rem;letter-spacing:.18em;font-weight:700;line-height:1;}
.astra-brand small{font-size:.62rem;color:#9ca3af;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
button,input,select,textarea{font-family:inherit;}
.wrap{max-width:980px;margin:0 auto;padding:calc(var(--nav-h) + 26px) 18px 108px;}
.hero{padding-bottom:18px;border-bottom:1px solid #f3f4f6;margin-bottom:16px;}
.eyebrow{font-size:.66rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--pink);margin:0 0 8px;}
h1{font-size:1.8rem;line-height:1.25;margin:0;font-weight:700;}
.lead{font-size:.86rem;line-height:1.75;color:var(--muted);margin:10px 0 0;}
.model-name{font-size:.68rem;line-height:1.5;color:#9ca3af;font-weight:700;margin:8px 0 0;}
.top-links{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px;}
.train-tabs{overflow:auto;border-radius:1rem;}
.train-tabs button{white-space:nowrap;min-width:max-content;}
.tab-panel{display:block;}
.section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px;}
.section-head h2{font-size:1.08rem;line-height:1.35;margin:0;font-weight:700;}
.model-pill{border:1.5px solid #f3f4f6;border-radius:999px;background:#fafafa;color:#6b7280;font-size:.72rem;font-weight:700;line-height:1.45;padding:6px 10px;white-space:nowrap;}
.link-list{display:flex;gap:8px;flex-wrap:wrap;}
.panel{border:1.5px solid #f3f4f6;border-radius:1.2rem;background:#fff;padding:16px;margin-bottom:14px;}
.access-panel h2{font-size:1.1rem;line-height:1.45;margin:0 0 8px;font-weight:700;}
.access-panel p{font-size:.84rem;line-height:1.7;color:#6b7280;margin:0 0 14px;font-weight:700;}
.access-login{display:grid;gap:8px;margin-top:12px;}
.access-login .field{font-size:.86rem;}
.access-login-error{display:none;font-size:.76rem;line-height:1.5;font-weight:700;color:#ef4444;}
.grid{display:grid;gap:12px;}
.grid.two{grid-template-columns:1fr 1fr;}
.label{display:block;font-size:.68rem;font-weight:700;color:#9ca3af;letter-spacing:.08em;text-transform:uppercase;margin:0 0 6px;}
.field,.select{width:100%;border:1.5px solid var(--line);border-radius:.9rem;background:#fff;color:#374151;font-size:.88rem;font-weight:500;padding:.72rem .85rem;outline:none;}
.file-drop{display:flex;align-items:center;justify-content:center;min-height:128px;border:1.5px dashed #e5e7eb;border-radius:1.1rem;background:#fafafa;text-align:center;color:#6b7280;font-size:.86rem;font-weight:700;cursor:pointer;padding:16px;}
.file-drop.compact{min-height:76px;}
.file-drop input{display:none;}
.toggle-row{display:flex;align-items:center;gap:8px;margin-top:12px;color:#4b5563;font-size:.8rem;font-weight:700;}
.toggle-row input{width:16px;height:16px;accent-color:#1f2937;}
.button{border:1.5px solid var(--line);border-radius:9999px;background:#fff;color:#374151;font-size:.84rem;font-weight:700;padding:.72rem 1rem;display:inline-flex;align-items:center;justify-content:center;gap:.45rem;cursor:pointer;text-decoration:none;min-height:42px;}
.button.primary{background:#1f2937;border-color:#1f2937;color:#fff;}
.button.primary.correct{border-color:#22c55e;}
.button.primary.register{border-color:#ef4444;}
.button.soft{background:#f9fafb;}
.button:disabled{opacity:.5;cursor:not-allowed;}
.button.loading{opacity:.82;cursor:progress;}
.button.loading::before{content:"";width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:999px;animation:spin .75s linear infinite;}
.icon-button{width:38px;height:38px;border:1.5px solid #f3f4f6;border-radius:999px;background:#fff;color:#6b7280;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;}
@keyframes spin{to{transform:rotate(360deg);}}
.seg{display:flex;gap:4px;background:#f3f4f6;border-radius:9999px;padding:3px;}
.seg button{flex:1;border:none;border-radius:9999px;background:transparent;color:#6b7280;font-size:.8rem;font-weight:700;padding:.62rem .8rem;cursor:pointer;}
.seg button.active{background:#1f2937;color:#fff;}
.status{font-size:.78rem;line-height:1.6;font-weight:700;color:#9ca3af;margin:10px 0 0;}
.preview{position:relative;width:100%;max-width:760px;margin:0 auto;border-radius:1rem;overflow:hidden;background:#f9fafb;border:1.5px solid #f3f4f6;}
.preview img{display:block;width:100%;height:auto;}
.preview canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;}
.results{display:grid;gap:10px;margin-top:12px;}
.result-card{border:1.5px solid #f3f4f6;border-radius:1rem;background:#fff;padding:12px;}
.result-title{display:flex;align-items:center;justify-content:space-between;gap:10px;font-weight:700;font-size:.92rem;}
.result-meta{font-size:.75rem;color:#9ca3af;font-weight:700;margin-top:4px;white-space:pre-line;}
.image-result-card{border:1.5px solid #f3f4f6;border-radius:1rem;background:#fff;padding:12px;display:grid;gap:10px;}
.image-result-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}
.image-result-name{font-size:.9rem;line-height:1.45;font-weight:700;word-break:break-word;}
.image-result-count{font-size:.78rem;font-weight:700;color:#ec4899;white-space:nowrap;}
.result-preview{max-width:none;}
.frames-off .result-preview canvas{display:none;}
.image-export-actions{margin-top:12px;padding-top:12px;border-top:1px solid #f3f4f6;}
.face-crop-results{display:grid;gap:8px;}
.face-result-card{display:grid;grid-template-columns:72px minmax(0,1fr);gap:10px;align-items:center;border:1.5px solid #f3f4f6;border-radius:.9rem;background:#fff;padding:8px;}
.face-result-card.linked{cursor:pointer;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease;}
.face-result-card.linked:hover{border-color:#f9a8d4;background:#fffafd;box-shadow:0 6px 18px rgba(236,72,153,.08);}
.face-result-card.linked:focus-visible{outline:3px solid rgba(236,72,153,.22);outline-offset:2px;}
.face-result-card canvas{width:72px;height:72px;border-radius:.7rem;background:#fafafa;display:block;}
.face-result-info{min-width:0;}
.empty-result{border:1.5px solid #f3f4f6;border-radius:.9rem;background:#fafafa;color:#9ca3af;font-size:.82rem;font-weight:700;padding:12px;text-align:center;}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px;}
.stat-card{border:1.5px solid #f3f4f6;border-radius:1rem;background:#fff;padding:12px;}
.stat-card.stat-total{border-color:#d1d5db;background:#fafafa;}
.stat-name{font-size:.82rem;font-weight:700;margin-bottom:4px;}
.stat-count{font-size:1.15rem;font-weight:700;color:#1f2937;}
.stat-date{font-size:.68rem;font-weight:700;color:#9ca3af;margin-top:2px;}
.stat-reset{width:100%;min-height:34px;margin-top:8px;padding:.42rem .68rem;font-size:.72rem;color:#ef4444;border-color:#fecaca;background:#fff;}
.train-layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(280px,.9fr);gap:14px;align-items:start;}
.face-list{display:grid;gap:7px;margin-top:8px;}
.face-option{border:1.5px solid #f3f4f6;border-radius:.9rem;background:#fff;padding:8px;display:grid;grid-template-columns:64px minmax(0,1fr);gap:9px;align-items:center;}
.face-option.active{border-color:#e5e7eb;}
.face-option.assigned{border-color:#f9a8d4;background:#fffafd;}
.face-option.skipped{opacity:.68;background:#fafafa;}
.face-option.low-quality{border-color:#fde68a;background:#fffdf4;}
.face-option canvas{width:64px;height:64px;border-radius:.65rem;background:#fafafa;display:block;}
.face-option-body{min-width:0;}
.face-option-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 5px;}
.face-option-title{font-size:.76rem;font-weight:700;color:#374151;}
.face-option-status{font-size:.64rem;font-weight:700;color:#9ca3af;white-space:nowrap;}
.face-member-select{width:100%;border:1.5px solid var(--line);border-radius:.72rem;background:#fff;color:#374151;font-size:.78rem;font-weight:700;padding:.5rem .65rem;outline:none;}
.face-skip{margin-top:4px;width:100%;border:none;background:transparent;color:#9ca3af;font-size:.68rem;font-weight:700;text-align:left;padding:2px 0;cursor:pointer;}
.face-skip:hover{color:#374151;}
.member-filter-tools{display:grid;gap:8px;margin-top:8px;}
.member-filter-tools .actions{margin-top:0;}
.member-filter{display:grid;grid-template-columns:repeat(auto-fit,minmax(132px,1fr));gap:7px;margin-top:10px;max-height:260px;overflow:auto;padding-right:2px;}
.member-filter-heading{grid-column:1/-1;font-size:.68rem;font-weight:700;color:#9ca3af;margin:5px 2px 1px;}
.member-filter label{display:flex;align-items:center;gap:8px;border:1.5px solid #f3f4f6;border-radius:.9rem;padding:9px 10px;font-size:.78rem;font-weight:700;color:#4b5563;background:#fff;}
.member-filter label:has(input:checked){border-color:#f9a8d4;background:#fffafd;color:#1f2937;}
.member-filter input{width:14px;height:14px;accent-color:#1f2937;flex-shrink:0;}
.filter-open{width:100%;margin-top:10px;justify-content:flex-start;}
.modal-backdrop{position:fixed;inset:0;z-index:120;background:rgba(17,24,39,.26);display:flex;align-items:center;justify-content:center;padding:18px;}
.modal-sheet{width:min(560px,100%);max-height:min(680px,calc(100dvh - 36px));overflow:auto;border:1.5px solid #f3f4f6;border-radius:1.2rem;background:#fff;padding:16px;box-shadow:0 18px 56px rgba(17,24,39,.16);}
.modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px;}
.modal-head h2{font-size:1.12rem;line-height:1.35;margin:0;font-weight:700;}
.modal-actions{display:flex;gap:8px;margin-top:14px;}
.access-manager{display:grid;gap:10px;}
.access-user-list{display:grid;gap:8px;max-height:320px;overflow:auto;padding-right:2px;}
.access-user-row{border:1.5px solid #f3f4f6;border-radius:1rem;background:#fff;padding:10px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;}
.access-user-name{font-size:.86rem;font-weight:700;color:#374151;line-height:1.45;}
.access-user-meta{font-size:.7rem;font-weight:700;color:#9ca3af;line-height:1.45;margin-top:2px;}
.access-user-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;}
.access-user-actions .button{min-height:34px;padding:.42rem .68rem;font-size:.72rem;}
.access-status{display:inline-flex;align-items:center;border:1.5px solid #f3f4f6;border-radius:999px;padding:2px 8px;font-size:.66rem;font-weight:700;color:#9ca3af;margin-left:6px;}
.access-status.active{border-color:#bbf7d0;color:#16a34a;}
.access-status.paused{border-color:#fecaca;color:#ef4444;}
.mobile-save-bar{margin-top:12px;border-top:1px solid #f3f4f6;padding-top:12px;display:flex;align-items:center;justify-content:space-between;gap:10px;}
.save-summary{font-size:.76rem;line-height:1.5;font-weight:700;color:#9ca3af;}
.blog-bottom-bar{position:fixed;left:0;right:0;bottom:0;z-index:70;display:none;gap:8px;padding:10px 14px calc(10px + env(safe-area-inset-bottom));background:rgba(255,255,255,.96);border-top:1px solid #f3f4f6;box-shadow:0 -8px 28px rgba(17,24,39,.08);}
.blog-bottom-bar .button{flex:1;min-width:0;padding-left:.5rem;padding-right:.5rem;}
.sort-bottom-bar{display:flex;}
.blog-card{border:1.5px solid #f3f4f6;border-radius:1rem;padding:12px;background:#fff;}
.blog-card{margin-top:10px;}
.blog-meta{font-size:.74rem;font-weight:700;color:#9ca3af;line-height:1.5;}
.blog-title{font-size:.92rem;font-weight:700;margin-top:4px;line-height:1.45;}
.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px;}
.hidden{display:none!important;}
@media(max-width:760px){
  .wrap{padding-left:14px;padding-right:14px;}
  h1{font-size:1.48rem;}
  .grid.two,.train-layout{grid-template-columns:1fr;}
  .panel{padding:14px;}
  .button{width:100%;}
  .section-head{display:grid;}
  .model-pill{white-space:normal;}
  .link-list{display:grid;}
  .actions .button{flex:1 1 44%;}
  .blog-actions{display:none;}
  body[data-train-mode="blog"] .blog-bottom-bar{display:flex;}
  .astra-brand{padding:0 14px;}
  .astra-brand small{max-width:calc(100vw - 86px);}
  .face-option{grid-template-columns:58px minmax(0,1fr);gap:8px;padding:7px;}
  .face-option canvas{width:58px;height:58px;}
  .mobile-save-bar{position:static;background:#fff;border-top:1px solid #f3f4f6;padding-top:10px;align-items:stretch;flex-direction:column;}
  body[data-train-mode="blog"] .mobile-save-bar .button{display:none;}
  .mobile-save-bar .button{width:100%;}
  .modal-backdrop{align-items:flex-end;padding:0;}
  .modal-sheet{max-height:78dvh;border-radius:1.2rem 1.2rem 0 0;border-bottom:none;padding:16px 14px calc(16px + env(safe-area-inset-bottom));}
  .modal-actions .button{flex:1;}
}
