:root {
    --navy: #101d36;
    --blue: #203c68;
    --gold: #e7b95b;
    --bg: #f4f7fb;
    --line: #dfe6ef;
    --muted: #68778d;
    --text: #17243b;
    --white: #fff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.45 Arial, Helvetica, sans-serif;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
::selection { background: #fff0c9; }

.site-header {
    background: var(--navy);
    color: white;
    padding: 26px max(16px, calc((100% - 1200px) / 2));
}
.header-top { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 22px; }
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex: none;
    background: transparent;
}
.eyebrow { display: block; font-size: 11px; letter-spacing: 1.6px; color: var(--gold); font-weight: bold; }
.brand .eyebrow { color: #cbd5e1; }
.brand strong { display: block; font-size: 18px; margin-top: 4px; }
.hero h2 { font-size: clamp(25px, 4vw, 36px); line-height: 1.15; margin: 0 0 9px; font-weight: 700; }
.hero p { color: #cbd5e1; margin: 0; max-width: 720px; }
.nav, .who { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.nav a, .header-link, .who span { color: white; text-decoration: none; font-weight: bold; font-size: 13px; }
.nav a.active, .nav a:hover, .header-link:hover { color: var(--gold); }

.wrap { max-width: 1200px; margin: auto; padding: 24px 16px 45px; }
.wrap.narrow { max-width: 560px; }
h1, h2 { margin: 0 0 8px; }
h1 { font-size: clamp(25px, 4vw, 36px); line-height: 1.15; }
h2 { font-size: 17px; }
.lede, .hint, .quiet { color: var(--muted); line-height: 1.5; }
.lede { margin: 8px 0 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 22px #12203a08;
}
.login-panel { max-width: 460px; margin: 0 auto; padding: 18px; }
.section-head, .split, .review-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.reference-sheet { padding: 16px; margin: 18px 0; }
.reference-sheet img { width: 100%; height: auto; display: block; border-radius: 12px; }
.example-mini { width: auto; height: 150px; max-width: none; object-fit: unset; display: block; border-radius: 10px; margin-top: 4px; background: transparent; }
.welcome { display: grid; gap: 10px; margin-bottom: 8px; }
.banner, .flash, .review-note { border-radius: 10px; padding: 12px 14px; }
.banner, .flash.info, .review-note { background: #fff9e9; color: #755a1c; border: 1px solid #ead9a8; }
.banner.ok, .flash.success { background: #e4f6ea; color: #146c36; border: 1px solid #b7e4c7; }
.banner.bad, .flash.error { background: #fdeaea; color: #9d2b2b; border: 1px solid #f3c0c0; }
.banner.redo { background: #edf3fa; color: #203c68; border: 1px solid #d5e2f2; }
.flash { margin: 0 0 16px; font-weight: bold; }
.review-note { margin: 0; }
.meter { height: 8px; width: min(280px, 100%); background: #e7edf5; border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; width: var(--p); background: var(--blue); }

.tools { display: grid; gap: 16px; margin: 18px 0; }
.stack { display: grid; gap: 12px; }
.stack.tight { gap: 8px; justify-items: start; }
.danger-zone { border-color: #f3c0c0; }
.guide { margin-top: 8px; padding: 16px; }
.guide p { margin: 8px 0 0; }
.guide ul { margin: 8px 0 0; padding-left: 18px; }
.guide li { margin: 8px 0; }
.site-footer { text-align: center; color: #7a8799; font-size: 11px; padding: 8px 16px 28px; }

.photo-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 18px 0 28px; }
.shot { background: white; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 6px 22px #12203a08; }
.pose-row { display: grid; grid-template-columns: 1fr 1fr; }
.example { margin: 0; background: #111; position: relative; }
.example img, .shot-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.example figcaption {
    position: absolute;
    left: 8px;
    bottom: 8px;
    background: #101d36;
    color: white;
    border-radius: 20px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
}
.shot-preview { position: relative; aspect-ratio: 3 / 4; background: #eef2f7; }
.sample-line { display: flex; gap: 12px; align-items: flex-start; }
.pair { display: flex; gap: 8px; align-items: flex-start; flex: none; }
.mine-thumb { height: 112px; width: auto; display: block; border-radius: 10px; background: transparent; }
.mine-empty { height: 112px; width: 74px; border: 1px dashed #c5ceda; border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-size: 11px; text-align: center; padding: 6px; background: transparent; }
.sample-open { padding: 0; border: 0; background: transparent; cursor: zoom-in; line-height: 0; flex: none; border-radius: 10px; }
.sample-thumb { height: 112px; width: auto; display: block; border-radius: 10px; background: transparent; }
.sample-lightbox { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(16, 29, 54, 0.92); }
.sample-lightbox img { max-width: min(92vw, 520px); max-height: 86vh; width: auto; height: auto; border-radius: 12px; background: transparent; }
.sample-lightbox .sample-close { position: absolute; top: 16px; right: 16px; min-height: 42px; }
.photo-grid .shot-preview { aspect-ratio: auto; min-height: 0; background: transparent; }
.photo-grid .shot-preview img { width: auto; max-width: 120px; max-height: 150px; height: auto; object-fit: contain; border-radius: 8px; }
.photo-grid .placeholder { position: static; display: block; margin: 0; color: var(--muted); text-align: left; }
.review-grid .sample-line { flex-wrap: wrap; }
.review-side {
    flex: 1;
    min-width: 148px;
    background: var(--navy);
    color: white;
    border-radius: 12px;
    padding: 12px 14px;
    display: grid;
    gap: 8px;
    align-content: start;
}
.review-side h2 { color: white; margin: 0; }
.shot-preview .badge { position: absolute; top: 10px; left: 10px; z-index: 1; }
.placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 6px;
    color: var(--muted);
    text-align: center;
}
.shot-body { display: grid; gap: 10px; padding: 16px; }
.shot-body h2 { font-size: 16px; }
.shot-body .btn, form.panel.stack > .btn, .login-panel .btn { width: 100%; }
.file-name { margin: 0; color: var(--muted); font-size: 12px; }

.badge { display: inline-flex; width: fit-content; padding: 5px 9px; border-radius: 20px; font-size: 11px; font-weight: bold; letter-spacing: .2px; }
.badge.ok { background: #e4f6ea; color: #1d7a3c; }
.badge.wait { background: #fff0c9; color: #825a12; }
.badge.bad { background: #fdeaea; color: #b03232; }
.badge.redo { background: #edf3fa; color: #203c68; }
.badge.idle { background: #eef2f8; color: #405979; }

.btn, .file-btn, .header-link {
    font: inherit;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
}
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--navy);
    background: var(--navy);
    color: white;
    border-radius: 9px;
    padding: 10px 13px;
    min-height: 42px;
}
.btn:hover { background: var(--blue); border-color: var(--blue); }
.btn.secondary { background: white; color: #34445e; border-color: #d4dce8; }
.btn.secondary:hover { background: #f7f9fc; }
.btn.danger { background: #b03232; border-color: #b03232; }
.btn.small { min-height: 0; padding: 6px 10px; font-size: 12px; }
.btn:disabled { opacity: .6; cursor: wait; }
.file-btn {
    position: relative;
    display: inline-flex;
    justify-content: center;
    border: 1px solid #d4dce8;
    border-radius: 9px;
    padding: 10px 13px;
    background: white;
    color: #34445e;
}
.file-btn input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: bold; letter-spacing: .4px; color: var(--muted); }
input, select, textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d4dce8;
    border-radius: 9px;
    background: white;
    padding: 10px 12px;
    font: inherit;
    font-weight: normal;
    color: var(--text);
}
textarea { min-height: 96px; resize: vertical; }
.inline-form { display: inline; }
.code-line { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 16px; }
.text-link { color: var(--blue); font-weight: bold; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 18px 0; }
.stat {
    display: grid;
    gap: 6px;
    text-decoration: none;
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
}
.stat strong { font-size: 21px; }
.stat span { font-size: 10px; letter-spacing: .8px; color: var(--muted); font-weight: bold; }
.stat:hover { border-color: var(--gold); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters a,
.filters button {
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid var(--line);
    background: white;
    color: #3f5069;
    border-radius: 9px;
    padding: 10px 13px;
    font-size: 13px;
    font-weight: bold;
}
.filters a.active,
.filters button.active { background: var(--blue); border-color: var(--blue); color: white; }
.search { display: flex; gap: 9px; align-items: end; margin: 14px 0; }
.grow { flex: 1; }
.table-wrap { width: 100%; overflow-x: auto; }
.table-scroll { max-height: 70vh; overflow: auto; margin-bottom: 16px; }
.table-scroll table { border-collapse: separate; border-spacing: 0; }
.table-scroll thead th { position: sticky; top: 0; z-index: 1; box-shadow: inset 0 -1px 0 var(--line); }
table { border-collapse: collapse; width: 100%; min-width: 860px; }
th {
    text-align: left;
    background: #f7f9fc;
    color: #65758b;
    padding: 13px 14px;
    font-size: 10px;
    letter-spacing: .7px;
}
td { padding: 13px 14px; border-top: 1px solid #edf0f5; font-size: 13px; vertical-align: middle; }
tbody tr:hover { background: #fafcff; }
.pager { display: flex; gap: 14px; justify-content: flex-end; align-items: center; margin-top: 14px; }
.pager a { color: var(--blue); font-weight: bold; }
.error-list { margin: 12px 0 0; color: #9d2b2b; }
.panel { padding: 0; }
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > h1,
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > h2,
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > .lede,
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > .split,
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > .filters,
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > .search,
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > .quiet,
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > .table-wrap,
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > .pager,
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > .error-list,
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > form { margin-left: 16px; margin-right: 16px; }
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > h1,
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > h2,
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > .split { padding-top: 16px; }
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > .pager,
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > .quiet,
.panel:not(form):not(.login-panel):not(.guide):not(.reference-sheet) > form { padding-bottom: 16px; }
.login-panel, .guide, .reference-sheet, .shot-body, form.panel { padding: 16px; }
form.panel.stack > h2 { margin-top: 0; }

@media (min-width: 800px) {
    .photo-grid { grid-template-columns: 1fr 1fr; }
    .tools { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .site-header { padding: 22px 16px; }
    .header-top { align-items: flex-start; flex-wrap: wrap; }
    .nav, .who { margin-left: auto; }
    .pose-row { grid-template-columns: 1fr 1fr; }
    .search { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
