/* Calculus IOSdocs staff UI. Tokens follow the Calculus Dashboard design system (calculus-dashboard). */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/poppins-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/poppins-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/poppins-500-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/poppins-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/poppins-600-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/poppins-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/poppins-700-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/poppins-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/roboto-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/roboto-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --background: 0 0% 98%;
  --foreground: 240 10% 10%;
  --card: 0 0% 100%;
  --primary: 238 78% 47%;
  --primary-foreground: 0 0% 100%;
  --secondary: 48 72% 58%;
  --muted: 240 5% 94%;
  --muted-foreground: 240 5% 45%;
  --accent: 238 30% 95%;
  --accent-foreground: 238 70% 30%;
  --destructive: 0 84% 60%;
  --success: 155 65% 38%;
  --warning: 45 90% 55%;
  --border: 240 5% 88%;
  --sidebar: 240 10% 96%;
  --sidebar-foreground: 240 10% 20%;
  --sidebar-accent: 238 30% 92%;
  --radius: 0.75rem;
  --shadow: 0 1px 2px hsl(240 10% 10% / 0.04), 0 8px 24px -12px hsl(240 10% 10% / 0.12);
  --font-heading: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-body: "Roboto", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "Courier New", monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: 240 15% 8%;
  --foreground: 0 0% 95%;
  --card: 240 15% 11%;
  --muted: 240 10% 16%;
  --muted-foreground: 240 5% 62%;
  --accent: 238 30% 18%;
  --accent-foreground: 238 80% 85%;
  --border: 240 10% 18%;
  --sidebar: 240 15% 10%;
  --sidebar-foreground: 240 5% 85%;
  --sidebar-accent: 240 10% 16%;
  --shadow: 0 1px 2px hsl(0 0% 0% / 0.3), 0 8px 24px -12px hsl(0 0% 0% / 0.5);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: hsl(var(--background)); color: hsl(var(--foreground)); font: 400 15px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-heading); line-height: 1.25; margin: 0; }
h1 { font-size: 1.6rem; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; overflow-wrap: anywhere; }
h2 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0; }
a { color: hsl(var(--primary)); text-underline-offset: 3px; }
:root[data-theme="dark"] a { color: hsl(238 90% 78%); }
img { max-width: 100%; }
.muted { color: hsl(var(--muted-foreground)); font-size: 0.875rem; }
.mono { display: block; font-family: var(--font-mono); font-size: 0.75rem; color: hsl(var(--muted-foreground)); overflow-wrap: anywhere; margin-top: 0.2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.icon { width: 1rem; height: 1rem; flex-shrink: 0; }
:root[data-theme="dark"] .only-light, :root:not([data-theme="dark"]) .only-dark { display: none !important; }
:focus-visible { outline: 2px solid hsl(var(--primary)); outline-offset: 2px; }

/* Buttons and inputs */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; height: 2.5rem; padding: 0 1rem; border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px); background: hsl(var(--card)); color: hsl(var(--foreground)) !important; font: 500 0.875rem/1 var(--font-body); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s; }
.button:hover { background: hsl(var(--muted)); }
.button-primary { background: hsl(var(--primary)); border-color: hsl(var(--primary)); color: hsl(var(--primary-foreground)) !important; }
.button-primary:hover { background: hsl(var(--primary) / 0.9); box-shadow: 0 0 30px -5px hsl(var(--primary) / 0.35); }
.button:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
.button-block { width: 100%; height: 3rem; font-size: 1rem; }
.icon-button { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border: 0; border-radius: calc(var(--radius) - 4px); background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; }
.icon-button:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.icon-button.logout:hover { color: hsl(var(--destructive)); }
input { font: inherit; color: inherit; width: 100%; height: 2.5rem; padding: 0 0.85rem; border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px); background: hsl(var(--card)); transition: border-color 0.15s, box-shadow 0.15s; }
input::placeholder { color: hsl(var(--muted-foreground)); }
input:focus { outline: none; border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / 0.18); }
.input-icon { position: relative; display: block; }
.input-icon > .icon { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); pointer-events: none; }
.input-icon > input { padding-left: 2.4rem; }
.reveal { position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border: 0; border-radius: 0.5rem; background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; }
.reveal:hover, .reveal[aria-pressed="true"] { color: hsl(var(--primary)); }

