:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #36302a;
  background: #ece4da;
  font-size: 16px;
  --ink: #36302a;
  --muted: #675f57;
  --red: #e91f2b;
  --green: #65a53f;
  --cream: #f6f3ec;
  --surface: #fffdfa;
  --line: #d7ccbd;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }
.wrap { width: min(1100px, calc(100% - 40px)); margin-inline: auto; }
.topbar { background: var(--cream); border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 16px; text-decoration: none; flex: 0 0 auto; }
.brand-logo { display: block; flex: 0 0 auto; }
.brand img { display: block; width: 118px; height: auto; }
.brand span { border-left: 1px solid #cfc4b5; padding-left: 16px; color: var(--ink); font-size: .92rem; font-weight: 700; white-space: nowrap; }
.topbar nav { display: flex; align-items: center; gap: 24px; }
.topbar nav a { text-decoration: none; color: var(--ink); }
.topbar nav a:hover { color: var(--red); }
.topbar nav form { margin: 0; }
.nav-user { color: var(--muted); font-size: .875rem; }
.text-button { border: 0; background: none; color: inherit; padding: 0; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.topbar .text-button { color: var(--ink); }
.topbar .text-button:hover { color: var(--red); }
.danger { color: #a32027; }
main.wrap { padding-top: 58px; padding-bottom: 80px; }
.eyebrow { color: #a82229; font-size: .78rem; font-weight: 800; letter-spacing: .14em; }
.page-heading { margin-bottom: 26px; }
.page-heading h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.045em; line-height: 1.1; margin: 12px 0 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(54,48,42,.07); padding: 30px; }
.card h2, .card h3 { letter-spacing: -.02em; }
.card h2 { margin: 0; font-size: 1.45rem; }
.card h3 { margin: 0; font-size: 1.1rem; }
.login-shell { display: grid; grid-template-columns: minmax(0,1fr) 430px; gap: 80px; align-items: center; min-height: calc(100vh - 220px); }
.login-intro h1 { font-size: clamp(2.9rem, 5.8vw, 5rem); line-height: 1.03; letter-spacing: -.055em; margin: 18px 0 22px; max-width: 660px; }
.login-card { padding: 38px; border-top: 5px solid var(--red); }
.login-card .login-help { color: var(--muted); font-size: .96rem; line-height: 1.5; margin: 0 0 20px; }
.login-card h2 { margin-bottom: 26px; }
.login-card form, .stack-form { display: flex; flex-direction: column; }
.login-card label, .stack-form label { font-size: .9rem; font-weight: 700; margin: 0 0 8px; }
.login-card input, .stack-form input { border: 1px solid #bfb2a3; border-radius: 4px; background: #fff; color: var(--ink); min-height: 48px; padding: 11px 13px; margin-bottom: 20px; min-width: 0; }
.login-card input:focus, .stack-form input:focus { outline: 3px solid rgba(101,165,63,.22); outline-offset: 1px; border-color: var(--green); }
.stack-form .file-input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; opacity: 0; overflow: hidden; }
.stack-form .file-picker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid #bfb2a3; border-radius: 4px; min-height: 48px; background: #fff; padding: 6px 12px; margin: 0 0 14px; cursor: pointer; font-weight: 400; }
.file-input:focus-visible + .file-picker { outline: 3px solid rgba(101,165,63,.22); outline-offset: 1px; border-color: var(--green); }
.file-picker-button { display: inline-block; background: #f6f0e6; border: 1px solid #b9a997; border-radius: 4px; padding: 6px 10px; font-size: .8rem; font-weight: 700; }
.file-picker-name { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.button { border: 1px solid transparent; border-radius: 4px; min-height: 44px; padding: 10px 18px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: .9rem; font-weight: 750; white-space: nowrap; }
.button.primary { background: var(--ink); color: var(--cream); }
.button.primary:hover { background: #151311; }
.button.secondary { background: #f6f0e6; border-color: #b9a997; color: var(--ink); }
.button.secondary:hover { border-color: var(--green); background: #edf4e8; }
.button.full { width: 100%; margin-top: 4px; }
.notice { border-radius: 4px; padding: 14px 18px; background: #ecf4e8; color: #2d6229; border-left: 4px solid var(--green); margin-bottom: 24px; }
.notice.error { background: #faeaea; color: #8f2028; border-left-color: var(--red); }
.asset-list { list-style: none; margin: 0; padding: 0; }
.asset-row { display: flex; align-items: center; gap: 18px; padding: 18px 0; border-bottom: 1px solid #e7dfd5; }
.asset-row:first-child { padding-top: 0; }
.asset-row:last-child { border-bottom: 0; padding-bottom: 0; }
.file-icon { display: inline-grid; place-items: center; flex: 0 0 45px; height: 51px; border-radius: 4px; background: #fbe7e7; color: #a91f29; font-size: .74rem; font-weight: 850; letter-spacing: .04em; }
.asset-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.asset-name strong { overflow-wrap: anywhere; font-size: 1rem; }
.asset-name small { color: var(--muted); font-size: .8rem; }
.empty { text-align: center; padding: 70px 20px; }
.empty h2 { margin: 0 0 8px; }
.empty p, .muted { color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 25px; }
.count { border-radius: 100px; background: #edf2e8; color: #386830; font-size: .76rem; font-weight: 750; padding: 4px 9px; }
.stack-form { border-radius: 8px; background: #f5f0e8; padding: 22px; }
.stack-form h3 { margin-bottom: 22px; }
.stack-form label { margin-top: 4px; }
.stack-form input { margin-bottom: 14px; }
.stack-form .hint { font-size: .8rem; color: var(--muted); margin: -3px 0 19px; line-height: 1.45; }
.stack-form .button { align-self: flex-start; }
.subsection { margin: 31px 0 13px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid #e7dfd5; padding: 14px 5px; }
th { font-size: .8rem; color: var(--muted); font-weight: 750; }
td:last-child, th:last-child { text-align: right; }
.table-link, .admin-footer a, .back-link { color: #a91f29; font-weight: 700; text-decoration: none; }
.table-link:hover, .admin-footer a:hover, .back-link:hover { text-decoration: underline; }
.admin-footer { margin-top: 28px; }
.narrow { max-width: 540px; }
.narrow .stack-form { background: none; padding: 0; }
.narrow .stack-form .button { margin-top: 4px; }
.back-link { display: inline-block; margin-bottom: 20px; font-size: .9rem; }
.delete-form { border-top: 1px solid #e7dfd5; margin-top: 32px; padding-top: 22px; }
.list-card { padding-top: 12px; padding-bottom: 12px; }
@media (max-width: 800px) {
  .login-shell { grid-template-columns: 1fr; gap: 34px; min-height: auto; }
  .login-intro h1 { max-width: 600px; }
  .admin-grid { grid-template-columns: 1fr; }
  main.wrap { padding-top: 36px; }
  .topbar-inner { min-height: 68px; }
}
@media (max-width: 550px) {
  .wrap { width: min(100% - 28px, 1100px); }
  .brand img { width: 94px; }
  .brand span { padding-left: 10px; font-size: .78rem; max-width: 125px; white-space: normal; line-height: 1.1; }
  .topbar nav { gap: 12px; }
  .topbar nav a { display: none; }
  .nav-user { display: none; }
  .login-intro h1 { font-size: 2.9rem; }
  .login-card, .card { padding: 22px; }
  .asset-row { gap: 12px; }
  .asset-row .button { padding: 9px 12px; font-size: .82rem; }
  .file-icon { flex-basis: 39px; height: 45px; }
  main.wrap { padding-bottom: 45px; }
}
