:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  --blue-950: #061d33;
  --blue-900: #082f55;
  --blue-800: #083b73;
  --blue-700: #0b4f9c;
  --blue-600: #1d4ed8;
  --blue-500: #2563eb;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --canvas: #f4f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #dbe3ee;
  --border-control: #8695aa;
  --success: #166534;
  --success-bg: #f0fdf4;
  --warning: #92400e;
  --warning-bg: #fffbeb;
  --danger: #b42318;
  --danger-bg: #fff1f2;
  --radius-sm: 7px;
  --radius-md: 11px;
  --radius-lg: 16px;
  --shadow-card: 0 8px 24px rgb(15 23 42 / 8%);
  --shadow-float: 0 18px 50px rgb(6 29 51 / 20%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--canvas); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--blue-700); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.35rem, 2vw, 1.75rem); }
h2 { margin-bottom: 8px; font-size: clamp(1.45rem, 2.4vw, 2rem); letter-spacing: -.025em; }
h3 { margin-bottom: 4px; font-size: 1rem; }
.muted { color: var(--text-muted); }
.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; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--blue-800); font-weight: 700; }

.eyebrow { display: inline-block; margin-bottom: 8px; color: var(--blue-700); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow-light { color: #bfdbfe; }
.brand-lockup { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 800; line-height: 1.05; }
.brand-lockup-large { font-size: 1.1rem; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgb(255 255 255 / 28%); border-radius: 12px; background: rgb(255 255 255 / 12%); color: #fff; font-size: .78rem; letter-spacing: .04em; }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr); }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(36px, 6vw, 72px); color: #fff; background: linear-gradient(145deg, var(--blue-950), var(--blue-800) 62%, #1260ae); }
.login-brand::before, .login-brand::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgb(255 255 255 / 10%); }
.login-brand::before { width: 520px; height: 520px; right: -180px; top: -170px; }
.login-brand::after { width: 340px; height: 340px; right: -80px; top: -80px; }
.login-brand > * { position: relative; z-index: 1; }
.login-brand-copy { max-width: 700px; margin: 80px 0 48px; }
.login-brand-copy h1 { max-width: 660px; margin-bottom: 20px; font-size: clamp(2.4rem, 4.8vw, 4.8rem); line-height: 1.03; letter-spacing: -.055em; }
.login-brand-copy p { max-width: 610px; color: #dbeafe; font-size: 1.08rem; line-height: 1.75; }
.feature-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 0; margin: 0; list-style: none; }
.feature-list li { display: grid; gap: 9px; padding-top: 16px; border-top: 1px solid rgb(255 255 255 / 20%); color: #e6f0ff; font-size: .9rem; }
.feature-list span { color: #93c5fd; font-size: .72rem; font-weight: 800; letter-spacing: .1em; }
.login-panel { display: grid; place-items: center; padding: 40px; background: #fff; }
.login-card { width: min(100%, 430px); }
.login-card h2 { margin-bottom: 8px; font-size: 2.1rem; }
.security-note { display: flex; gap: 9px; align-items: flex-start; margin-top: 28px; color: var(--text-muted); font-size: .8rem; line-height: 1.55; }
.security-note span { color: var(--success); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: 256px; display: flex; flex-direction: column; padding: 24px 16px; color: #dceaff; background: linear-gradient(180deg, var(--blue-950), var(--blue-900)); box-shadow: 8px 0 30px rgb(6 29 51 / 10%); }
.sidebar .brand-lockup { padding: 0 10px 28px; }
.primary-nav { display: grid; gap: 5px; }
.primary-nav a { min-height: 46px; display: grid; grid-template-columns: 32px 1fr auto; gap: 9px; align-items: center; padding: 7px 11px; border-radius: 9px; color: #cfe3ff; text-decoration: none; font-size: .9rem; font-weight: 650; border-left: 3px solid transparent; transition: background .16s ease, color .16s ease; }
.primary-nav a:hover { color: #fff; background: rgb(255 255 255 / 8%); }
.primary-nav a[aria-current="page"] { color: #fff; border-left-color: #60a5fa; background: rgb(37 99 235 / 26%); }
.nav-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: rgb(255 255 255 / 8%); font-size: .76rem; font-weight: 900; }
.nav-count { min-width: 23px; padding: 2px 7px; border-radius: 999px; color: #dbeafe; background: rgb(255 255 255 / 10%); font-size: .69rem; text-align: center; }
.nav-count-warning { color: #fde68a; background: rgb(245 158 11 / 18%); }
.sidebar-footer { display: flex; gap: 10px; align-items: center; margin-top: auto; padding: 16px 11px 2px; border-top: 1px solid rgb(255 255 255 / 10%); }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { color: #fff; font-size: .76rem; }
.sidebar-footer small { margin-top: 3px; color: #9fbada; font-size: .69rem; }
.service-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 4px rgb(245 158 11 / 14%); }
.service-dot.healthy { background: #22c55e; box-shadow: 0 0 0 4px rgb(34 197 94 / 14%); }
.sidebar-overlay { position: fixed; inset: 0; z-index: 40; border: 0; background: rgb(6 29 51 / 55%); }

.workspace { min-height: 100vh; margin-left: 256px; }
.topbar { position: sticky; top: 0; z-index: 30; height: 76px; display: flex; gap: 20px; align-items: center; padding: 0 32px; border-bottom: 1px solid var(--border); background: rgb(255 255 255 / 94%); backdrop-filter: blur(10px); }
.page-heading { min-width: 0; }
.page-heading h1 { margin: 2px 0 0; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb { display: block; color: var(--text-muted); font-size: .72rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-menu { display: flex; align-items: center; gap: 10px; padding: 0 7px 0 14px; border-left: 1px solid var(--border); }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--blue-700); font-size: .74rem; font-weight: 800; }
.user-copy { max-width: 190px; }
.user-copy strong, .user-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-copy strong { font-size: .79rem; }
.user-copy small { margin-top: 2px; color: var(--text-muted); font-size: .68rem; }
.menu-toggle { display: none !important; }
.page-container { max-width: 1500px; margin: 0 auto; padding: 30px 32px 56px; }
.page { animation: page-in .18s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.page-intro { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.page-intro h2 { margin-bottom: 6px; }
.page-intro p { margin-bottom: 0; }

.card { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.card-header { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.card-header p { margin-bottom: 0; font-size: .82rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi-card { min-height: 132px; display: flex; gap: 15px; align-items: flex-start; padding: 21px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-card); }
.kpi-card strong { display: block; margin: 4px 0 2px; font-size: 2rem; line-height: 1; letter-spacing: -.04em; }
.kpi-card small, .kpi-label { color: var(--text-muted); font-size: .75rem; }
.kpi-label { display: block; font-weight: 700; }
.kpi-icon { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; font-weight: 900; }
.kpi-blue { color: var(--blue-700); background: var(--blue-50); }
.kpi-indigo { color: #5b21b6; background: #f5f3ff; }
.kpi-amber { color: var(--warning); background: var(--warning-bg); }
.kpi-rose { color: var(--danger); background: var(--danger-bg); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 20px; }
.entity-list { display: grid; }
.entity-row { display: flex; gap: 13px; align-items: center; padding: 13px 0; border-bottom: 1px solid #edf1f6; }
.entity-row:last-child { border-bottom: 0; }
.entity-avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--blue-700); background: var(--blue-50); font-size: .78rem; font-weight: 900; }
.entity-copy { min-width: 0; }
.entity-copy strong, .entity-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entity-copy strong { font-size: .85rem; }
.entity-copy small { margin-top: 3px; color: var(--text-muted); font-size: .72rem; }
.entity-row time { margin-left: auto; color: var(--text-muted); font-size: .72rem; white-space: nowrap; }
.quick-actions { display: grid; align-content: start; }
.quick-actions > button { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; padding: 12px 0; border: 0; border-bottom: 1px solid #edf1f6; background: transparent; text-align: left; cursor: pointer; }
.quick-actions > button:last-child { border-bottom: 0; }
.quick-actions > button:hover strong { color: var(--blue-700); }
.quick-actions strong, .quick-actions small { display: block; }
.quick-actions strong { font-size: .82rem; }
.quick-actions small { margin-top: 4px; color: var(--text-muted); font-size: .7rem; }
.quick-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--blue-700); background: var(--blue-50); font-weight: 900; }

.button, .icon-button, .text-button { border: 0; cursor: pointer; }
.button { min-height: 42px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; font-size: .8rem; font-weight: 750; transition: transform .12s ease, background .12s ease, border-color .12s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .58; cursor: not-allowed; transform: none; }
.button-primary { color: #fff; background: var(--blue-700); }
.button-primary:hover { background: var(--blue-800); }
.button-secondary { color: var(--blue-800); border-color: #b7cbe3; background: #fff; }
.button-secondary:hover { background: var(--blue-50); border-color: #8db2d8; }
.button-ghost { color: var(--text-muted); background: transparent; }
.button-ghost:hover { color: var(--blue-800); background: var(--blue-50); }
.button-danger { color: #fff; background: var(--danger); }
.button-block { width: 100%; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; background: transparent; font-size: 1.2rem; }
.icon-button:hover { background: var(--blue-50); }
.text-button { padding: 4px; color: var(--blue-700); background: transparent; font-size: .76rem; font-weight: 750; }
.table-action { min-height: 34px; padding: 6px 10px; font-size: .72rem; }

.stack-form { display: grid; gap: 16px; margin-top: 24px; }
.form-card { margin-bottom: 20px; border-color: #b9d2ee; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 20px; }
.field { display: grid; gap: 6px; }
.field-span-2 { grid-column: span 2; }
.field label { color: #223047; font-size: .76rem; font-weight: 750; }
.field input, .field textarea, .field select, .compact-select, .search-field input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border-control); border-radius: 9px; color: var(--text); background: #fff; outline: none; }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:hover, .field textarea:hover, .field select:hover, .compact-select:hover { border-color: #64748b; }
.field input:focus, .field textarea:focus, .field select:focus, .compact-select:focus, .search-field input:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgb(37 99 235 / 16%); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 3px; }
.inline-message { min-height: 18px; color: var(--danger); font-size: .78rem; line-height: 1.45; }
.inline-message.success { color: var(--success); }
.account-summary { display: grid; gap: 18px; margin: 0; }
.account-summary div { display: grid; gap: 5px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.account-summary div:last-child { padding-bottom: 0; border-bottom: 0; }
.account-summary dt { color: var(--muted); font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.account-summary dd { margin: 0; color: var(--ink); font-size: 1rem; font-weight: 700; overflow-wrap: anywhere; }

.table-card { padding: 0; overflow: hidden; }
.toolbar { min-height: 68px; display: flex; gap: 16px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.search-field { min-width: min(420px, 70%); display: flex; align-items: center; gap: 7px; }
.search-field span { margin-right: -36px; z-index: 1; color: var(--text-muted); }
.search-field input { padding-left: 36px; border-color: var(--border); background: var(--canvas); }
.result-count { margin-left: auto; color: var(--text-muted); font-size: .76rem; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .79rem; }
th, td { padding: 14px 18px; border-bottom: 1px solid #e9eef5; text-align: left; vertical-align: middle; }
th { color: var(--text-muted); background: #f8fafc; font-size: .69rem; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
tbody tr:hover { background: #f8fbff; }
tbody tr:last-child td { border-bottom: 0; }
.cell-title { display: block; color: var(--text); font-weight: 750; }
.cell-subtitle { display: block; max-width: 310px; margin-top: 4px; color: var(--text-muted); font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-actions { display: flex; gap: 7px; justify-content: flex-end; white-space: nowrap; }
.status-badge { display: inline-flex; gap: 6px; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active, .status-approved, .status-ready { color: var(--success); background: var(--success-bg); }
.status-pending { color: var(--warning); background: var(--warning-bg); }
.status-expired, .status-rejected, .status-blocked { color: var(--danger); background: var(--danger-bg); }
.status-revoked, .status-neutral { color: var(--text-muted); background: #eef2f7; }
.empty-state { padding: 54px 24px; text-align: center; }
.empty-state > span { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 15px; color: var(--blue-700); background: var(--blue-50); font-weight: 900; }
.empty-state h3 { margin-bottom: 7px; }
.empty-state p { margin: 0; color: var(--text-muted); font-size: .8rem; }
.compact-select { width: auto; min-width: 175px; }
.document-controls { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) auto; gap: 16px; align-items: end; margin-bottom: 20px; }
.document-rules-page { margin: -26px -10px 0; padding: 0 10px 28px; border-radius: 20px; background: linear-gradient(145deg, #eaf4ff 0%, #f7fbff 55%, #dbeafe 100%); }
.rule-hero { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin: 0 -10px 22px; padding: 30px 34px; border-radius: 20px 20px 0 0; color: #fff; background: linear-gradient(125deg, #082f55, #075da8 58%, #1687d9); box-shadow: 0 14px 34px rgb(8 47 85 / 18%); }
.rule-hero h2 { margin: 5px 0 8px; font-size: 2rem; }
.rule-hero p { max-width: 720px; margin: 0; color: #dbeafe; line-height: 1.55; }
.rule-hero-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.rule-hero-badges span { padding: 8px 11px; border: 1px solid rgb(255 255 255 / 22%); border-radius: 999px; color: #e0f2fe; background: rgb(255 255 255 / 9%); font-size: .69rem; font-weight: 800; white-space: nowrap; }
.rule-workspace { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(520px, 1.8fr); gap: 20px; }
.rule-scope-card { display: grid; grid-template-columns: minmax(280px, 1.5fr) minmax(260px, 1fr) auto; gap: 18px; align-items: end; margin-bottom: 20px; border-color: #8fc2ee; box-shadow: 0 10px 26px rgb(8 47 85 / 9%); }
.rule-scope-copy h3 { margin: 3px 0 5px; }
.rule-scope-copy p { margin: 0; }
.rule-scope-card .button { min-height: 44px; }
.rule-scope-card .inline-message { grid-column: 1 / -1; margin: 0; }
.rule-editor, .rule-catalog { border-color: #b9d8f5; box-shadow: 0 10px 26px rgb(8 47 85 / 9%); }
.rule-options { display: grid; gap: 9px; padding: 0; border: 0; }
.rule-options legend { margin-bottom: 5px; color: var(--ink); font-size: .78rem; font-weight: 800; }
.rule-options label { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border: 1px solid #c9def2; border-radius: 9px; background: #f6fbff; font-size: .77rem; font-weight: 700; cursor: pointer; }
.rule-options input { accent-color: var(--blue-700); }
.rule-list { display: grid; gap: 12px; margin-top: 18px; }
.rule-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 16px; border: 1px solid #cfe0f1; border-radius: 12px; background: #fff; }
.rule-card.is-assigned { border-color: #2787d8; box-shadow: inset 4px 0 #1674c5; background: #f8fcff; }
.rule-card-select { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.rule-card-select > input { margin-top: 3px; accent-color: var(--blue-700); }
.rule-card-select > input:disabled { cursor: not-allowed; }
.rule-card.is-inactive { opacity: .7; background: #f1f5f9; }
.rule-card h4 { margin: 0 0 5px; color: var(--blue-950); font-size: .91rem; }
.rule-card-meta, .rule-flags { display: flex; flex-wrap: wrap; gap: 7px; }
.rule-card-meta span, .rule-flags span { padding: 4px 7px; border-radius: 6px; color: #31577c; background: #eaf4ff; font-size: .65rem; font-weight: 750; }
.rule-flags { margin-top: 10px; }
.rule-flags span { color: #475569; background: #f1f5f9; }
.rule-audit { display: block; margin-top: 9px; color: var(--text-muted); font-size: .66rem; }
.document-controls .button { min-height: 44px; }
#document-requirements { color: #d6002b; background-color: #060c14; border-color: #060c14; }
#document-requirements:hover:not(:disabled) { color: #ff234f; background-color: #111b28; border-color: #111b28; }
.document-definition-card { margin-bottom: 20px; }
.definition-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.3fr) minmax(240px, 1.5fr) auto; gap: 14px; align-items: end; margin-top: 18px; }
.definition-form .button { min-height: 44px; }
.definition-groups { display: grid; gap: 14px; margin-top: 20px; }
.definition-group { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; }
.definition-group h4 { margin: 0; padding: 12px 16px; color: var(--ink); background: #f8fafc; font-size: .82rem; }
.definition-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.4fr) auto; gap: 14px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); }
.definition-row strong, .definition-row span { overflow-wrap: anywhere; }
.definition-row span { color: var(--text-muted); font-size: .76rem; }

.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.decision-card { margin-top: 18px; padding: 16px; border: 1px solid var(--border); border-radius: 11px; background: #f8fafc; }
.decision-card p { margin: 6px 0 0; color: var(--text-muted); font-size: .77rem; line-height: 1.5; }
.decision-card.ready { border-color: #bbdfc4; background: var(--success-bg); }
.decision-card.blocked { border-color: #fecdd3; background: var(--danger-bg); }
.timeline { display: grid; gap: 14px; }
.timeline-item { position: relative; padding-left: 24px; }
.timeline-item::before { content: ""; position: absolute; left: 3px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue-500); box-shadow: 0 0 0 4px var(--blue-100); }
.timeline-item strong, .timeline-item small { display: block; }
.timeline-item small { margin-top: 4px; color: var(--text-muted); }
.empty-copy, .loading-block { color: var(--text-muted); font-size: .82rem; }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.service-card { min-height: 126px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-card); }
.service-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.service-card h3 { text-transform: capitalize; }
.service-card p { margin: 18px 0 0; color: var(--text-muted); font-size: .73rem; }

.dialog { width: min(92vw, 500px); padding: 0; border: 0; border-radius: var(--radius-lg); color: var(--text); box-shadow: var(--shadow-float); }
.dialog::backdrop { background: rgb(6 29 51 / 62%); backdrop-filter: blur(2px); }
.dialog form { padding: 24px; }
.dialog-header { display: flex; justify-content: space-between; gap: 20px; }
.dialog h2 { font-size: 1.4rem; }
.share-dialog { width: min(94vw, 680px); }
.share-secret { display: grid; gap: 10px; margin: 20px 0; }
.share-secret > div { display: grid; gap: 5px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }
.share-secret span { color: var(--text-muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.share-secret code { overflow-wrap: anywhere; color: var(--primary); }
.share-secret strong { font-size: 1.25rem; letter-spacing: .14em; }
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.upload-checklist { display: grid; gap: 8px; margin: 22px 0; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: #f8fafc; }
.upload-checklist .card-header { margin-bottom: 4px; }
.upload-task { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); text-align: left; cursor: pointer; }
.upload-task span { display: grid; gap: 3px; }
.upload-task small { color: var(--text-muted); }
.upload-task b { color: var(--primary); font-size: .75rem; }
.upload-task.is-complete { border-color: #bbdfc4; background: var(--success-bg); }
.upload-task.is-complete b { color: var(--success); }
.requirement-options { display: grid; gap: 10px; margin: 20px 0; padding: 0; border: 0; }
.requirement-options legend { margin-bottom: 4px; color: var(--ink); font-size: .82rem; font-weight: 800; }
.rule-assignment-help { margin: 0 0 10px; font-size: .72rem; }
.assignment-rule-options { display: grid; gap: 9px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbff; cursor: pointer; }
.checkbox-row input { margin-top: 3px; accent-color: var(--blue-700); }
.checkbox-row span { display: grid; gap: 3px; }
.checkbox-row strong { font-size: .86rem; }
.checkbox-row small { color: var(--muted); font-size: .74rem; line-height: 1.4; }
.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { padding: 14px 16px; border: 1px solid #b9d2ee; border-radius: 11px; color: var(--blue-950); background: #fff; box-shadow: var(--shadow-float); font-size: .8rem; line-height: 1.45; animation: toast-in .2s ease-out; }
.toast.success { border-color: #bbdfc4; background: var(--success-bg); }
.toast.error { border-color: #fecdd3; color: var(--danger); background: var(--danger-bg); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.public-body { min-height: 100vh; background: linear-gradient(145deg, var(--blue-950), var(--blue-900)); }
.public-header { height: 82px; border-bottom: 1px solid rgb(255 255 255 / 12%); }
.public-header-inner { width: min(1120px, calc(100% - 40px)); height: 100%; display: flex; align-items: center; justify-content: space-between; margin: 0 auto; }
.secure-label { display: inline-flex; gap: 8px; align-items: center; color: #dbeafe; font-size: .76rem; font-weight: 700; }
.secure-label span { color: #4ade80; }
.public-main { width: min(1120px, calc(100% - 40px)); display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: clamp(32px, 7vw, 96px); align-items: start; margin: 0 auto; padding: 64px 0 70px; }
.public-intro { padding-top: 22px; color: #fff; }
.public-intro h1 { max-width: 620px; margin-bottom: 20px; font-size: clamp(2.35rem, 5vw, 4.7rem); line-height: 1.03; letter-spacing: -.055em; }
.public-intro > p { max-width: 610px; color: #dbeafe; line-height: 1.75; }
.public-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 55px; }
.public-steps span { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / 18%); color: #9fbada; font-size: .73rem; }
.public-steps span.is-active { color: #fff; border-color: #60a5fa; }
.public-steps b { color: #93c5fd; font-size: .68rem; }
.public-card { min-height: 460px; padding: 30px; border: 1px solid #cfdae8; border-radius: 20px; background: #fff; box-shadow: var(--shadow-float); }
.public-card-header { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; }
.public-card-header h2 { font-size: 1.5rem; }
.public-loading { min-height: 390px; display: grid; place-items: center; color: var(--text-muted); font-size: .84rem; }
.invite-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 18px 0 24px; }
.invite-meta div { padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: #f8fafc; }
.invite-meta dt { color: var(--text-muted); font-size: .66rem; font-weight: 800; text-transform: uppercase; }
.invite-meta dd { margin: 5px 0 0; font-size: .78rem; font-weight: 750; }
.file-drop { min-height: 132px; display: flex !important; gap: 14px; align-items: center; justify-content: center; padding: 20px; border: 1.5px dashed #8db2d8; border-radius: 11px; background: var(--blue-50); text-align: left; cursor: pointer; }
.file-drop:hover { border-color: var(--blue-500); background: #e4f0ff; }
.file-drop strong, .file-drop small { display: block; }
.file-drop strong { color: var(--blue-900); font-size: .8rem; }
.file-drop small { margin-top: 5px; color: var(--text-muted); font-size: .69rem; }
.file-icon { width: 46px; height: 54px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: #fff; background: var(--blue-700); font-size: .64rem; font-weight: 900; }
.privacy-copy { margin: 18px 0 0; color: var(--text-muted); font-size: .68rem; line-height: 1.55; text-align: center; }

:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 2px; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desktop-action { display: none; }
}

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-102%); transition: transform .2s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .workspace { margin-left: 0; }
  .menu-toggle { display: grid !important; }
  .topbar { padding: 0 20px; }
  .page-container { padding: 26px 20px 48px; }
  .public-main { grid-template-columns: 1fr; }
  .public-card { width: min(100%, 620px); }
  .rule-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-brand { min-height: 290px; padding: 28px 24px; }
  .login-brand-copy { margin: 45px 0 0; }
  .login-brand-copy h1 { font-size: 2.35rem; }
  .feature-list { display: none; }
  .login-panel { padding: 34px 22px; }
  .public-header-inner, .public-main { width: min(100% - 32px, 1120px); }
  .public-main { padding-top: 42px; }
  .public-intro h1 { font-size: 2.45rem; }
  .public-steps { margin-top: 36px; }
  .public-card { padding: 22px; }
  .topbar { height: 68px; gap: 10px; }
  .breadcrumb, .user-copy, .topbar .button-ghost { display: none; }
  .avatar { width: 34px; height: 34px; }
  .user-menu { padding-left: 8px; }
  .page-container { padding: 22px 16px 42px; }
  .page-intro { align-items: stretch; flex-direction: column; gap: 14px; }
  .page-intro > .button, .page-intro > .compact-select { align-self: flex-start; }
  .form-grid, .two-column { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: auto; }
  .service-grid { grid-template-columns: 1fr; }
  .form-actions { position: sticky; bottom: 0; padding: 10px 0; background: #fff; }
  .rule-hero { align-items: flex-start; flex-direction: column; padding: 24px 22px; }
  .rule-hero-badges { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 112px; }
  .card { padding: 18px; }
  .table-card { padding: 0; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .document-controls { grid-template-columns: 1fr; }
  .definition-form, .definition-row { grid-template-columns: 1fr; }
  .search-field { min-width: 100%; }
  .result-count { margin-left: 0; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  tbody tr { padding: 14px 16px; border-bottom: 1px solid var(--border); }
  tbody tr:last-child { border-bottom: 0; }
  td { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 7px 0; border: 0; }
  td::before { content: attr(data-label); color: var(--text-muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
  .cell-actions { justify-content: flex-start; white-space: normal; }
  .cell-subtitle { white-space: normal; }
  .toast-region { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