/* Badges, alerts, progress */
.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.65rem; border-radius: 999px; font: 500 0.75rem/1.4 var(--font-body); white-space: nowrap; }
.badge-success { background: hsl(var(--success) / 0.12); color: hsl(155 65% 30%); }
.badge-warning { background: hsl(var(--warning) / 0.2); color: hsl(40 80% 28%); }
.badge-danger { background: hsl(var(--destructive) / 0.12); color: hsl(0 70% 45%); }
:root[data-theme="dark"] .badge-success { color: hsl(155 60% 60%); }
:root[data-theme="dark"] .badge-warning { color: hsl(45 90% 65%); }
:root[data-theme="dark"] .badge-danger { color: hsl(0 85% 72%); }
.alert { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.75rem 0.9rem; border-radius: calc(var(--radius) - 2px); font-size: 0.875rem; margin-bottom: 1.25rem; animation: fade-in 0.3s ease-out; }
.alert .icon { margin-top: 0.15rem; }
.alert-error { background: hsl(var(--destructive) / 0.1); color: hsl(0 72% 45%); }
.alert-success { background: hsl(var(--success) / 0.1); color: hsl(155 65% 30%); }
:root[data-theme="dark"] .alert-error { color: hsl(0 85% 72%); }
:root[data-theme="dark"] .alert-success { color: hsl(155 60% 60%); }
progress { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 0.375rem; border: 0; border-radius: 999px; background: hsl(var(--muted)); overflow: hidden; }
progress::-webkit-progress-bar { background: hsl(var(--muted)); border-radius: 999px; }
progress::-webkit-progress-value { background: hsl(var(--primary)); border-radius: 999px; }
progress::-moz-progress-bar { background: hsl(var(--primary)); border-radius: 999px; }
.progress-lg { height: 0.6rem; margin: 0.75rem 0 0.5rem; }

