/* CleverHive shared styles: tokens, base elements and the components every area uses (buttons, cards, forms, menus, dialogs, toasts).
   Brand: Indigo #252A63, Brass #C49A52, Graphite #4A4A55. One light theme on white. Loaded on every page, before the area styles and motion.css. */

/* ================================================================== Layout and components */
/* CleverHive — minimal design system.
   Brand: Indigo #252A63, Brass #C49A52, Graphite #4A4A55.
   Flat white surfaces separated by thin borders; shadows only for things that float (menus, dialogs, toasts).
   Component layout lives here; colours, borders and states are finished in theme.css.
   Text, borders and focus rings keep WCAG AA contrast. */
:root {
  --indigo: #252A63;
  --indigo-600: #313781;
  --indigo-700: #1C2050;
  --indigo-tint: #E4E7F6;
  --accent: #313781;           /* links, active items, highlights */
  --brass: #C49A52;
  --brass-700: #7A5C25;
  --brass-tint: #F5EBD8;
  --brass-300: color-mix(in srgb, var(--brass) 62%, #fff); /* light brass for small text and lines on indigo */
  --brass-600: #8A6528;        /* darkest brass that still gives 4.5:1 with white text (brass buttons, avatars) */
  --brass-800: #6B4D1D;        /* pressed brass */
  --paper: #F4F2EE;            /* the logo's colour on dark backgrounds */
  --graphite: #4A4A55;
  --on-accent: #FFFFFF;

  --bg: #FFFFFF;               /* page behind the content panel: always white */
  --surface: #FFFFFF;          /* cards, panels, inputs */
  --surface-hi: #F9FAFB;       /* hover rows, quiet fills */
  --subtle: #F2F4F7;           /* tags, tracks, segmented controls */
  --border: #E4E7EC;
  --border-strong: #D0D5DD;
  --text: #1B1E33;
  --muted: #555B6E;            /* 6.6:1 on white */
  --faint: #667085;            /* 4.9:1 on white */
  --line: #EAECF0;

  /* Flat by default. Only floating layers (menus, dialogs, toasts) get a shadow. */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px -4px rgba(16, 24, 40, .14), 0 4px 8px -2px rgba(16, 24, 40, .06);
  --raise-lg: var(--shadow-lg);
  --raise: var(--shadow-xs);
  --ring: 0 0 0 3px rgba(49, 55, 129, .22);

  --hot: #B42318;   --hot-tint: #F9E1DE;
  --warm: #8A5A12;  --warm-tint: #F6E7CC;
  --cold: #3F4A73;  --cold-tint: #E1E5F1;
  --ok: #12703A;    --ok-tint: #DCF0E3;
  --danger: #B42318;
  color-scheme: light;

  --r-lg: 14px; --r: 12px; --r-sm: 9px; --r-xs: 7px;
  --ease: cubic-bezier(.22, .9, .24, 1);
  --fast: 160ms; --mid: 260ms;
  --side-w: 264px; --side-w-min: 84px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Telugu", "Noto Sans Tamil", "Noto Sans Kannada", "Noto Sans Devanagari", sans-serif;
  --font-brand: "Archivo", "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  background: var(--surface); color: var(--text);
  font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased;
  min-height: 100vh; overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; color: var(--text); letter-spacing: -.015em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 8px; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring) !important; }
