/* Sirix CRM. Built only from tokens.css variables (Sirix Maps scheme); see DESIGN.md. */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 600 13px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; transition: color var(--t) var(--ease), text-decoration-color var(--t) var(--ease); }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .codes { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--bg-soft); padding: 8px 12px; border-radius: var(--r); }
.helper { font-weight: 400; font-size: 12px; color: var(--gray); }
.muted { color: var(--gray-2); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.section-label, .card-title, .table th, .kpi-label, legend.section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--gray);
}
.count { color: var(--ink-2); margin-left: 4px; letter-spacing: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.plain { list-style: none; padding: 0; margin: 6px 0; }
.inline-form { display: inline-flex; margin: 0; }

/* ---------- Top bar and rail ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px; padding-right: 12px;
  background: var(--topbar); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding-left: 11px; text-decoration: none; font-size: 13.5px; font-weight: 700; letter-spacing: .005em; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand-mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r);
  background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 15px;
}
.topsearch { position: relative; flex: 1; max-width: 440px; margin-left: 20px; }
.topsearch .icon { position: absolute; left: 10px; top: 7px; color: var(--gray); pointer-events: none; }
.topsearch input {
  width: 100%; height: var(--search-h); padding: 0 12px 0 34px; border-radius: var(--r-menu);
  background: var(--bg-soft); border: 1px solid var(--line); outline: none;
}
.topsearch input:focus { border-color: var(--accent); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: var(--header-ctl); height: var(--header-ctl); border-radius: var(--r);
  background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); cursor: pointer;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.icon-btn:hover { background: var(--bg-soft-2); color: var(--ink); }
[data-theme-toggle] .icon:nth-of-type(2) { display: none; }
[data-theme="light"] [data-theme-toggle] .icon:nth-of-type(1) { display: none; }
[data-theme="light"] [data-theme-toggle] .icon:nth-of-type(2) { display: block; }
.avatar {
  display: inline-grid; place-items: center; width: var(--header-ctl); height: var(--header-ctl); border-radius: 50%;
  background: var(--bg-soft-2); border: 1px solid var(--line-2); font-size: 11.5px; font-weight: 700; color: var(--ink-2); flex: none;
}
.avatar-sm { width: 30px; height: 30px; font-size: 11px; }
summary.avatar { cursor: pointer; list-style: none; }
summary.avatar::-webkit-details-marker { display: none; }

.menu { position: relative; }
.menu-pop {
  position: absolute; top: calc(100% + 8px); min-width: 250px; z-index: 40; padding: 6px;
  background: var(--bg-soft); border: 1px solid var(--line-float); border-radius: var(--r-menu); box-shadow: var(--sh-menu);
}
.menu-right { right: 0; }
.menu-head { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu-head span:not(.chip) { font-weight: 400; font-size: 12px; color: var(--gray); }
.menu-head .chip { align-self: flex-start; margin-top: 4px; }
.menu-row {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border-radius: 7px;
  background: none; border: 0; color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; text-align: left;
}
.menu-row:hover { background: var(--bg-soft-2); color: var(--ink); }
.menu-row .icon { color: var(--gray); }
.menu form { margin: 0; }

.rail {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; z-index: 20; width: var(--rail-w);
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 10px;
  background: var(--panel); border-right: 1px solid var(--line);
}
.rail-btn {
  position: relative; display: grid; place-items: center; width: var(--rail-btn); height: var(--rail-btn); border-radius: var(--r-card);
  color: var(--gray); border: 1px solid transparent; text-decoration: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.rail-btn:hover { background: var(--bg-soft-2); color: var(--ink); }
.rail-btn.is-active { background: var(--bg-soft-2); border-color: var(--line-2); color: var(--accent); }
.rail-btn[data-tip]:hover::after, .rail-btn[data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  padding: 6px 9px; border-radius: var(--r); background: var(--bg-soft); border: 1px solid var(--line-float); box-shadow: var(--sh-menu);
  color: var(--ink); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none;
}
.rail-sep { width: 22px; height: 1px; background: var(--line-2); margin: 6px 0; }

.main { margin-left: var(--rail-w); padding: calc(var(--topbar-h) + 24px) 28px 56px; }
.main > * { max-width: 1320px; margin-left: auto; margin-right: auto; }

/* ---------- Page head ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; overflow-wrap: anywhere; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.title-icon {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-card); flex: none;
  background: var(--bg-soft-2); border: 1px solid var(--line); color: var(--gray);
}
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--gray); }
.crumbs a { color: var(--gray); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumb-sep { color: var(--gray-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: var(--dialog-btn); padding: 0 14px;
  border-radius: var(--r); border: 1px solid var(--line-2); background: var(--bg-soft-2); color: var(--ink);
  font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), filter var(--t) var(--ease);
}
.btn:hover { color: var(--ink); background: color-mix(in srgb, var(--bg-soft-2), var(--ink) 6%); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn-primary:hover { background: var(--accent); color: var(--on-accent); filter: brightness(1.07); }
[data-theme="light"] .btn-primary { color: #ffffff; }
[data-theme="light"] .btn-primary:hover { color: #ffffff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-soft-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger), transparent 55%); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger), transparent 88%); color: var(--danger); }
.btn-sm { height: var(--header-ctl); padding: 0 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.dialog .btn:focus-visible { outline-offset: 2px; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; height: var(--chip-h); padding: 0 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; vertical-align: middle;
}
.chip-neutral { background: var(--bg-soft-2); border-color: var(--line-2); color: var(--ink-2); }
.chip-accent { background: var(--accent-soft); color: var(--accent); }
.chip-warning { background: var(--warning-bg); border-color: var(--warning-line); color: var(--warning-ink); }
.chip-danger { background: color-mix(in srgb, var(--danger), transparent 88%); border-color: color-mix(in srgb, var(--danger), transparent 70%); color: var(--danger); }
.chip-muted { background: transparent; border-color: var(--line-2); color: var(--gray); }
.id-chip {
  padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-soft-2); color: var(--ink-2);
  font-size: 11.5px; font-weight: 600; cursor: copy; word-break: break-all; text-align: left;
}

/* ---------- Cards, layout ---------- */
.card { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 18px; }
.card-title { margin: 0 0 12px; display: flex; align-items: center; gap: 6px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head .card-title { margin: 0; }
.card-table { padding: 0; overflow-x: auto; }
.card-table > .card-head { padding: 14px 18px 0; }
.pad { padding: 4px 18px 16px; }
.pad-title { padding: 14px 18px 0; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w); gap: 16px; align-items: start; }
.col-main, .col-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.main > .card, .main > .card-table { margin-bottom: 16px; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 12px 18px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast) var(--ease); }
.table tbody tr:hover, .table tr.is-current { background: color-mix(in srgb, var(--bg-soft), var(--ink) 3%); }
.table .num { text-align: right; }
.table-dense td { padding: 8px 14px; font-size: 12.5px; }
.table-dense th { padding: 10px 14px 8px; }
.row-link { font-weight: 700; text-decoration: none; }
.row-link:hover { text-decoration: underline; }
.changes div { font-size: 12px; color: var(--ink-2); }
.code { font-size: 11.5px; padding: 1px 5px; border-radius: var(--r-xs); background: var(--bg-soft-2); color: var(--ink-2); }