/* Login */
.login { display: grid; min-height: 100vh; grid-template-columns: 1fr; }
.login-art { display: none; position: relative; overflow: hidden; place-items: center; padding: 3rem; background: linear-gradient(135deg, #2f5ff3, #7b9cf2); background: linear-gradient(135deg, oklch(0.57 0.2323 262.72), oklch(0.7 0.1425 260.89)); }
.login-art img { width: 75%; max-width: 640px; filter: drop-shadow(0 30px 40px hsl(240 60% 15% / 0.25)); }
.login-panel { position: relative; display: grid; place-items: center; padding: 2rem 1.25rem; background: hsl(var(--background)); }
.login-theme { position: absolute; top: 1rem; right: 1rem; }
.login-box { width: 100%; max-width: 26rem; animation: fade-in 0.3s ease-out; }
.login-logo { display: flex; justify-content: center; margin-bottom: 2.25rem; }
.login-logo img { height: 3.25rem; width: auto; user-select: none; }
.login-box h1 { justify-content: center; font-size: 1.5rem; margin-bottom: 1.75rem; }
.login-form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: 0.45rem; font: 500 0.875rem/1.4 var(--font-body); }
.login-form input { height: 3rem; }
.login-form .button-block { margin-top: 0.4rem; }
@media (min-width: 1024px) { .login { grid-template-columns: 1fr 1fr; } .login-art { display: grid; } }

/* App shell */
.shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: hsl(var(--sidebar)); border-right: 1px solid hsl(var(--border)); }
.sidebar-logo { height: 3.5rem; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid hsl(var(--border)); padding: 0 1rem; }
.sidebar-logo img { height: 1.75rem; width: auto; }
.sidebar-nav { flex: 1; display: grid; align-content: start; gap: 0.25rem; padding: 0.6rem; }
.sidebar-nav a { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.75rem; border-radius: calc(var(--radius) - 4px); color: hsl(var(--sidebar-foreground) / 0.75); font: 500 0.875rem/1.2 var(--font-body); text-decoration: none; transition: background 0.15s, color 0.15s; }
.sidebar-nav a:hover { background: hsl(var(--sidebar-accent) / 0.6); color: hsl(var(--sidebar-foreground)); }
.sidebar-nav a.active { background: hsl(var(--sidebar-accent)); color: hsl(var(--primary)); }
:root[data-theme="dark"] .sidebar-nav a.active { color: hsl(238 90% 80%); }
.sidebar-backdrop { display: none; }
/* Legal links at the bottom of the sidebar (the nav above takes the remaining height). */
.sidebar-legal { display: grid; gap: 0.1rem; padding: 0.6rem; border-top: 1px solid hsl(var(--border)); }
.sidebar-legal a { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.75rem; border-radius: calc(var(--radius) - 4px); color: hsl(var(--sidebar-foreground) / 0.6); font: 400 0.8rem/1.2 var(--font-body); text-decoration: none; transition: background 0.15s, color 0.15s; }
.sidebar-legal a:hover { background: hsl(var(--sidebar-accent) / 0.6); color: hsl(var(--sidebar-foreground)); }
.sidebar-legal .icon { width: 0.95rem; height: 0.95rem; }
.workspace { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; height: 3.5rem; display: flex; align-items: center; gap: 0.75rem; padding: 0 1rem; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--card) / 0.8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.menu-button { display: none; }
.topbar-title { flex: 1; min-width: 0; padding: 0.15rem 0; font: 500 0.875rem/1.4 var(--font-heading); color: hsl(var(--muted-foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 0.35rem; }
.user-chip { display: flex; align-items: center; gap: 0.55rem; padding: 0.25rem 0.75rem 0.25rem 0.25rem; margin: 0 0.25rem; border-radius: 999px; background: hsl(var(--muted)); }
.avatar { display: grid; place-items: center; width: 1.85rem; height: 1.85rem; border-radius: 50%; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font: 600 0.72rem/1 var(--font-heading); }
.user-name { font-size: 0.85rem; font-weight: 500; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-form { margin: 0; }
.content { width: 100%; padding: 1.5rem; animation: fade-in 0.3s ease-out; }

/* Page content */
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-heading .muted { margin-top: 0.3rem; }
.breadcrumb { margin-bottom: 1rem; }
.breadcrumb a { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.875rem; font-weight: 500; text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); box-shadow: var(--shadow); min-width: 0; }
.stat > div { min-width: 0; }
.stat-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; color: #fff; flex-shrink: 0; }
.stat-icon .icon { width: 1.25rem; height: 1.25rem; }
.tone-primary { background: #2563eb; background: oklch(0.57 0.2323 262.72); }
.tone-gold { background: #f5b30c; color: hsl(40 80% 15%); }
.tone-green { background: #5fb38a; }
.tone-red { background: #e55a5a; }
.stat-label { color: hsl(var(--muted-foreground)); font-size: 0.8rem; font-weight: 500; }
.stat-value { font: 600 1.6rem/1.2 var(--font-heading); margin: 0.3rem 0 0.15rem; overflow-wrap: anywhere; }
.stat-note { color: hsl(var(--muted-foreground)); font-size: 0.78rem; }
.card { border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); box-shadow: var(--shadow); margin-bottom: 1.5rem; overflow: hidden; scroll-margin-top: 4.5rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem; flex-wrap: wrap; }
.card-header .muted { margin-top: 0.2rem; }
.search { width: min(100%, 22rem); }
.usage-card { padding: 1.25rem; }
.usage-line { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; font-size: 0.85rem; margin-bottom: 0.4rem; white-space: nowrap; }
.table-scroll { overflow-x: auto; border-top: 1px solid hsl(var(--border)); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th { padding: 0.75rem 1.25rem; text-align: left; background: hsl(var(--muted) / 0.5); color: hsl(var(--muted-foreground)); font: 500 0.75rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
td { padding: 0.9rem 1.25rem; border-top: 1px solid hsl(var(--border)); vertical-align: middle; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: hsl(var(--accent) / 0.5); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-main { min-width: 15rem; max-width: 28rem; overflow-wrap: anywhere; }
.cell-usage { min-width: 11rem; }
.cell-usage .usage-line { justify-content: flex-start; gap: 0.3rem; }
.row-link { font-weight: 500; color: hsl(var(--foreground)) !important; text-decoration: none; }
.row-link:hover { color: hsl(var(--primary)) !important; text-decoration: underline; }
.doc-name { display: flex; gap: 0.5rem; align-items: center; font-weight: 500; }
.doc-name .icon { color: hsl(var(--primary)); }
details { margin-top: 0.35rem; }
summary { cursor: pointer; color: hsl(var(--muted-foreground)); font-size: 0.75rem; width: max-content; }
summary:hover { color: hsl(var(--primary)); }
code { display: block; margin-top: 0.35rem; font-family: var(--font-mono); font-size: 0.72rem; overflow-wrap: anywhere; color: hsl(var(--muted-foreground)); }
.empty { padding: 3rem 1.25rem; text-align: center; color: hsl(var(--muted-foreground)); }
.empty .icon { display: block; width: 1.75rem; height: 1.75rem; margin: 0 auto 0.6rem; opacity: 0.6; }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.75rem; padding: 0.9rem 1.25rem; border-top: 1px solid hsl(var(--border)); }
.pager > :last-child { justify-self: end; }

@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 50; left: 0; width: 15rem; transform: translateX(-100%); transition: transform 0.25s ease; }
  .sidebar-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: hsl(var(--foreground) / 0.2); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
  .menu-button { display: inline-grid; }
  .user-name { display: none; }
  .user-chip { padding: 0.2rem; margin: 0; background: transparent; }
}
@media (max-width: 640px) {
  .content { padding: 1rem; }
  .stats { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
  .page-heading { flex-direction: column; }
  .search { width: 100%; }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager > .muted { grid-column: 1 / -1; grid-row: 2; text-align: center; }
  h1 { font-size: 1.35rem; }
}
[aria-busy="true"] { opacity: 0.55; transition: opacity 0.15s; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

/* Account pages: registration, verification, password reset, API key */
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.field-link, .auth-switch a { font-weight: 500; font-size: 0.85rem; text-decoration: none; }
.field-link:hover, .auth-switch a:hover { text-decoration: underline; }
.auth-switch { margin-top: 1.5rem; text-align: center; color: hsl(var(--muted-foreground)); font-size: 0.875rem; }
.form-hint { color: hsl(var(--muted-foreground)); font-size: 0.875rem; margin-bottom: 1.1rem; text-align: center; }
.code-input { height: 3.5rem !important; text-align: center; font: 600 1.6rem/1 var(--font-mono); letter-spacing: 0.6em; padding-left: 1.4rem; }
.resend-form { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0.35rem; margin-top: 1.25rem; }
.link-button { border: 0; background: none; padding: 0; color: hsl(var(--primary)); font: 500 0.875rem/1.4 var(--font-body); cursor: pointer; }
:root[data-theme="dark"] .link-button { color: hsl(238 90% 78%); }
.link-button:hover { text-decoration: underline; }
.key-card { padding-bottom: 1.25rem; }
.key-card > :not(.card-header) { margin-left: 1.25rem; margin-right: 1.25rem; }
.key-box { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.9rem 1rem; margin-bottom: 1rem; border: 1px dashed hsl(var(--primary) / 0.5); border-radius: calc(var(--radius) - 2px); background: hsl(var(--accent) / 0.6); }
.key-box code { flex: 1; min-width: 12rem; margin: 0; font-size: 0.95rem; color: hsl(var(--foreground)); letter-spacing: 0.02em; }
.key-usage { margin: 0.5rem 0 1.1rem; line-height: 1.7; }
code.inline { display: inline; margin: 0; padding: 0.1rem 0.35rem; border-radius: 0.3rem; background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.mono-inline { font-family: var(--font-mono); font-size: 0.8rem; }
.key-input { flex: 1; min-width: 12rem; height: 2.5rem; font: 500 0.95rem/1 var(--font-mono); letter-spacing: 0.02em; background: hsl(var(--card)); }
.key-box .icon-button { flex-shrink: 0; }
[data-copy] .copied-icon, [data-copy].copied .copy-icon { display: none; }
[data-copy].copied .copied-icon { display: block; color: hsl(var(--success)); }

/* Recipient pages (/p preview, /v verification) */
.public-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--card) / 0.85); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.public-header-inner { max-width: 80rem; margin: 0 auto; height: 3.5rem; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.public-logo img { height: 1.75rem; width: auto; display: block; }
.public-main { max-width: 80rem; margin: 0 auto; padding: 1.5rem; animation: fade-in 0.3s ease-out; }
.public-main > .alert { margin-bottom: 1.25rem; }
.public-note { margin: 0.5rem 0 2rem; }
.public-message { display: flex; gap: 1rem; align-items: flex-start; padding: 1.5rem; max-width: 40rem; margin: 3rem auto; }
.public-message h1 { font-size: 1.25rem; margin-bottom: 0.35rem; }
.heading-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.pdf-card { padding: 0; }
.pdf-frame { display: block; width: 100%; height: 78vh; min-height: 30rem; border: 0; background: hsl(var(--muted)); }
.party-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.party { padding: 1.25rem; margin-bottom: 0; }
.party h2 { margin: 0.3rem 0 0.75rem; overflow-wrap: anywhere; }
.party dl { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 0; font-size: 0.875rem; }
.party dt { color: hsl(var(--muted-foreground)); }
.party dd { margin: 0; overflow-wrap: anywhere; }
.decide-all { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.stavke-table td, .stavke-table th { padding: 0.65rem 0.75rem; }
.stavke-table tfoot td { border-top: 2px solid hsl(var(--border)); background: hsl(var(--muted) / 0.4); }
.cell-text { min-width: 12rem; max-width: 24rem; overflow-wrap: anywhere; white-space: pre-line; }
.nowrap { white-space: nowrap; }
.decision { display: flex; gap: 0.35rem; border: 0; margin: 0; padding: 0; min-width: 0; }
.choice { position: relative; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.65rem; border: 1px solid hsl(var(--border)); border-radius: 999px; font-size: 0.8rem; font-weight: 500; white-space: nowrap; cursor: pointer; color: hsl(var(--muted-foreground)); background: hsl(var(--card)); transition: background 0.15s, border-color 0.15s, color 0.15s; }
.choice .icon { width: 0.85rem; height: 0.85rem; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice:has(input:focus-visible) { outline: 2px solid hsl(var(--primary)); outline-offset: 2px; }
.choice-yes:has(input:checked) { background: hsl(var(--success) / 0.14); border-color: hsl(var(--success) / 0.6); color: hsl(155 65% 28%); }
.choice-no:has(input:checked) { background: hsl(var(--destructive) / 0.12); border-color: hsl(var(--destructive) / 0.55); color: hsl(0 70% 42%); }
:root[data-theme="dark"] .choice-yes:has(input:checked) { color: hsl(155 60% 62%); }
:root[data-theme="dark"] .choice-no:has(input:checked) { color: hsl(0 85% 74%); }
.answer-card { padding: 1.25rem; display: grid; gap: 1rem; }
.answer-card h2 { margin: 0; }
textarea { font: inherit; color: inherit; width: 100%; padding: 0.65rem 0.85rem; border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px); background: hsl(var(--card)); resize: vertical; }
textarea:focus { outline: none; border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / 0.18); }
.legal-note { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.9rem 1rem; border: 1px solid hsl(var(--primary) / 0.25); border-left: 3px solid hsl(var(--primary)); border-radius: calc(var(--radius) - 2px); background: hsl(var(--accent) / 0.6); font-size: 0.875rem; line-height: 1.55; }
.legal-note > .icon { flex-shrink: 0; margin-top: 0.15rem; color: hsl(var(--primary)); }
.legal-note p { margin: 0; }
.legal-note p + p { margin-top: 0.6rem; font-weight: 500; }
.field-error { margin: 0.4rem 0 0; font-size: 0.8125rem; color: hsl(0 72% 45%); }
:root[data-theme="dark"] .field-error { color: hsl(0 85% 72%); }
/* Reply PDF drop zone: the real file input stays focusable (keyboard opens the picker), the label is the visible target. */
.dropzone { position: relative; }
.dropzone-input { position: absolute; opacity: 0; width: 1px; height: 1px; padding: 0; border: 0; }
.dropzone-area { display: grid; justify-items: center; gap: 0.35rem; padding: 1.75rem 1rem; border: 2px dashed hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--muted) / 0.35); text-align: center; font-size: 0.875rem; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.dropzone-area strong { font-weight: 500; }
.dropzone-area:hover, .dropzone-over .dropzone-area { border-color: hsl(var(--primary)); background: hsl(var(--accent) / 0.7); }
.dropzone:has(.dropzone-input:focus-visible) .dropzone-area, .dropzone:has(.dropzone-input:focus-visible) .dropzone-file { outline: 2px solid hsl(var(--primary)); outline-offset: 2px; }
.dropzone-invalid .dropzone-area { border-color: hsl(var(--destructive) / 0.7); }
.dropzone-icon { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 999px; background: hsl(var(--primary) / 0.1); color: hsl(var(--primary)); flex-shrink: 0; }
.dropzone-file { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0.9rem; border: 1px solid hsl(var(--success) / 0.5); border-radius: var(--radius); background: hsl(var(--success) / 0.07); }
.dropzone-file .dropzone-icon { background: hsl(var(--success) / 0.14); color: hsl(155 65% 30%); }
.dropzone-name { display: grid; gap: 0.1rem; min-width: 0; flex: 1; font-size: 0.875rem; }
.dropzone-name strong { font-weight: 500; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
tr.row-missing td { background: hsl(var(--destructive) / 0.07); }
tr.row-missing .choice { border-color: hsl(var(--destructive) / 0.6); }
.thanks-card { display: grid; justify-items: center; gap: 1rem; max-width: 36rem; margin: 4rem auto; padding: 2.5rem 2rem; text-align: center; }
.thanks-card p { margin: 0; font: 500 1.125rem/1.5 var(--font-heading, inherit); }
.thanks-icon { display: inline-grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 999px; background: hsl(var(--success) / 0.14); color: hsl(155 65% 32%); }
.thanks-icon .icon { width: 1.75rem; height: 1.75rem; }
/* Confirmation modal (native <dialog>: focus stays inside, Esc closes). */
.modal { width: min(30rem, calc(100vw - 2rem)); padding: 0; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); color: hsl(var(--foreground)); box-shadow: 0 24px 64px -16px hsl(240 10% 10% / 0.45); }
.modal[open] { animation: modal-in 0.18s ease-out; }
.modal::backdrop { background: hsl(240 10% 8% / 0.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.modal-body { display: grid; gap: 0.9rem; padding: 1.5rem 1.5rem 1.25rem; }
.modal-body h2 { margin: 0; font-size: 1.15rem; }
.modal-icon { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 999px; background: hsl(var(--warning) / 0.2); color: hsl(40 80% 32%); }
.modal-summary { list-style: none; margin: 0; padding: 0; border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px); font-size: 0.875rem; }
.modal-summary li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0.8rem; }
.modal-summary li + li { border-top: 1px solid hsl(var(--border)); }
.modal-summary span { color: hsl(var(--muted-foreground)); }
.modal-summary strong { font-weight: 500; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.modal-warning { margin: 0; padding: 0.75rem 0.9rem; border-radius: calc(var(--radius) - 2px); background: hsl(var(--destructive) / 0.1); color: hsl(0 72% 42%); font-size: 0.875rem; }
:root[data-theme="dark"] .modal-warning { color: hsl(0 85% 74%); }
:root[data-theme="dark"] .modal-icon { color: hsl(45 90% 62%); }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 1rem 1.5rem; border-top: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.35); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (max-width: 480px) { .modal-actions .button { flex: 1; } .thanks-card { margin: 2rem auto; padding: 2rem 1.25rem; } }
.doc-title { overflow-wrap: anywhere; }
.doc-page { padding: 1.25rem; }
.answer-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.napomena { white-space: pre-line; margin: 0.25rem 0 0.5rem; }
@media (max-width: 760px) { .party-grid { grid-template-columns: minmax(0, 1fr); } .public-main { padding: 1rem; } .pdf-frame { height: 70vh; } }
/* Phones: each stavka becomes a card; the decision buttons stay visible without sideways scrolling. */
@media (max-width: 760px) {
  .stavke-table, .stavke-table tbody, .stavke-table tfoot, .stavke-table tr, .stavke-table td { display: block; width: 100%; }
  .stavke-table thead { display: none; }
  .stavke-table tbody tr { padding: 0.75rem 1rem; border-top: 1px solid hsl(var(--border)); }
  .stavke-table tbody td { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0; border: 0; text-align: right; max-width: none; min-width: 0; }
  .stavke-table tbody td::before { content: attr(data-label); color: hsl(var(--muted-foreground)); font-size: 0.8rem; text-align: left; flex-shrink: 0; }
  .stavke-table tbody td:empty { display: none; }
  .stavke-table tbody td.cell-decision { display: block; padding-top: 0.6rem; }
  .stavke-table tbody td.cell-decision::before { display: none; }
  .decision .choice { flex: 1; justify-content: center; }
  .stavke-table tfoot tr { display: flex; justify-content: space-between; padding: 0.6rem 1rem; border-top: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.4); }
  .stavke-table tfoot td { display: block; width: auto; padding: 0; border: 0; background: none; }
  .stavke-table tfoot td[data-label]::before { content: attr(data-label) " "; color: hsl(var(--muted-foreground)); font-size: 0.8rem; }
  .stavke-table tfoot td:empty { display: none; }
  .table-scroll:has(.stavke-table) { overflow-x: visible; }
}

/* Documents: party line, muted badge and the /dokumenti accordion list */
.doc-party { display: block; margin-top: 0.25rem; padding-left: 1.5rem; color: hsl(var(--muted-foreground)); font-size: 0.8rem; overflow-wrap: anywhere; }
.badge-muted { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.doc-list { padding: 0; }
.doc-list-head, .doc-item > summary { display: grid; grid-template-columns: minmax(14rem, 2.5fr) 7rem 9.5rem 6.5rem 8.5rem 1.5rem; gap: 1rem; align-items: center; padding: 0.85rem 1.25rem; }
.doc-list-head { background: hsl(var(--muted) / 0.5); color: hsl(var(--muted-foreground)); font: 500 0.75rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: 0.04em; }
.doc-item { margin-top: 0; border-top: 1px solid hsl(var(--border)); }
.doc-item > summary { width: 100%; min-width: 0; cursor: pointer; list-style: none; font-size: 0.875rem; transition: background 0.12s; }
.doc-item > summary::-webkit-details-marker { display: none; }
.doc-item > summary:hover { background: hsl(var(--accent) / 0.5); }
.doc-item[open] > summary { background: hsl(var(--accent) / 0.6); }
.doc-main { min-width: 0; overflow-wrap: anywhere; }
.doc-chevron { display: grid; place-items: center; color: hsl(var(--muted-foreground)); transition: transform 0.2s; }
.doc-item[open] .doc-chevron { transform: rotate(90deg); }
.doc-body { padding: 1rem 1.25rem 1.25rem; border-top: 1px solid hsl(var(--border)); background: hsl(var(--background)); }
.doc-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.doc-body .table-scroll { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 4px); background: hsl(var(--card)); }
.doc-answer { margin-top: 1rem; display: grid; gap: 0.35rem; justify-items: start; }
.doc-list > .empty { display: grid; justify-items: center; gap: 0.5rem; }
.doc-list > .pager, #doc-results > .pager { border-top: 1px solid hsl(var(--border)); }
@media (max-width: 900px) {
  .doc-list-head { display: none; }
  .doc-item > summary { position: relative; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.35rem 1rem; padding-right: 2.75rem; }
  .doc-item > summary .doc-main { grid-column: 1 / -1; }
  .doc-item > summary .doc-cell[data-label]::before { content: attr(data-label) ": "; color: hsl(var(--muted-foreground)); font-size: 0.78rem; }
  .doc-item > summary .doc-cell.num { text-align: left; }
  .doc-chevron { position: absolute; top: 0.9rem; right: 1rem; }
  .doc-body { padding: 0.75rem; }
}

/* Bot defense: honeypot field (off-screen, never shown) and the Turnstile widget. */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.captcha { display: grid; gap: 0.35rem; justify-items: start; min-height: 65px; }
.captcha .field-error { margin: 0; }

/* Checkboxes on the sign-in and registration forms (Zapamti me, terms acceptance). */
.check { display: flex; align-items: flex-start; gap: 0.6rem; margin: 0.25rem 0 1rem; font-size: 0.875rem; line-height: 1.45; cursor: pointer; }
.check input { width: 1.05rem; height: 1.05rem; margin: 0.12rem 0 0; flex-shrink: 0; accent-color: hsl(var(--primary)); padding: 0; }
.check a { font-weight: 500; }
.legal-links { margin: 1.25rem 0 0; text-align: center; font-size: 0.8rem; color: hsl(var(--muted-foreground)); }
.legal-links a { color: hsl(var(--muted-foreground)); text-decoration: none; }
.legal-links a:hover { color: hsl(var(--primary)); text-decoration: underline; }

/* Privacy policy and terms of use. */
.legal { max-width: 56rem; margin: 0 auto 2rem; padding: 2rem 2.25rem; line-height: 1.65; }
.legal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.legal-head h1 { margin: 0; }
.legal-lang { font-size: 0.875rem; font-weight: 500; text-decoration: none; padding: 0.3rem 0.75rem; border: 1px solid hsl(var(--border)); border-radius: 999px; }
.legal h2 { font-size: 1.1rem; margin: 2rem 0 0.6rem; }
.legal p { margin: 0 0 0.85rem; }
.legal ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.legal li { margin-bottom: 0.35rem; }
.legal .table-scroll { margin: 0.5rem 0 1rem; border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 4px); }
.legal-table { font-size: 0.85rem; line-height: 1.5; }
.legal-table th, .legal-table td { padding: 0.65rem 0.75rem; vertical-align: top; text-align: left; white-space: normal; }
.legal-table td:first-child { min-width: 14rem; }
.legal code { font-family: var(--font-mono); font-size: 0.8rem; overflow-wrap: anywhere; }
.public-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem 1.25rem; padding: 1.25rem 1rem 2rem; font-size: 0.8rem; color: hsl(var(--muted-foreground)); }
.public-footer a { color: hsl(var(--muted-foreground)); text-decoration: none; }
.public-footer a:hover { color: hsl(var(--primary)); text-decoration: underline; }
@media (max-width: 760px) { .legal { padding: 1.25rem 1rem; } .legal-table td:first-child { min-width: 10rem; } }

/* Documents tab: search, status chips and the upload-date sort, applied without an Apply button. */
.doc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid hsl(var(--border)); }
.search-box { flex: 1 1 18rem; min-width: 0; max-width: 32rem; }
.doc-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip { display: inline-flex; align-items: center; height: 2rem; padding: 0 0.85rem; border: 1px solid hsl(var(--border)); border-radius: 999px; background: hsl(var(--card)); color: hsl(var(--muted-foreground)) !important; font: 500 0.8125rem/1 var(--font-body); text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.chip:hover { border-color: hsl(var(--primary) / 0.5); color: hsl(var(--foreground)) !important; }
.chip.active { background: hsl(var(--primary)); border-color: hsl(var(--primary)); color: hsl(var(--primary-foreground)) !important; }
.chip:focus-visible, .sort-toggle:focus-visible { outline: 2px solid hsl(var(--primary)); outline-offset: 2px; }
.sort-toggle { height: 2rem; padding: 0 0.85rem; font-size: 0.8125rem; }
.sort-toggle .icon { width: 0.95rem; height: 0.95rem; }
[data-doc-results][aria-busy="true"] { opacity: 0.55; transition: opacity 0.15s; }
#doc-results > .empty { display: grid; justify-items: center; gap: 0.5rem; }
@media (max-width: 760px) {
  .doc-toolbar { padding: 0.85rem; }
  .search-box { flex-basis: 100%; max-width: none; }
  .doc-controls { width: 100%; justify-content: space-between; }
}

/* Reason for a denied stavka: the input row on the verify page and the shown row in document details. */
.stavke-table tr.row-denied > td { border-bottom-color: transparent; }
.stavka-note-row > td { padding-top: 0 !important; background: hsl(var(--destructive) / 0.04); }
.stavka-note { display: grid; gap: 0.35rem; padding: 0.25rem 0 0.6rem; font-size: 0.8125rem; }
.stavka-note textarea { min-height: 2.75rem; font-size: 0.875rem; }
.stavka-note-row.row-missing > td { background: hsl(var(--destructive) / 0.08); }
.stavka-note-row.row-missing textarea { border-color: hsl(var(--destructive) / 0.7); }
.stavka-note-view > td { padding: 0.35rem 0.75rem 0.65rem !important; font-size: 0.8125rem; }
.stavka-note-label { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 500; color: hsl(0 70% 42%); }
.stavka-note-label .icon { width: 0.85rem; height: 0.85rem; }
:root[data-theme="dark"] .stavka-note-label { color: hsl(0 85% 74%); }
.stavka-note-view .napomena { margin: 0; white-space: pre-line; }
@media (max-width: 760px) {
  .stavke-table tbody tr.stavka-note-row { padding-top: 0; border-top: 0; }
  .stavke-table tbody tr.stavka-note-row > td { display: block; text-align: left; }
  .stavke-table tbody tr.stavka-note-row > td::before { display: none; }
}
/* Send button highlighted after "Ostani" / staying on the page. */
@keyframes attention-ring { 0% { box-shadow: 0 0 0 0 hsl(var(--primary) / 0.55); } 100% { box-shadow: 0 0 0 14px hsl(var(--primary) / 0); } }
.button.attention { animation: attention-ring 0.9s ease-out 3; }
/* Home: open a document from the latest-documents table. */
th.row-action, td.row-action { width: 3rem; text-align: right; padding-right: 0.75rem; }
.open-arrow { color: hsl(var(--primary)); }
.open-arrow:hover { background: hsl(var(--accent)); }
a.doc-link { text-decoration: none; color: hsl(var(--foreground)) !important; }
a.doc-link:hover { color: hsl(var(--primary)) !important; text-decoration: underline; }
/* Legal pages: back button and the logo as a home link. */
.legal-nav { max-width: 56rem; margin: 0 auto 1rem; }
a.public-logo { display: inline-block; }
