/* WhisperPing v2 -- brand stylesheet.
   Palette carried forward from v1 (deadmanswitch/app/static/style.css):
   cream #F4E7DC, warm brown #49423D, muted #7a746d, accent #D6A77A / #c39467,
   notice #f1cfb0, 'Segoe UI', white cards, 16px radius, soft shadow.
   Dark mode is re-derived from the same warm palette, not a generic gray. */

:root {
  --bg: #F4E7DC;
  --text: #49423D;
  --muted: #7a746d;
  --accent: #D6A77A;
  --accent-hover: #c39467;
  --accent-text: #ffffff;
  --notice: #f1cfb0;
  --error-bg: #f6d4c8;
  --error-border: #d98c73;
  --card: #ffffff;
  --card-shadow: 0 4px 12px rgba(73, 66, 61, 0.10);
  --border: #e6d6c8;
  --input-bg: #ffffff;
  --input-border: #d8c7b8;
  --chip: #f7ede4;
  --danger: #c0604a;
  --danger-hover: #a84f3b;
  --success: #7a9b76;
  --success-hover: #648261;
  --radius: 16px;
  --radius-sm: 8px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1a16;
    --text: #f1e6dc;
    --muted: #b3a89d;
    --accent: #D6A77A;
    --accent-hover: #e3bb93;
    --accent-text: #241d18;
    --notice: #4a3626;
    --error-bg: #4d2a20;
    --error-border: #a8604a;
    --card: #2a231e;
    --card-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    --border: #3b3129;
    --input-bg: #231d19;
    --input-border: #4a3e35;
    --chip: #362c25;
    --danger: #d97a63;
    --danger-hover: #e69581;
    --success: #8fae8a;
    --success-hover: #a3c19e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 16px/1.55 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1 { font-size: 1.55rem; margin: .3rem 0 1rem; font-weight: 600; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; font-weight: 600; }
code { background: var(--chip); padding: .05rem .3rem; border-radius: 4px; }

/* Environment banner (config: WP_ENVIRONMENT_BANNER) */
.banner { background: var(--accent); color: var(--accent-text); text-align: center;
          padding: 6px 12px; font-size: 12.5px; letter-spacing: .04em; font-weight: 600; }

/* Header */
.topbar { max-width: 50rem; margin: 0 auto; padding: .9rem 1.2rem; display: flex;
          gap: 1.1rem; flex-wrap: wrap; align-items: center; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 600; text-decoration: none; font-size: 1.1rem; }
.brand img { width: 34px; height: 34px; }
.topbar nav { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.topbar nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.topbar nav a:hover, .topbar nav a.here { color: var(--text); }
.topbar form { margin: 0 0 0 auto; }

main { max-width: 50rem; margin: 0 auto; padding: .4rem 1.2rem 1.5rem; }
footer { max-width: 50rem; margin: 1.5rem auto 2rem; padding: 0 1.2rem; font-size: .78rem; color: var(--muted); }

/* Cards and sections */
.card, fieldset { background: var(--card); border: none; border-radius: var(--radius);
                  box-shadow: var(--card-shadow); padding: 1.1rem 1.3rem 1.2rem; margin: 0 0 1.1rem; }
fieldset { min-width: 0; }
legend { float: left; width: 100%; padding: 0; margin: 0 0 .35rem; font-weight: 600; font-size: 1.08rem; }
legend + * { clear: both; }
.section-intro { color: var(--muted); font-size: .92rem; margin: 0 0 .8rem; }

/* Auth-style pages: centred card with the logo, like v1's login */
body.auth main { display: flex; justify-content: center; padding-top: 6vh; }
.auth-card { width: 100%; max-width: 380px; text-align: center; padding: 2rem 1.8rem; }
.auth-card .logo { width: 84px; height: 84px; margin: 0 auto .8rem; display: block; }
.auth-card form { text-align: left; }
.auth-card .subtitle { color: var(--muted); font-size: .92rem; margin: -.4rem 0 1.3rem; }

/* Forms */
label { display: block; margin: .6rem 0 .2rem; font-size: .93rem; }
label.inline { display: inline-flex; align-items: center; gap: .35rem; margin: .2rem .9rem .2rem 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel],
input[type=search], textarea, select {
  font: inherit; color: var(--text); background: var(--input-bg); padding: .5rem .65rem;
  width: 100%; max-width: 28rem; border: 1px solid var(--input-border); border-radius: var(--radius-sm); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input.short { max-width: 6.5rem; }
textarea { max-width: 100%; min-height: 3.2rem; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }
button, .btn { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-text);
               border: none; border-radius: var(--radius-sm); padding: .55rem 1.15rem; cursor: pointer;
               text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: var(--accent-hover); color: var(--accent-text); }
button.secondary, .btn.secondary { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--input-border); }
button.secondary:hover { background: var(--chip); color: var(--text); }
/* Stop = red, Resume/Start = green (Jeff, 2026-09-24) -- Pause stays .secondary. */
button.danger, .btn.danger { background: var(--danger); color: #fff; }
button.danger:hover, .btn.danger:hover { background: var(--danger-hover); }
button.success, .btn.success { background: var(--success); color: #fff; }
button.success:hover, .btn.success:hover { background: var(--success-hover); }
button.wide { width: 100%; margin-top: .6rem; }
.hint { color: var(--muted); font-size: .88rem; margin: .25rem 0; }
.muted { color: var(--muted); }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
/* Keeps a number input and its unit label (e.g. "[5] minutes") together as
   one wrappable unit, so .row's flex-wrap can only break BETWEEN such pairs,
   never between an input and its own label (2026-09-24). */
.unit-pair { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.spacer { margin-left: auto; }

/* Flash messages */
.flash { background: var(--notice); color: var(--text); padding: .6rem .85rem; border-radius: var(--radius-sm); margin: 0 0 1rem; }
.flash.error { background: var(--error-bg); box-shadow: inset 3px 0 0 var(--error-border); }

/* Segmented control (rhythm) */
.segmented { display: inline-flex; background: var(--chip); border-radius: 999px; padding: 3px; margin: .2rem 0 .6rem; }
.segmented label { margin: 0; padding: .35rem 1rem; border-radius: 999px; cursor: pointer; font-weight: 500; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--accent); color: var(--accent-text); }
.segmented label:focus-within { outline: 2px solid var(--accent); }

/* Circle names */
.circle-name { display: inline-block; background: var(--chip); border-radius: 999px; padding: .05rem .6rem;
               font-size: .82rem; font-weight: 600; margin-left: .35rem; vertical-align: 2px; }

/* Contact picker */
.picker { border: 1px solid var(--input-border); border-radius: var(--radius-sm); background: var(--input-bg); }
.picker-search { border: none !important; border-bottom: 1px solid var(--border) !important; border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important; max-width: 100% !important; }
.picker-list { max-height: 17rem; overflow-y: auto; }
.picker-row { display: flex; align-items: center; gap: .6rem; padding: .45rem .7rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.picker-row:last-child { border-bottom: none; }
.picker-row[hidden] { display: none; }
.picker-row.on { background: var(--chip); }
.picker-name { margin: 0; display: inline-flex; align-items: center; gap: .45rem; font-weight: 500; flex: 1 1 12rem; }
.picker-name small { color: var(--muted); font-weight: 400; }
.picker-ch { display: inline-flex; gap: .3rem; }
.picker-row:not(.on) .picker-ch { display: none; }
.chip { display: inline-flex; align-items: center; gap: .3rem; margin: 0; padding: .15rem .6rem; border-radius: 999px;
        font-size: .82rem; background: var(--card); box-shadow: inset 0 0 0 1px var(--input-border); cursor: pointer; }
.chip:has(input:checked) { background: var(--accent); color: var(--accent-text); box-shadow: none; }
.chip:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.chip input { width: .9rem; height: .9rem; }
.picker-foot { padding: .4rem .7rem; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--border); }
.picker-empty { padding: .6rem .7rem; color: var(--muted); font-size: .9rem; }

/* Reminders */
.reminder { border-top: 1px solid var(--border); padding: .7rem 0 .2rem; }
.reminder:first-of-type { border-top: none; }
.override-panel { margin: .5rem 0 .3rem 1.2rem; padding: .7rem .9rem; border-left: 3px solid var(--accent); background: var(--chip); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.override-panel[hidden] { display: none; }

/* Dashboard */
.chime-head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.chime-head strong { font-size: 1.1rem; }
.pill { font-size: .78rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; background: var(--chip); }
.pill.on { background: var(--accent); color: var(--accent-text); }
.due { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin: .6rem 0 .2rem;
       padding: .6rem .8rem; background: var(--chip); border-radius: var(--radius-sm); }
.due form { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.inline-form { display: inline; margin: 0; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
td, th { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: .82rem; }

/* Dashboard countdown */
.countdown-block { margin: .7rem 0 .3rem; padding: .9rem 1rem; background: var(--chip); border-radius: var(--radius-sm); }
.countdown-label { color: var(--muted); font-size: .88rem; }
.countdown { font-size: 2rem; font-weight: 600; letter-spacing: .01em; font-variant-numeric: tabular-nums; line-height: 1.2; margin: .15rem 0; }
.countdown.overdue { font-size: 1.1rem; color: var(--error-border); }
.countdown-sub { font-size: .92rem; }
.countdown-sub strong { font-variant-numeric: tabular-nums; }
.countdown-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .7rem; }
.countdown-block.paused { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* Clear an alert without an all-clear */
.clear-alert { margin-top: .6rem; }
.clear-alert summary { cursor: pointer; font-size: .9rem; color: var(--muted); }
.clear-alert form { margin-top: .5rem; }
