/* Henia Vault web app. Dark, glass, gradient accent. Logical properties only, so RTL mirrors. */

:root {
  --bg: #050b14;
  --text: #eaf2f7;
  --muted: rgba(234, 242, 247, .68);
  --dim: rgba(234, 242, 247, .6);
  --faint: rgba(234, 242, 247, .56);
  --ink: #04121c;
  --blue: #7fb3ff;
  --blue-soft: #a9c8ff;
  --green: #5fe0b4;
  --green-soft: #7ff0c8;
  --mint: #c9f5e6;
  --amber: #ffd27a;
  --red: #ff9a9a;
  --violet: #c6c0ff;
  --grad: linear-gradient(120deg, #4d8dff, #2fd3a0);
  --grad-text: linear-gradient(100deg, #7fb3ff, #5fe0b4);
  --glass: rgba(255, 255, 255, .05);
  --glass-2: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .1);
  --line-soft: rgba(255, 255, 255, .07);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: Geist, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --tabbar-h: 64px;
  color-scheme: dark;
}
:root[lang="he"] { --font: Assistant, Geist, system-ui, -apple-system, "Segoe UI", sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 700px at 15% 10%, rgba(61, 123, 255, .22), transparent 60%),
    radial-gradient(900px 600px at 90% 90%, rgba(47, 211, 160, .16), transparent 60%),
    var(--bg);
  overflow: hidden;
}
a { color: var(--blue); }
a:hover { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
::selection { background: rgba(47, 211, 160, .35); }
h1, h2, p { margin: 0; }
.mono { font-family: var(--mono); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.noscript { padding: 24px; }

@keyframes hRise { from { opacity: 0; transform: translateY(18px) scale(.985); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes hFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(24px, -18px) scale(1.08); } 100% { transform: translate(0, 0) scale(1); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

.anim, .anim-rise { animation: hRise .6s var(--ease) both; }
.stagger { animation: hRise .6s var(--ease) both; }
.pulse { animation: pulse 1.6s infinite; }

/* ------------------------------------------------------------------ layout */
:root[dir="rtl"] .stage { flex-direction: row-reverse; } /* agent panel stays on the right */
.stage { height: 100vh; height: 100dvh; display: flex; justify-content: center; align-items: stretch; gap: 40px; }
.phone {
  position: relative; width: 100%; height: 100vh; height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #071524 0%, #06101c 55%, #051712 100%);
}
@media (min-width: 600px) {
  .phone { max-width: 480px; border-inline: 1px solid var(--line-soft); }
}
@media (min-width: 1100px) {
  .stage { align-items: center; padding: 24px; }
  .phone {
    width: 420px; max-width: 420px; height: min(900px, calc(100dvh - 48px)); flex: none;
    border-radius: 44px; border: 1px solid var(--line);
    box-shadow: 0 50px 100px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .04) inset;
  }
}

.orbs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.orb-wrap { position: absolute; transition: transform 2s var(--ease); }
.orb-wrap-a { width: 640px; height: 640px; inset-inline-start: -260px; top: -240px; }
.orb-wrap-b { width: 620px; height: 620px; inset-inline-end: -300px; bottom: -160px; }
.orb { width: 100%; height: 100%; border-radius: 50%; filter: blur(60px); }
.orb-a { background: radial-gradient(circle, rgba(61, 123, 255, .38), rgba(61, 123, 255, .14) 40%, transparent 70%); animation: drift 16s ease-in-out infinite; }
.orb-b { background: radial-gradient(circle, rgba(47, 211, 160, .32), rgba(47, 211, 160, .12) 40%, transparent 70%); animation: drift 20s ease-in-out infinite reverse; }
.orb-c { position: absolute; width: 520px; height: 520px; inset-inline-start: -60px; top: 260px; background: radial-gradient(circle, rgba(56, 170, 220, .16), transparent 70%); filter: blur(70px); animation: drift 24s ease-in-out -8s infinite; }

.topbar { position: relative; z-index: 2; flex: none; display: flex; align-items: center; }
.topbar-onb { gap: 14px; padding: max(14px, env(safe-area-inset-top)) 24px 10px; }
.topbar-app { justify-content: space-between; padding: max(14px, env(safe-area-inset-top)) 22px 8px; }
.dots { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dot-step { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); transition: background .6s; }
.dot-step.on { background: var(--grad); }
.icon-btn {
  position: relative; width: 36px; height: 36px; flex: none; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; text-decoration: none;
}
.icon-btn:hover { background: rgba(255, 255, 255, .12); color: var(--text); }
.icon-btn::after { content: ""; position: absolute; inset: -4px; }
.version-pill { font-size: 11px; font-family: var(--mono); padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); color: rgba(234, 242, 247, .82); }

.scroll { position: relative; z-index: 2; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; overscroll-behavior: contain; }
.screen-host { flex: 1; display: flex; flex-direction: column; min-height: 100%; }
.boot { flex: 1; display: flex; align-items: center; justify-content: center; }

.screen { flex: 1; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.screen-onb { padding: 14px 26px max(30px, env(safe-area-inset-bottom)); }
.screen-app { padding: 10px 20px calc(var(--tabbar-h) + 46px + env(safe-area-inset-bottom)); gap: 18px; }
.screen.welcome { padding-top: max(20px, env(safe-area-inset-top)); }
.grow { flex: 1; min-height: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.stack-xs { display: flex; flex-direction: column; gap: 6px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.center { text-align: center; }
.pad { padding-inline: 4px; }

/* ------------------------------------------------------------------ type */
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.brand-sm { gap: 9px; }
.logo { width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(from 200deg, #3d7bff, #2fd3a0, #3d7bff); flex: none; }
.brand-sm .logo { width: 20px; height: 20px; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--blue); }
.tone-green, .eyebrow.tone-green { color: var(--green); }
.tone-blue { color: var(--blue); }
.tone-red { color: var(--red); }
.tone-amber { color: var(--amber); }
.tone-muted { color: var(--faint); }
.title { font-size: 31px; line-height: 1.08; font-weight: 600; letter-spacing: -.025em; text-wrap: pretty; }
.title-tab { font-size: 30px; padding-inline: 4px; }
.title-detail { font-size: 28px; line-height: 1.1; }
.display { font-size: 38px; line-height: 1.04; font-weight: 600; letter-spacing: -.03em; text-wrap: pretty; margin-block-end: -4px; }
:root[lang="he"] .display, :root[lang="he"] .title { letter-spacing: 0; line-height: 1.12; }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 15px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.lead-sm { font-size: 14px; }
.fineprint { font-size: 12px; line-height: 1.5; color: var(--faint); }
.subtitle { font-size: 14px; color: var(--muted); }
.unit { color: var(--faint); font-weight: 400; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------------ buttons */
.btn {
  position: relative; width: 100%; min-height: 56px; border-radius: 999px; border: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 22px;
  font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
  transition: filter .2s, background .2s, opacity .3s, transform .1s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled, .btn.is-dim { opacity: .4; cursor: default; }
.btn-primary { background: var(--grad); color: var(--ink); box-shadow: 0 14px 30px -12px rgba(47, 211, 160, .6); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); color: var(--ink); }
.btn-secondary { min-height: 52px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: var(--text); font-size: 15px; font-weight: 500; }
.btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, .1); color: var(--text); }
.btn-white { background: #f4f7fa; color: var(--ink); }
.btn-white:hover { background: #fff; color: var(--ink); }
.btn-danger { color: #ffb4b4; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(4, 18, 28, .3); border-top-color: var(--ink); animation: spin .8s linear infinite; flex: none; }
.spinner-light { border-color: rgba(234, 242, 247, .2); border-top-color: var(--green); }

.pill {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: all .3s;
}
.pill::after { content: ""; position: absolute; inset: -5px -2px; } /* 44px touch target */
.pill-ghost { border: 1px solid rgba(255, 255, 255, .18); background: transparent; color: rgba(234, 242, 247, .86); font-weight: 500; }
.pill-ghost:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.pill-soft { border: 0; background: rgba(255, 255, 255, .1); color: var(--text); }
.pill-grad { border: 0; background: var(--grad); color: var(--ink); }
.pill-warn { border: 1px solid rgba(255, 154, 154, .4); background: rgba(255, 120, 120, .12); color: #ffc0c0; }
.pill-xs { min-height: 30px; padding: 0 11px; font-size: 11px; }
.pill-xs::after { inset: -7px -2px; }
.back { align-self: flex-start; min-height: 36px; font-size: 13px; color: var(--text); background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); }
:root[dir="rtl"] .flip { display: inline-block; transform: scaleX(-1); }

/* ------------------------------------------------------------------ cards and rows */
.card { border-radius: 24px; background: var(--glass); border: 1px solid var(--line); }
.card.soft { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .08); border-radius: 22px; }
.pad-card { padding: 16px; }
.list-card { padding: 4px 16px; }
.list-card > .row:not(:last-child), .list-flat > .row:not(:last-child) { border-block-end: 1px solid var(--line-soft); }
.list-flat > .row { border-block-start: 1px solid var(--line-soft); }
.empty { padding: 18px; font-size: 14px; line-height: 1.5; color: var(--dim); }
.empty.dashed { background: rgba(255, 255, 255, .03); border-style: dashed; border-color: rgba(255, 255, 255, .16); }

.row {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; min-height: 52px; text-align: start; background: transparent; border: 0; color: var(--text);
}
.row-switch { cursor: pointer; }
.row-switch:disabled { opacity: .5; cursor: default; }
.row-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row-label { font-size: 15px; font-weight: 500; }
.row-label.strong { font-weight: 600; }
.row-sub { font-size: 12px; color: var(--faint); line-height: 1.4; }
.row-sub.mono { font-size: 11px; }

.switch { flex: none; width: 48px; height: 28px; border-radius: 999px; background: rgba(255, 255, 255, .14); position: relative; transition: background .3s; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .3s var(--ease); }
.switch.on { background: var(--grad); }
.switch.on::after { transform: translateX(20px); }
:root[dir="rtl"] .switch.on::after { transform: translateX(-20px); }

.chip { flex: none; display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; align-self: center; }
.chip-blue { background: rgba(77, 141, 255, .18); color: var(--blue-soft); }
.chip-green { background: rgba(47, 211, 160, .16); color: var(--green-soft); }
.chip-amber { background: rgba(255, 196, 90, .16); color: var(--amber); }
.chip-violet { background: rgba(160, 150, 255, .18); color: var(--violet); }
.chip-red { background: rgba(255, 110, 110, .18); color: #ffb0b0; }
.chip-gray { background: rgba(255, 255, 255, .09); color: rgba(234, 242, 247, .74); }
.chips { display: flex; gap: 6px; align-items: center; }
.chips.wrap { flex-wrap: wrap; }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot-green { background: var(--green); } .dot-blue { background: var(--blue); } .dot-amber { background: var(--amber); }
.dot-red { background: #ff7a7a; } .dot-gray { background: rgba(234, 242, 247, .4); }
.dot.glow.dot-green { box-shadow: 0 0 10px var(--green); } .dot.glow.dot-blue { box-shadow: 0 0 10px var(--blue); }
.dot.glow.dot-amber { box-shadow: 0 0 10px var(--amber); } .dot.glow.dot-red { box-shadow: 0 0 10px #ff7a7a; }

.notice { border-radius: 20px; padding: 14px 16px; font-size: 14px; line-height: 1.45; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.notice-ok { background: rgba(47, 211, 160, .1); border: 1px solid rgba(95, 224, 180, .28); color: var(--mint); }
.notice-muted { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); color: var(--muted); }
.notice-error { background: rgba(255, 110, 110, .1); border: 1px solid rgba(255, 140, 140, .35); color: #ffc9c9; }
.notice-info { background: linear-gradient(120deg, rgba(61, 123, 255, .2), rgba(47, 211, 160, .16)); border: 1px solid rgba(127, 179, 255, .25); color: var(--text); justify-content: flex-start; align-items: flex-start; }
.notice-amber-soft { background: rgba(255, 196, 90, .07); border: 1px solid rgba(255, 210, 122, .2); color: rgba(255, 230, 180, .92); font-size: 13px; justify-content: flex-start; padding: 12px 14px; border-radius: 18px; }
.notice-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .14); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; font-family: var(--mono); }
.field-error { font-size: 13px; color: #ffb4b4; padding: 2px 4px; }
.loading { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--dim); padding: 14px 4px; }

.section { display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; gap: 10px; }
.section-head h2 { font-size: 13px; font-weight: 600; }
.section-head .aside { font-size: 11px; color: var(--faint); }

/* ------------------------------------------------------------------ inputs */
.field { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--muted); }
.input {
  width: 100%; min-height: 48px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06); padding: 0 14px; font-size: 16px; color: var(--text);
}
.input::placeholder { color: rgba(234, 242, 247, .38); }
.input:focus { border-color: rgba(95, 224, 180, .6); }
.input-lg { min-height: 54px; border-radius: 18px; padding: 0 16px; font-size: 20px; font-weight: 500; }
.textarea { padding: 12px 14px; resize: vertical; min-height: 88px; line-height: 1.45; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, rgba(234, 242, 247, .6) 50%), linear-gradient(135deg, rgba(234, 242, 247, .6) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
:root[dir="rtl"] select.input { background-position: 15px 50%, 20px 50%; }
select.input option { background: #0b1826; color: var(--text); }
input[type="date"].input { color-scheme: dark; }

.segmented { display: grid; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.seg-4 { grid-template-columns: repeat(4, 1fr); }
.seg-2 { grid-template-columns: repeat(2, 1fr); }
.seg { min-height: 40px; border-radius: 999px; border: 0; background: transparent; color: rgba(234, 242, 247, .78); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .3s; }
.seg.on { background: var(--grad); color: var(--ink); }
.seg:hover:not(.on) { color: var(--text); background: rgba(255, 255, 255, .05); }

/* ------------------------------------------------------------------ welcome */
.hero { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 250px; }
.hero-stack { position: relative; width: 250px; height: 230px; }
.float-card { position: absolute; padding: 14px 16px; border-radius: 22px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: floaty 7s ease-in-out infinite; }
.float-k { font-size: 11px; }
.float-v { font-size: 15px; font-weight: 600; margin-block-start: 2px; }
.fc-memory { inset-inline-start: 0; top: 0; width: 190px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.fc-memory .float-k { color: var(--dim); }
.fc-state { inset-inline-start: 40px; top: 78px; width: 190px; background: rgba(61, 123, 255, .14); border: 1px solid rgba(127, 179, 255, .3); animation-delay: -2.3s; }
.fc-state .float-k { color: var(--blue-soft); }
.fc-plan { inset-inline-start: 70px; top: 156px; width: 180px; background: linear-gradient(120deg, rgba(61, 123, 255, .35), rgba(47, 211, 160, .35)); border: 1px solid rgba(95, 224, 180, .45); animation-delay: -4.6s; box-shadow: 0 20px 40px -20px rgba(47, 211, 160, .6); }
.fc-plan .float-k { color: var(--mint); }

/* ------------------------------------------------------------------ sign in */
.sep-diagram { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.sep-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .05); }
.sep-vault { background: linear-gradient(120deg, rgba(61, 123, 255, .18), rgba(47, 211, 160, .18)); }
.sep-k { font-size: 13px; color: var(--muted); }
.sep-vault .sep-k { color: rgba(234, 242, 247, .85); }
.sep-v { font-size: 12px; }
.sep-link { display: flex; align-items: center; gap: 10px; padding-inline-start: 14px; font-size: 12px; color: var(--green); }
.sep-line { width: 2px; height: 22px; border-radius: 2px; background: linear-gradient(#7fb3ff, #5fe0b4); }
.dev-form { padding: 16px; }
.dev-head { display: flex; align-items: center; gap: 10px; }

/* ------------------------------------------------------------------ consent */
.consent-item {
  display: flex; gap: 14px; align-items: flex-start; text-align: start; border-radius: 20px; padding: 16px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--line); color: var(--text); transition: all .3s;
}
.consent-item.on { background: rgba(47, 211, 160, .08); border-color: rgba(95, 224, 180, .35); }
.check { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); color: var(--ink); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; transition: background .3s; }
.consent-item.on .check { background: var(--grad); }
.consent-title { font-size: 15px; font-weight: 600; }
.consent-body { font-size: 13px; line-height: 1.45; color: var(--dim); }

/* ------------------------------------------------------------------ documents */
.consent-card { padding: 2px 16px; }
.consent-card.is-on { background: rgba(47, 211, 160, .06); border-color: rgba(95, 224, 180, .28); }
.consent-card .row-label { font-size: 14px; font-weight: 600; }
.doc-row { align-items: center; }
.doc-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.doc-ext { flex: none; width: 34px; height: 34px; border-radius: 12px; background: rgba(255, 255, 255, .08); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: var(--blue-soft); }
.doc-row .row-label { font-size: 14px; }
.doc-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.doc-status { font-size: 12px; font-weight: 500; }
.doc-status.tone-green { color: var(--green); }
.doc-status.tone-blue { color: var(--blue-soft); }
.doc-status.tone-red { color: #ffb0b0; }
.doc-actions { display: flex; gap: 6px; }

/* ------------------------------------------------------------------ review */
.review-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; border-radius: 20px; transition: all .3s; }
.review-card.is-flagged { border-color: rgba(255, 210, 122, .35); }
.review-card.is-confirmed { background: rgba(47, 211, 160, .08); border-color: rgba(95, 224, 180, .35); }
.review-card.is-rejected { opacity: .75; }
.review-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.review-label { font-size: 15px; font-weight: 600; }
.review-kind { flex: none; font-size: 11px; color: var(--faint); }
.flag-text { font-size: 12px; color: var(--amber); line-height: 1.4; }
.review-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-block-start: 2px; }

/* ------------------------------------------------------------------ compile */
.funnel { padding: 8px 18px; }
.funnel-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; opacity: .3; transition: opacity .5s; }
.funnel-row.on { opacity: 1; }
.funnel-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.funnel-label { font-size: 13px; color: rgba(234, 242, 247, .75); }
.funnel-n { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.bar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, #4d8dff, #2fd3a0); transition: width 1s var(--ease); }
:root[dir="rtl"] .bar-fill { background: linear-gradient(270deg, #4d8dff, #2fd3a0); }

/* ------------------------------------------------------------------ pair */
.mcp-url { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mcp-v { font-size: 12px; word-break: break-all; color: rgba(234, 242, 247, .9); }
.steps-card { padding: 14px 16px; }
.steps-head { font-size: 13px; font-weight: 600; color: var(--blue); margin-block-end: 6px; }
.steps { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.45; color: rgba(234, 242, 247, .82); }
.instruction { border-radius: 18px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(95, 224, 180, .3); padding: 14px; font-family: var(--mono); font-size: 11px; line-height: 1.6; color: rgba(234, 242, 247, .86); word-break: break-word; }
.instruction bdi { display: block; text-align: left; }
.instruction-ok { color: var(--green); margin-block-start: 6px; font-family: var(--font); font-size: 12px; }

/* ------------------------------------------------------------------ app: now */
.hero-card {
  border-radius: 28px; padding: 20px; display: flex; gap: 18px; align-items: center;
  background: linear-gradient(135deg, rgba(61, 123, 255, .28), rgba(47, 211, 160, .18));
  border: 1px solid rgba(127, 179, 255, .25); box-shadow: 0 20px 50px -25px rgba(61, 123, 255, .6);
}
.ring { position: relative; width: 88px; height: 88px; flex: none; }
.ring-svg { transform: rotate(-90deg); display: block; }
:root[dir="rtl"] .ring-svg { transform: rotate(-90deg) scaleY(-1); }
.ring-arc { transition: stroke-dasharray 1s var(--ease); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-n { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.ring-of { font-size: 10px; color: var(--muted); margin-block-start: 2px; }
.hero-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hero-title { font-size: 22px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; text-wrap: pretty; }
.hero-sub { font-size: 12px; color: var(--muted); line-height: 1.4; }

.dcard {
  display: flex; align-items: center; gap: 14px; text-align: start; border-radius: 22px; padding: 14px 16px; min-height: 68px;
  background: rgba(255, 255, 255, .055); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: background .25s, transform .25s;
}
.dcard:hover { background: rgba(255, 255, 255, .09); transform: translateY(-1px); color: var(--text); }
.dcard-alert { background: linear-gradient(120deg, rgba(255, 110, 90, .2), rgba(255, 196, 90, .12)); border-color: rgba(255, 150, 120, .45); }
.dcard-alert:hover { background: linear-gradient(120deg, rgba(255, 110, 90, .28), rgba(255, 196, 90, .16)); }
.dglyph { flex: none; width: 40px; height: 40px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--ink); font-weight: 700; }
.g-blue { background: linear-gradient(135deg, #4d8dff, #7fb3ff); }
.g-green { background: linear-gradient(135deg, #2fd3a0, #7ff0c8); }
.g-alert { background: linear-gradient(135deg, #ff7a6a, #ffc45a); }
.dcard .row-text { flex: 1; }
.dtitle { font-size: 15px; font-weight: 600; }
.dsub { font-size: 12px; color: var(--dim); }
.chev { flex: none; color: rgba(234, 242, 247, .45); font-size: 18px; }

.mon-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: start; }
.mon-row .chip { align-self: start; padding: 3px 9px; }
.mon-cadence { grid-column: 1 / -1; }
.mon-row .row-label { font-size: 14px; }

.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.stat { border-radius: 18px; padding: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); }
.stat-n { font-size: 20px; font-weight: 600; }
.stat-l { font-size: 11px; color: var(--faint); }

/* directive detail */
.why-card { border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: linear-gradient(135deg, rgba(61, 123, 255, .18), rgba(47, 211, 160, .12)); border: 1px solid rgba(127, 179, 255, .22); }
.why-card.why-alert { background: linear-gradient(135deg, rgba(255, 110, 90, .18), rgba(255, 196, 90, .1)); border-color: rgba(255, 150, 120, .4); }
.why-k { font-size: 12px; font-weight: 600; color: var(--blue-soft); }
.why-alert .why-k { color: #ffc2a8; }
.why-v { font-size: 15px; line-height: 1.5; }
.chain { display: flex; flex-direction: column; padding: 0 4px; }
.chain-head { font-size: 13px; font-weight: 600; margin-block-end: 8px; }
.chain-item { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; }
.chain-rail { display: flex; flex-direction: column; align-items: center; }
.chain-dot { width: 10px; height: 10px; border-radius: 50%; margin-block-start: 5px; background: var(--blue); box-shadow: 0 0 0 4px rgba(127, 179, 255, .15); flex: none; }
.chain-dot.grad { width: 12px; height: 12px; margin-block-start: 4px; background: var(--grad); box-shadow: none; }
.chain-line { flex: 1; width: 2px; background: var(--line); margin-block-start: 4px; }
.chain-body { display: flex; flex-direction: column; gap: 3px; padding-block-end: 16px; min-width: 0; }
.chain-rule .chain-body { padding-block-end: 0; }
.chain-label { font-size: 14px; font-weight: 600; }
.chain-detail { font-size: 13px; color: rgba(234, 242, 247, .82); }
.chain-src { font-size: 11px; color: var(--faint); line-height: 1.5; text-decoration: none; overflow-wrap: anywhere; }
a.chain-src:hover { color: var(--green); text-decoration: underline; }
.bp-grid { direction: ltr; } /* blood pressure always reads systolic/diastolic left to right */
:root[dir="rtl"] .bp-grid .field { direction: rtl; }
.bp-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.bp-slash { font-size: 26px; color: var(--faint); padding-block-end: 10px; }
.minor-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-block-start: 4px; }
.history { border-radius: 18px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line-soft); padding: 4px 14px; }
.history summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--dim); min-height: 44px; display: flex; align-items: center; }
.history-list { margin: 0 0 10px; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.history-list li { display: flex; flex-direction: column; }

/* ------------------------------------------------------------------ upcoming */
.month { font-size: 13px; font-weight: 600; padding: 0 4px; }
.up-item { display: flex; gap: 14px; align-items: center; border-radius: 22px; background: var(--glass); border: 1px solid rgba(255, 255, 255, .09); padding: 12px 14px; color: var(--text); text-decoration: none; }
.up-item.is-link:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.up-item .row-text { flex: 1; }
.date-tile { flex: none; width: 48px; height: 52px; border-radius: 16px; background: rgba(255, 255, 255, .07); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.date-tile.hl { background: linear-gradient(135deg, rgba(61, 123, 255, .4), rgba(47, 211, 160, .35)); }
.date-mon { font-size: 10px; color: rgba(234, 242, 247, .75); text-transform: uppercase; }
.date-day { font-size: 18px; font-weight: 600; line-height: 1.1; }

/* ------------------------------------------------------------------ records */
.src-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ledger-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ledger-cell { border-radius: 18px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); padding: 12px 14px; min-height: 48px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: var(--text); text-decoration: none; transition: background .2s; }
.ledger-cell:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.ledger-name { font-size: 13px; color: rgba(234, 242, 247, .78); }
.ledger-n { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cat-row { align-items: flex-start; }
.cat-value { font-size: 13px; color: rgba(234, 242, 247, .85); }

.paper { border-radius: 22px; background: #f5f8fa; color: #0d1a26; padding: 18px; display: flex; flex-direction: column; gap: 12px; font-size: 13px; line-height: 1.5; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); }
.paper-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-block-end: 10px; border-block-end: 1px solid #d7e0e8; }
.paper-title { font-size: 15px; font-weight: 700; }
.paper-date { color: #4c5d6c; font-size: 12px; }
.paper-k { font-weight: 700; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #4c5d6c; }
.paper-note { color: #4c5d6c; font-size: 11px; padding-block-start: 8px; border-block-start: 1px solid #d7e0e8; }

/* ------------------------------------------------------------------ access */
.agent-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: all .4s; }
.agent-card.is-active { background: linear-gradient(135deg, rgba(61, 123, 255, .18), rgba(47, 211, 160, .12)); }
.agent-card.is-revoked { background: rgba(255, 255, 255, .03); }
.agent-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { flex: none; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.avatar.sq { border-radius: 12px; background: rgba(255, 255, 255, .12); }
.avatar.round { border-radius: 50%; background: var(--grad); color: var(--ink); }
.scope { font-size: 11px; font-family: var(--mono); padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: rgba(234, 242, 247, .82); }
.scope.dim { opacity: .45; }
.delegate-card { padding: 12px 16px 4px; display: flex; flex-direction: column; }
.dg-head { padding-block-end: 8px; }
.delegate-card > .row { border-block-start: 1px solid var(--line-soft); min-height: 48px; padding: 10px 0; }
.delegate-card .row-label { font-size: 14px; font-weight: 400; }
.pref { display: flex; flex-direction: column; gap: 10px; }

/* ------------------------------------------------------------------ tab bar */
.tabbar {
  position: absolute; z-index: 5; inset-inline: 16px; bottom: calc(22px + env(safe-area-inset-bottom)); height: var(--tabbar-h);
  border-radius: 999px; background: rgba(12, 24, 38, .74); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, .12); display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px; gap: 4px;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .8);
}
.tab { border-radius: 999px; display: flex; align-items: center; justify-content: center; color: rgba(234, 242, 247, .74); font-size: 13px; font-weight: 600; text-decoration: none; transition: all .35s var(--ease); min-width: 0; }
.tab:hover { color: var(--text); }
.tab.on { background: var(--grad); color: var(--ink); }

/* ------------------------------------------------------------------ agent panel */
.panel { display: none; }
@media (min-width: 1100px) {
  .panel {
    display: flex; flex-direction: column; overflow: hidden; flex: none;
    width: 400px; height: min(900px, calc(100dvh - 48px)); border-radius: 32px;
    background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .09);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  }
}
.panel-head { padding: 22px 24px 16px; display: flex; flex-direction: column; gap: 6px; border-block-end: 1px solid rgba(255, 255, 255, .08); }
.panel-eyebrow { font-size: 13px; font-weight: 600; color: var(--green); }
.panel-status { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--dim); }
.panel-status .dot { width: 7px; height: 7px; animation: pulse 2s infinite; }
.panel-title { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.panel-sub { font-size: 12px; color: var(--faint); }
.panel-body { flex: 1; overflow-y: auto; padding: 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.panel-empty { border-radius: 20px; padding: 18px; background: rgba(255, 255, 255, .04); border: 1px dashed rgba(255, 255, 255, .14); font-size: 13px; line-height: 1.5; color: var(--dim); }
.panel-label { font-size: 12px; font-weight: 600; color: var(--dim); }
.log-entry { border-radius: 18px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .07); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; animation: hRise .5s both; direction: ltr; text-align: left; }
.log-entry.seen { animation: none; }
.log-top { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 11px; }
.log-call { color: var(--blue-soft); overflow-wrap: anywhere; }
.log-time { color: rgba(234, 242, 247, .45); flex: none; }
.log-res { font-family: var(--mono); font-size: 11px; color: var(--green); line-height: 1.5; white-space: pre-wrap; }
.manifest { margin: 0; border-radius: 18px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .07); padding: 14px; font-family: var(--mono); font-size: 11px; line-height: 1.55; color: rgba(234, 242, 247, .84); white-space: pre-wrap; word-break: break-word; text-align: left; }

/* ------------------------------------------------------------------ motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .orb, .orb-c, .float-card { animation: none !important; }
}
