/* Büro, klarer. — interface styles.
   Restyled with the "unslop" method by Damir Sokolovsky (@heydamir), https://github.com/heydamir/unslop, CC BY 4.0:
   one neutral ramp, three text roles, one accent used rarely, 4px spacing grid, weights 400/500, hairline borders. */
:root {
  --page: #fafafa; --card: #ffffff; --raised: #f4f4f5;
  --text: #171717; --text-2: #525252; --text-3: #737373;
  --line: rgba(0, 0, 0, .08); --line-strong: rgba(0, 0, 0, .16);
  --accent: #1f5a45; --on-accent: #ffffff; --accent-tint: rgba(31, 90, 69, .08);
  --neg: #dc2626; --pos: #16a34a; --warn: #b45309;
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .05); --shadow-l: 0 8px 24px rgba(0, 0, 0, .06);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
:root[data-theme="dark"] {
  --page: #141415; --card: #19191b; --raised: #232325;
  --text: #ededed; --text-2: #a1a1a6; --text-3: #85858b;
  --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .18);
  --accent: #7fc7a4; --on-accent: #0f1f18; --accent-tint: rgba(127, 199, 164, .1);
  --neg: #e5484d; --pos: #4cc38a; --warn: #e0a458;
  --shadow-s: none; --shadow-l: none;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 400 15px/22px var(--sans); font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; line-height: 32px; font-weight: 500; }
h2 { font-size: 16px; line-height: 24px; font-weight: 500; }
h3 { font-size: 15px; line-height: 22px; font-weight: 500; }
a { color: var(--accent); text-underline-offset: 2px; }
.muted { color: var(--text-2); } .small { font-size: 13px; line-height: 20px; }
.note { font-size: 13px; line-height: 20px; color: var(--text-3); }
.spacer { flex: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* controls */
.btn, .icon-btn { height: 36px; padding: 0 16px; border: 1px solid var(--line-strong); background: var(--card); border-radius: 8px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--text); white-space: nowrap; transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease); }
.btn:hover, .icon-btn:hover { background: var(--raised); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn.quiet { border-color: transparent; background: none; color: var(--text-2); }
.btn.quiet:hover { background: var(--raised); color: var(--text); }
.btn.danger { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 40%, transparent); }
.btn.big { height: 44px; padding: 0 20px; }
.btn[disabled] { opacity: .55; cursor: progress; }
.icon-btn { height: 32px; padding: 0 12px; font-size: 13px; font-weight: 400; color: var(--text-2); }
input[type="text"], input[type="number"], input[type="date"], input[type="time"], select.in, textarea { width: 100%; min-height: 36px; border: 1px solid var(--line-strong); background: var(--card); border-radius: 8px; padding: 8px 12px; }
textarea { resize: vertical; line-height: 22px; }
input[type="file"] { max-width: 100%; font-size: 13px; }
label.f { display: block; font-size: 13px; line-height: 20px; color: var(--text-2); margin-bottom: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: none; height: 30px; padding: 0 12px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--text); font-weight: 500; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stack > * + * { margin-top: 12px; }
.two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.two > *, .stack > *, .panel { min-width: 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow-s); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes sp { to { transform: rotate(360deg); } }

