/* Legalmente Ford MGMT on the web: a calm, light workspace for a computer. The brand stays
   in the espresso side bar with the gold seal; the work itself is on white, in Montserrat,
   dense enough to see a whole case at once. Its own styles: the apps' dark css/styles.css
   is not loaded here. */

@font-face { font-family: 'Playfair Display'; src: url('../fonts/playfair-display-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('../fonts/montserrat-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #f4f2ee;
  --panel: #fff;
  --panel-2: #f9f7f3;
  --ink: #1f1a15;
  --ink-2: #4a4037;
  --muted: #776c60;
  --line: #e7e1d7;
  --line-2: #d8cfc1;
  --brand: #1a130d;        /* side bar, primary buttons */
  --gold: #c9a96e;         /* accents on dark, borders */
  --gold-ink: #87672c;     /* gold as text on white */
  --tint: #f7f0e3;         /* selected, highlighted */
  --hot-bg: #f6e7c8;
  --hot-line: #e2c58a;
  --hot-ink: #6b4e17;
  --ok: #2c7a4b;
  --ok-bg: #edf7f0;
  --ok-line: #bcdcc6;
  --danger: #b03f2d;
  --note-bg: #fff8e2;
  --note-line: #ead18a;
  --focus: 0 0 0 3px rgba(201, 169, 110, .4);
  --display: 'Playfair Display', Georgia, serif;
  --sans: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; font: 400 14px/1.5 var(--sans); color: var(--ink); background: var(--bg); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; line-height: 1.2; }
a { color: var(--gold-ink); }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* The seal: LF in gold inside a gold ring. */
.monogram {
  display: grid;
  place-items: center;
  flex: none;
  width: 64px;
  aspect-ratio: 1;
  border: 1px solid var(--gold);
  border-radius: 50%;
  outline: 1px solid rgba(201, 169, 110, .35);
  outline-offset: 4px;
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1;
}
.monogram.xs { width: 36px; font-size: .95rem; outline: 0; }
.gold {
  background: linear-gradient(180deg, #f3e3bd 0%, #d4b27a 48%, #a8823f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- the frame ---------- */

.shell { display: grid; grid-template-columns: 220px 340px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.side { display: flex; flex-direction: column; min-height: 0; padding: 16px 12px; overflow-y: auto; background: var(--brand); color: #e9e1d3; }
.pane-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--panel); }
.pane-main { min-width: 0; overflow-y: auto; container-type: inline-size; }
.pane-main.loading > * { opacity: .45; transition: opacity .15s .1s; }

/* Side bar */
.side-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 8px; padding: 4px 8px 16px; border-bottom: 1px solid rgba(201, 169, 110, .22); text-decoration: none; }
.side-brand > span:last-child { display: flex; flex-direction: column; }
.side-brand b { font-family: var(--display); font-weight: 500; font-size: 1.05rem; color: #ecd9b0; white-space: nowrap; }
.side-brand small { color: var(--gold); font-size: .6rem; font-weight: 600; letter-spacing: .26em; }
.side-label { margin: 16px 10px 6px; color: rgba(233, 225, 211, .5); font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.side-link, .side-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #e9e1d3;
  font: 500 .88rem var(--sans);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.side-link svg, .side-btn svg { flex: none; width: 17px; height: 17px; color: rgba(201, 169, 110, .9); }
.side-link span { flex: 1; }
.side-link b { color: rgba(233, 225, 211, .55); font-size: .78rem; font-weight: 600; }
.side-link:hover, .side-btn:hover { background: rgba(255, 255, 255, .06); }
.side-link[aria-current="true"] { background: rgba(201, 169, 110, .17); color: #fff; }
.side-link[aria-current="true"] b { color: #f3e3bd; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.side-foot { display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(201, 169, 110, .2); }
.side-btn { color: rgba(233, 225, 211, .82); font-size: .84rem; }
.globe { flex: none; width: 17px; color: var(--gold); font-size: .62rem; font-weight: 700; text-align: center; }
.side-user { display: flex; flex-direction: column; padding: 8px 10px; color: rgba(233, 225, 211, .9); font-size: .78rem; overflow-wrap: anywhere; }
.side-user small { color: rgba(233, 225, 211, .5); font-size: .68rem; }

/* List of cases */
.list-head { padding: 14px 14px 8px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel-2); }
.search svg { flex: none; width: 16px; height: 16px; color: var(--muted); }
.search input { min-height: 0; padding: 8px 0; border: 0; background: none; box-shadow: none; }
.search input:focus { box-shadow: none; }
.search:focus-within { border-color: var(--gold); box-shadow: var(--focus); }
.list-title { display: flex; gap: 6px; padding: 4px 16px 8px; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.list-title b { color: var(--ink-2); }
.list { flex: 1; min-height: 0; overflow-y: auto; border-top: 1px solid var(--line); }
.row { display: flex; flex-direction: column; gap: 2px; padding: 11px 16px 11px 13px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; color: var(--ink); text-decoration: none; }
.row:hover { background: var(--panel-2); }
.row.sel { border-left-color: var(--gold); background: var(--tint); }
.row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.row-top b { overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.row.hot .row-top b::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--gold); vertical-align: 2px; }
.row-top time { flex: none; color: var(--muted); font-size: .76rem; }
.row-meta { overflow: hidden; color: var(--muted); font-size: .8rem; white-space: nowrap; text-overflow: ellipsis; }
.row-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.tag { padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); color: var(--ink-2); font-size: .72rem; font-weight: 500; white-space: nowrap; }
.tag.hot { border-color: var(--hot-line); background: var(--hot-bg); color: var(--hot-ink); }
.badge { flex: none; padding: 1px 9px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink-2); font-size: .7rem; font-weight: 600; white-space: nowrap; }
.badge.new { border-color: var(--brand); background: var(--brand); color: #f3e3bd; }
.badge.in_progress { border-color: var(--gold); background: var(--tint); color: var(--hot-ink); }
.badge.closed { color: var(--muted); }
.badge.appt-confirmed { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }
.badge.appt-reschedule { border-color: var(--hot-line); background: var(--hot-bg); color: var(--hot-ink); }
.empty { padding: 28px 16px; color: var(--muted); text-align: center; }

/* ---------- home and agenda ---------- */

.home { display: flex; flex-direction: column; gap: 16px; max-width: 880px; padding: 28px 32px 48px; }
.page-h { font-family: var(--display); font-weight: 500; font-size: 1.7rem; }
.card { padding: 6px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.card h2 { padding: 8px 16px; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.card h2.day { color: var(--ink); font-size: .95rem; letter-spacing: 0; text-transform: none; }
.card h2.day::first-letter { text-transform: uppercase; }
.appt-line { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.card h2 + .appt-line { border-top: 0; }
.appt-line:hover { background: var(--panel-2); }
.appt-ico svg { display: block; width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--tint); color: var(--gold-ink); }
.appt-line .grow { display: flex; flex-direction: column; }
.appt-line .grow b { font-weight: 600; }
.appt-line .grow span { color: var(--muted); font-size: .8rem; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 48px 0; color: var(--muted); }
.pick .monogram { border-color: var(--line-2); outline-color: var(--line); background: var(--brand); }

/* ---------- the open case ---------- */

.case { display: flex; flex-direction: column; gap: 14px; padding: 22px 28px 56px; }
.back-list { display: none; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 600; text-decoration: none; }
.back-list svg { width: 16px; height: 16px; }
.case-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; }
.case-title { flex: 1; min-width: 240px; }
.case-title h1 { font-family: var(--display); font-weight: 500; font-size: 1.8rem; }
.case-title p { margin-top: 2px; color: var(--muted); font-size: .86rem; }
.case-tools { display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--panel-2); }
.seg-btn { padding: 6px 12px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); font: 600 .8rem var(--sans); white-space: nowrap; cursor: pointer; }
.seg-btn:hover { background: var(--panel); }
.seg-btn[aria-pressed="true"], .seg-btn[aria-selected="true"] { background: var(--brand); color: #f3e9d6; }
.tool, .x { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink-2); cursor: pointer; }
.tool:hover, .x:hover { border-color: var(--gold); background: var(--tint); }
.tool svg, .x svg { width: 16px; height: 16px; }
.case-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pill, .chip-link { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel); color: var(--ink); font-size: .84rem; text-decoration: none; }
.pill:hover, .chip-link:hover { border-color: var(--gold); background: var(--tint); }
.pill svg { width: 15px; height: 15px; color: var(--gold-ink); }
.pill .wa-icon { color: #1f9d55; }
.reach { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; }
.reach svg { flex: none; width: 15px; height: 15px; }
.reach.on { color: var(--ok); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tbtn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); font-weight: 600; font-size: .84rem; text-decoration: none; }
.tbtn:hover { border-color: var(--gold); background: var(--tint); }
.tbtn svg { width: 16px; height: 16px; color: var(--gold-ink); }
.tbtn.on { border-color: var(--brand); background: var(--brand); color: #f3e9d6; }
.tbtn.on svg { color: var(--gold); }

.composer { padding: 16px 18px 18px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); box-shadow: 0 8px 28px rgba(40, 25, 10, .08); }
.composer header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.composer h2 { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.composer h2 svg { width: 18px; height: 18px; color: var(--gold-ink); }
.composer .form-card { max-width: 680px; }
.sent-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px 12px 16px; border: 1px solid var(--ok-line); border-radius: 12px; background: var(--ok-bg); }
.sent-strip p { flex: 1; min-width: 220px; }
.sent-strip p b { color: var(--ok); }

.case-tabs { display: none; align-self: flex-start; }
.case-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 24px; }
.case-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.col-h { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
/* No room for two columns: one at a time, with tabs. */
@container (max-width: 800px) {
  .case-tabs { display: inline-flex; }
  .col-h { display: none; }
  .case-body { grid-template-columns: minmax(0, 1fr); }
  .case-body[data-tab="timeline"] .col-report, .case-body[data-tab="report"] .col-timeline { display: none; }
}

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tl { display: flex; flex-direction: column; gap: 5px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.tl.client { margin-right: 28px; border-left: 3px solid var(--gold); }
.tl.staff { margin-left: 28px; background: var(--panel-2); }
.tl.note { border-color: var(--note-line); background: var(--note-bg); }
.tl.quiet { margin-left: 0; border-style: dashed; background: transparent; color: var(--muted); }
.tl.new { border-color: var(--gold); background: var(--tint); box-shadow: 0 0 0 1px var(--gold); }
.tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tl-head b { font-size: .84rem; font-weight: 600; color: var(--ink); }
.tl-head span { color: var(--muted); font-size: .74rem; white-space: nowrap; }
.tl-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: .8rem; }
.state { color: var(--muted); font-weight: 500; }
.state.done { color: var(--ok); font-weight: 600; }
.quote { padding-left: 10px; border-left: 2px solid var(--line-2); color: var(--muted); font-style: italic; white-space: pre-wrap; overflow-wrap: anywhere; }
.appt-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--gold); border-radius: 10px; background: var(--tint); }
.appt-when { display: flex; align-items: center; gap: 12px; }
.appt-when svg { flex: none; width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: var(--panel); color: var(--gold-ink); }
.appt-when div { display: flex; flex-direction: column; }
.appt-when b { font-weight: 600; }
.appt-when span { color: var(--muted); font-size: .8rem; }
.appt-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* Report */
.detail-grid, .detail-grid .col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.panel { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.panel h2 { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.kv { display: grid; grid-template-columns: minmax(110px, 36%) 1fr; gap: 6px 12px; margin: 0; font-size: .88rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); cursor: zoom-in; }
.photo-grid figcaption { margin-top: 3px; color: var(--muted); font-size: .74rem; }
.map { position: relative; z-index: 0; height: 240px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pin span { position: absolute; top: 2px; left: 2px; width: 30px; height: 30px; border: 2px solid #1a120b; border-radius: 50% 50% 50% 0; background: var(--gold); transform: rotate(-45deg); }
.pin span::after { content: ''; position: absolute; top: 8px; left: 8px; width: 10px; height: 10px; border-radius: 50%; background: #1a120b; }
/* Only the report, with room: its two columns side by side. */
@container (min-width: 640px) and (max-width: 800px) {
  .detail-grid { display: grid; grid-template-columns: 1.1fr .9fr; align-items: start; }
}

/* ---------- buttons and forms ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: 600 .84rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--gold); background: var(--tint); }
.btn svg { flex: none; width: 16px; height: 16px; }
.btn.primary { border-color: var(--brand); background: var(--brand); color: #f6eedf; }
.btn.primary:hover { background: #33261a; }
.btn.big { align-self: flex-start; min-height: 40px; padding: 9px 22px; }
.btn.slim { min-height: 30px; padding: 4px 10px; font-size: .78rem; }
.btn.danger { border-color: #e6bcb2; color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: #fcefec; }
.btn.wa .wa-icon { color: #1f9d55; }
.detail-grid .btn.danger { align-self: flex-start; }
.link { padding: 0; border: 0; background: none; color: var(--gold-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link.danger { color: var(--danger); }

.form-card { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; color: var(--ink-2); font-size: .8rem; font-weight: 600; }
input, textarea, select { width: 100%; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink); font: 400 .9rem/1.45 var(--sans); }
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: #a39789; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 420px; }
.form-card select { max-width: 200px; }
.choice { min-width: 0; margin: 0; padding: 0; border: 0; }
.choice legend { margin-bottom: 6px; padding: 0; color: var(--ink-2); font-size: .8rem; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; padding: 6px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; font-size: .82rem; font-weight: 600; cursor: pointer; }
.chip input:checked + span { border-color: var(--brand); background: var(--brand); color: #f6eedf; }
.chip input:focus-visible + span { box-shadow: var(--focus); }
.hint { color: var(--muted); font-size: .8rem; }

/* ---------- sign in ---------- */

.login { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: radial-gradient(120% 70% at 50% 0%, #3a2a1c 0%, #120d09 70%); }
.login-card { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 380px; padding: 32px 28px 26px; border-radius: 14px; background: var(--panel); box-shadow: 0 24px 70px rgba(0, 0, 0, .45); text-align: center; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 6px; }
.login-brand .monogram { margin-bottom: 10px; background: var(--brand); }
.login-name { font-family: var(--display); font-size: 1.55rem; }
.login-sub { color: var(--gold-ink); font-size: .68rem; font-weight: 700; letter-spacing: .32em; }
.notice { padding: 10px 12px; border: 1px solid var(--hot-line); border-radius: 8px; background: #fbf4e4; color: var(--hot-ink); font-size: .86rem; text-align: left; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; border: 1px solid #dadce0; border-radius: 8px; background: #fff; color: #1f1f1f; font: 600 .92rem var(--sans); cursor: pointer; }
.btn-google:hover { background: #f8f9fa; }
.sso-icon { width: 18px; height: 18px; }
.link-btn { align-self: center; padding: 0; border: 0; background: none; color: var(--gold-ink); font: 600 .82rem var(--sans); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* ---------- photo viewer, toast, busy ---------- */

#lightbox { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 24px; background: rgba(12, 8, 5, .92); }
#lightbox figure { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: calc(100vw - 150px); margin: 0; }
#lightbox img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 6px; }
#lightbox figcaption { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; color: #e9e1d3; font-size: .84rem; }
#lightbox a { color: var(--gold); }
.lb-prev, .lb-next { flex: none; width: 44px; height: 44px; border: 1px solid rgba(201, 169, 110, .5); border-radius: 50%; background: none; color: #f3e3bd; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, .08); }
#toast { position: fixed; right: 24px; bottom: 24px; z-index: 90; max-width: 420px; padding: 12px 16px; border-radius: 10px; background: var(--brand); color: #f6eedf; font-size: .88rem; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); }
#busy { position: fixed; inset: 0; z-index: 85; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(244, 242, 238, .65); color: var(--ink-2); }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line-2); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* A one-time message for Katia. */
.note-pop { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 24px; background: rgba(12, 8, 5, .72); animation: note-fade .3s ease-out; }
.note-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 380px;
  padding: 36px 30px 28px;
  border: 1px solid var(--gold);
  border-radius: 16px;
  background: radial-gradient(120% 80% at 50% 0%, #3a2a1c 0%, #120d09 75%);
  color: #f3e9d6;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
  animation: note-rise .45s ease-out;
}
.note-card p { font-family: var(--display); font-size: 1.7rem; line-height: 1.3; color: #ecd9b0; }
.note-card .heart { font-size: 2rem; line-height: 1; }
.note-card .btn.primary { min-width: 140px; border-color: var(--gold); background: linear-gradient(180deg, #e2c690, #b8955a); color: #1a130d; }
@keyframes note-fade { from { opacity: 0; } }
@keyframes note-rise { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .note-pop, .note-card { animation: none; } }

/* ---------- smaller windows ---------- */

/* No room for three columns: the list, or what's open in it. */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 210px minmax(0, 1fr); }
  .shell[data-view="cases"] .pane-main, .shell:not([data-view="cases"]) .pane-list { display: none; }
  .pane-list { border-right: 0; }
  .back-list { display: inline-flex; flex-basis: 100%; }
}
/* A phone or a narrow window: the side bar becomes a bar along the top. */
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .side { flex-direction: row; align-items: center; gap: 2px; padding: 8px 10px; overflow-x: auto; }
  .side-nav, .side-foot { display: contents; }
  .side-brand { margin: 0 6px 0 0; padding: 0; border: 0; }
  .side-brand > span:last-child, .side-label, .side-user, .side-link span, .side-btn span:not(.globe) { display: none; }
  .side-link, .side-btn { width: auto; flex: none; }
  .case, .home { padding: 16px 16px 40px; }
  .tl.client { margin-right: 0; }
  .tl.staff { margin-left: 0; }
}

/* ---------- printing a case ---------- */

@media print {
  html, body { height: auto; background: #fff; }
  .shell { display: block; height: auto; }
  .side, .pane-list, .toolbar, .composer, .sent-strip, .case-tabs, .case-tools, .back-list, .tl-foot, .appt-actions,
  .detail-grid .btn.danger, .link-row, #toast, #busy, #lightbox { display: none !important; }
  .pane-main { overflow: visible; }
  .case { padding: 0; }
  .case-body { display: block !important; }
  .case-col { display: flex !important; margin-bottom: 18px; }
  .col-h { display: block !important; }
  .panel, .tl, .appt-card { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
