:root {
  --bg: #ffffff;
  --bg-deep: #f7f7f8;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --line: #e7e7e8;
  --line-strong: #d8d8da;
  --text: #202123;
  --muted: #6a6d75;
  --stone: #202123;
  --stone-soft: #6a6d75;
  --gem: #0d9488;
  --gem-deep: #0f766e;
  --success: #166534;
  --warning: #a16207;
  --danger: #b42318;
  --shadow: rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic", sans-serif;
}

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

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin-top: 0;
}

.shell {
  min-height: 100vh;
  position: relative;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: #f6f8f9;
  border: 1px solid var(--line);
}

.brand-mark {
  width: 1.7rem;
  height: 1.7rem;
}

.brand-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.topnav,
.page-actions,
.account-box,
.hero-actions,
.hero-metrics {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nav-link {
  padding: 0.55rem 0.9rem;
  border-radius: 0.65rem;
  color: var(--stone-soft);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-link.is-active {
  color: var(--gem-deep);
  background: #f6fbfa;
  border: 1px solid rgba(13, 148, 136, 0.12);
}

.account-box {
  padding: 0.3rem 0.3rem 0.3rem 0.95rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid var(--line);
}

.content {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.hero,
.page-header,
.dashboard-grid,
.stack {
  margin-bottom: 1.5rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 1.5rem;
  align-items: stretch;
}

.hero-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1.25rem;
  box-shadow: none;
}

.hero-card--stone,
.panel--brand {
  background: var(--surface);
}

.hero-card--gem,
.panel--danger {
  background: var(--surface);
  border-color: var(--line);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.dashboard-hero {
  align-items: center;
}

.dashboard-hero__copy {
  max-width: 44rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.eyebrow {
  margin-bottom: 0.65rem;
  color: var(--gem-deep);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
}

h1,
h2 {
  letter-spacing: -0.03em;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
}

.lede,
.muted,
.empty-copy,
.ghost-note {
  color: var(--muted);
}

.lede {
  max-width: 36rem;
  font-size: 0.98rem;
  line-height: 1.65;
}

.feature-list,
.compact-list,
.record-list {
  margin: 0;
  padding-left: 1.1rem;
}

.feature-list li,
.compact-list li,
.record-list li {
  margin-bottom: 0.45rem;
}

.metric-chip {
  display: inline-grid;
  gap: 0.15rem;
  min-width: 7rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  background: #fafafa;
  border: 1px solid var(--line);
}

.metric-chip strong {
  font-size: 1.2rem;
}

.metric-chip span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.9rem;
  padding: 0 1rem;
  border-radius: 0.7rem;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--stone);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: border-color 120ms ease, background 120ms ease;
}

.button--primary {
  border-color: var(--gem);
  background: var(--gem);
  color: white;
}

.button--ghost {
  background: transparent;
}

.button--block {
  width: 100%;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, 24rem);
  gap: 1.25rem;
  align-items: stretch;
  min-height: calc(100vh - 10rem);
}

.auth-intro {
  display: grid;
  align-content: end;
}

.auth-intro__mark {
  display: none;
}

.auth-panel {
  width: 100%;
  align-self: center;
}

.stack {
  display: grid;
  gap: 1rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  color: var(--stone);
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.8rem 0.95rem;
  border-radius: 0.7rem;
  border: 1px solid var(--line-strong);
  background: #fff;
  font: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(13, 148, 136, 0.45);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.08);
  background: white;
}

.field textarea {
  min-height: 7rem;
}

.checkbox-field {
  display: flex;
  align-items: end;
}

.flash {
  margin-bottom: 1rem;
  border-radius: 0.7rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  background: #fff;
}

.flash--success {
  border-color: rgba(22, 101, 52, 0.22);
  box-shadow: inset 0 0 0 1px rgba(22, 101, 52, 0.06);
}

.flash--danger {
  border-color: rgba(180, 35, 24, 0.22);
  box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.06);
}

.record-list {
  list-style: none;
  padding-left: 0;
}

.record-list li + li,
.compact-list li + li {
  margin-top: 0.8rem;
}

.panel-header,
.record-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.record-row {
  padding: 0.95rem 0;
  border-bottom: 1px solid rgba(68, 64, 60, 0.08);
}

.record-list li:last-child .record-row {
  border-bottom: 0;
  padding-bottom: 0;
}

.record-list li:first-child .record-row {
  padding-top: 0.2rem;
}

.record-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: end;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0 0.75rem;
  border-radius: 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(68, 64, 60, 0.1);
  background: #fafafa;
}

.status-badge--danger {
  border-color: rgba(180, 35, 24, 0.16);
  color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
}

.status-badge--warning {
  border-color: rgba(161, 98, 7, 0.18);
  color: var(--warning);
  background: rgba(161, 98, 7, 0.08);
}

@media (max-width: 960px) {
  .hero,
  .auth-shell,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding-top: 1.4rem;
  }
}

@media (max-width: 640px) {
  .topbar,
  .content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .brand-link {
    gap: 0.7rem;
  }

  .brand-mark-wrap {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 0.9rem;
  }

  .brand-name {
    font-size: 1rem;
  }

  h1 {
    font-size: 2.4rem;
  }

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

  .panel-header,
  .record-row {
    flex-direction: column;
  }

  .record-row__meta {
    justify-content: start;
  }
}