::selection { background: var(--indigo-tint); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; }
.row.end { justify-content: flex-end; }
.stack > * + * { margin-top: 20px; }
.w-narrow { max-width: 780px; }
.inline { display: inline; }
.divided { border-top: 1px solid var(--line); }
a[aria-disabled=true] { opacity: .45; pointer-events: none; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--indigo); color: #fff; padding: 10px 14px; border-radius: var(--r-xs); transition: top var(--fast); }
.skip-link:focus { top: 12px; text-decoration: none; }
/* ------------------------------------------------------------------ brand */
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--surface); box-shadow: none; }
.brand-mark img { width: 28px; height: 28px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; white-space: nowrap; transition: opacity var(--fast), transform var(--mid) var(--ease); }
.brand-name { font-family: var(--font-brand); font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.brand-name .c { color: var(--accent); }
.brand-name .h { color: var(--brass); }
.brand-sub { font-size: 8.5px; font-weight: 650; letter-spacing: .32em; color: var(--graphite); margin-top: 4px; }
/* ------------------------------------------------------------------ soft surfaces */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--raise); position: relative; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card-head h2 { display: flex; align-items: center; gap: 9px; }
.card-head h2 svg { width: 18px; height: 18px; stroke: var(--brass-700); }
.card-body { padding: 18px 22px 22px; }
.well { border-radius: var(--r); box-shadow: none; padding: 16px 18px; }
.soft-divider { height: 1px; margin: 16px 0; background: var(--line); }
/* ------------------------------------------------------------------ buttons */
.btn {
  --b-bg: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--r-sm); border: 0;
  background: var(--b-bg); color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  box-shadow: none; position: relative; user-select: none;
  transition: box-shadow var(--fast) var(--ease), transform var(--fast) var(--ease), background var(--fast), color var(--fast);
}
.btn:hover { text-decoration: none; background: var(--surface-hi); }
.btn:active, .btn.is-pressed { transform: translateY(0); box-shadow: none; }
.btn svg { width: 17px; height: 17px; stroke: currentColor; flex: none; transition: transform var(--fast) var(--ease); }
.btn:hover svg { transform: translateX(1px); }
.btn-primary { color: #fff; background: var(--indigo); border-color: var(--indigo); }
.btn-primary:hover { background: var(--indigo-600); }
.btn-primary:active { background: var(--indigo-700); }
.btn-brass { color: #fff; background: var(--brass-600); border-color: var(--brass-600); }
.btn-brass:active { background: var(--brass-800); }
.btn-danger { color: var(--danger); }
.btn-danger.solid { color: #fff; background: #B42318; border-color: #B42318; }
.btn-ghost { box-shadow: none; background: transparent; color: var(--muted); }
.btn-ghost:hover { box-shadow: none; color: var(--text); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 12.5px; border-radius: 10px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 15px; border-radius: 15px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading svg { opacity: 0; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-color: var(--muted) transparent var(--muted) transparent; animation: spin .8s linear infinite;
}
.btn-primary.is-loading::after, .btn-brass.is-loading::after, .btn-danger.solid.is-loading::after { border-color: #fff transparent #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  width: 42px; height: 42px; border-radius: 13px; border: 0; background: var(--surface); color: var(--graphite);
  display: grid; place-items: center; cursor: pointer; box-shadow: none; position: relative; flex: none;
  transition: box-shadow var(--fast), transform var(--fast) var(--ease), color var(--fast);
}
.icon-btn:hover { color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.icon-btn:active, .icon-btn[aria-expanded=true] { box-shadow: none; transform: none; color: var(--accent); }
.icon-btn svg { width: 19px; height: 19px; stroke: currentColor; }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--hot); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
/* ------------------------------------------------------------------ badges and tags */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.hot { color: var(--hot); background: var(--hot-tint); }
.badge.warm { color: var(--warm); background: var(--warm-tint); }
.badge.cold { color: var(--cold); background: var(--cold-tint); }
.badge.none { color: var(--muted); background: rgba(91, 96, 117, .1); }
.badge.ok { color: var(--ok); background: var(--ok-tint); }
.badge.new { color: var(--accent); background: var(--indigo-tint); }
.badge.plain::before { display: none; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 8px; background: var(--surface); box-shadow: none; color: var(--graphite); font-size: 12px; font-weight: 550; white-space: nowrap; }
.tag.callback { color: var(--brass-700); }
.tag.sample { color: var(--accent); font-weight: 650; }
/* ------------------------------------------------------------------ alerts and toasts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-sm); font-size: 13.5px; margin-bottom: 16px; box-shadow: none; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; stroke: currentColor; }
.alert-ok { color: #0D5A2E; background: var(--ok-tint); }
.alert-error { color: #8F1D14; background: var(--hot-tint); }
.alert-info { color: var(--accent); background: var(--indigo-tint); }
.alert-warn { color: #6A4A12; background: var(--warm-tint); }
.alert b { font-weight: 650; }
.toasts { position: fixed; top: 18px; right: 18px; z-index: 90; display: grid; gap: 12px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 16px 16px; border-radius: var(--r);
  background: var(--surface); box-shadow: var(--raise-lg); position: relative; overflow: hidden;
  animation: toast-in var(--mid) var(--ease) both;
}
.toast.leaving { animation: toast-out 220ms var(--ease) both; }
.toast .ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; box-shadow: none; }
.toast .ico svg { width: 17px; height: 17px; stroke: currentColor; }
.toast.ok .ico { color: var(--ok); }
.toast.error .ico { color: var(--danger); }
.toast.info .ico { color: var(--accent); }
.toast .msg-text { flex: 1; padding-top: 4px; font-weight: 550; }
.toast .close { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 4px; border-radius: 8px; }
.toast .close:hover { color: var(--text); }
.toast .close svg { width: 16px; height: 16px; stroke: currentColor; }
.toast .timer { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--brass); animation: toast-timer 5s linear both; }
.toast.error .timer { background: var(--danger); }
.toast:hover .timer { animation-play-state: paused; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px) scale(.97); } }
@keyframes toast-timer { from { width: 100%; } to { width: 0; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 10px 32px 20px; flex-wrap: wrap; }
.page-head .crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.page-head .crumbs a { color: var(--muted); }
.page-head .sub { color: var(--muted); margin-top: 4px; max-width: 620px; }
.page-head .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.content { padding: 4px 32px 56px; max-width: 1320px; width: 100%; }
/* page enter animation */
.page-enter > * { animation: rise var(--mid) var(--ease) both; }
.page-enter > *:nth-child(2) { animation-delay: 40ms; }
.page-enter > *:nth-child(3) { animation-delay: 80ms; }
.page-enter > *:nth-child(4) { animation-delay: 120ms; }
.page-enter > *:nth-child(5) { animation-delay: 160ms; }
.page-enter > *:nth-child(n+6) { animation-delay: 200ms; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
/* avatar */
.avatar { width: 38px; height: 38px; border-radius: 13px; background: var(--indigo); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.avatar.brass { background: var(--brass-600); }
.avatar.soft { background: var(--surface); color: var(--accent); box-shadow: none; }
.avatar.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 11px; }
a.avatar:hover { text-decoration: none; }
/* dropdown menus */
.dropdown { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 12px); min-width: 250px; z-index: 50; padding: 8px; border-radius: var(--r);
  background: var(--surface); box-shadow: var(--raise-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.97); transform-origin: top right;
  transition: opacity var(--fast), transform var(--mid) var(--ease), visibility 0s linear var(--mid);
}
.dropdown.open .menu { opacity: 1; visibility: visible; transform: none; transition: opacity var(--fast), transform var(--mid) var(--ease), visibility 0s; }
.menu .menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .menu-head .n { font-weight: 650; }
.menu .menu-head .e { font-size: 12.5px; color: var(--muted); }
.menu a, .menu button { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; border: 0; background: none; color: var(--text); font-weight: 550; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { text-decoration: none; box-shadow: none; color: var(--accent); }
.menu svg { width: 17px; height: 17px; stroke: currentColor; flex: none; }
.menu .danger { color: var(--danger); }
.menu .empty-note { padding: 18px 12px; color: var(--muted); text-align: center; font-size: 13px; }
.menu .item-line { display: block; }
.menu .item-line .t { font-weight: 600; }
.menu .item-line .d { font-size: 12px; color: var(--muted); }
.menu.wide { min-width: 330px; }
/* dialogs (modal) */
dialog.modal {
  border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--raise-lg), 0 30px 80px rgba(20, 24, 60, .25);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
}
dialog.modal[open] { animation: pop-in var(--mid) var(--ease) both; }
dialog.modal.closing { animation: pop-out 180ms var(--ease) both; }
dialog.modal::backdrop { background: rgba(27, 30, 51, .32); backdrop-filter: blur(3px); animation: fade-in var(--mid) both; }
dialog.modal.closing::backdrop { animation: fade-out 180ms both; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 24px 4px; }
.modal-body { padding: 14px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 8px 24px 24px; flex-wrap: wrap; }
.modal-ico { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; box-shadow: none; margin-bottom: 12px; }
.modal-ico svg { width: 22px; height: 22px; stroke: currentColor; }
.modal-ico.danger { color: var(--danger); }
.modal-ico.info { color: var(--accent); }
@keyframes pop-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(29, 165, 86, 0); } }
/* ------------------------------------------------------------------ forms */
label.field { display: block; }
.field > span, .field > .lbl { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--graphite); margin-bottom: 8px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 400; }
.field .err { font-size: 12.5px; color: var(--danger); margin-top: 6px; font-weight: 550; display: flex; gap: 6px; align-items: center; }
.field .err svg { width: 14px; height: 14px; stroke: currentColor; flex: none; }
.field .opt { font-weight: 500; color: var(--faint); font-style: normal; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=tel], input[type=number], input[type=time], select, textarea {
  width: 100%; height: 46px; padding: 0 15px; border: 0; border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font-size: 14px; outline: none; box-shadow: none;
  transition: box-shadow var(--fast), background var(--fast);
  -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { background: var(--surface-hi); box-shadow: var(--ring) !important; }
input:disabled, select:disabled, textarea:disabled { color: var(--muted); cursor: not-allowed; opacity: .75; }
select { padding-right: 40px; 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='%235B6075' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; }
textarea { height: auto; padding: 12px 15px; line-height: 1.55; resize: vertical; min-height: 96px; }
textarea.code { font: 12.5px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; min-height: 520px; tab-size: 2; }
.field.invalid input, .field.invalid select, .field.invalid textarea,
.touched input:invalid, .touched select:invalid, .touched textarea:invalid { box-shadow: 0 0 0 3px rgba(180, 35, 24, .14) !important; border-color: var(--danger); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.pw-toggle { position: absolute; right: 6px; top: 6px; width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--surface); box-shadow: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-toggle:hover { color: var(--accent); }
.pw-toggle[aria-pressed=true] { box-shadow: none; color: var(--accent); }
.pw-toggle svg { width: 17px; height: 17px; stroke: currentColor; }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.strength i { height: 6px; border-radius: 4px; box-shadow: none; transition: background var(--mid); }
.strength[data-score="1"] i:nth-child(-n+1) { background: var(--hot); }
.strength[data-score="2"] i:nth-child(-n+2) { background: var(--brass); }
.strength[data-score="3"] i:nth-child(-n+3) { background: #4E9A5C; }
.strength[data-score="4"] i { background: var(--ok); }
.strength-text { font-size: 12px; color: var(--muted); margin-top: 6px; min-height: 18px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: var(--r-sm); cursor: pointer; box-shadow: none; transition: box-shadow var(--fast); }
.check:has(input:checked) { box-shadow: none; }
.check input, .radio-card input, .agree input { margin-top: 2px; accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.check .t { font-weight: 650; font-size: 13.5px; }
.check .d { font-size: 12.5px; color: var(--muted); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.radio-card { position: relative; border-radius: var(--r); padding: 16px 18px 16px 48px; cursor: pointer; box-shadow: none; transition: box-shadow var(--fast), transform var(--fast) var(--ease); }
.radio-card:hover { transform: translateY(-1px); }
.radio-card input { position: absolute; left: 18px; top: 19px; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--indigo-tint); }
.radio-card .t { font-weight: 650; }
.radio-card .d { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.switch-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; border-radius: 999px; box-shadow: none; cursor: pointer; transition: background var(--mid); }
.switch .slider::after { content: ""; position: absolute; width: 22px; height: 22px; left: 4px; top: 4px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .2); transition: transform var(--mid) var(--ease); }
.switch input:checked + .slider { background: linear-gradient(145deg, #353C8C, var(--indigo)); }
.switch input:checked + .slider::after { transform: translateX(22px); }
.switch input:focus-visible + .slider { box-shadow: var(--ring); }
table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
th { text-align: left; font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; padding: 6px 14px; white-space: nowrap; }
td { padding: 13px 14px; vertical-align: middle; background: var(--surface); transition: background var(--fast); }
tbody tr td:first-child { border-radius: 14px 0 0 14px; }
tbody tr td:last-child { border-radius: 0 14px 14px 0; }
tbody tr { transition: transform var(--fast) var(--ease), filter var(--fast); }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: var(--surface-hi); }
td .primary { font-weight: 650; color: var(--text); }
td .secondary { font-size: 12.5px; color: var(--muted); }
td.summary { width: 30%; max-width: 0; }
td.summary div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--graphite); }
td.course { min-width: 150px; }
.empty { padding: 56px 24px; text-align: center; color: var(--muted); }
.empty .ico { width: 70px; height: 70px; border-radius: 24px; margin: 0 auto 16px; display: grid; place-items: center; box-shadow: none; color: var(--brass-700); }
.empty .ico svg { width: 30px; height: 30px; stroke: currentColor; }
.empty b { color: var(--text); font-size: 15px; }
.empty .row { margin-top: 18px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 12px 14px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; word-break: break-word; }
.msg { display: flex; gap: 10px; max-width: 84%; }
.msg .bubble { padding: 11px 15px; border-radius: 16px; font-size: 14px; line-height: 1.6; transition: box-shadow var(--mid); }
.msg .who-tag { font-size: 11.5px; color: var(--muted); margin: 0 4px 4px; font-weight: 600; }
.msg.agent .bubble { box-shadow: none; border-top-left-radius: 5px; }
.msg.caller { align-self: flex-end; flex-direction: row-reverse; }
.msg.caller .bubble { box-shadow: none; border-top-right-radius: 5px; }
.msg.caller .who-tag { text-align: right; }
.msg.playing .bubble { box-shadow: 0 0 0 2px var(--brass); }
audio { width: 100%; height: 44px; border-radius: 22px; }
.faq { padding: 18px 20px; }
.faq summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { width: 18px; height: 18px; stroke: var(--muted); transition: transform var(--mid) var(--ease); flex: none; }
.faq[open] summary svg { transform: rotate(180deg); }
.faq .a { color: var(--graphite); margin-top: 10px; white-space: pre-wrap; }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.industry-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.industry-pick label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px 12px; border-radius: 14px; box-shadow: none; cursor: pointer; text-align: center; font-size: 12.5px; font-weight: 650; color: var(--graphite); transition: box-shadow var(--fast), transform var(--fast) var(--ease), color var(--fast); }
.industry-pick label:hover { transform: translateY(-1px); color: var(--accent); }
.industry-pick input { position: absolute; opacity: 0; pointer-events: none; }
.industry-pick svg { width: 22px; height: 22px; stroke: currentColor; }
.industry-pick label:has(input:checked) { border-color: var(--accent); background: var(--indigo-tint); color: var(--accent); }
.industry-pick label:has(input:focus-visible) { box-shadow: var(--ring); }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.legend { font-size: 12.5px; font-weight: 650; color: var(--graphite); margin-bottom: 10px; padding: 0; }
.field.invalid .industry-pick label { border-color: var(--danger); }
.left { text-align: left !important; }
/* error page */
.error-page { min-height: 80vh; display: grid; place-items: center; text-align: center; padding: 40px 20px; }
.error-page .brand-mark { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 20px; }
.error-page .brand-mark img { width: 44px; height: 44px; }
@media (max-width: 900px) {
  .page-head { padding: 6px 16px 16px; }
  .content { padding: 0 16px 40px; }
  .form-grid, .checks, .radio-cards, .settings-grid { grid-template-columns: 1fr; }
  td, th { padding-left: 10px; padding-right: 10px; }
  .msg { max-width: 94%; }
}
.show-xs { display: none; }
.show-xs:empty { display: none !important; }
@media (max-width: 600px) {
  td .tag { white-space: normal; height: auto; min-height: 24px; padding: 3px 9px; }
  td.nowrap:has(.tag) { white-space: normal; }
  .hide-xs { display: none; }
  .show-xs { display: block; }
  .industry-pick { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 21px; }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 14px 16px 18px; }
  .kv { grid-template-columns: 110px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}

/* ================================================================== Colours, borders and states */
/* CleverHive minimal theme: flat surfaces, thin borders, one accent. Loaded after app.css.
   Shadows only on floating layers (menus, dialogs, toasts). Every state has a visible border or fill, not just a shadow.
   One light theme on a white background (there is no dark mode). */
body { background: var(--bg); }
::selection { background: var(--indigo-tint); }
/* ------------------------------------------------------------------ surfaces */
.card { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs); border-radius: var(--r-lg); }
.card-head { padding: 16px 20px 0; }
.card-head h2 svg { stroke: var(--faint); }
.card-body { padding: 16px 20px 20px; }
.well { background: var(--surface-hi); border: 1px solid var(--border); box-shadow: none; }
.soft-divider { background: var(--line); }
/* ------------------------------------------------------------------ buttons */
.btn {
  height: 38px; padding: 0 14px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-xs); border-radius: var(--r-sm); font-weight: 600;
}
.btn:hover { transform: none; background: var(--surface-hi); box-shadow: var(--shadow-xs); }
.btn:active, .btn.is-pressed { background: var(--subtle); box-shadow: none; }
.btn:hover svg { transform: none; }
.btn-primary { background: var(--indigo); border-color: var(--indigo); color: #fff; box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--indigo-600); border-color: var(--indigo-600); }
.btn-primary:active { background: var(--indigo-700); box-shadow: none; }
.btn-brass { background: var(--brass-600); border-color: var(--brass-600); color: #fff; box-shadow: var(--shadow-xs); }
.btn-brass:hover { background: var(--brass-700); border-color: var(--brass-700); }
.btn-brass:active { background: var(--brass-800); box-shadow: none; }
.btn-danger { color: var(--danger); border-color: var(--border-strong); }
.btn-danger:hover { background: var(--hot-tint); border-color: var(--hot); }
.btn-danger.solid { background: #B42318; border-color: #B42318; color: #fff; }
.btn-danger.solid:hover { background: #9A1D14; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: var(--subtle); box-shadow: none; color: var(--text); }
.btn-sm { height: 32px; padding: 0 11px; border-radius: var(--r-xs); }
.btn-lg { height: 46px; padding: 0 22px; border-radius: var(--r-sm); }
.btn[disabled], .btn.disabled { background: var(--subtle); box-shadow: none; }
.icon-btn { width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); box-shadow: none; color: var(--muted); }
.icon-btn:hover { transform: none; background: var(--surface-hi); color: var(--text); }
.icon-btn:active, .icon-btn[aria-expanded=true] { background: var(--subtle); color: var(--text); box-shadow: none; }
.icon-btn .dot { box-shadow: 0 0 0 2px var(--surface); }
/* ------------------------------------------------------------------ small parts */
.tag { background: var(--subtle); box-shadow: none; border-radius: 6px; color: var(--graphite); }
.tag.callback { background: var(--warm-tint); color: var(--brass-700); }
.tag.sample { background: var(--indigo-tint); color: var(--accent); }
.alert { box-shadow: none; border: 1px solid transparent; border-radius: var(--r-sm); color: var(--text); }
.alert-ok { background: var(--ok-tint); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-error { background: var(--hot-tint); border-color: color-mix(in srgb, var(--hot) 25%, transparent); }
.alert-info { background: var(--indigo-tint); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.alert-warn { background: var(--warm-tint); border-color: color-mix(in srgb, var(--warm) 25%, transparent); }
.alert-ok svg { color: var(--ok); }
.alert-error svg { color: var(--danger); }
.alert-info svg { color: var(--accent); }
.alert-warn svg { color: var(--brass-700); }
.toast { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: var(--r); }
.toast .ico { box-shadow: none; background: var(--subtle); }
.toast.ok .ico { background: var(--ok-tint); }
.toast.error .ico { background: var(--hot-tint); }
.toast.info .ico { background: var(--indigo-tint); }
kbd, .side-search kbd, .global-search kbd, kbd.key { box-shadow: none; border: 1px solid var(--border); background: var(--surface-hi); }
.avatar { box-shadow: none; border-radius: 10px; }
.avatar.brass { background: var(--brass-600); box-shadow: none; }
.avatar.soft { background: var(--indigo-tint); color: var(--accent); box-shadow: none; }
.brand-mark { box-shadow: none; border: 1px solid var(--border); background: #fff; border-radius: 10px; width: 36px; height: 36px; }
.brand-mark img { width: 24px; height: 24px; }
.page-head { padding: 22px 24px 16px; }
.content { padding: 4px 24px 48px; }
/* menus and dialogs float */
.menu { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: var(--r); padding: 6px; top: calc(100% + 8px); }
.menu .menu-head { border-bottom-color: var(--line); }
.menu a, .menu button { border-radius: 8px; padding: 9px 10px; }
.menu a:hover, .menu button:hover { box-shadow: none; background: var(--subtle); color: var(--text); }
dialog.modal { border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-lg); border-radius: 16px; }
dialog.modal::backdrop { background: rgba(16, 24, 40, .45); backdrop-filter: none; }
.modal-ico { box-shadow: none; background: var(--subtle); border-radius: 12px; }
.modal-ico.danger { background: var(--hot-tint); }
.modal-ico.info { background: var(--indigo-tint); }
/* ------------------------------------------------------------------ forms */
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=tel], input[type=number], input[type=time], select, textarea {
  height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow-xs); border-radius: var(--r-sm); color: var(--text);
}
textarea { height: auto; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { background: var(--surface); border-color: var(--accent); box-shadow: var(--ring) !important; }
input:disabled, select:disabled, textarea:disabled { background: var(--subtle); }
.field.invalid input, .field.invalid select, .field.invalid textarea,
.touched input:invalid, .touched select:invalid, .touched textarea:invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(180, 35, 24, .14) !important; }
.pw-toggle { top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 7px; box-shadow: none; background: transparent; }
.pw-toggle:hover { background: var(--subtle); }
.pw-toggle[aria-pressed=true] { box-shadow: none; background: var(--indigo-tint); color: var(--accent); }
.strength i { box-shadow: none; background: var(--subtle); }
.check, .radio-card, .industry-pick label, .voice-pick label, .mode-pick label {
  border: 1px solid var(--border); background: var(--surface); box-shadow: none; transition: border-color var(--fast), background var(--fast);
}
.check:hover, .radio-card:hover, .industry-pick label:hover, .voice-pick label:hover, .mode-pick label:hover { transform: none; border-color: var(--border-strong); background: var(--surface-hi); }
.check:has(input:checked), .radio-card:has(input:checked), .industry-pick label:has(input:checked), .voice-pick label:has(input:checked), .mode-pick label:has(input:checked) {
  border-color: var(--accent); background: var(--indigo-tint); box-shadow: 0 0 0 1px var(--accent) inset; transform: none;
}
.industry-pick label:has(input:focus-visible), .voice-pick label:has(input:focus-visible), .mode-pick label:has(input:focus-visible) { box-shadow: var(--ring); }
.field.invalid .industry-pick label { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); box-shadow: none; }
.switch .slider { box-shadow: none; background: var(--border-strong); }
.switch .slider::after { background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .2); }
.switch input:checked + .slider { background: var(--indigo); }
.switch input:focus-visible + .slider { box-shadow: var(--ring); }
table { border-collapse: collapse; border-spacing: 0; }
th { padding: 10px 16px; background: var(--surface-hi); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--faint); font-size: 11px; }
td { padding: 12px 16px; background: transparent; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr td:first-child, tbody tr td:last-child { border-radius: 0; }
tbody tr.link:hover { transform: none; filter: none; }
tbody tr.link:hover td { background: var(--surface-hi); }
.empty .ico { box-shadow: none; background: var(--subtle); border-radius: 14px; width: 56px; height: 56px; color: var(--faint); }
.empty .ico svg { width: 24px; height: 24px; }
.msg.agent .bubble { box-shadow: none; background: var(--subtle); }
.msg.caller .bubble { box-shadow: none; background: var(--indigo-tint); }
.msg.playing .bubble { box-shadow: 0 0 0 2px var(--brass); }
/* knowledge and cards that link */
.item-card:hover, .tpl:hover, .emp:hover, .industry:hover { transform: none; box-shadow: var(--shadow-xs); border-color: var(--border-strong); }
.faq { padding: 16px 18px; }
.voice-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.voice-pick label, .mode-pick label { position: relative; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
/* The invisible radio covers its whole card and takes the click itself, so a card is selectable wherever it is pressed. */
.voice-pick input, .mode-pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.voice-pick label, .mode-pick label { user-select: none; }
.stack > fieldset.field.plain { margin-top: 20px; }
.voice-pick label:has(input:checked)::after { content: ""; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.voice-pick .av { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-weight: 750; font-size: 12px; background: var(--subtle); color: var(--accent); flex: none; }
.voice-pick .t { font-weight: 650; font-size: 13px; }
.voice-pick .d { font-size: 11.5px; color: var(--muted); }
kbd.key { font: 600 12px ui-monospace, Consolas, monospace; padding: 2px 6px; border-radius: 6px; }
@keyframes ring { from { transform: scale(.9); opacity: .5; } to { transform: scale(1.25); opacity: 0; } }
.error-page .brand-mark { width: 60px; height: 60px; border-radius: 14px; }
.error-page .brand-mark img { width: 36px; height: 36px; }
/* ------------------------------------------------------------------ calm motion: keep it short and subtle */
.page-enter > * { animation-duration: 200ms; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
@media (max-width: 900px) {
  .page-head { padding: 16px 16px 14px; }
  .content { padding: 0 16px 40px; }
}
@keyframes guide-dots { 50% { opacity: .35; } }
.faq { max-width: 820px; margin: 0 auto; }
.faq details { padding: 16px 20px; margin-top: 12px; }
.faq summary { cursor: pointer; font-weight: 650; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) {
  .price-grid, .ind-grid, .grid-2, .foot-grid { grid-template-columns: 1fr; }
}
.center { text-align: center; }

/* ------------------------------------------------------------------ voice picker: hear 20 voices, choose one, name it */
.vp { display: grid; gap: 14px; }
.vp-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.vp-filter, .vp-langs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vp-filter[hidden], .vp-langs[hidden], .vp-play[hidden], .vp-card[hidden] { display: none; }
.vp-filter button, .vp-langs button { height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color var(--fast), color var(--fast), border-color var(--fast); }
.vp-filter button span { margin-left: 4px; font-size: 11.5px; font-weight: 600; opacity: .7; }
.vp-filter button:hover, .vp-langs button:hover { color: var(--text); border-color: var(--border-strong); }
.vp-filter button[aria-pressed="true"], .vp-langs button[aria-pressed="true"] { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.vp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.vp-card { position: relative; display: flex; align-items: center; gap: 11px; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; user-select: none; transition: border-color var(--fast), background-color var(--fast), box-shadow var(--fast); }
.vp-card:hover { border-color: var(--border-strong); background: var(--surface-hi); }
.vp-card input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.vp-card:has(input:checked) { border-color: var(--indigo); background: var(--indigo-tint); box-shadow: 0 0 0 1px var(--indigo); }
.vp-card:has(input:focus-visible) { box-shadow: var(--ring); }
.vp-av { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; font-size: 15px; background: linear-gradient(145deg, var(--indigo-600), var(--indigo)); }
.vp-f .vp-av { background: linear-gradient(145deg, var(--brass-600), var(--brass-700)); }
.vp-meta { min-width: 0; flex: 1; display: grid; line-height: 1.25; }
.vp-meta b { font-size: 14px; font-weight: 650; }
.vp-meta small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-tier { position: absolute; top: -8px; left: 12px; padding: 1px 8px; border-radius: 999px; background: var(--brass-tint); color: var(--brass-700); font-size: 10.5px; font-weight: 750; letter-spacing: .02em; }
.vp-play { position: relative; z-index: 2; width: 34px; height: 34px; flex: none; display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--accent); cursor: pointer; transition: background-color var(--fast), color var(--fast), transform var(--fast) var(--ease); }
.vp-play svg { width: 14px; height: 14px; stroke: currentColor; fill: currentColor; }
.vp-play:hover { background: var(--indigo); color: #fff; transform: scale(1.06); }
.vp-play.playing { background: var(--brass-600); border-color: var(--brass-600); color: #fff; animation: vp-pulse 1s ease-in-out infinite; }
@keyframes vp-pulse { 50% { box-shadow: 0 0 0 5px rgba(196, 154, 82, .28); } }
@media (prefers-reduced-motion: reduce) { .vp-play.playing { animation: none; } }
.vp-name { max-width: 420px; }
