:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #697386;
  --line: #e6e9f2;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --soft: #eef4ff;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #16a34a;
  --shadow: 0 16px 40px rgba(31, 41, 55, 0.08);
  --radius: 20px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #eaf1ff, transparent 34%), var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.app-header,
.container {
  width: min(1200px, calc(100% - 40px));
  margin-left: auto;
  margin-right: auto;
}
.app-header {
  padding: 34px 0 18px;
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: flex-start;
}
.header-copy { max-width: 620px; }
.header-right { display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(30px, 5vw, 46px); line-height: 1.1; }
h2 { margin-bottom: 8px; font-size: 20px; }
.sub, .section-title p { color: var(--muted); margin-bottom: 0; line-height: 1.6; }

.container { margin-bottom: 76px; }
.narrow-container { width: min(1100px, calc(100% - 40px)); }
.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(230, 233, 242, 0.9);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(12px);
}

.nav-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
}
.nav-tabs a {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
}
.nav-tabs a.active, .nav-tabs a:hover { color: var(--primary); background: var(--soft); }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.today-card { margin-bottom: 18px; }
.today-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.today-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfdff;
  display: flex;
  flex-direction: column;
  min-height: 122px;
}
.today-item span { color: var(--muted); font-size: 14px; }
.today-item strong { font-size: 28px; margin-top: 12px; overflow-wrap: anywhere; }
.today-item em { color: var(--muted); font-style: normal; margin-top: auto; }
.status-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.chip, .mini-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
  background: #f3f4f6;
  color: var(--muted);
}
.chip.ok, .mini-chip.ok { background: #dcfce7; color: #166534; }
.chip.warn, .mini-chip.warn { background: #fef3c7; color: #92400e; }
.chip.bad, .mini-chip.bad { background: #fee2e2; color: #991b1b; }
.chip.muted, .mini-chip.muted { background: #f3f4f6; color: var(--muted); }
.mini-chip { padding: 5px 8px; font-size: 12px; margin: 2px 2px 2px 0; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.quick-card { color: inherit; text-decoration: none; display: flex; flex-direction: column; min-height: 128px; transition: transform .15s, border-color .15s; }
.quick-card:hover { transform: translateY(-2px); border-color: rgba(37, 99, 235, 0.35); }
.quick-card span { color: var(--primary); font-size: 13px; font-weight: 900; }
.quick-card strong { font-size: 24px; margin-top: 10px; }
.quick-card em { color: var(--muted); font-style: normal; margin-top: auto; }

.settings-card, .toolbar { margin-bottom: 18px; }
.toolbar { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }
.settings-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; }
.settings-grid .field:first-child { grid-column: span 1; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.metric { padding: 18px; display: flex; flex-direction: column; min-height: 132px; }
.metric span { color: var(--muted); font-size: 14px; }
.metric strong { font-size: 34px; line-height: 1.2; margin-top: 12px; overflow-wrap: anywhere; }
.metric em { color: var(--muted); font-style: normal; margin-top: auto; }

.grid-2, .details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
  align-items: start;
}
.grid-2 > *, .details-grid > * { min-width: 0; }
.form-page-grid { align-items: start; }

.section-title { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-title.tight { align-items: center; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.compact { min-width: 170px; }
.span-2 { grid-column: span 2; }
label { font-size: 13px; color: #394254; font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  font-size: 15px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }
textarea { resize: vertical; }

button, a.ghost, .mini-link, .small-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}
.primary { background: var(--primary); color: #fff; }
.primary:hover { background: var(--primary-dark); }
.ghost, .mini-link, .small-btn { background: var(--soft); color: var(--primary); }
.mini-link, .small-btn { min-height: 36px; padding: 8px 12px; border-radius: 12px; font-size: 13px; flex: 0 0 auto; }
.danger { background: #fff1f2; color: var(--danger); min-height: 34px; padding: 6px 10px; font-size: 13px; }
.actions-cell { display: flex; gap: 6px; align-items: center; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; max-width: 100%; }
table { width: 100%; border-collapse: collapse; min-width: 720px; background: #fff; }
.compact-table-card { overflow: hidden; }
.compact-wrap { width: 100%; }
.compact-table { min-width: 610px; }
.compact-table th, .compact-table td { padding: 10px 10px; font-size: 13px; }
.compact-table td:nth-child(3) { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 12px 12px; white-space: nowrap; font-size: 14px; }
th { background: #f8fafc; color: #3c4658; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
.empty { color: var(--muted); text-align: center; padding: 26px; }

.chart-card canvas { width: 100%; display: block; border-radius: 14px; background: linear-gradient(#fff, #fafcff); border: 1px solid var(--line); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.94);
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 99;
}

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.38); backdrop-filter: blur(4px); }
.modal-panel { position: relative; width: min(780px, 100%); max-height: min(86vh, 820px); overflow-y: auto; }
.modal-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.bottom-nav { display: none; }

@media (max-width: 1120px) {
  .settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
  .app-header { flex-direction: column; }
  .header-right { align-items: flex-start; }
  .header-actions { justify-content: flex-start; }
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .details-grid { grid-template-columns: 1fr; }
  .form-grid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body { padding-bottom: 76px; }
  .app-header, .container, .narrow-container { width: min(100% - 28px, 1200px); }
  .quick-actions { grid-template-columns: 1fr; }
  .nav-tabs { width: 100%; overflow-x: auto; border-radius: 18px; justify-content: flex-start; }
  .nav-tabs a { white-space: nowrap; }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 12px;
    z-index: 90;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 8px;
    backdrop-filter: blur(12px);
  }
  .bottom-nav a {
    text-decoration: none;
    color: var(--muted);
    font-size: 14px;
    font-weight: 900;
    text-align: center;
    padding: 10px 8px;
    border-radius: 16px;
  }
  .bottom-nav a.active { color: var(--primary); background: var(--soft); }
}
@media (max-width: 640px) {
  .summary-grid, .today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid, .form-grid.wide, .modal-form, .settings-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .toolbar { align-items: stretch; }
  .toolbar .field, .toolbar button { width: 100%; }
  .metric strong { font-size: 28px; }
  .today-item strong { font-size: 24px; }
  .card { padding: 16px; }
  .quick-card strong { font-size: 22px; }
}

/* v0.4：更扁平、更有颜色层次的仪表盘 */
:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #102033;
  --muted: #667085;
  --line: #e4eaf3;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --soft: #eaf2ff;
  --danger: #ef4444;
  --warn: #f59e0b;
  --ok: #22c55e;
  --blue: #3b82f6;
  --green: #22c55e;
  --orange: #f97316;
  --purple: #8b5cf6;
  --rose: #f43f5e;
  --cyan: #06b6d4;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 22px;
}

body {
  background:
    radial-gradient(circle at 0% 0%, rgba(59,130,246,.16), transparent 30%),
    radial-gradient(circle at 95% 12%, rgba(139,92,246,.12), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
}

.card {
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(228,234,243,.9);
  box-shadow: var(--shadow);
}

.primary { background: linear-gradient(135deg, #3b82f6, #2563eb); box-shadow: 0 8px 18px rgba(37,99,235,.18); }
.ghost, .mini-link, .small-btn { background: #eef5ff; color: #2563eb; }
.nav-tabs { background: #ffffff; box-shadow: 0 6px 18px rgba(15,23,42,.04); }
.nav-tabs a.active, .nav-tabs a:hover { background: #eaf2ff; color: #2563eb; }

.hero-dashboard {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1.05fr 1.7fr;
  gap: 18px;
  align-items: stretch;
  overflow: hidden;
  position: relative;
}
.hero-dashboard::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--blue), var(--green), var(--orange), var(--purple));
}
.hero-copy {
  padding: 8px 6px 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-copy h2 { font-size: clamp(24px, 3vw, 34px); margin: 12px 0; }
.pill {
  width: fit-content;
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 12px;
  background: #eaf2ff;
  color: #2563eb;
  font-weight: 900;
  font-size: 13px;
}
.visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ring-card {
  --accent: var(--blue);
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  align-items: center;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 16px;
  min-width: 0;
}
.ring-card.accent-blue { --accent: var(--blue); }
.ring-card.accent-green { --accent: var(--green); }
.ring-card.accent-orange { --accent: var(--orange); }
.ring-card.accent-purple { --accent: var(--purple); }
.ring-card span { color: var(--muted); font-size: 13px; font-weight: 800; }
.ring-card strong { display: block; font-size: 22px; margin-top: 6px; overflow-wrap: anywhere; }
.ring-card em { display: block; color: var(--muted); font-style: normal; font-size: 13px; margin-top: 5px; line-height: 1.4; }
.progress-ring {
  --percent: 0;
  --accent: inherit;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--percent) * 1%), #e9eef7 0);
  display: grid;
  place-items: center;
  position: relative;
}
.progress-ring::after {
  content: "";
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  box-shadow: inset 0 0 0 1px rgba(228,234,243,.9);
}
.progress-ring span {
  position: relative;
  z-index: 1;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}
.progress-list {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  padding-top: 4px;
}
.progress-line > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 7px;
}
.progress-line em { font-style: normal; font-weight: 700; }
.bar {
  height: 10px;
  background: #e9eef7;
  border-radius: 999px;
  overflow: hidden;
}
.bar i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  transition: width .25s ease;
}
.progress-line:nth-child(2) .bar i { background: linear-gradient(90deg, #86efac, #22c55e); }
.progress-line:nth-child(3) .bar i { background: linear-gradient(90deg, #fdba74, #f97316); }
.progress-line:nth-child(4) .bar i { background: linear-gradient(90deg, #c4b5fd, #8b5cf6); }

.status-row { margin-top: 4px; grid-column: 1 / -1; }
.formula-note { grid-column: 1 / -1; margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.quick-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.quick-card { border: none; min-height: 138px; }
.quick-card span { opacity: .88; }
.accent-card-blue { background: linear-gradient(135deg, #dbeafe, #ffffff); }
.accent-card-green { background: linear-gradient(135deg, #dcfce7, #ffffff); }
.accent-card-orange { background: linear-gradient(135deg, #ffedd5, #ffffff); }
.accent-card-purple { background: linear-gradient(135deg, #ede9fe, #ffffff); }

.color-card { border: none; position: relative; overflow: hidden; }
.color-card::after { content: ""; position: absolute; inset: auto -28px -36px auto; width: 92px; height: 92px; border-radius: 50%; opacity: .32; }
.color-card.blue { background: #eff6ff; } .color-card.blue::after { background: var(--blue); }
.color-card.green { background: #f0fdf4; } .color-card.green::after { background: var(--green); }
.color-card.orange { background: #fff7ed; } .color-card.orange::after { background: var(--orange); }
.color-card.rose { background: #fff1f2; } .color-card.rose::after { background: var(--rose); }
.color-card.purple { background: #f5f3ff; } .color-card.purple::after { background: var(--purple); }
.color-card.cyan { background: #ecfeff; } .color-card.cyan::after { background: var(--cyan); }

.settings-page-card { margin-bottom: 18px; }
.settings-page-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.settings-tips { margin-top: 0; }

.bottom-nav { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1120px) {
  .hero-dashboard { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .hero-dashboard { padding: 16px; }
  .visual-grid, .progress-list { grid-template-columns: 1fr; }
  .ring-card { grid-template-columns: 76px 1fr; padding: 14px; }
  .progress-ring { width: 70px; height: 70px; }
  .progress-ring::after { width: 52px; height: 52px; }
  .quick-actions { grid-template-columns: 1fr; }
  .settings-page-grid { grid-template-columns: 1fr; }
}

/* v0.4.3：统一间距、对齐单日概览和表单卡片 */
:root {
  --gap-xs: 8px;
  --gap-sm: 12px;
  --gap-md: 16px;
  --gap-lg: 20px;
  --section-gap: 18px;
}

.container > section,
.settings-card,
.settings-page-card,
.toolbar,
.summary-grid,
.grid-2,
.details-grid,
.quick-actions {
  margin-bottom: var(--section-gap);
}

.hero-dashboard,
.visual-grid,
.progress-list,
.quick-actions,
.summary-grid,
.grid-2,
.details-grid,
.form-grid,
.toolbar {
  gap: var(--gap-md);
}

.overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
  flex-wrap: wrap;
}

.overview-date-field {
  width: 170px;
  min-width: 170px;
}
.overview-date-field label {
  font-size: 12px;
}
.overview-date-field input {
  padding: 10px 12px;
  min-height: 42px;
}

.hero-copy,
.ring-card,
.progress-line,
.metric,
.quick-card,
.chart-card,
.compact-table-card {
  height: 100%;
}

.ring-card {
  min-height: 130px;
  align-content: center;
}

.progress-line {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.section-title {
  align-items: flex-start;
}

.form-grid > .field,
.settings-page-grid > .field,
.toolbar > .field {
  min-width: 0;
}

.settings-page-grid .primary,
.toolbar .primary {
  align-self: end;
  min-height: 45px;
}

.table-wrap {
  margin-top: 0;
}

@media (max-width: 720px) {
  .overview-head {
    align-items: stretch;
  }
  .overview-date-field {
    width: 100%;
    min-width: 0;
  }
  .hero-dashboard,
  .visual-grid,
  .progress-list,
  .quick-actions,
  .summary-grid,
  .grid-2,
  .details-grid,
  .form-grid,
  .toolbar {
    gap: var(--gap-sm);
  }
}

/* v0.4.5：手机端日期控件、图表高度和睡眠输入修复 */
input,
select,
textarea {
  min-width: 0;
  max-width: 100%;
}

.field,
.field.compact,
.toolbar > .field,
.form-grid > .field,
.settings-page-grid > .field {
  min-width: 0;
  max-width: 100%;
}

input[type="date"] {
  min-width: 0;
  max-width: 100%;
}

.overview-date-control {
  width: min(100%, 330px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--gap-sm);
  align-items: end;
}

.overview-date-control .overview-date-field {
  width: auto;
  min-width: 0;
}

.overview-date-control .small-btn {
  white-space: nowrap;
  min-height: 42px;
}

.chart-card {
  min-width: 0;
  align-self: start;
}

.chart-card canvas {
  display: block;
  width: 100% !important;
  height: 220px !important;
  max-height: 220px;
  min-height: 220px;
}

.sleep-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gap-sm);
}

@media (max-width: 720px) {
  .overview-date-control {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .toolbar .field,
  .toolbar button,
  .toolbar select,
  .toolbar input {
    width: 100%;
  }

  .chart-card canvas {
    height: 210px !important;
    max-height: 210px;
    min-height: 210px;
  }
}

@media (max-width: 420px) {
  .overview-date-control {
    grid-template-columns: 1fr;
  }

  .overview-date-control .small-btn {
    width: 100%;
  }

  .sleep-inputs {
    grid-template-columns: 1fr 1fr;
  }
}


/* v0.4.6：趋势图移动端固定容器，避免 iOS/安卓浏览器反复缩放 canvas */
.chart-grid {
  align-items: start;
}

.chart-card {
  height: auto !important;
  overflow: hidden;
}

.chart-card h2 {
  line-height: 1.35;
  margin-bottom: 14px;
}

.chart-plot {
  width: 100%;
  height: 220px;
  max-height: 220px;
  min-height: 220px;
  overflow: hidden;
  position: relative;
  border-radius: 14px;
  background: linear-gradient(#fff, #fafcff);
  border: 1px solid var(--line);
  contain: layout paint size;
}

.chart-plot canvas,
.chart-card canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

@media (max-width: 720px) {
  .chart-card {
    padding: 16px;
  }

  .chart-card h2 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .chart-plot {
    height: 168px;
    max-height: 168px;
    min-height: 168px;
  }
}

@media (max-width: 420px) {
  .chart-card {
    padding: 14px;
  }

  .chart-card h2 {
    font-size: 17px;
  }

  .chart-plot {
    height: 156px;
    max-height: 156px;
    min-height: 156px;
  }
}


/* v0.4.7：登录页与退出登录入口 */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

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

.login-card {
  padding: 28px;
}

.login-card h1 {
  font-size: clamp(30px, 7vw, 42px);
  margin-bottom: 12px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

.login-submit:disabled {
  opacity: .58;
  cursor: not-allowed;
}

.login-error,
.login-alert {
  margin-top: 16px;
  border-radius: 16px;
  padding: 12px 14px;
  line-height: 1.6;
  font-weight: 700;
}

.login-error {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
}

.login-alert {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
}

.login-alert code {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(245,158,11,.28);
  border-radius: 8px;
  padding: 1px 5px;
}

.login-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 18px 0 0;
}

@media (max-width: 720px) {
  .login-body {
    padding: 16px;
  }
  .login-card {
    padding: 22px;
  }
}
