/* MakiPoint Corp — the company's own look, the same as makipoint.com: warm paper, deep navy ink,
   Manrope titles with tight tracking, DM Sans text, navy buttons with small radii, hairline
   rules. Self-hosted fonts. */

@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/dm-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/dm-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/dm-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/manrope-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/manrope-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/manrope-latin-700-normal.woff2) format('woff2'); }

:root {
  --paper: #f9f7f5;
  --card: #ffffff;
  --sunk: #f3f1ee;
  --ink: #061329;
  --ink-2: #4d627a;
  --muted: #74818b;
  --navy: #26374a;
  --navy-grad: linear-gradient(135deg, #34465b, #26374a);
  --steel: #52677e;
  --line: #d7dde4;
  --line-soft: #e5e9ed;
  --danger: #954e46;
  --ok: #3e6a48;
  --urgent: #a0602a;
  --r: 6px;
  --r-card: 14px;
  --title: 'Manrope', Arial, sans-serif;
  --text: 'DM Sans', Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--text); }
body { min-height: 100vh; text-rendering: geometricPrecision; }
a { color: var(--navy); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { color: #fff; background: var(--navy); }
:focus-visible { outline: 3px solid rgba(71, 91, 113, 0.35); outline-offset: 3px; }

/* ── frame ───────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 26px 18px; display: flex; flex-direction: column; gap: 2px;
  background: var(--paper); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; }
.brand img { width: 32px; height: 32px; }
.brand b { font: 700 19px/1 var(--title); letter-spacing: -0.045em; color: #07132a; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.nav-group { color: var(--steel); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; padding: 18px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); color: #1f3045; font-size: 14px; text-decoration: none; }
.nav a:hover { background: var(--sunk); }
.nav a.on { background: var(--navy); color: #fff; }
.side .me { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13px; }

main { padding: 0 44px 80px; max-width: 1160px; }

.hero { padding: 46px 0 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.kicker { color: #37506a; font-size: 12px; font-weight: 600; letter-spacing: 0.19em; text-transform: uppercase; margin-bottom: 18px; }
h1 { font: 600 clamp(36px, 4.4vw, 52px)/1.04 var(--title); letter-spacing: -0.045em; margin: 0; color: var(--ink); }
h1 em { font-style: normal; color: var(--ink); }
h2 { font: 600 24px/1.15 var(--title); letter-spacing: -0.04em; margin: 0 0 12px; color: var(--ink); }
h3 { font: 600 14px/1.3 var(--text); margin: 0 0 10px; color: #101c31; }
.lede { color: var(--ink-2); max-width: 620px; margin: 14px 0 0; font-size: 16px; line-height: 1.48; }

/* ── surfaces ────────────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px 24px; }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.muted { color: var(--muted); }
.soft { color: var(--ink-2); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
.grow { flex: 1; }
.mt { margin-top: 18px; }
.pt { padding-top: 48px; }
.clickable { cursor: pointer; transition: border-color 0.15s; }
.clickable:hover { border-color: var(--steel); }
pre.doc { white-space: pre-wrap; font: 400 13px/1.6 var(--text); color: #152233; }

/* ── controls ────────────────────────────────────────────────────────── */
.btn {
  height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
  background: var(--card); color: #1f3045; font-size: 14px; font-weight: 500; transition: border-color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--steel); }
.btn.gold { border: 0; color: #fff; background: var(--navy-grad); }
.btn.gold:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: #e3c9c5; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
label.field { display: block; }
label.field > span { display: block; color: #24364c; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
label.field > small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
input[type='text'], input[type='email'], input[type='tel'], input[type='number'], input[type='password'], input[type='date'], input[type='time'], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cfd7de; border-radius: 0; background: #fff; color: #152233;
  font-size: 15px; line-height: 1.35; outline: none; -webkit-appearance: none; appearance: none;
}
select { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2352677e' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 32px; }
input:focus, select:focus, textarea:focus { border-color: var(--steel); box-shadow: 0 0 0 3px rgba(82, 103, 126, 0.12); }
textarea { min-height: 110px; resize: vertical; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: #24364c; font-size: 14px; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 999px; background: #cfd7de; position: relative; cursor: pointer; margin: 0; transition: background 0.15s; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked { background: var(--navy); }
.switch input:checked::after { transform: translateX(18px); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-size: 12px; font-weight: 500; background: #fff; }
.pill.gold { border-color: #c9d3dd; background: #eef2f6; color: var(--navy); }
.pill.urgent { border-color: #ecd3bd; background: #fbf1e8; color: var(--urgent); }
.pill.ok { border-color: #cfe0d2; background: #eff6f0; color: var(--ok); }
.pill.danger { border-color: #e9cfcb; background: #faefed; color: var(--danger); }

/* ── calls list ──────────────────────────────────────────────────────── */
.calls { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.call-row {
  display: grid; grid-template-columns: 120px 1fr auto 60px; align-items: center; gap: 18px; padding: 16px 6px;
  border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; cursor: pointer;
}
.call-row:hover { background: #fff; }
.call-row .when { color: var(--muted); font-size: 12px; line-height: 1.35; }
.call-row .title { font: 600 17px/1.25 var(--title); letter-spacing: -0.02em; }
.call-row .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.call-row .dur { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }

/* ── call detail ─────────────────────────────────────────────────────── */
.player audio { width: 100%; margin-top: 6px; }
.transcript { display: grid; grid-template-columns: 70px 100px 1fr 1fr; font-size: 14px; }
.transcript > div { padding: 10px 8px; border-top: 1px solid var(--line-soft); }
.transcript .h { color: var(--steel); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; border-top: 0; }
.transcript .who-natasha { color: var(--navy); font-weight: 600; }
.transcript .masked { color: var(--urgent); }
.log { font: 400 13px/1.5 var(--text); }
.log div { display: grid; grid-template-columns: 90px 170px 1fr; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.log code { color: var(--ink-2); white-space: pre-wrap; word-break: break-word; font-family: inherit; }
dl.facts { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; color: #152233; }

/* ── people ──────────────────────────────────────────────────────────── */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.person { padding: 20px; border-radius: var(--r-card); background: var(--card); border: 1px solid var(--line); cursor: pointer; }
.person:hover { border-color: var(--steel); }
.person .face { width: 52px; height: 52px; border-radius: 50%; background: #eef2f6; display: grid; place-items: center; font: 700 18px var(--title); color: var(--navy); overflow: hidden; }
.person .face img { width: 100%; height: 100%; object-fit: cover; }
.week { display: grid; grid-template-columns: 90px 60px 1fr; gap: 8px 12px; align-items: center; font-size: 14px; }
.week .blocks { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.week .blocks input[type='time'] { width: 130px; }

/* ── overlays ────────────────────────────────────────────────────────── */
.sheet-back { position: fixed; inset: 0; background: rgba(22, 31, 42, 0.55); backdrop-filter: blur(6px); z-index: 50; display: flex; justify-content: flex-end; }
.sheet { width: min(720px, 100%); height: 100%; overflow-y: auto; background: #fbfaf7; padding: 34px; box-shadow: 0 28px 90px rgba(14, 24, 32, 0.36); }
.sheet h2 { font-size: 34px; letter-spacing: -0.05em; margin-bottom: 24px; }
.sheet .actions { position: sticky; bottom: -34px; margin: 26px -34px -34px; padding: 16px 34px; background: #fbfaf7; border-top: 1px solid var(--line); display: flex; gap: 10px; }
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--navy); color: #fff; padding: 11px 18px; border-radius: var(--r); box-shadow: 0 12px 40px rgba(14, 24, 32, 0.25); font-size: 14px; }
.toast.bad { background: var(--danger); }

/* ── gate (sign-in, owner set-up, invitation) ────────────────────────── */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate .panel { width: min(440px, 100%); }
.gate .panel img { width: 44px; height: 44px; margin-bottom: 30px; }
.gate .panel .kicker { margin-bottom: 14px; }
.gate .panel h1 { margin-bottom: 14px; }
.gate .panel p { color: var(--ink-2); font-size: 16px; line-height: 1.48; margin: 0 0 22px; }
.gate .panel input { margin-bottom: 4px; }
.gate .panel .btn { width: 100%; height: 50px; margin-top: 14px; font-size: 15px; }
.gate .panel .foot { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }

.empty { text-align: left; padding: 40px 28px; }
.empty h2 { font-size: 26px; }
.lang-toggle { display: inline-flex; gap: 14px; }
.lang-toggle button { border: 0; background: none; padding: 4px 2px; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 600; position: relative; }
.lang-toggle button.on { color: var(--ink); }
.lang-toggle button.on::after { content: ''; position: absolute; left: -4px; right: -4px; bottom: -2px; height: 1px; background: #26384e; }
.mobile-bar { display: none; }
.brand-mini { font: 700 19px var(--title); letter-spacing: -0.045em; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; position: fixed; inset: 0; z-index: 60; height: 100%; }
  .side.open { display: flex; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; position: sticky; top: 0; z-index: 40; background: rgba(249, 247, 245, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  main { padding: 0 16px 60px; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .call-row { grid-template-columns: 1fr auto; }
  .call-row .when { grid-column: 1 / -1; }
  .transcript { grid-template-columns: 1fr; }
  .transcript .h { display: none; }
  .log div { grid-template-columns: 1fr; gap: 2px; }
  dl.facts { grid-template-columns: 1fr; }
  .sheet { padding: 22px; }
}

/* ── rhythm: one spacing system for every screen ───────────────────────── */
.grid { gap: 20px; }
.grid > .card + .card, .grid > * { margin-top: 0; }
.card > * + * { margin-top: 18px; }
.card > h2 + *, .card > h3 + * { margin-top: 12px; }
.form > * + * { margin-top: 22px; }
.form > h2 + * { margin-top: 16px; }
label.field > span, .field-block > .label { display: block; color: #24364c; font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.field-block > .hint, .hint { margin-top: 8px; font-size: 12px; line-height: 1.45; }
.inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: stretch; }
.inline .btn { height: auto; min-height: 44px; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.form > .actions-row { margin-top: 26px; }
.result:empty { display: none; }
.result > * + * { margin-top: 10px; }
select:disabled, input:disabled { background-color: var(--sunk); color: var(--muted); cursor: not-allowed; }
.statuses { display: flex; flex-wrap: wrap; gap: 14px 30px; }
.status { display: flex; align-items: center; gap: 10px; color: #24364c; font-size: 14px; }
.card audio { width: 100%; }
.grid.two > label.field, .grid.three > label.field, .grid > .field-block { min-width: 0; }
.week { row-gap: 12px; }
.empty > * + * { margin-top: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.doc-block { background: var(--sunk); border-color: var(--line-soft); }
.sheet .stack > * + * { margin-top: 22px; }
.sheet .stack > h3 { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 15px; }
.sheet .grid { row-gap: 22px; }
.week label.switch:has(input:not(:checked)) + .blocks { opacity: 0.35; pointer-events: none; }
.week > div:nth-child(3n + 1) { color: #24364c; font-weight: 500; }
.live-row { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
