:root {
    --accent: #1b5a9e;
    --accent-dark: #123a66;
    --ink: #17242f;
    --muted: #586675;
    --paper: #f1f5fa;
    --line: #d7e1ec;
    --card: #ffffff;
    --error: #a3201a;
    --display: 'Fraunces', Georgia, serif;
    --body: 'Instrument Sans', -apple-system, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; }
h2 { font-size: 1.35rem; margin: 28px 0 12px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 2px; }

label { display: block; font-weight: 600; font-size: .9rem; }
input:not([type=checkbox], [type=radio]), select, textarea {
    display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: 400 1rem var(--body); color: var(--ink);
    background: var(--card); border: 1px solid var(--line); border-radius: 8px;
}
.btn { display: inline-block; padding: 12px 22px; border: 0; border-radius: 8px; font: 600 1rem var(--body); text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn:disabled { opacity: .6; cursor: default; }
.link { background: none; border: 0; padding: 0; font: 600 .95rem var(--body); color: var(--accent); cursor: pointer; text-decoration: underline; }
.error { color: var(--error); font-size: .95rem; margin: 10px 0; }
.error:empty { display: none; }
.field-error { display: block; color: var(--error); font-weight: 400; font-size: .85rem; }

/* Remove with the banner in each page when the portal goes live. Fixed colors so customer skins can't restyle it. */
.test-banner { position: sticky; top: 0; z-index: 20; padding: 8px 16px; background: #f6c945; color: #241b18; font: 400 .9rem/1.35 -apple-system, 'Segoe UI', sans-serif; text-align: center; }

.view-as { padding: 8px 16px; background: var(--line); font-size: .9rem; text-align: center; }

/* Landing */
.landing { background: var(--accent-dark); min-height: 100vh; display: grid; place-items: center; padding:  64px 16px 16px; }
.landing .test-banner { position: fixed; left: 0; right: 0; }
.login-card { width: 100%; max-width: 400px; padding: 36px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.login-card h1 { font-size: 2rem; margin-bottom: 8px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.login-card form { margin-top: 22px; display: grid; gap: 14px; }
.login-card.wide { max-width: 640px; }
.login-card .after { margin-top: 18px; text-align: center; font-size: .95rem; }
.login-card a { color: var(--accent); font-weight: 600; }
.login-card fieldset { border: 0; margin: 0; padding: 0; }
.login-card legend { padding: 0; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px 14px; }
.choices label { display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: 1rem; }
.field-trap { position: absolute; left: -9999px; }

/* Customer pages */
.brand { position: relative; text-align: center; padding: 34px 16px 22px; border-bottom: 1px solid var(--line); }
.brand img { display: block; width: 190px; height: auto; margin: 0 auto 10px; mix-blend-mode: multiply; }
.brand h1 { color: var(--accent); font-size: 2rem; letter-spacing: .06em; }
.brand p { color: var(--muted); margin-top: 2px; }
.brand .link { position: absolute; top: 16px; right: 16px; }
.tabs { display: flex; justify-content: center; gap: 8px; padding: 14px 16px 0; }
.tabs button { padding: 8px 16px; border: 1px solid transparent; border-radius: 8px; background: none; font: 600 .95rem var(--body); color: var(--muted); cursor: pointer; }
.tabs button[aria-pressed=true] { color: var(--accent); border-color: var(--line); background: var(--card); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; max-width: 1020px; margin: 0 auto; padding: 8px 16px 56px; align-items: start; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fields .wide { grid-column: 1 / -1; }
.approve { display: flex; gap: 10px; align-items: flex-start; margin: 22px 0 16px; font-weight: 400; font-size: 1rem; }
.approve input { margin-top: 5px; }
.proof { position: sticky; top: 56px; }
.proof-frame { background: var(--card); padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.proof-frame img { display: block; width: 100%; aspect-ratio: 153 / 252; box-shadow: 0 2px 10px rgba(0, 0, 0, .14); background: #fff; }
.proof .muted { margin-top: 8px; }
.problems { color: var(--error); padding-left: 18px; margin: 8px 0 0; font-size: .95rem; }
#historyTab { max-width: 1020px; margin: 0 auto; padding: 22px 16px 56px; overflow-x: auto; }

table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .8rem; color: var(--muted); }
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 26px; max-width: min(760px, calc(100vw - 32px)); color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, .4); }
#doneDialog h2 { margin-top: 0; }
#doneDialog p { margin: 10px 0 18px; }

/* Shop admin */
.admin { max-width: 1120px; margin: 0 auto; padding: 24px 16px 56px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.admin #orders { overflow-x: auto; }
.admin .tabs { justify-content: flex-start; padding: 0; margin-bottom: 18px; }
.admin .table-wrap { overflow-x: auto; }
.account-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: end; }
.status-message { margin: 12px 0; font-size: .95rem; }
.view-as-pick { margin-bottom: 14px; }
.view-as-pick .link + .link { margin-left: 14px; }
.notice { padding: 10px 14px; margin-bottom: 14px; background: #fbf0dc; color: #6e470c; border-radius: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.filters .grow { flex: 1 1 220px; }
.pill { padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; background: #e8eef5; }
.pill.new { background: #dfeaf7; color: var(--accent-dark); }
.pill.in-progress { background: #fbf0dc; color: #6e470c; }
.pill.complete { background: #e7f2ec; color: #235a40; }
.detail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.detail-head h2 { margin: 0; }
.detail-columns { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.detail-proof { width: 100%; box-shadow: 0 2px 10px rgba(0, 0, 0, .14); }
.detail-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 14px 0 0; font-size: .95rem; }
dt { color: var(--muted); }
dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 800px) {
    .layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .proof { position: static; order: -1; max-width: 210px; margin: 0 auto; width: 100%; }
    .proof h2 { margin-top: 12px; }
    .brand { padding-top: 22px; }
    .brand img { width: 140px; }
    .brand h1 { font-size: 1.45rem; letter-spacing: .03em; }
    .fields { grid-template-columns: minmax(0, 1fr); }
    .brand .link { position: static; display: block; margin: 10px auto 0; }
    .detail-columns { grid-template-columns: minmax(0, 1fr); }
    .detail-proof { max-width: 220px; }
}
