:root {
  color-scheme: light;
  --page: #f7f3ea;
  --paper: #fffdf8;
  --ink: #15181d;
  --muted: #5f6873;
  --line: #d9d1c3;
  --line-strong: #b7aa98;
  --teal: #2f6f68;
  --teal-dark: #214d49;
  --brass: #a67635;
  --plum: #5a3f53;
  --shadow: rgba(37, 32, 26, 0.12);
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.page {
  display: flex;
  flex-direction: column;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #101318;
}

.login-shell {
  width: min(380px, 100%);
}

.login-intro {
  margin-bottom: 22px;
}

.login-intro .eyebrow {
  margin-bottom: 10px;
  color: #8fd6c7;
}

.login-title {
  color: #f4efe5;
  font-size: 2.4rem;
  line-height: 1.05;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form input,
.login-form button {
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
  font: inherit;
}

.login-form input {
  padding: 0 14px;
  color: #f4efe5;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.login-form input:focus {
  outline: 3px solid rgba(143, 214, 199, 0.28);
  outline-offset: 2px;
}

.login-form button {
  margin-top: 8px;
  color: #07110f;
  background: #8fd6c7;
  border: 0;
  font-weight: 700;
  cursor: pointer;
}

.login-form.is-loading button {
  opacity: 0.72;
  pointer-events: none;
}

.login-error {
  margin: 4px 0 0;
  color: #f3a0a0;
  font-size: 0.92rem;
  line-height: 1.4;
}

.page-landing {
  justify-content: center;
  padding: 24px;
}

.landing-shell {
  width: min(var(--max), 100%);
  min-height: min(720px, calc(100vh - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: stretch;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px var(--shadow);
}

.landing-copy {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--brass);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 4.2rem;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 700;
}

.lead {
  margin: 22px 0 0;
  max-width: 37rem;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
.tile:focus-visible,
.topbar a:focus-visible {
  outline: 3px solid rgba(47, 111, 104, 0.28);
  outline-offset: 3px;
}

.button-primary {
  background: var(--ink);
  color: #fffdf8;
}

.button-primary:hover {
  background: var(--teal-dark);
}

.button-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.button-secondary:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.hero-media {
  margin: 0;
  min-height: 560px;
  overflow: hidden;
  background: #d8d0c2;
}

.hero-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.topbar {
  width: min(var(--max), calc(100% - 48px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 1rem;
  font-weight: 700;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar nav a {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.topbar nav a:hover,
.topbar nav a[aria-current="page"] {
  background: rgba(47, 111, 104, 0.1);
  color: var(--teal-dark);
}

.content {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  padding: 58px 0 70px;
}

.intro {
  max-width: 680px;
  padding-bottom: 28px;
}

.intro .lead {
  margin-top: 20px;
}

.storage-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 14px;
}

.stat-card {
  min-height: 128px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(37, 32, 26, 0.08);
}

.stat-label {
  color: var(--brass);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.stat-value {
  margin-top: 16px;
  color: var(--ink);
  font-size: 2.25rem;
  line-height: 1;
  font-weight: 750;
}

.stat-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.storage-detail-panel {
  margin: 0 0 14px;
  padding: 20px;
  background: rgba(255, 253, 248, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(37, 32, 26, 0.07);
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading .eyebrow {
  margin-bottom: 8px;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.2;
  font-weight: 750;
}

.storage-detail-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.storage-detail {
  min-height: 104px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--paper);
  border: 1px solid rgba(217, 209, 195, 0.88);
  border-radius: 8px;
}

.storage-detail strong {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.2;
}

.storage-detail-metric {
  margin-top: 14px;
  color: var(--teal-dark);
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 750;
}

.storage-detail-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 14px;
}

.tile {
  min-height: 210px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(37, 32, 26, 0.08);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.tile:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  box-shadow: 0 18px 44px rgba(37, 32, 26, 0.12);
}

.tile strong {
  display: block;
  font-size: 1.25rem;
  line-height: 1.2;
  font-weight: 700;
}

.tile span:last-child {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.tile-status {
  width: fit-content;
  padding: 5px 8px;
  color: var(--plum);
  border: 1px solid rgba(90, 63, 83, 0.25);
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tile-ready {
  background: #eef7f4;
  border-color: rgba(47, 111, 104, 0.3);
}

.tile-ready .tile-status {
  color: var(--teal-dark);
  border-color: rgba(47, 111, 104, 0.35);
}

.tile-wide {
  background: #edf5f1;
}

.file-hero {
  max-width: 820px;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.config-tile {
  min-height: 252px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(37, 32, 26, 0.08);
}

.config-tile-primary {
  background: #edf5f1;
  border-color: rgba(47, 111, 104, 0.3);
}

.config-tile strong {
  display: block;
  font-size: 1.18rem;
  line-height: 1.25;
}

.config-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.config-tile code {
  margin-top: auto;
  padding: 10px;
  display: block;
  overflow-wrap: anywhere;
  color: var(--teal-dark);
  background: rgba(47, 111, 104, 0.08);
  border: 1px solid rgba(47, 111, 104, 0.16);
  border-radius: 8px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
}

.inline-link {
  width: fit-content;
  margin-top: auto;
  color: var(--teal-dark);
  font-size: 0.92rem;
  font-weight: 750;
  border-bottom: 1px solid rgba(47, 111, 104, 0.35);
}

.inline-link:focus-visible {
  outline: 3px solid rgba(47, 111, 104, 0.28);
  outline-offset: 3px;
}

.tool-page {
  display: grid;
  min-height: calc(100vh - 72px);
  place-items: center;
}

.tool-panel {
  width: min(720px, 100%);
  padding: 38px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 54px var(--shadow);
}

.tool-panel h1 {
  font-size: 2.9rem;
}

@media (max-width: 980px) {
  .landing-shell {
    grid-template-columns: 1fr;
  }

  .hero-media {
    min-height: 360px;
    order: -1;
  }

  .landing-copy {
    padding: 36px;
  }

  h1 {
    font-size: 3.2rem;
  }

  .tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .config-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .storage-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .storage-detail-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .page-landing {
    padding: 14px;
    justify-content: flex-start;
  }

  .landing-shell {
    min-height: auto;
  }

  .landing-copy,
  .tool-panel {
    padding: 24px;
  }

  .hero-media {
    min-height: 260px;
  }

  h1,
  .tool-panel h1 {
    font-size: 2.45rem;
  }

  .topbar {
    width: min(var(--max), calc(100% - 28px));
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 16px 0;
  }

  .topbar nav {
    justify-content: flex-start;
  }

  .content {
    width: min(var(--max), calc(100% - 28px));
    padding: 40px 0 52px;
  }

  .tile-grid {
    grid-template-columns: 1fr;
  }

  .config-grid {
    grid-template-columns: 1fr;
  }

  .storage-strip {
    grid-template-columns: 1fr;
  }

  .storage-detail-list {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 2rem;
  }
}
