/* TomaLab app pages (account, docs, admin). Same look as the static pages: Figtree, #F5F5F7, white cards. */
:root {
  --ink: #1D1D1F;
  --muted: #6E6E73;
  --line: #D2D2D7;
  --bg: #F5F5F7;
  --card: #FFFFFF;
  --blue: #0066CC;
  --blue-dark: #0052A3;
  --green: #1D7F3F;
  --green-bg: #E3F5E9;
  --amber: #8A5A00;
  --amber-bg: #FFF1D6;
  --red: #B3261E;
  --red-bg: #FCE8E6;
  --brand: #0B0C10;
  --shadow: rgba(0, 0, 0, 0.25) 0 20px 40px -30px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.1; }
p { margin: 0; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.site-nav {
  max-width: 1024px; margin: 0 auto; padding: 0 22px; height: 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 13px;
}
.brand { color: var(--ink); display: flex; align-items: baseline; gap: 8px; padding: 12px 0; }
.brand b { font-size: 16px; letter-spacing: -0.01em; }
.brand span { color: var(--muted); font-size: 12px; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a { color: var(--ink); padding: 12px 10px; opacity: 0.85; white-space: nowrap; }
.nav-links a:hover { opacity: 1; color: var(--ink); }
.nav-links form { margin: 0; }

/* Layout */
main.page { max-width: 1024px; margin: 0 auto; padding: 64px 22px 96px; display: flex; flex-direction: column; gap: 32px; }
main.narrow { max-width: 488px; }
main.doc { max-width: 760px; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; align-items: start; }
.eyebrow { font-size: 15px; font-weight: 600; color: var(--muted); }
.kicker { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.title { font-size: clamp(36px, 4.5vw, 52px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.title-sm { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.lead { font-size: 17px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }

/* Cards */
.card { background: var(--card); border-radius: 24px; padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.card-dashed { background: var(--card); border: 1px dashed var(--line); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.card h2 { font-size: 22px; font-weight: 700; }
.shot { border-radius: 16px; overflow: hidden; background: var(--brand); line-height: 0; }
.shot img { width: 100%; height: auto; display: block; }
.panel-in { animation: panelIn .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .panel-in { animation: none; } }

/* Forms */
.form { background: var(--card); border-radius: 24px; padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.form label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.form input[type=email], .form input[type=password], .form input[type=text], .form input[type=search], .form textarea, .form select {
  font: inherit; font-weight: 400; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); width: 100%;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); padding-top: 4px; }
.check input { width: 18px; height: 18px; margin-top: 3px; flex-shrink: 0; }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.captcha { min-height: 0; }
.captcha iframe { border: 0; color-scheme: normal; width: 300px; height: 65px; max-width: 100%; }

/* Buttons */
.btn {
  font: inherit; font-weight: 500; padding: 13px 26px; border-radius: 980px; border: none;
  background: var(--blue); color: #fff; cursor: pointer; min-height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
}
.btn:hover { background: var(--blue-dark); color: #fff; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-dark { background: var(--ink); }
.btn-dark:hover { background: #000; }
.btn-sm { font-size: 15px; padding: 10px 18px; min-height: 40px; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); font-size: 13px; padding: 7px 14px; min-height: 32px; }
.btn-ghost:hover { background: #fff; color: var(--ink); }
.btn-link { background: none; border: none; color: var(--blue); font: inherit; font-weight: 500; cursor: pointer; padding: 8px 4px; }
.btn-link:hover { color: var(--blue-dark); }
.btn-danger { background: transparent; border: 1px solid var(--red); color: var(--red); font-size: 13px; padding: 6px 12px; min-height: 30px; border-radius: 980px; cursor: pointer; font-family: inherit; }
.btn-danger:hover { background: var(--red-bg); }

/* Badges, alerts */
.badge { font-size: 12px; font-weight: 600; border-radius: 980px; padding: 6px 12px; white-space: nowrap; background: var(--bg); color: var(--muted); }
.badge-green { color: var(--green); background: var(--green-bg); }
.badge-amber { color: var(--amber); background: var(--amber-bg); }
.badge-red { color: var(--red); background: var(--red-bg); }
.alert { border-radius: 14px; padding: 12px 16px; font-size: 15px; background: #fff; border: 1px solid var(--line); }
.alert-error { color: var(--red); background: var(--red-bg); border-color: transparent; }
.alert-ok { color: var(--green); background: var(--green-bg); border-color: transparent; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(0,0,0,.12); border-top-color: var(--blue); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Licence cards and docs */
dl.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; font-size: 14px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 600; }
.doc-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.doc-list a { display: flex; align-items: center; gap: 12px; color: var(--ink); background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.doc-list a:hover { background: #ECECF0; }
.doc-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; flex-shrink: 0; text-transform: uppercase; }
.doc-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.doc-text b { font-size: 15px; font-weight: 600; }
.doc-text span { font-size: 13px; color: var(--muted); }
.doc-action { color: var(--blue); font-weight: 500; font-size: 14px; flex-shrink: 0; }
.machines { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.machines li { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.info-strip { background: var(--card); border-radius: 24px; padding: 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.info-strip div { display: flex; flex-direction: column; gap: 4px; font-size: 15px; }

/* Docs pages */
.prose { background: var(--card); border-radius: 24px; padding: 32px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 18px; }
.prose h2 { font-size: 26px; margin-top: 10px; }
.prose h3 { font-size: 19px; margin-top: 6px; }
.prose ol, .prose ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; background: var(--bg); border-radius: 6px; padding: 2px 6px; word-break: break-all; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #E5E5EA; vertical-align: top; }
.tip { background: var(--bg); border-radius: 14px; padding: 14px 16px; font-size: 15px; }
.tip b { letter-spacing: 0.04em; font-size: 13px; }

/* Admin */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-nav a { padding: 8px 14px; border-radius: 980px; color: var(--ink); font-size: 15px; }
.admin-nav a.on { background: var(--ink); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.stat { background: var(--card); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.stat b { font-size: 34px; letter-spacing: -0.03em; line-height: 1; }
.stat span { font-size: 14px; color: var(--muted); }
.table-wrap { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid #E5E5EA; white-space: nowrap; }
table.data td { padding: 11px 14px; border-bottom: 1px solid #F0F0F3; vertical-align: top; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #FAFAFC; }
pre.payload { background: var(--brand); color: #E8E8ED; border-radius: 16px; padding: 18px; font-size: 13px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; font-size: 14px; }
.search { display: flex; gap: 10px; flex-wrap: wrap; }
.search input { font: inherit; padding: 10px 14px; border-radius: 980px; border: 1px solid var(--line); min-width: 240px; flex: 1; }

/* Footer + cookie bar */
.site-footer { border-top: 1px solid rgba(0,0,0,.08); }
.site-footer > div { max-width: 1024px; margin: 0 auto; padding: 24px 22px 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 14px; }
.site-footer a, .site-footer button { color: var(--muted); font: inherit; background: none; border: none; padding: 0; cursor: pointer; }
.site-footer a:hover, .site-footer button:hover { color: var(--ink); }
#cookie-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 20; max-width: 720px; margin: 0 auto; background: rgba(29,29,31,.92); color: #F5F5F7; border-radius: 18px; padding: 14px 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; font-size: 14px; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
#cookie-bar a { color: #8EC5FF; }
#cookie-bar button { font: inherit; font-size: 14px; border-radius: 980px; padding: 8px 14px; cursor: pointer; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; }
#cookie-bar button[data-cookie="all"] { background: #fff; color: var(--ink); border-color: #fff; }

@media (max-width: 640px) {
  .brand span { display: none; }
  .site-nav { gap: 8px; padding: 0 12px; }
  .nav-links a { padding-left: 6px; padding-right: 6px; }
  .nav-links .hide-sm { display: none; }
  main.page { padding-top: 40px; }
  .prose { padding: 22px; }
}
@media print {
  .site-header, .site-footer, #cookie-bar, .no-print { display: none !important; }
  body { background: #fff; }
  .prose { box-shadow: none; padding: 0; }
}
