/* =========================================================================
   Désirs d'Orient — Owner dashboard
   Warm, elegant, calm. Cream/ivory ground · deep green + terracotta · gold.
   System serif for headings, system sans for UI. No web-font fetch.
   ========================================================================= */

:root {
  /* Ground & paper */
  --ivory:        #faf6ee;
  --cream:        #f4ecdd;
  --paper:        #fffdf8;
  --paper-2:      #fbf6ec;
  --line:         #e7dcc6;
  --line-soft:    #efe6d4;

  /* Ink */
  --ink:          #2b2620;
  --ink-soft:     #5c554a;
  --ink-faint:    #8a8073;

  /* Brand */
  --green:        #1f3d35;   /* deep hammam green */
  --green-700:    #2c5247;
  --green-tint:   #e9efe9;
  --terracotta:   #b5613f;
  --terracotta-700:#9a4f31;
  --terra-tint:   #f6e7df;
  --gold:         #d4af37;
  --gold-soft:    #e7d9a8;
  --gold-deep:    #a8842a;

  /* States */
  --ok:           #3f7a52;
  --ok-tint:      #e6f0e7;
  --warn:         #b07d20;
  --warn-tint:    #f7eecf;
  --danger:       #a6402f;
  --danger-tint:  #f6e3df;

  /* System */
  --radius:       16px;
  --radius-sm:    10px;
  --radius-lg:    22px;
  --shadow:       0 1px 2px rgba(43,38,32,.04), 0 10px 30px rgba(43,38,32,.07);
  --shadow-soft:  0 1px 2px rgba(43,38,32,.04), 0 4px 14px rgba(43,38,32,.05);
  --ring:         0 0 0 3px rgba(212,175,55,.35);

  --serif: "Iowan Old Style", "Hoefler Text", "Apple Garamond", Garamond,
           "Times New Roman", Georgia, "Cambria", "Noto Serif", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
           Arial, "Noto Sans", sans-serif;

  --maxw: 1120px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(212,175,55,.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(31,61,53,.07), transparent 55%),
    var(--ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.55;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: .2px; color: var(--ink); margin: 0; }
a { color: inherit; }
button { font-family: inherit; }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 999px;
  padding: .62rem 1.15rem;
  font-size: .94rem; font-weight: 600;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  box-shadow: var(--shadow-soft);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-sm { padding: .42rem .85rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(180deg, var(--green-700), var(--green));
  color: #f6f1e3; border-color: var(--green);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(31,61,53,.25); }
.btn-gold {
  background: linear-gradient(180deg, #e3c25a, var(--gold));
  color: #3a2f12; border-color: var(--gold-deep);
}
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.btn-ghost:hover { background: var(--paper-2); }
.btn-danger { background: var(--danger-tint); border-color: #e6c3bb; color: var(--danger); box-shadow: none; }
.btn-danger:hover { background: #f2d6cf; }

/* ===================== LOGIN ===================== */
.login-view {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 2rem 1.25rem;
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.6rem 2.2rem 2rem;
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.login-crest {
  width: 64px; height: 64px; margin: 0 auto 1.1rem;
  border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--green-700), var(--green));
  box-shadow: 0 8px 20px rgba(31,61,53,.25), inset 0 0 0 1px rgba(212,175,55,.4);
}
.crest-monogram { font-family: var(--serif); font-size: 1.9rem; color: var(--gold); line-height: 1; }
.login-eyebrow {
  margin: 0 0 .35rem; font-size: .74rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-deep); font-weight: 700;
}
.login-wordmark { font-size: 2.05rem; line-height: 1.1; color: var(--green); }
.login-sub { margin: .55rem 0 1.7rem; color: var(--ink-soft); font-size: .96rem; }
.login-form { text-align: left; }
.login-foot { margin: 1.3rem 0 0; font-size: .78rem; color: var(--ink-faint); }

/* ---------- Fields ---------- */
.field { display: block; margin-bottom: 1rem; }
.field-label {
  display: block; margin-bottom: .4rem;
  font-size: .82rem; font-weight: 600; color: var(--ink-soft); letter-spacing: .01em;
}
.field-hint { display: block; margin-top: .35rem; font-size: .76rem; color: var(--ink-faint); }
input[type="text"], input[type="password"], input[type="number"], input[type="time"],
input[type="tel"], select, textarea {
  width: 100%;
  font: inherit; color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .68rem .8rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
textarea { resize: vertical; min-height: 3.2rem; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold); background: var(--paper);
  box-shadow: var(--ring);
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }

.form-error { margin: .2rem 0 1rem; color: var(--danger); font-size: .85rem; font-weight: 600; }

/* ===================== APP SHELL ===================== */
.app { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1.4rem;
  padding: .85rem clamp(1rem, 4vw, 2rem);
  background: rgba(252,249,242,.86);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-brand { display: flex; align-items: center; gap: .6rem; flex: 0 0 auto; }
.brand-crest {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.05rem; color: var(--gold);
  background: linear-gradient(180deg, var(--green-700), var(--green));
  box-shadow: inset 0 0 0 1px rgba(212,175,55,.35);
}
.brand-wordmark { font-family: var(--serif); font-size: 1.22rem; color: var(--green); letter-spacing: .2px; white-space: nowrap; }

.nav { display: flex; gap: .25rem; flex: 1 1 auto; }
.nav-link {
  text-decoration: none; color: var(--ink-soft);
  font-size: .92rem; font-weight: 600;
  padding: .5rem .8rem; border-radius: 999px;
  transition: background .18s ease, color .18s ease;
  white-space: nowrap;
}
.nav-link:hover { background: var(--paper-2); color: var(--ink); }
.nav-link.is-active { background: var(--green-tint); color: var(--green); }

.topbar-right { display: flex; align-items: center; gap: .8rem; flex: 0 0 auto; }
.owner-area { font-size: .88rem; color: var(--ink-soft); font-weight: 600; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-toggle { display: none; }

.view {
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: clamp(1.4rem, 4vw, 2.6rem) clamp(1rem, 4vw, 2rem) 3rem;
  flex: 1 1 auto;
  animation: fade-in .35s ease both;
}
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.appfoot {
  display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center;
  padding: 1.3rem 1rem 2rem; color: var(--ink-faint); font-size: .8rem;
  border-top: 1px solid var(--line-soft);
}
.appfoot-dot { opacity: .5; }

/* ---------- Page header ---------- */
.page-head { margin-bottom: 1.6rem; }
.page-eyebrow { font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-deep); font-weight: 700; margin: 0 0 .35rem; }
.page-title { font-size: clamp(1.7rem, 4vw, 2.3rem); color: var(--green); }
.page-sub { margin: .45rem 0 0; color: var(--ink-soft); max-width: 60ch; }

/* ---------- Cards & surfaces ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.card-pad { padding: 1.3rem 1.4rem; }
.section { margin-top: 2rem; }
.section-title { font-size: 1.18rem; color: var(--green); margin-bottom: .9rem; display: flex; align-items: baseline; gap: .6rem; }
.section-note { font-size: .82rem; color: var(--ink-faint); font-weight: 500; }

/* ---------- Stat tiles ---------- */
.stat-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow-soft);
  position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -18px; top: -18px;
  width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,.16), transparent 70%);
}
.stat-num { font-family: var(--serif); font-size: 2.2rem; color: var(--green); line-height: 1; }
.stat-label { margin-top: .45rem; font-size: .84rem; color: var(--ink-soft); font-weight: 600; }
.stat--warn .stat-num { color: var(--terracotta-700); }

