/* vocsend — shared styles for the app and the command-line guide. */

:root {
  --paper: #f7f4ee;
  --card: #ffffff;
  --ink: #15171c;
  --soft: #5d6370;
  --line: #e3ded3;
  --send: #f0522d;
  --send-ink: #ffffff;
  --receive: #0c7c7e;
  --receive-ink: #ffffff;
  --good: #1d7a3e;
  --warn: #9a6a00;
  --bad: #c0392b;
  --code: #1b1e25;
  --code-ink: #e8e6e1;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.05), 0 8px 24px rgba(20, 20, 30, 0.06);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1115;
    --card: #181b21;
    --ink: #eef0f3;
    --soft: #9aa1ad;
    --line: #2a2e37;
    --send: #ff6a45;
    --receive: #25a9a6;
    --receive-ink: #06201f;
    --good: #4cc27a;
    --warn: #e0a931;
    --bad: #ff7b6b;
    --code: #0a0c10;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
p { margin: 0.6em 0; }
[hidden] { display: none !important; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ---------------------------------------------------------------- top bar */

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; max-width: 720px; margin: 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.15rem; text-decoration: none; letter-spacing: -0.02em; }
.brand svg { width: 28px; height: 28px; }
.top nav { display: flex; gap: 16px; font-size: 0.92rem; }
.top nav a { color: var(--soft); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--soft); text-decoration: none; font-size: 0.95rem; padding: 6px 0; }

/* ------------------------------------------------------------------- hero */

.hero { padding: 6px 0 26px; text-align: center; }
.hero h1 { font-size: clamp(1.9rem, 7.2vw, 2.9rem); font-weight: 800; margin: 14px auto 10px; max-width: 14em; }
.hero .lede { color: var(--soft); max-width: 30em; margin: 0 auto 22px; }

.bars { display: flex; align-items: center; justify-content: center; gap: 4px; height: 64px; }
.bars span {
  width: 6px; border-radius: 3px; background: linear-gradient(var(--send), var(--receive));
  height: 20%; transition: height 0.09s ease-out; opacity: 0.9;
}
.bars.idle span { animation: breathe 2.4s ease-in-out infinite; }
.bars.idle span:nth-child(3n) { animation-delay: -0.5s; }
.bars.idle span:nth-child(3n+1) { animation-delay: -1.1s; }
.bars.idle span:nth-child(4n) { animation-delay: -1.7s; }
@keyframes breathe { 0%, 100% { height: 14%; } 50% { height: 62%; } }
@media (prefers-reduced-motion: reduce) { .bars.idle span { animation: none; height: 35%; } }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.big {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 108px; border-radius: var(--radius); border: 0; text-decoration: none;
  font: 700 1.2rem var(--sans); letter-spacing: -0.01em; box-shadow: var(--shadow); cursor: pointer;
  transition: transform 0.08s ease;
}
.big:active { transform: scale(0.98); }
.big small { font-weight: 500; font-size: 0.82rem; opacity: 0.9; }
.big svg { width: 26px; height: 26px; }
.big.send { background: var(--send); color: var(--send-ink); }
.big.receive { background: var(--receive); color: var(--receive-ink); }
.sub-choice { display: block; text-align: center; margin: 16px 0 0; color: var(--soft); font-size: 0.95rem; }

/* ------------------------------------------------------------------ cards */

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 16px 0; box-shadow: var(--shadow); }
.card h2 { font-size: 1.15rem; margin-bottom: 8px; }
.card h3 { font-size: 1rem; margin: 14px 0 4px; }
.section-title { font-size: 1.5rem; font-weight: 800; margin: 44px 0 6px; }
.muted { color: var(--soft); }
.small { font-size: 0.9rem; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 10px 0 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 12px 44px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 0.9rem; background: var(--paper); border: 1px solid var(--line);
}

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: var(--paper); border: 1px solid var(--line); color: var(--soft); }

/* ------------------------------------------------------------------ forms */

textarea, input[type=text], input[type=password] {
  width: 100%; font: 16px/1.45 var(--mono); color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; -webkit-appearance: none; appearance: none;
}
textarea { min-height: 150px; resize: vertical; }
textarea:focus, input:focus { outline: 2px solid var(--receive); outline-offset: 1px; }
textarea[readonly] { background: var(--paper); }
label.field { display: block; font-size: 0.92rem; font-weight: 600; margin: 12px 0 5px; }