/* ---------- Definition lists ---------- */
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 20px; margin: 0; }
.dl dt { font-size: 12px; font-weight: 400; color: var(--gray); }
.dl dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.dl-wide { grid-column: 1 / -1; }
.dl-stack { grid-template-columns: 1fr; gap: 12px; }

/* ---------- Forms ---------- */
.form-card { max-width: 880px; }
.form-section { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.form-section legend { padding: 0; margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.req { color: var(--danger); }
.field-error { font-size: 12px; font-weight: 600; color: var(--danger); }
.input {
  width: 100%; height: var(--input-h); padding: 0 12px; border-radius: var(--r);
  background: var(--bg); border: 1px solid var(--line-2); color: var(--ink);
  font-size: 13px; font-weight: 600; outline: none; transition: border-color var(--t) var(--ease);
}
.input::placeholder { color: var(--gray-2); font-weight: 400; }
.input:hover { border-color: color-mix(in srgb, var(--line-2), var(--ink) 12%); }
.input:focus { border-color: var(--accent); }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
select.input {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9a9e' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 18px;
}
.input-search { height: var(--search-h); border-radius: var(--r-menu); width: auto; }
.has-error .input { border-color: var(--danger); }
.input-code { font-size: 16px; letter-spacing: .3em; text-align: center; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--line); }
.card > .form-actions { margin-top: 16px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }
.parent-fixed { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.parent-fixed .icon { color: var(--gray); }
.inline-fields { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.inline-fields .field { min-width: 240px; }
.field-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray); }
.roles-help { margin-top: 14px; font-size: 12.5px; }
.roles-help summary { cursor: pointer; color: var(--ink-2); }
.roles-help .dl { margin-top: 12px; }
.roles-help dd { font-weight: 400; color: var(--ink-2); }

/* ---------- Filters, tabs, pager ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.filter-search { position: relative; }
.filter-search .icon { position: absolute; left: 9px; top: 7px; color: var(--gray); pointer-events: none; }
.filter-search .input { padding-left: 32px; width: 260px; }
.tabs { display: flex; gap: 2px; margin-bottom: 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 9px 12px; font-size: 13px; color: var(--gray); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 10px; }
.empty { padding: 40px 20px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }

/* ---------- Notices, toasts, dialogs ---------- */
.notice { padding: 11px 14px; border-radius: var(--r); border: 1px solid; font-size: 12.5px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.notice-danger { background: color-mix(in srgb, var(--danger), transparent 90%); border-color: color-mix(in srgb, var(--danger), transparent 70%); }
.notice-warning { background: var(--warning-bg); border-color: var(--warning-line); color: var(--warning-ink); }
.notice-warning a { color: var(--warning-ink); }
.notice-accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent), transparent 70%); }
.notice-muted { background: var(--bg-soft-2); border-color: var(--line); color: var(--ink-2); font-weight: 400; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: var(--r);
  background: var(--bg-soft); border: 1px solid var(--line-2); box-shadow: var(--sh-toast); font-size: 13px; font-weight: 600;
  animation: toast-in var(--t-toast) var(--ease-out);
}
.toast span { flex: 1; }
.toast-success .icon { color: var(--accent); }
.toast-error .icon { color: var(--danger); }
.toast-warning .icon { color: var(--warning); }
.toast-info .icon { color: var(--gray); }
.toast-x { background: none; border: 0; color: var(--gray); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: var(--r-xs); }
.toast-x:hover { color: var(--ink); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity var(--t-toast) var(--ease), transform var(--t-toast) var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.dialog {
  width: min(460px, calc(100vw - 32px)); padding: 20px 22px; border-radius: var(--r-panel);
  background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); box-shadow: var(--sh-dialog);
}
.dialog::backdrop { background: var(--scrim); backdrop-filter: blur(var(--scrim-blur)); }
.dialog-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.dialog-text { color: var(--ink-2); font-weight: 400; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dialog form { margin: 0; }

/* ---------- Lookup (record picker) ---------- */
.lookup { position: relative; }
.lookup-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50; margin: 4px 0 0; padding: 4px; list-style: none;
  max-height: 280px; overflow-y: auto; background: var(--bg-soft); border: 1px solid var(--line-float); border-radius: var(--r-menu); box-shadow: var(--sh-menu);
}
.lookup-list li { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.lookup-list li:hover, .lookup-list li[aria-selected="true"] { background: var(--bg-soft-2); }
.lookup-list .lookup-empty { cursor: default; color: var(--gray); font-weight: 400; }
.lookup-list .lookup-empty:hover { background: none; }
.link-existing { display: grid; grid-template-columns: minmax(0, 1fr) 180px auto; gap: 10px; align-items: end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.link-existing:has([data-lookup-kind]) { grid-template-columns: 150px minmax(0, 1fr) 170px auto; }

/* ---------- Lists: people, timeline, sessions ---------- */
.people, .timeline, .sessions { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.people li:last-child { border-bottom: 0; }
.people-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.people-main .helper { flex-basis: 100%; }
.people-main a { text-decoration: none; }
.timeline li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.timeline li:first-child { padding-top: 0; }
.timeline li:last-child { border-bottom: 0; padding-bottom: 0; }
.tl-head { display: flex; flex-direction: column; gap: 1px; }
.tl-head strong { font-size: 12.5px; }
.tl-changes { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--ink-2); }
.tl-field { color: var(--gray); font-weight: 400; margin-right: 2px; }
.timeline .icon { width: 15px; height: 15px; color: var(--gray); }
.sessions li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sessions li:last-child { border-bottom: 0; }

/* ---------- Home ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 6px; text-decoration: none; transition: border-color var(--t) var(--ease); }
a.kpi:hover { color: var(--ink); border-color: var(--line-2); }
.kpi-value { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.kpis-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 10px; }
.kpis-2 .kpi { background: var(--bg-soft-2); border-radius: var(--r-card); padding: 12px 14px; }
.stack-bar { display: flex; gap: 2px; height: 10px; border-radius: var(--r-pill); overflow: hidden; background: var(--bg-soft-2); }
.seg { flex: 1 1 0; min-width: 4px; }
.seg-accent, .dot-accent { background: var(--accent); }
.seg-warning, .dot-warning { background: var(--warning); }
.seg-danger, .dot-danger { background: var(--danger); }
.seg-neutral, .dot-neutral { background: var(--gray); }
.seg-muted, .dot-muted { background: var(--gray-2); }
.legend { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.legend a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--ink-2); }
.legend strong { color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Sign-in ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; background: var(--stage); padding: 24px 16px; }
.auth-wrap { width: min(400px, 100%); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; font-size: 13.5px; font-weight: 700; }
.auth-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-panel); box-shadow: var(--sh-fly); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.auth-card .dialog-title { margin: 0; }
.auth-lang { display: flex; justify-content: center; gap: 14px; margin-top: 14px; font-size: 12px; }
.auth-lang a { color: var(--gray); text-decoration: none; }
.auth-lang a[aria-current] { color: var(--ink); }
.qr { display: grid; place-items: center; min-height: 212px; }
.qr img { background: #ffffff; padding: 8px; border-radius: var(--r-card); width: 200px; height: 200px; image-rendering: pixelated; }
.secret { text-align: center; font-size: 15px; font-weight: 700; letter-spacing: .08em; padding: 10px; border-radius: var(--r); background: var(--bg-soft-2); cursor: copy; overflow-wrap: anywhere; }
.codes { list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; background: var(--bg-soft-2); border-radius: var(--r-card); font-size: 14px; font-weight: 600; text-align: center; }
.secret-link code { display: block; font-size: 12px; padding: 8px 10px; border-radius: 6px; background: var(--bg); color: var(--ink); word-break: break-all; }
.notice .btn { align-self: flex-start; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .layout-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .main { margin-left: 0; padding: calc(var(--topbar-h) + 16px) 16px calc(var(--rail-w) + 32px); }
  .rail { top: auto; right: 0; width: auto; height: var(--rail-w); flex-direction: row; justify-content: space-around; padding: 0 6px; border-right: 0; border-top: 1px solid var(--line); }
  .rail-sep { width: 1px; height: 22px; margin: 0; }
  .rail-btn[data-tip]:hover::after, .rail-btn[data-tip]:focus-visible::after { display: none; }
  .brand span:last-child { display: none; }
  .topsearch { margin-left: 4px; }
  .form-grid, .kpis-2 { grid-template-columns: minmax(0, 1fr); }
  .field-wide { grid-column: auto; }
  .link-existing, .link-existing:has([data-lookup-kind]) { grid-template-columns: minmax(0, 1fr); }
  .filter-search .input { width: 100%; }
  .filter-search { flex: 1 1 100%; }
  .page-actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