/* ---------- Receptionist status banner ---------- */
.recept {
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  margin-top: 1.4rem;
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(120deg, var(--green-tint), var(--paper) 70%);
  box-shadow: var(--shadow-soft);
}
.recept.is-paused { background: linear-gradient(120deg, var(--warn-tint), var(--paper) 70%); }
.recept-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 4px rgba(63,122,82,.16); background: var(--ok); }
.recept.is-paused .recept-dot { background: var(--warn); box-shadow: 0 0 0 4px rgba(176,125,32,.16); }
.recept-text { flex: 1 1 240px; }
.recept-title { font-family: var(--serif); font-size: 1.1rem; color: var(--green); }
.recept.is-paused .recept-title { color: var(--terracotta-700); }
.recept-sub { font-size: .86rem; color: var(--ink-soft); margin-top: .15rem; }

/* Toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: .65rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 52px; height: 30px; border-radius: 999px;
  background: var(--ok); transition: background .22s ease;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
  flex: 0 0 auto;
}
.switch-track::after {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2);
  transition: transform .22s cubic-bezier(.4,1.2,.5,1);
}
.switch input:checked + .switch-track { background: var(--warn); }
.switch input:checked + .switch-track::after { transform: translateX(22px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--ring); }
.switch-label { font-size: .9rem; font-weight: 600; color: var(--ink-soft); }

/* ---------- Lists / tables ---------- */
.list { display: flex; flex-direction: column; gap: .7rem; }
.row-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
  text-align: left; width: 100%;
  cursor: pointer; color: inherit;
  transition: transform .14s ease, box-shadow .2s ease, border-color .2s ease;
}
.row-card:hover { transform: translateY(-1px); border-color: var(--gold-soft); box-shadow: var(--shadow); }
.row-card:focus-visible { outline: none; box-shadow: var(--ring); }
.row-static { cursor: default; }
.row-static:hover { transform: none; border-color: var(--line); box-shadow: var(--shadow-soft); }
.avatar {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.05rem; color: var(--green-700);
  background: var(--cream); box-shadow: inset 0 0 0 1px var(--line);
}
.row-main { flex: 1 1 auto; min-width: 0; }
.row-title { font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: .5rem; }
.row-meta { font-size: .82rem; color: var(--ink-faint); margin-top: .15rem; }
.row-snippet { font-size: .88rem; color: var(--ink-soft); margin-top: .25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-side { flex: 0 0 auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; }
.row-count { font-family: var(--serif); font-size: 1.15rem; color: var(--green); }
.row-chevron { color: var(--gold-deep); flex: 0 0 auto; display: inline-flex; transition: transform .16s ease; }
.row-chevron svg { width: 18px; height: 18px; }
.row-card:hover .row-chevron { transform: translateX(2px); }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  padding: .2rem .6rem; border-radius: 999px;
  background: var(--cream); color: var(--ink-soft); border: 1px solid var(--line);
  text-transform: capitalize;
}
.badge--ok { background: var(--ok-tint); color: var(--ok); border-color: #cfe2d2; }
.badge--warn { background: var(--warn-tint); color: var(--warn); border-color: #ecdcae; }
.badge--danger { background: var(--danger-tint); color: var(--danger); border-color: #e6c3bb; }
.badge--green { background: var(--green-tint); color: var(--green); border-color: #cfe0d4; }
.badge--gold { background: #f6edcf; color: var(--gold-deep); border-color: var(--gold-soft); }
.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---------- Transcript (conversation detail) ---------- */
.conv-meta { display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin: .4rem 0 1.4rem; color: var(--ink-soft); font-size: .86rem; }
.conv-meta b { color: var(--ink); font-weight: 700; }
.transcript {
  display: flex; flex-direction: column; gap: .85rem;
  padding: 1.4rem; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--paper-2), var(--paper));
  border: 1px solid var(--line); box-shadow: var(--shadow-soft);
}
.bubble-row { display: flex; flex-direction: column; max-width: 76%; }
.bubble-row.is-customer { align-self: flex-start; align-items: flex-start; }
.bubble-row.is-agent { align-self: flex-end; align-items: flex-end; }
.bubble-who { font-size: .72rem; font-weight: 700; letter-spacing: .02em; margin: 0 .3rem .25rem; color: var(--ink-faint); }
.bubble {
  padding: .7rem .95rem; border-radius: 16px; font-size: .94rem; line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
  box-shadow: var(--shadow-soft);
}
.is-customer .bubble { background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 5px; color: var(--ink); }
.is-agent .bubble {
  background: linear-gradient(180deg, var(--green-700), var(--green));
  color: #f4efe2; border-bottom-right-radius: 5px;
}
.is-agent .bubble-who { color: var(--gold-deep); }
.bubble-ts { font-size: .68rem; color: var(--ink-faint); margin: .25rem .3rem 0; }

details.trace {
  margin-top: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); overflow: hidden;
}
details.trace > summary {
  cursor: pointer; list-style: none; padding: .9rem 1.2rem;
  font-weight: 600; color: var(--ink-soft); font-size: .9rem;
  display: flex; align-items: center; gap: .5rem;
}
details.trace > summary::-webkit-details-marker { display: none; }
details.trace > summary::before { content: "▸"; color: var(--gold-deep); transition: transform .18s ease; }
details.trace[open] > summary::before { transform: rotate(90deg); }
.trace-body { padding: 0 1.2rem 1.1rem; }
.trace-pre {
  margin: 0; padding: 1rem; border-radius: var(--radius-sm);
  background: #1f1c17; color: #e9dcc4; font-size: .8rem; line-height: 1.5;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  overflow: auto; max-height: 360px; white-space: pre-wrap; word-break: break-word;
}

/* ---------- Settings forms ---------- */
.settings-intro {
  margin-bottom: 1.6rem; padding: 1.1rem 1.3rem;
  border-left: 4px solid var(--gold); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: #f8f0d9; color: var(--ink-soft); font-size: .9rem;
}
.panel { margin-bottom: 1.5rem; }
.panel-head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: 1rem; }
.panel-title { font-size: 1.15rem; color: var(--green); }
.panel-desc { font-size: .85rem; color: var(--ink-soft); margin: -.4rem 0 1rem; }

.grid-2 { display: grid; gap: 1rem 1.2rem; grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-hours { display: grid; gap: .7rem; grid-template-columns: 120px 1fr 1fr; align-items: center; }
.grid-hours .gh-label { font-weight: 600; color: var(--ink-soft); font-size: .9rem; }

.ritual-row {
  display: grid; gap: .6rem .8rem;
  grid-template-columns: 1.6fr .8fr .8fr 1.4fr;
  align-items: end;
  padding: .9rem; border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  background: var(--paper-2); margin-bottom: .7rem;
}
.empty-flag {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .72rem; font-weight: 700; color: var(--warn);
  background: var(--warn-tint); border: 1px solid #ecdcae;
  padding: .12rem .5rem; border-radius: 999px;
}
.needs-attention { box-shadow: inset 0 0 0 2px var(--gold-soft); }
.field.is-needed .field-label::after {
  content: "à remplir"; margin-left: .5rem; font-size: .68rem; font-weight: 700;
  color: var(--warn); background: var(--warn-tint); padding: .08rem .45rem; border-radius: 999px;
  border: 1px solid #ecdcae; text-transform: none; letter-spacing: 0;
}

.save-bar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: flex-end; gap: 1rem; flex-wrap: wrap;
  margin-top: 1.6rem; padding: 1rem 1.2rem;
  background: rgba(252,249,242,.92); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.save-bar .save-hint { margin-right: auto; font-size: .84rem; color: var(--ink-soft); }

/* ---------- States: loading / empty / error ---------- */
.state {
  display: grid; place-items: center; text-align: center; gap: .7rem;
  padding: 3.2rem 1.5rem; color: var(--ink-soft);
}
.state-icon {
  width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: .15rem;
  border-radius: 50%; color: var(--gold-deep);
  background: radial-gradient(circle at 50% 32%, #f7eed0, var(--cream));
  box-shadow: inset 0 0 0 1px var(--gold-soft), var(--shadow-soft);
}
.state-icon svg { width: 26px; height: 26px; }
.state--error .state-icon {
  color: var(--danger);
  background: radial-gradient(circle at 50% 32%, var(--danger-tint), var(--cream));
  box-shadow: inset 0 0 0 1px #e6c3bb, var(--shadow-soft);
}
.state-title { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); }
.state-sub { font-size: .9rem; color: var(--ink-faint); max-width: 42ch; }
.state--error .state-title { color: var(--danger); }

.skeleton { position: relative; overflow: hidden; background: var(--cream); border-radius: var(--radius); }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  transform: translateX(-100%); animation: shimmer 1.3s infinite;
}
.sk-row { height: 74px; margin-bottom: .7rem; }
@keyframes shimmer { to { transform: translateX(100%); } }

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--gold-soft); border-top-color: var(--gold-deep);
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Back link ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: .4rem;
  background: none; border: none; cursor: pointer;
  color: var(--gold-deep); font-weight: 600; font-size: .88rem;
  padding: .2rem 0; margin-bottom: 1rem;
}
.back-link:hover { color: var(--terracotta-700); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 1.5rem);
  z-index: 100; pointer-events: none;
  max-width: min(92vw, 460px);
  padding: .85rem 1.2rem; border-radius: 999px;
  background: var(--ink); color: var(--ivory);
  font-size: .9rem; font-weight: 600; box-shadow: 0 12px 34px rgba(43,38,32,.3);
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-ok { background: linear-gradient(180deg, #3f7a52, #2f5d3e); }
.toast.is-error { background: linear-gradient(180deg, #b34634, var(--danger)); }

/* ---------- Numerals & icons ---------- */
/* Tabular figures so counts, prices and aligned numbers never shift width. */
.stat-num, .row-count, .conv-meta b, input[type="number"] { font-variant-numeric: tabular-nums; }
.avatar svg { width: 20px; height: 20px; color: var(--green-700); }

/* ---------- Misc ---------- */
.muted { color: var(--ink-faint); }
.mt-0 { margin-top: 0; }
.divider { height: 1px; background: var(--line-soft); border: 0; margin: 1.4rem 0; }
.inline-spin { display: inline-flex; align-items: center; gap: .5rem; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1023px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 767px) {
  body { font-size: 15.5px; }
  .topbar { gap: .8rem; flex-wrap: wrap; }
  .nav {
    order: 3; flex-basis: 100%;
    display: none; flex-direction: column; gap: .25rem;
    padding-top: .6rem; border-top: 1px solid var(--line-soft); margin-top: .2rem;
  }
  .app.nav-open .nav { display: flex; }
  .nav-link { padding: .65rem .8rem; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; gap: 4px; justify-content: center;
    position: fixed; top: .85rem; right: clamp(1rem,4vw,2rem); z-index: 50;
    width: 40px; height: 38px; padding: 8px 9px;
    background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: var(--shadow-soft); cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: var(--green); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
  .topbar-right { margin-right: 48px; }
  .owner-area { display: none; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: .7rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-hours { grid-template-columns: 70px 1fr 1fr; gap: .5rem; }
  .ritual-row { grid-template-columns: 1fr 1fr; }
  .ritual-row .rr-name { grid-column: 1 / -1; }
  .ritual-row .rr-includes { grid-column: 1 / -1; }
  .bubble-row { max-width: 88%; }
  .row-snippet { white-space: normal; }
}

/* ===================== REDUCED MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .btn:hover, .row-card:hover { transform: none; }
}
