/* Gantrel app: the website's palette (one warm red, blush panels, ink text) made calm for daily work. System fonts so it
   loads instantly; the red is kept for actions and things that need attention. Light only, like the site. */
:root {
  --bg: #fbf8f7; --card: #ffffff; --blush: #fff1ee; --blush-2: #ffe2dc; --ink: #1f2430; --muted: #5b6272; --line: #ece7e6;
  --red: #e5352b; --red-dark: #c42820; --good: #1d7a46; --warn: #a15c00;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--text); display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
body.bare { display: block; }
a { color: var(--red-dark); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 4px; }
h1, h2 { margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 1.6rem; }
p { margin: 0; }

/* Side menu */
header.top { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 18px 14px; border-right: 1px solid var(--line); background: var(--card); }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; padding: 0 8px; }
.logo svg { height: 34px; width: auto; display: block; }
.logo.big { font-size: 1.6rem; justify-content: center; margin-bottom: 18px; }
.logo.big svg { height: 52px; }
nav.side { display: grid; gap: 2px; }
nav.side a { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
nav.side a:hover { background: var(--blush); }
nav.side a[aria-current] { background: var(--blush); color: var(--red-dark); }
.out { margin-top: auto; background: none; border: 0; color: var(--muted); font: inherit; text-align: left; padding: 8px 10px; cursor: pointer; border-radius: 10px; }
.out:hover { background: var(--blush); }
.n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 0.75rem; font-weight: 700; }
.n.soft { background: var(--line); color: var(--muted); }

.page { padding: 26px 30px 60px; display: grid; gap: 18px; align-content: start; max-width: 1240px; width: 100%; }
.ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.ph > div > p { color: var(--muted); margin-top: 4px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; align-content: start; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; min-width: 0; }
.pad { padding: 18px; }
.ch { font-size: 0.95rem; padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.ch.flat { padding: 0 0 12px; border: 0; }
.ch .more { margin-left: auto; font-weight: 500; font-size: 0.85rem; }
.sub { color: var(--muted); font-size: 0.88rem; }
.pre { white-space: pre-line; }
.hint { color: var(--muted); font-size: 0.85rem; }
.empty { color: var(--muted); }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--blush); color: var(--red-dark); }
.tag.bad { background: var(--red); color: #fff; }

/* Rows: one thing per line, time on the right */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 0; }
.rows > li > a, .rows > li > span:first-child, .rows .grow { flex: 1; min-width: 0; color: inherit; text-decoration: none; display: block; }
.rows > li > a:hover b { color: var(--red-dark); }
.rows .sub { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows.mail .subj { display: block; }
.rows.vm .sub, .rows.vm p { white-space: normal; }
.rows time { color: var(--muted); font-size: 0.85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rows li.unread b { color: var(--ink); }
.rows li.unread { background: linear-gradient(90deg, var(--blush) 0 4px, transparent 4px); }
.rows li.late time { color: var(--red-dark); font-weight: 700; }
.rows li.on { background: var(--blush); }
.rows .end { display: flex; gap: 10px; align-items: center; }
.rows.mail .subj { font-weight: 600; }
.rows audio { width: 100%; max-width: 420px; margin: 8px 0; }

.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl td.in { color: var(--good); font-weight: 700; }
.tbl td.out { color: var(--ink); }
.tbl tr.expected td { background: #fffaf2; }
.card:has(> .tbl) { overflow-x: auto; }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 0.92rem; }
.tabs a:hover { background: var(--blush); }
.tabs a[aria-current] { background: var(--ink); color: #fff; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; gap: 6px; font: 700 0.92rem var(--text); background: var(--red); color: #fff; padding: 9px 16px; border-radius: 999px; text-decoration: none; border: 0; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--red-dark); }
.btn.soft { background: var(--blush); color: var(--red-dark); }
.btn.soft:hover { background: var(--blush-2); }
.btn.ghost { background: none; color: var(--muted); }
.btn.sm { padding: 5px 11px; font-size: 0.82rem; }
.btn[disabled] { opacity: .6; cursor: wait; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form { display: grid; gap: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 160px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 0.85rem; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
input, select, textarea { font: 400 0.95rem var(--text); color: var(--ink); background: #fff; border: 1px solid #ddd5d3; border-radius: 10px; padding: 8px 10px; width: 100%; }
input[type=checkbox] { width: auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--blush-2); }
textarea { resize: vertical; }
fieldset.opt { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; display: grid; gap: 8px; }
fieldset.opt legend { font-weight: 700; padding: 0 6px; }
.search input { max-width: 420px; }

/* Mail */
.letter header { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.letter header time { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
pre.body { margin: 0; padding: 18px; white-space: pre-wrap; word-wrap: break-word; font: 0.95rem/1.55 var(--text); }
iframe.body { display: block; width: 100%; height: 520px; border: 0; background: #fff; }
.letter .hint { padding: 8px 18px 0; }
.files { list-style: none; margin: 0; padding: 12px 18px 16px; display: flex; gap: 8px 16px; flex-wrap: wrap; }

/* Texts */
.bubbles { display: grid; gap: 8px; margin-bottom: 14px; }
.bubble { max-width: 75%; padding: 9px 13px; border-radius: 16px; display: grid; gap: 2px; }
.bubble p { white-space: pre-wrap; }
.bubble.in { background: var(--blush); justify-self: start; border-bottom-left-radius: 4px; }
.bubble.out { background: var(--ink); color: #fff; justify-self: end; border-bottom-right-radius: 4px; }
.bubble.out .sub { color: #c8ccd6; }

/* Jobs */
details.job summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 14px; padding: 14px 18px; }
details.job summary::-webkit-details-marker { display: none; }
details.job summary > span:first-child { display: grid; gap: 2px; }
details.job .nums { display: grid; justify-items: end; gap: 2px; font-variant-numeric: tabular-nums; }
details.job[open] summary { border-bottom: 1px solid var(--line); }

/* Sign-in */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate .card { width: 100%; max-width: 420px; display: grid; gap: 12px; }
.qr { display: grid; place-items: center; }
.qr svg { width: 200px; height: 200px; }
pre.codes { font: 1.1rem/1.8 var(--mono); background: var(--blush); padding: 14px 18px; border-radius: 12px; margin: 0; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; opacity: 0; transition: .2s; pointer-events: none; z-index: 20; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--red-dark); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* Phones: the menu becomes a bar across the top */
@media (max-width: 860px) {
  body { grid-template-columns: minmax(0, 1fr); }
  header.top { position: sticky; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 6px 10px; border-right: 0; border-bottom: 1px solid var(--line); z-index: 5; }
  nav.side { order: 3; width: 100%; display: flex; flex-wrap: wrap; gap: 2px; }
  nav.side a { padding: 6px 9px; gap: 4px; white-space: nowrap; }
  .logo { padding: 0; }
  .logo svg { height: 28px; }
  .out { margin: 0 0 0 auto; white-space: nowrap; }
  .page { padding: 18px 14px 48px; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .bubble { max-width: 90%; }
}
.copy { font-family: var(--mono); font-size: 0.95rem; background: var(--blush); padding: 10px 12px; border-radius: 8px; word-break: break-all; user-select: all; letter-spacing: .04em; }