.action {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 58px; margin-top: 12px;
  border: 0; border-radius: 14px; font: 700 1.1rem var(--sans); cursor: pointer; box-shadow: var(--shadow);
}
.action.send { background: var(--send); color: var(--send-ink); }
.action.receive { background: var(--receive); color: var(--receive-ink); }
.action.stop { background: var(--ink); color: var(--paper); }
.action:disabled { opacity: 0.45; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.button {
  flex: 1 1 auto; min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font: 600 0.95rem var(--sans); cursor: pointer;
}
.button.primary { background: var(--send); border-color: var(--send); color: var(--send-ink); }
.linkish { background: none; border: 0; padding: 0; color: var(--soft); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

details.settings { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 4px; }
details.settings summary { cursor: pointer; padding: 10px 0; font-weight: 650; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.settings summary::-webkit-details-marker { display: none; }
details.settings summary::after { content: "+"; font-size: 1.3rem; color: var(--soft); }
details.settings[open] summary::after { content: "–"; }

.switch { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; margin: 2px 0 0; cursor: pointer; transition: background 0.15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform 0.15s; }
.switch input:checked { background: var(--receive); }
.switch input:checked::after { transform: translateX(18px); }
.switch b { display: block; font-weight: 650; }
.switch span { display: block; color: var(--soft); font-size: 0.88rem; }

input[type=range] { width: 100%; accent-color: var(--send); height: 32px; }
.level-read { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.level-read b { font-size: 1.05rem; }
.level-read > span { color: var(--soft); font-size: 0.9rem; }
.scale { display: flex; justify-content: space-between; color: var(--soft); font-size: 0.78rem; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.segmented button { border: 0; background: none; border-radius: 9px; min-height: 42px; font: 600 0.95rem var(--sans); color: var(--soft); cursor: pointer; }
.segmented button[aria-pressed=true] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
select { font: 16px var(--sans); padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }

/* ----------------------------------------------------------------- status */

.status { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.status .bars { height: 44px; margin-bottom: 8px; }
.status .now { font-weight: 650; text-align: center; }
.status .detail { text-align: center; color: var(--soft); font-size: 0.9rem; min-height: 1.3em; }
.progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 10px 0 2px; }
.progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--send), var(--receive)); }
.notice { margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 0.95rem; border: 1px solid; }
.notice.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); background: color-mix(in srgb, var(--good) 9%, transparent); }
.notice.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: color-mix(in srgb, var(--bad) 9%, transparent); }
.chip { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-bottom: 10px; border-radius: 12px; background: var(--paper); border: 1px dashed var(--line); font-size: 0.92rem; }

dl.info { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 10px 0 0; font-size: 0.93rem; }
dl.info dt { color: var(--soft); }
dl.info dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--soft); font-weight: 600; font-size: 0.82rem; }
th:first-child, td:first-child { text-align: left; }
td.solid { color: var(--good); font-weight: 650; } td.marginal { color: var(--warn); font-weight: 650; } td.fails { color: var(--bad); font-weight: 650; }
td.waiting { color: var(--soft); text-align: left; }

.log { font: 0.78rem/1.45 var(--mono); color: var(--soft); white-space: pre-wrap; max-height: 12em; overflow-y: auto; margin: 6px 0 0; }

/* ----------------------------------------------------------------- footer */

footer { margin: 48px 0 32px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--soft); font-size: 0.9rem; text-align: center; }
footer a { color: var(--ink); }

/* ------------------------------------------------------ command-line guide */

.doc h1 { font-size: clamp(1.8rem, 6.5vw, 2.5rem); font-weight: 800; margin: 12px 0 8px; }
.doc h2 { font-size: 1.4rem; font-weight: 800; margin: 40px 0 8px; }
.doc h3 { font-size: 1.08rem; margin: 26px 0 6px; }
.doc ul { padding-left: 1.2em; }
.doc li { margin: 0.3em 0; }
code { font-family: var(--mono); font-size: 0.9em; background: color-mix(in srgb, var(--ink) 8%, transparent); padding: 1px 6px; border-radius: 6px; }
pre {
  background: var(--code); color: var(--code-ink); border-radius: 14px; padding: 14px 16px; overflow-x: auto;
  font: 0.86rem/1.6 var(--mono); margin: 12px 0; -webkit-overflow-scrolling: touch;
}
pre code { background: none; padding: 0; font-size: inherit; }
pre .p { color: #8fd3d1; user-select: none; }      /* the prompt */
pre .c { color: #8a8f99; }                         /* a comment or output */
.doc table { margin: 10px 0; }
.doc th, .doc td { text-align: left; white-space: normal; vertical-align: top; }
.doc td:first-child { white-space: nowrap; }
.cta { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 650; margin: 6px 8px 6px 0; }
.cta.light { background: var(--card); color: var(--ink); border: 1px solid var(--line); }

/* ---------------------------------------------------------------- privacy */

.private {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--good) 35%, var(--line)); border-radius: 12px;
  background: color-mix(in srgb, var(--good) 9%, var(--card)); font-size: 0.86rem; line-height: 1.4; text-align: left;
}
.private svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--good); }
.private b { color: var(--good); }

#send-level-block.off .scale, #send-level-block.off input { opacity: 0.4; }
input[type=range]:disabled { cursor: not-allowed; }
