:root {
  --side: #14100f;
  --side-active: #2a1f18;
  --paper: #f6f0e4;
  --card: #fffdf8;
  --line: #e1d6c3;
  --line-2: #ece3d2;
  --ink: #241b17;
  --muted: #6b5d50;
  --gold: #d9a441;
  --gold-deep: #8a5f0c;
  --gold-ink: #1a1206;
  --ok: #2f8a54;
  --ok-bg: #dcefe2;
  --bad: #9b2c2c;
  --bad-bg: #f3dcdc;
  --serif: 'Bodoni Moda', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }
.shell { display: flex; min-height: 100vh; }

/* Sidebar */
aside { width: 264px; flex-shrink: 0; padding: 32px 20px; display: flex; flex-direction: column; gap: 32px; background: var(--side); color: #f4ead9; position: sticky; top: 0; height: 100vh; }
.a-logo { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.a-logo b { display: block; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 22px; line-height: 1; }
.a-logo small { font-size: 10px; letter-spacing: .24em; color: #b8a995; }
.a-nav { display: flex; flex-direction: column; gap: 4px; }
.a-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; color: #d8cbb6; border-radius: 2px; }
.a-nav a:hover { background: #1f1714; color: #f4ead9; }
.a-nav a[aria-current="page"] { background: var(--side-active); color: var(--gold); font-weight: 500; }
.a-foot { margin-top: auto; padding: 0 8px; font-size: 12px; line-height: 1.5; color: #9a8c7a; }

/* Main */
main { flex-grow: 1; min-width: 0; padding: 48px 56px 64px; display: flex; flex-direction: column; gap: 28px; }
.demo-flag { align-self: flex-start; font-size: 12px; letter-spacing: .08em; color: var(--gold-deep); background: #f7e7c4; border: 1px dashed #d9a441; padding: 6px 12px; border-radius: 2px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.top > div { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
h1 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 44px; line-height: 1.1; }
.top p { margin: 0; font-size: 17px; color: var(--muted); }
.status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: #f7e7c4; color: var(--gold-deep); }
.badge.grey { background: var(--line-2); color: var(--muted); }
.badge .d { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 2px; font-size: 15px; font-weight: 600; cursor: pointer; border: 1px solid var(--ink); background: transparent; color: var(--ink); }
.btn:hover { background: var(--line-2); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn-gold:hover { background: #e7b556; }
.btn-quiet { border-color: var(--line); font-weight: 500; }
.btn-danger { border-color: var(--line); color: var(--bad); font-weight: 500; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid-6-4 { grid-template-columns: 1.5fr 1fr; }
.panel { padding: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.panel h2 { margin: 0; font-size: 12px; letter-spacing: .16em; font-weight: 600; color: var(--gold-deep); }
.kv { display: flex; flex-direction: column; }
.kv div { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.kv div:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.preview { background: #14100f; color: #f4ead9; border-radius: 2px; padding: 26px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.preview .t { align-self: flex-start; background: var(--gold); color: var(--gold-ink); font-size: 11px; font-weight: 600; letter-spacing: .16em; padding: 4px 10px; border-radius: 2px; }
.preview .h { font-family: var(--serif); font-size: 36px; line-height: 1.05; }
.preview .h em { color: var(--gold); }
.preview .f { font-size: 14px; color: #d8cbb6; }
.preview svg { position: absolute; right: -40px; bottom: -80px; opacity: .5; }
.hint { margin: 0; font-size: 14px; color: var(--muted); }

.steps { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 20px; align-items: stretch; }
.step { display: flex; flex-direction: column; gap: 12px; }
.step-label { font-weight: 600; font-size: 14px; }
.arrow { align-self: center; color: var(--gold); font-size: 22px; }
.gcal { border: 1px solid var(--line); border-left: 4px solid #d9a441; border-radius: 4px; padding: 16px; background: #fff; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.gcal b { font-size: 16px; }
.gcal .sm { color: var(--muted); }
.gcal .lab { margin-top: 6px; align-self: flex-start; font-size: 12px; background: #f7e7c4; color: var(--gold-deep); padding: 2px 8px; border-radius: 999px; }
.map { display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 4px; }
.map div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; font-size: 14px; border-bottom: 1px solid var(--line-2); }
.map div:last-child { border-bottom: 0; }
.map span:last-child { color: var(--muted); text-align: right; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; letter-spacing: .14em; font-weight: 600; color: var(--muted); padding: 0 12px 10px 0; border-bottom: 1px solid var(--line); }
td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; }
.chipl { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--line-2); color: var(--muted); margin: 2px 4px 2px 0; white-space: nowrap; }
.chipl.gold { background: #f7e7c4; color: var(--gold-deep); }
.chipl.ok { background: var(--ok-bg); color: var(--ok); }

.check { display: flex; align-items: center; gap: 12px; min-height: 40px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold-deep); }
.log div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.log div:last-child { border-bottom: 0; }
.log span:last-child { color: var(--muted); }

/* Uploads */
.drop { border: 2px dashed #c9bba4; border-radius: 4px; background: #fbf6ec; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; transition: background .15s, border-color .15s; }
.drop.over { background: #f7e7c4; border-color: var(--gold); }
.drop .big { font-family: var(--serif); font-size: 26px; }
.drop .sm { font-size: 13px; color: var(--muted); }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
legend { font-size: 12px; letter-spacing: .16em; font-weight: 600; color: var(--gold-deep); margin-bottom: 8px; }
.reads div { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.reads div:last-child { border-bottom: 0; }
.reads b { font-weight: 600; }
.reads span { color: var(--muted); font-size: 14px; }

.review { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 28px; align-items: start; }
.file-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.file-head b { font-size: 16px; }
.pdf { background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 30px -12px rgba(36,27,23,.25); padding: 30px 26px; display: flex; flex-direction: column; gap: 14px; font-size: 13px; position: relative; }
.pdf .pre { font-size: 10px; letter-spacing: .22em; color: var(--muted); text-align: center; }
.pdf .ttl { font-family: var(--serif); font-size: 30px; line-height: 1.05; text-align: center; }
.pdf .ln { display: flex; align-items: flex-start; gap: 8px; }
.pdf .course { line-height: 1.45; }
.pdf .course span { color: var(--muted); font-style: italic; }
.mk { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); font-size: 11px; font-weight: 700; flex-shrink: 0; }
.changes { display: flex; flex-direction: column; gap: 12px; }
.changes > b { font-size: 16px; }
.change { display: grid; grid-template-columns: 22px 1fr; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; }
.change input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--gold-deep); }
.change .hd { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.change .what { font-size: 15px; }
.change .why { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.change.off { opacity: .55; }
.change.warn { border-color: #e6c27a; background: #fffaf0; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #f4ead9; padding: 14px 20px; border-radius: 4px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 1100px) {
  main { padding: 36px 28px 56px; }
  .grid, .grid-6-4 { grid-template-columns: 1fr; }
  .review { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .arrow { transform: rotate(90deg); justify-self: center; }
}
@media (max-width: 780px) {
  .shell { flex-direction: column; }
  aside { width: auto; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px 20px; padding: 14px 16px; }
  .a-nav { flex-direction: row; flex-wrap: wrap; }
  .a-nav a { min-height: 40px; font-size: 14px; }
  .a-foot { display: none; }
  main { padding: 28px 16px 48px; }
  h1 { font-size: 34px; }
  .kv div { grid-template-columns: 1fr; gap: 2px; }
  .panel { padding: 20px; }
}

/* Laravel build additions */
.flash { padding: 12px 16px; border-radius: 4px; font-size: 14px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--bad-bg); color: var(--bad); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input { font: inherit; font-size: 15px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 2px; background: #fff; color: var(--ink); }
.field input:focus { outline: 2px solid var(--gold); outline-offset: -1px; }
.field .err { font-size: 13px; color: var(--bad); }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.steps-list b { font-weight: 600; }
.steps-list code, .conv code { font-size: 13px; background: var(--line-2); padding: 1px 6px; border-radius: 2px; }
.conv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 14px; margin: 0; }
.conv dt { white-space: nowrap; }
.conv dd { margin: 0; color: var(--muted); }
details summary { cursor: pointer; font-weight: 600; font-size: 14px; }
details[open] summary { margin-bottom: 14px; }
.a-nav form { margin: 0; }
.a-nav button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; color: #d8cbb6; border-radius: 2px; cursor: pointer; width: 100%; }
.a-nav button:hover { background: #1f1714; color: #f4ead9; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--side); }
.login-card { width: min(400px, 100%); background: var(--card); border-radius: 4px; padding: 36px 32px; display: flex; flex-direction: column; gap: 20px; }
.login-card .a-logo { color: var(--ink); padding: 0; }
.login-card .a-logo small { color: var(--muted); }
.check-inline { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.muted-cell { color: var(--muted); }
.pdf-frame { width: 100%; height: 72vh; min-height: 480px; border: 1px solid var(--line); border-radius: 2px; background: #fff; }
.chipl.bad { background: var(--bad-bg); color: var(--bad); }
.change .why details, details.why { margin-top: 6px; }
@media (max-width: 1100px) { .pdf-frame { height: 60vh; } }