/* shell: sidebar · work · assistant */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr) 344px; min-height: 100vh; max-width: 1600px; margin: 0 auto; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px; padding: 16px; border-right: 1px solid var(--line); }
.brand { font-size: 17px; font-weight: 600; letter-spacing: 0; }
.brand span { color: var(--accent); }
.biz { color: var(--text-3); font-size: 13px; line-height: 20px; margin-top: 4px; overflow-wrap: anywhere; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { height: 36px; border: 0; background: none; border-radius: 8px; padding: 0 12px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; color: var(--text-2); text-align: left; transition: background-color .15s var(--ease); }
.nav button:hover { background: var(--raised); }
.nav button[aria-current="page"] { background: var(--raised); color: var(--text); font-weight: 500; box-shadow: inset 0 0 0 1px var(--line); }
.badge { font: 400 12px/16px var(--mono); color: var(--text-3); }
.nav button[aria-current="page"] .badge { color: var(--accent); }
.side-foot { margin-top: auto; display: grid; gap: 8px; justify-items: start; }
.side-foot select { height: 32px; width: 100%; border: 1px solid var(--line-strong); background: var(--card); border-radius: 8px; padding: 0 8px; font-size: 13px; }
.engine { font-size: 12px; line-height: 16px; color: var(--text-3); }
.engine.on::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--pos); margin-right: 6px; vertical-align: 1px; }
.legal { font-size: 12px; line-height: 16px; display: flex; gap: 12px; flex-wrap: wrap; }
.legal a { color: var(--text-3); }
main { padding: 24px 32px 64px; min-width: 0; }
.hello { display: grid; gap: 4px; margin-bottom: 24px; }
.hello p { color: var(--text-2); max-width: 72ch; }
.subnav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.subnav button { height: 36px; border: 0; background: none; padding: 0 12px; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav button[aria-selected="true"] { color: var(--text); font-weight: 500; border-bottom-color: var(--accent); }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 32px 0 8px; flex-wrap: wrap; }
.empty { padding: 24px 16px; color: var(--text-3); border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; }

/* today: figures and the approval queue */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.kpi b { display: block; font-size: 28px; line-height: 32px; font-weight: 500; }
.kpi span { color: var(--text-3); font-size: 13px; line-height: 20px; }
.kpi.hi b { color: var(--accent); }
.queue, .list { display: grid; gap: 8px; }
.card, .item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.card.t-urgent, .card.t-invoice { box-shadow: inset 3px 0 0 var(--neg); }
.card.done, .item.done { opacity: .6; }
.card-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 12px 16px; cursor: pointer; width: 100%; text-align: left; background: none; border: 0; transition: background-color .15s var(--ease); }
.card-head:hover { background: var(--raised); }
.tag { display: block; font-size: 12px; line-height: 16px; color: var(--text-3); }
.card-head h3 { font-weight: 500; }
.card-head .sum { color: var(--text-2); font-size: 14px; line-height: 20px; grid-column: 1 / -1; overflow-wrap: anywhere; }
.saves { font-size: 12px; line-height: 16px; color: var(--text-3); white-space: nowrap; padding-top: 2px; }
.chips { display: flex; gap: 4px 16px; flex-wrap: wrap; grid-column: 1 / -1; align-items: center; }
.chip { font-size: 12px; line-height: 16px; color: var(--text-3); }
.chip.urgent { color: var(--neg); font-weight: 500; }
.chip.money { color: var(--text); font-weight: 500; }
.chip.warn { color: var(--warn); }
.fict { font-size: 12px; line-height: 16px; color: var(--text-3); border: 1px dashed var(--line-strong); border-radius: 4px; padding: 0 6px; }
.card-body { border-top: 1px solid var(--line); padding: 16px; display: grid; gap: 16px; }
.orig { background: var(--raised); border-radius: 8px; padding: 12px; font-size: 14px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; }
.facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 14px; line-height: 20px; }
.facts li { display: grid; grid-template-columns: 152px minmax(0, 1fr); gap: 12px; }
.facts li span:first-child { color: var(--text-3); }
.facts .alert { color: var(--warn); }
.draft textarea { min-height: 220px; font-size: 14px; line-height: 22px; }

