:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #66717e;
  --line: #dce2e8;
  --paper: #ffffff;
  --canvas: #f3f5f7;
  --blue: #174a8b;
  --blue-dark: #103762;
  --green: #217a58;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
a { color: var(--blue); }
.shell { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.site-header { background: #142238; border-bottom: 1px solid #25364d; }
.topbar { min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-block: 10px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.nav-link { color: #cdd8e6; font-size: .92rem; font-weight: 600; text-decoration: none; }
.nav-link:hover { color: #fff; }
.logout { margin: 0 0 0 6px; }
.quiet-button { border: 1px solid #52647b; border-radius: 7px; color: #fff; background: transparent; padding: 8px 12px; cursor: pointer; }
main { padding: 48px 0 72px; }
h1 { margin: 6px 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.05; font-weight: 600; }
h2 { margin: 6px 0 10px; font-size: 1.25rem; }
.eyebrow { color: var(--blue); font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.lede { max-width: 720px; color: var(--muted); font-size: 1.04rem; line-height: 1.7; }
.intro-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; margin-bottom: 40px; }
.status-card, .app-card, .login-card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgb(24 32 42 / 5%); }
.status-card { padding: 22px; }
.status-card p, .status-card small { color: var(--muted); }
.metric { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.metric:last-of-type { margin-bottom: 12px; }
.app-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.app-card { padding: 22px; }
.path { min-height: 42px; color: var(--muted); font: .82rem ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.primary-link { display: inline-block; margin-top: 12px; font-weight: 700; text-decoration: none; }
.page-heading { margin-bottom: 26px; }
.page-heading h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); overflow-wrap: anywhere; }
.crumb-home { font-size: .86rem; font-weight: 700; text-decoration: none; }
.muted { color: var(--muted); }
.file-list { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.file-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: center; padding: 13px 16px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: #f7f9fb; }
.file-kind { color: var(--green); font-size: .66rem; font-weight: 800; letter-spacing: .08em; }
.code-view { margin: 0; max-height: 72vh; overflow: auto; padding: 22px; background: #111923; color: #dce8f4; border-radius: 9px; font: .82rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; tab-size: 4; white-space: pre; }
.notice, .alert { padding: 14px 16px; border-radius: 8px; }
.notice { color: #604b16; background: #fff7dc; border: 1px solid #efd991; }
.alert { margin: 18px 0; color: #792b2b; background: #fff0f0; border: 1px solid #efbaba; }
.login-card { width: min(460px, 100%); margin: 7vh auto 0; padding: 32px; }
.login-card h1 { font-size: 2.25rem; }
.login-form, .stack-form { display: grid; gap: 10px; margin-top: 26px; }
.login-form label, .stack-form label { margin-top: 8px; font-size: .86rem; font-weight: 700; }
.login-form input, .stack-form input, .stack-form select { width: 100%; border: 1px solid #b9c2cc; border-radius: 7px; padding: 11px 12px; font: inherit; background: #fff; color: var(--ink); }
.login-form input:focus, .stack-form input:focus, .stack-form select:focus { outline: 3px solid rgb(23 74 139 / 16%); border-color: var(--blue); }
.submit-button { margin-top: 14px; border: 0; border-radius: 7px; padding: 12px 16px; color: #fff; background: var(--blue); font: inherit; font-weight: 700; cursor: pointer; }
.submit-button:hover { background: var(--blue-dark); }
.secondary-button { border: 1px solid var(--blue); border-radius: 7px; padding: 10px 14px; color: var(--blue); background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.secondary-button:hover { background: #eef3fa; }
.stack-form .submit-button { justify-self: start; min-width: 160px; }
.field-hint { margin-top: -4px; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.form-card { width: min(640px, 100%); padding: 32px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgb(24 32 42 / 5%); }
.form-card h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.form-card h2 { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.inline-form { margin: 12px 0 0; }
.form-link { display: inline-block; margin-top: 18px; font-size: .9rem; font-weight: 700; text-decoration: none; }
.success { margin: 18px 0; padding: 14px 16px; border-radius: 8px; color: #185c43; background: #ecf8f2; border: 1px solid #b4dfca; }
.alert p { margin: 0; }
.alert p + p { margin-top: 6px; }
.home-notice { margin: -16px 0 28px; }
.home-notice a { font-weight: 700; }
.studio-card { border-color: #b9cbe3; background: linear-gradient(180deg, #f5f8fd, #fff); }
.card-text { min-height: 42px; margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }

@media (max-width: 820px) {
  .intro-grid { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 22px, 1120px); }
  main { padding-top: 30px; }
  .app-grid { grid-template-columns: 1fr; }
  .login-card, .form-card { padding: 24px 20px; }
  .nav-links { gap: 6px 14px; }
  .stack-form .submit-button { justify-self: stretch; }
  .file-row { grid-template-columns: 62px minmax(0, 1fr); padding-inline: 12px; }
}
