:root {
  --navy: #0b2e4a;
  --navy-2: #164066;
  --red: #c81d25;
  --sand: #f3efe6;
  --card: #fffcf7;
  --line: #e3d9c8;
  --ink: #1c1915;
  --muted: #5e584f;
  --hot: #c81d25;
  --warm: #b86e00;
  --cold: #3d6b8c;
  --ok: #1d6b45;
  --shadow: 0 1px 2px rgba(28, 25, 21, 0.06);
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--sand); color: var(--ink); }
body { min-height: 100vh; }
a { color: var(--navy); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; }
.card, .meta, pre.body, h1, h2 { overflow-wrap: anywhere; }
img { max-width: 100%; }

.shell { display: flex; min-height: 100vh; }
.side {
  display: none;
  width: 220px;
  background: var(--navy);
  color: #f4efe6;
  padding: 20px 14px 32px;
  flex-shrink: 0;
}
.side a { color: #f4efe6; text-decoration: none; display: block; padding: 10px 12px; border-radius: 10px; }
.side a.active, .side a:hover { background: var(--navy-2); }
.brand { padding: 4px 12px 18px; }
.brand strong { display: block; font-size: 1.15rem; letter-spacing: 0.01em; }
.brand span { display: block; color: #d9c7a4; font-size: 0.82rem; margin-top: 2px; }
.main { flex: 1; min-width: 0; padding: 16px 16px 96px; max-width: 980px; overflow-x: hidden; }
.topbar {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  margin-bottom: 14px; flex-wrap: wrap;
}
.topbar h1 { font-size: 1.45rem; margin: 0; letter-spacing: -0.02em; }
.score {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.score div, .pill, .heat {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 0.86rem;
}
.score strong { color: var(--ok); }
.banner {
  background: #fff4e5; border: 1px solid #efd3a4; border-radius: 12px;
  padding: 10px 12px; margin-bottom: 12px; font-size: 0.92rem;
}
.banner.bad { background: #fde8e8; border-color: #f0b4b4; }
.grid { display: grid; gap: 12px; min-width: 0; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; box-shadow: var(--shadow); min-width: 0; max-width: 100%;
}
.card h2 { margin: 0 0 6px; font-size: 1.05rem; }
.meta { color: var(--muted); font-size: 0.88rem; line-height: 1.45; }
.row { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.heat.hot { color: var(--hot); border-color: #f0b4b4; background: #fff5f5; }
.heat.warm { color: var(--warm); border-color: #efd3a4; background: #fff8ee; }
.heat.cold { color: var(--cold); }
.rank {
  width: 36px; height: 36px; border-radius: 10px; background: var(--navy); color: white;
  display: grid; place-items: center; font-weight: 700; flex-shrink: 0;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
button, .btn {
  background: var(--navy); color: white; border: 0; border-radius: 12px;
  min-height: 44px; padding: 10px 14px; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer;
}
button.secondary, .btn.secondary { background: transparent; color: var(--navy); border: 1px solid var(--navy); }
button.warn { background: var(--red); }
button.ok { background: var(--ok); }
label { display: block; font-size: 0.86rem; margin: 10px 0 4px; color: var(--muted); }
.checkline { display: flex; gap: 8px; align-items: flex-start; font-size: 0.92rem; color: var(--ink); }
.checkline input { width: 1.1rem; height: 1.1rem; margin-top: 2px; flex: 0 0 auto; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  background: white; min-height: 44px;
}
textarea { min-height: 120px; }
pre.body {
  white-space: pre-wrap; word-break: break-word; background: #f7f3ea;
  border-radius: 12px; padding: 12px; font-family: ui-monospace, monospace; font-size: 0.88rem;
}
.email-preview {
  background: white; padding: 16px; border-radius: 12px; border: 1px solid var(--line); overflow-x: auto;
}
.check { list-style: none; padding: 0; margin: 8px 0; }
.check li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.bottom {
  display: flex; position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--navy); overflow-x: auto; z-index: 5;
}
.bottom a {
  color: #f4efe6; text-decoration: none; padding: 12px 14px; font-size: 0.82rem;
  white-space: nowrap; min-height: 48px;
}
.bottom a.active { background: var(--navy-2); }
.field-help { font-size: 0.8rem; color: var(--muted); margin: 0 0 8px; }
code.mono {
  font-family: ui-monospace, monospace; word-break: break-all; display: block;
  background: #f7f3ea; padding: 10px; border-radius: 10px; margin-top: 8px;
}
.locked { background: #eef3f7; }
.trend {
  display: flex; align-items: flex-end; gap: 4px; height: 112px;
  width: 100%; max-width: 100%; min-width: 0;
  overflow-x: auto; padding-bottom: 4px;
}
.trend .col { flex: 0 0 76px; min-width: 76px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.trend .bar { width: 100%; background: var(--navy); border-radius: 4px 4px 0 0; }
.trend span { font-size: 0.65rem; color: var(--muted); margin-top: 4px; text-align: center; line-height: 1.2; }

@media (min-width: 900px) {
  .side { display: block; }
  .bottom { display: none; }
  .main { padding: 28px 32px 48px; }
  .grid.two { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 899px) {
  .shell, .main, .card, form, pre, code { max-width: 100%; }
  .actions { flex-direction: column; }
  .actions form, .actions button, .actions .btn { width: 100%; }
  .card form button { width: 100%; margin-top: 8px; }
  .row { flex-wrap: wrap; }
  table { display: block; max-width: 100%; overflow-x: auto; }
}

@media (max-width: 420px) {
  .main { padding: 12px 12px 112px; }
  .topbar h1 { font-size: 1.2rem; }
  .score { width: 100%; }
  .score div, .pill { font-size: 0.78rem; padding: 6px 8px; }
  .bottom a { padding: 12px 10px; }
  .card form .row button { width: auto; }
}