/* calls, messages, calendar */
.item-head { display: grid; grid-template-columns: 96px minmax(0, 200px) minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding: 0 16px; min-height: 44px; width: 100%; text-align: left; background: none; border: 0; }
button.item-head { cursor: pointer; transition: background-color .15s var(--ease); }
button.item-head:hover { background: var(--raised); }
.when { font: 400 12px/16px var(--mono); color: var(--text-3); }
.who { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.what { color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { font-size: 12px; line-height: 16px; color: var(--text-3); white-space: nowrap; }
.meta a { color: inherit; }
.flag { font-size: 12px; font-weight: 500; color: var(--neg); margin-left: 8px; }
.flag.soft { color: var(--warn); }
.item-body { border-top: 1px solid var(--line); padding: 16px; display: grid; gap: 12px; }
.item-actions { display: flex; gap: 8px; padding: 0 16px 12px 128px; }
.day { margin: 24px 0 8px; color: var(--text-2); font-weight: 400; font-size: 13px; }
.day:first-child { margin-top: 0; }
.talk { display: grid; gap: 8px; align-content: start; }
.bubble { max-width: 86%; padding: 8px 12px; border-radius: 12px; background: var(--raised); overflow-wrap: anywhere; font-size: 14px; line-height: 20px; justify-self: start; }
.bubble.me { justify-self: end; background: var(--accent-tint); }

/* inbox, automation, impact, settings */
.sources { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.src { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: grid; gap: 4px; align-content: start; justify-items: start; }
.src b { font-weight: 500; } .src small { color: var(--text-3); font-size: 12px; line-height: 16px; }
.drop { border: 1px dashed var(--line-strong); border-radius: 8px; padding: 12px; display: grid; gap: 8px; justify-items: start; }
.autos { display: grid; gap: 8px; }
.auto { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: start; }
.auto dl { margin: 8px 0 0; display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 4px 12px; font-size: 14px; line-height: 20px; }
.auto dt { color: var(--text-3); } .auto dd { margin: 0; color: var(--text-2); }
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; margin: 0; z-index: 1; }
.switch i { position: absolute; inset: 0; background: var(--line-strong); border-radius: 12px; transition: background-color .15s var(--ease); }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); transition: transform .15s var(--ease); box-shadow: var(--shadow-s); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.tbl-wrap { overflow-x: auto; }
table.calc { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
table.calc th { text-align: left; font-size: 12px; line-height: 16px; color: var(--text-3); font-weight: 400; padding: 8px; border-bottom: 1px solid var(--line); }
table.calc td { padding: 8px; border-bottom: 1px solid var(--line); }
table.calc td.n, table.calc th.n { text-align: right; }
table.calc input { width: 80px; min-height: 32px; padding: 4px 8px; text-align: right; }
table.calc tr.off td { color: var(--text-3); text-decoration: line-through; }
table.calc tfoot td { font-weight: 500; border-bottom: 0; }
.big-num { font-size: 32px; line-height: 32px; font-weight: 500; color: var(--accent); }
.steps { counter-reset: s; display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; }
.steps li::before { content: counter(s); font: 400 12px/22px var(--mono); color: var(--text-3); }
.steps b { font-weight: 500; }
.qr { background: #fff; padding: 8px; border-radius: 8px; width: 160px; flex: none; border: 1px solid var(--line); line-height: 0; }
.qr svg { width: 100%; height: auto; display: block; }
.codebox { font: 400 13px/20px var(--mono); background: var(--raised); border-radius: 8px; padding: 8px 12px; overflow-wrap: anywhere; user-select: all; }
details summary { cursor: pointer; color: var(--text-2); }

/* assistant */
.ask { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-left: 1px solid var(--line); }
.ask-head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.ask-close, .ask-fab { display: none; }
.ask-log { flex: 1; overflow: auto; display: grid; gap: 8px; align-content: start; }
.ask .bubble { max-width: 94%; }
.ask .chips { gap: 4px; flex-direction: column; align-items: stretch; }
.ask .chips .chip { border: 1px solid var(--line); background: none; border-radius: 8px; min-height: 32px; padding: 4px 12px; cursor: pointer; text-align: left; font-size: 13px; line-height: 20px; color: var(--text-2); transition: background-color .15s var(--ease); }
.ask .chips .chip:hover { background: var(--raised); color: var(--text); }
.ask-form { display: flex; gap: 8px; } .ask-form input { flex: 1; min-width: 0; }

/* welcome, call page, legal pages */
.welcome { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.welcome .panel { max-width: 520px; width: 100%; padding: 32px; box-shadow: var(--shadow-l); }
.welcome h1 em { font-style: normal; color: var(--accent); }
.call { max-width: 520px; margin: 0 auto; padding: 24px 16px 40px; min-height: 100vh; display: flex; flex-direction: column; gap: 16px; }
.call-head { display: flex; align-items: center; gap: 12px; }
.call-head h1 { font-size: 20px; line-height: 28px; }
.orb { width: 128px; height: 128px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 500; cursor: pointer; margin: 8px auto; display: grid; place-items: center; text-align: center; padding: 16px; transition: background-color .15s var(--ease), transform .15s var(--ease); }
.orb:active { transform: scale(.98); }
.orb.listening { background: var(--neg); animation: live 1.4s ease-in-out infinite; }
.orb.off { background: var(--raised); color: var(--text-3); }
@keyframes live { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--neg) 16%, transparent); } }
.call form { display: flex; gap: 8px; } .call form input { flex: 1; }
.doc { max-width: 720px; margin: 0 auto; padding: 40px 16px 80px; }
.doc h1 { margin-bottom: 8px; } .doc h2 { margin: 32px 0 8px; } .doc p, .doc li { color: var(--text-2); margin-bottom: 8px; }
.doc .todo { background: color-mix(in srgb, var(--warn) 12%, transparent); border-radius: 4px; padding: 0 4px; color: var(--text); }
#toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%) translateY(8px); background: var(--text); color: var(--page); padding: 8px 16px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); max-width: 92vw; z-index: 50; }
#toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 1280px) {
  .shell { grid-template-columns: 248px minmax(0, 1fr); }
  .ask { position: fixed; right: 0; top: 0; width: min(376px, 100vw); z-index: 40; background: var(--card); transform: translateX(100%); transition: transform .3s var(--ease); box-shadow: var(--shadow-l); }
  .ask.open { transform: none; }
  .ask-close { display: inline-flex; }
  .ask-fab { display: inline-flex; align-items: center; position: fixed; right: 16px; bottom: 16px; z-index: 35; height: 44px; padding: 0 20px; background: var(--accent); color: var(--on-accent); border: 0; border-radius: 8px; font-weight: 500; box-shadow: var(--shadow-l); cursor: pointer; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .biz, .engine, .legal { display: none; }
  .side-foot { margin: 0 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; }
  .side-foot select { width: auto; max-width: 44vw; }
  .nav { position: fixed; bottom: 0; left: 0; right: 0; flex-direction: row; gap: 0; background: var(--card); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); z-index: 30; }
  .nav button { flex: 1; flex-direction: column; justify-content: center; align-items: center; height: 48px; gap: 0; font-size: 12px; line-height: 16px; padding: 0 2px; }
  .nav button[aria-current="page"] { box-shadow: none; background: none; color: var(--accent); }
  main { padding: 16px 16px 120px; }
  h1 { font-size: 24px; line-height: 28px; }
  .btn { height: 44px; }
  .kpis { grid-template-columns: 1fr 1fr; } .kpis .kpi:first-child { grid-column: 1 / -1; }
  .two { grid-template-columns: minmax(0, 1fr); }
  .sources { grid-template-columns: 1fr 1fr; }
  .facts li, .auto dl { grid-template-columns: minmax(0, 1fr); gap: 0; } .auto dt { margin-top: 8px; }
  .item-head { grid-template-columns: 88px minmax(0, 1fr); padding: 8px 16px; }
  .item-head .what, .item-head .meta { grid-column: 1 / -1; white-space: normal; }
  .item-actions { padding-left: 16px; }
  .ask-fab { bottom: 72px; }
  .panel { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: 0s !important; } }
