/* Porcelain: canvas, ink, one violet-navy dark surface and a single copper accent. Shared by the
   client messenger and the admin console. */
* { box-sizing: border-box; }

:root {
  --canvas: #F4F2ED;
  --surface: #FBFAF7;
  --ink: #121116;
  --navy: #26243E;
  --copper: #A9552B;
  --copper-soft: #F1E1D6;
  --muted: #6B675F;
  --line: #D9D4C9;
  --soft-line: #E7E3DA;
  --bubble: #ECE8DF;
  --green: #2F7A4F;
  --red: #B3372B;
  --radius: 16px;
  --font-head: "Hanken Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font: 14.5px/1.5 var(--font-body);
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .head { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.015em; }
.mono, code, pre { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
a { color: var(--copper); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font: inherit;
  color: inherit;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 7px 13px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
button:hover { border-color: #b9b3a6; }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
button.primary:hover { background: #1c1a30; }
button.accent { background: var(--copper); border-color: var(--copper); color: #fff; }
button.accent:hover { background: #8f4522; }
button.big { padding: 11px 18px; border-radius: 12px; font-weight: 500; }
button.link { border: none; background: none; color: var(--copper); padding: 4px; }
button.danger { color: var(--red); }
button.danger-solid { background: var(--red); border-color: var(--red); color: #fff; }

:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }

input, textarea, select {
  font: inherit;
  color: inherit;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 11px;
  background: #fff;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--copper); box-shadow: 0 0 0 3px var(--copper-soft); }
textarea { resize: vertical; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; }

.stack { display: grid; gap: 14px; min-width: 0; }
.stack > *, .modal > * { min-width: 0; }
.row-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.row-actions .spacer { flex: 1; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(38, 36, 62, 0.08);
}

.spinner {
  width: 40px; height: 40px; margin: 0 auto; border-radius: 50%;
  border: 3px solid var(--soft-line); border-top-color: var(--navy);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.mark {
  width: 52px; height: 52px; margin: 0 auto; border-radius: 15px; background: var(--navy);
  display: grid; place-items: center;
}
.mark::after { content: ""; width: 18px; height: 18px; border-radius: 6px; background: var(--copper); transform: rotate(45deg); }

.banner { background: var(--navy); color: #fff; font-size: 12.5px; text-align: center; padding: 6px 12px; }
.banner b { font-weight: 600; }
.banner.trial { background: var(--copper-soft); color: var(--ink); border-bottom: 1px solid #e3cdbd; }

/* ---- switch, modal, toasts ---- */

.switch { position: relative; width: 34px; height: 20px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #cfc9bc; transition: background 0.15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--copper); outline-offset: 2px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(18, 17, 22, 0.38); display: grid; place-items: center; padding: 24px; }
.modal { width: min(620px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; background: var(--surface); border-radius: 20px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28); display: grid; gap: 16px; }
.modal h2 { margin: 0; font-size: 19px; }

.toasts { position: fixed; top: 16px; right: 16px; z-index: 40; display: grid; gap: 8px; width: min(340px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; cursor: pointer;
  background: rgba(251, 250, 247, 0.96); border: 1px solid var(--line);
  box-shadow: 0 14px 36px rgba(38, 36, 62, 0.16); animation: toast-in 0.2s ease-out;
}
.toast p { margin: 0; font-size: 13.5px; }
.toast b { display: block; font-size: 13px; }
.toast.error b { color: var(--red); }
@keyframes toast-in { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
