/* THE CONTROL Royal UI v14 – exact source brand, grounded data, refined gold on obsidian.
   All color choices derive from the supplied logo: obsidian, warm metallic gold,
   muted bronze and ivory. This CSS is intentionally loaded AFTER styles.css. */
:root {
  color-scheme:dark;
  --ink:#f4e9d7; --muted:#c1ad91; --soft:#090806; --paper:#17120f;
  --edge:rgba(192,146,86,.41); --green:#d4af76; --green-dark:#0a0807;
  --mint:#2c2118; --gold:#d9ae70; --red:#ee8e84; --red-bg:#362019;
  --amber:#d7b77f; --amber-bg:#2b2117; --shadow:0 16px 35px rgba(0,0,0,.28);
  --royal-gold-1:#f5dbac; --royal-gold-2:#c99e61; --royal-gold-3:#8e663a;
  --royal-ink:#0c0a09; --royal-panel:#19140f; --royal-line:rgba(209,165,102,.4);
}
html{scrollbar-color:#685134 #100d0a}
body{font-size:16px}
body {background:radial-gradient(ellipse at 57% -12%,rgba(142,93,41,.17),transparent 46%),linear-gradient(145deg,#0d0b09,#090807 65%,#120e0b);color:var(--ink);font-size:15px;line-height:1.75}
::selection{color:#19120b;background:#edc98e}
a {color:#dfbd89}
a:hover {color:#ffe4b1}
.muted,.tiny.muted,.small.muted,.field-hint {color:var(--muted)}
.positive{color:#95d2ad}.negative{color:#f0a29c}
.eyebrow{color:#caa36e;letter-spacing:.11em}
.layout{grid-template-columns:284px minmax(0,1fr)}
.sidebar {background:linear-gradient(168deg,#17120e 0%,#0a0908 52%,#0c0a09 100%);border-inline-end:1px solid rgba(211,161,98,.55);color:#efe4d2;padding:13px 17px 22px;gap:14px;box-shadow:-7px 0 22px rgba(0,0,0,.45)}
.sidebar::before{content:'';position:absolute;inset-inline-end:0;top:0;bottom:0;width:1px;background:linear-gradient(transparent,#e0b879 23%,#795631 50%,#d7ad6c 78%,transparent);pointer-events:none}
.sidebar .brand {padding:0 4px 10px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;text-align:center;border-bottom:1px solid rgba(205,159,104,.33)}
.thecontrol-wordmark{display:block;width:min(100%,245px);height:auto;object-fit:contain;filter:drop-shadow(0 5px 18px rgba(202,151,81,.10))}
.brand-caption{font-size:.68rem;color:#d4c2a4;letter-spacing:.045em;margin-top:-6px}
.sidebar nav{display:grid;gap:2px}
.nav-caption{color:#c6a576;margin:9px 13px 6px;font-size:.71rem;letter-spacing:.08em}
.nav-link{background:transparent;color:#e7dcd0;padding:10px 12px;margin:1px 0;min-height:42px;border-radius:9px;border:1px solid transparent;text-align:right;font-weight:650;font-size:.84rem;transition:background .14s,color .14s,border-color .14s;gap:12px}
.nav-link .ico{width:21px;height:21px;display:inline-grid;place-items:center;color:#b68b54;flex-shrink:0}
.nav-link .ico svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.nav-link:hover{color:#fff3dc;background:linear-gradient(90deg,rgba(186,136,74,.15),rgba(186,136,74,.06));border-color:rgba(192,143,81,.27)}
.nav-link.active{background:linear-gradient(103deg,#c99959,#f0d2a0 40%,#c99b5c);color:#20170f;border:1px solid #f0cea0;box-shadow:inset 0 1px rgba(255,255,255,.32),0 3px 16px rgba(189,139,69,.23);border-inline-start:1px solid #f0cea0}
.nav-link.active .ico{color:#2f1d0d}
.sidebar-bottom{border:1px solid #71583b;border-radius:12px;background:linear-gradient(130deg,#1b140f,#100d0a);padding:13px}
.sidebar-bottom .user-name{color:#f4dfbd}.sidebar-bottom .small,.sidebar-bottom .muted{color:#cbb9a1!important}
.sidebar-bottom button{border:1px solid #806443;color:#f4e2c7;background:#211911;text-align:center}
.sidebar-bottom button:hover{background:#382719}
.workspace{background:transparent}
.topbar{background:rgba(13,11,9,.95);min-height:89px;padding:15px 30px;border-bottom:1px solid var(--royal-line);backdrop-filter:blur(18px);box-shadow:0 3px 14px rgba(0,0,0,.22)}
.topbar h1{font-size:1.24rem;color:#f5e6cd;font-weight:820;letter-spacing:0}
.topbar p{font-size:.78rem;color:#c7b69c}
.topbar .top-actions{justify-content:flex-end}
.header-profile{display:flex;align-items:center;gap:10px;min-width:0;border-inline-start:1px solid rgba(209,165,102,.29);padding-inline-start:15px}
.topbar-mobile-emblem{display:none;width:43px;height:43px;object-fit:cover;border-radius:10px;border:1px solid #98734b;flex:0 0 auto}
.header-profile-avatar{width:35px;height:35px;border-radius:50%;display:grid;place-items:center;background:#322518;border:1px solid #b78d51;color:#f3d9aa;font-weight:850;font-size:.88rem}
.header-profile-name{display:block;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#ecd5ae;font-weight:730;font-size:.79rem}
.command-search{position:relative;flex:1;min-width:180px;max-width:540px;z-index:17}
.command-search-input{height:42px;width:100%;border:1px solid rgba(193,145,78,.47);border-radius:11px;background:#1b1713;color:#f6ead4;padding:10px 36px 10px 13px;outline:0;font-size:.8rem}
.command-search-input::placeholder{color:#bcab91;opacity:1}
.command-search-input:focus{border-color:#e7c08a;box-shadow:0 0 0 3px rgba(211,161,98,.12)}
.command-search-icon{position:absolute;inset-inline-start:12px;top:12px;color:#d6b17b;font-size:1.1rem;pointer-events:none}
.command-search-results{position:absolute;top:calc(100% + 7px);inset-inline:0;border:1px solid #8e693e;background:#1a140f;border-radius:12px;box-shadow:0 21px 48px #000b;max-height:380px;overflow:auto;padding:7px;z-index:50}
.command-result{display:flex;text-align:right;width:100%;align-items:center;gap:10px;background:transparent;border:0;border-radius:8px;padding:11px 10px;color:#f7e9d6;cursor:pointer}
.command-result:hover,.command-result:focus-visible{background:#392819;color:#fff}
.command-result>span{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.command-result small{color:#d5b383;font-size:.74rem}
.command-search-empty{color:#c9b59a;padding:11px;font-size:.8rem}
.content{padding:22px 27px 80px;max-width:1740px}
.btn{background:linear-gradient(130deg,#211a14,#15100d);border:1px solid #886a49;color:#f6e6cb;border-radius:9px;font-weight:720;box-shadow:0 3px 8px rgba(0,0,0,.09)}
.btn:hover{background:#322418;border-color:#d2a86f;color:#ffeccd}
.btn:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid #e7bd7e;outline-offset:2px}
.btn-primary,.btn-dark{background:linear-gradient(145deg,#f3dab0 0%,#cfa266 48%,#9b6c35 100%);border-color:#ecc793;color:#24180e;box-shadow:inset 0 1px rgba(255,255,255,.42),0 4px 14px rgba(177,123,53,.18)}
.btn-primary:hover,.btn-dark:hover{color:#20140b;background:linear-gradient(140deg,#fff0cd,#d7a565);border-color:#f9deaa}
.btn-danger,.btn-danger:hover{color:#ffb2a9;border-color:#a0574f;background:#2a1715}
.btn-danger:hover{background:#45201d}
.link-btn{color:#f0cc95}
.link-btn:hover{color:#fff0d2}
.card,.row-card,.network-toolbar,.network-insight-card,.network-intro,.case-directory-card,.case-directory-search,.case-add-panel,.shared-case-card,.vault-panel,.wealth-card,.wealth-total,.wealth-blank-summary,.vault-balance,.vault-month-item,.vault-categories {background:linear-gradient(135deg,#211912,#15110e 80%);color:#f2e8d7;border:1px solid rgba(204,159,97,.47);box-shadow:0 5px 15px rgba(0,0,0,.15)}
.card{border-radius:15px;padding:19px}
.card.clickable:hover,.row-card:hover,.contact-card:hover{border-color:#dfb67e;background:#241b13}
.row-card{box-shadow:none;padding:12px;border-radius:10px}
.row-card h3,.card h2,.card h3,.section-heading h2,.section-heading h3,.vault-section-top h3,.wealth-list-head h3{color:#f7e9d5}
.row-card p,.section-heading p,.card p,.vault-section-top p,.wealth-list-head p{color:#cdb99d}
.grid{gap:14px}
.pill{background:#30261b;color:#e6c695;border:1px solid #765432}
.pill.neutral,.pill.blue{background:#272019;color:#e7d5be;border-color:#6b523b}
.pill.gold{background:#3a2c1b;color:#f1d4a7;border-color:#987043}
.pill.red{background:#3f211b;color:#f7aba0;border-color:#a05b4a}
.notice{background:#1e2b23;color:#b6d9c2;border-color:#526b58}
.notice.warning{background:#332414;color:#f3d8aa;border-color:#8e6637}
.notice.danger{background:#341916;color:#ffc0af;border-color:#8f483e}
.thecontrol-wealth-notice,.wealth-note-line,.vault-guidance,.form-source-help{background:#221a13;border-color:#8b6946;color:#e4d4bc}
.thecontrol-wealth-notice p,.thecontrol-wealth-notice strong,.wealth-note-line p,.vault-guidance p,.form-source-help{color:#ead9bd}
.thecontrol-wealth-notice>span{color:#e2b574}
/* Real-data imperial dashboard */
.royal-dashboard{display:grid;gap:17px}
.royal-hero{position:relative;isolation:isolate;overflow:hidden;background:radial-gradient(ellipse at 19% 15%,rgba(186,131,57,.16),transparent 45%),linear-gradient(105deg,#22170f,#0d0b09 70%);border:1px solid #ae7d42;border-radius:17px;min-height:182px;padding:24px 27px;display:flex;justify-content:space-between;align-items:center;gap:20px}
.royal-hero:after{content:'';position:absolute;bottom:0;inset-inline:0;height:2px;background:linear-gradient(90deg,transparent,#e9c18a 22%,#a6773a 54%,#e2bc7d 78%,transparent);box-shadow:0 0 13px #b67d3c;pointer-events:none}
.royal-hero>.royal-hero-copy{position:relative;z-index:1;max-width:650px}
.royal-hero .eyebrow{color:#d7b27b;font-family:Georgia,serif;letter-spacing:.18em}
.royal-hero h2{font-size:1.56rem;color:#fff3dd;margin:8px 0 7px;line-height:1.35}
.royal-hero p{color:#d6c4aa;font-size:.9rem;margin:0;line-height:1.7}
.royal-hero-crest{width:175px;min-width:155px;height:126px;object-fit:cover;object-position:50% 21%;opacity:.9;filter:drop-shadow(0 3px 12px rgba(226,171,92,.10))}
.royal-hero-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:15px}
.royal-hero-actions .btn{min-height:38px}
.royal-primary-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}
.royal-stat{position:relative;display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:122px;padding:17px 15px;border:1px solid #916735;border-radius:12px;color:#e9d8bd;background:linear-gradient(120deg,#261b12,#14110e 68%);box-shadow:inset 0 1px rgba(246,203,145,.16),0 4px 14px rgba(0,0,0,.19);text-align:right}
.royal-stat:after{content:'';position:absolute;bottom:0;inset-inline:17px;height:1px;background:linear-gradient(90deg,transparent,#dba767,transparent)}
.royal-stat:hover{border-color:#e9c384;background:#2e2015}
.royal-stat>div{min-width:0;flex:1}
.royal-stat small{display:block;font-size:.77rem;color:#d9c4a5;line-height:1.4}
.royal-stat strong{display:block;color:#ffedcc;line-height:1.2;margin-top:12px;font-size:1.8rem;font-variant-numeric:tabular-nums}
.royal-stat-icon{display:grid;place-items:center;width:44px;height:44px;flex:0 0 auto;color:#e9c188;background:#352619;border:1px solid #8c653b;border-radius:11px}
.royal-stat-icon svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round;stroke-linecap:round}
.royal-dashboard-layout{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(300px,.9fr);gap:14px}
.royal-panel{background:linear-gradient(150deg,#221913,#120f0d 84%);border:1px solid #8b653d;border-radius:13px;padding:18px 20px;min-width:0}
.royal-panel-head{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:13px;margin:0 0 18px}
.royal-panel-head h3{margin:0;color:#f3e3c7;font-size:1.05rem}
.royal-panel-head p{margin:3px 0 0;color:#c5af8c;font-size:.79rem}
.royal-panel-head select{background:#211913;color:#f3dfc0;border:1px solid #9d7445;padding:8px 10px;min-height:37px;border-radius:7px}
.royal-chart{display:block;width:100%;height:auto;min-height:200px;max-height:256px;overflow:visible}
.royal-chart-label{font-size:12px;fill:#c1a57f;font-family:system-ui,Tahoma,sans-serif}
.royal-chart-grid{stroke:rgba(200,154,96,.21);stroke-width:1}
.royal-chart-line{fill:none;stroke:#e0b36e;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.royal-chart-area{fill:url(#royal-area)}
.royal-legend{display:flex;flex-wrap:wrap;gap:8px;margin-top:9px}
.royal-legend-item{display:flex;align-items:center;gap:7px;font-size:.78rem;color:#dbcaac}
.royal-legend-dot{width:10px;height:10px;display:inline-block;border-radius:3px;background:var(--legend-color)}
.royal-donut-layout{display:flex;align-items:center;gap:19px;flex-wrap:wrap}
.royal-donut{--ring:conic-gradient(#d8a45c 0% 100%);width:148px;height:148px;flex:0 0 148px;border-radius:50%;background:var(--ring);position:relative;display:grid;place-items:center;box-shadow:0 0 12px rgba(177,124,58,.15)}
.royal-donut:after{content:'';position:absolute;inset:26px;border-radius:50%;background:#17120f;box-shadow:inset 0 0 0 1px #8a643d}
.royal-donut-center{position:relative;z-index:1;text-align:center;color:#f6e8d0;font-size:1.5rem;line-height:1.15;font-weight:800}
.royal-donut-center small{display:block;color:#cbb89a;font-size:.68rem;font-weight:500;margin-top:6px}
.royal-donut-legend{display:grid;gap:9px;flex:1;min-width:140px}
.royal-financial-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
.royal-section-shortcuts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.royal-shortcut{min-height:125px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:9px;padding:14px 9px;text-align:center;color:#f4e4c9;background:radial-gradient(circle at 50% 0,rgba(201,153,78,.20),transparent 56%),linear-gradient(#251b13,#15110e);border:1px solid #966e42;border-radius:12px}
.royal-shortcut:hover{border-color:#ecc88e;color:#fff3d9;transform:translateY(-2px)}
.royal-shortcut svg{width:33px;height:33px;color:#dfb77e;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linejoin:round;stroke-linecap:round}
.royal-shortcut strong{font-size:.91rem}
.royal-shortcut small{font-size:.75rem;color:#cbb99b}
.royal-quick-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;padding:13px 14px;border:1px solid #83603a;border-radius:12px;background:#14100c}
.royal-quick-actions strong{padding:0 5px;color:#f2d6a8;margin-inline-end:auto}
.royal-quick-actions .btn{min-height:36px;font-size:.79rem}
.royal-secondary-counts{margin:0;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}
.royal-secondary-counts .dashboard-stat{min-height:84px;padding:13px 15px;background:#211913;border:1px solid #624b32;box-shadow:none;gap:6px}
.royal-secondary-counts .dashboard-stat-number{font-size:1.35rem;color:#efd2a1}
.royal-secondary-counts .dashboard-stat-label{font-size:.78rem;color:#c7b395}
/* Inputs, records, tables and details */
.field-control,.filter-input,.filter-select,.form-field input,.form-field select,.form-field textarea,.vault-search input,.network-control input,.network-control select {background:#1a1511!important;border:1px solid #856642!important;color:#f4e9d7!important;caret-color:#e6bd80}
input::placeholder,textarea::placeholder{color:#bea98b!important;opacity:1}
option{background:#19130f;color:#f5e6ca}
.field-control:focus,.filter-input:focus,.filter-select:focus{border-color:#edc68b!important;box-shadow:0 0 0 3px rgba(211,160,95,.12)!important}
input[type=date]::-webkit-calendar-picker-indicator,input[type=month]::-webkit-calendar-picker-indicator{filter:invert(.85) sepia(.3)}
.field-label{color:#f0dfc3}.field-hint{color:#cbb89a}
.modal,.drawer{background:#14100d;color:#f0e3ce;border:1px solid #976f43;box-shadow:0 26px 85px rgba(0,0,0,.7)}
.overlay,.drawer-shade{background:rgba(0,0,0,.74);backdrop-filter:blur(4px)}
.modal-head,.drawer-head{background:#1c1510;border-bottom-color:#7d5c36;color:#f5e5cb}
.modal-head h2,.drawer-title,.drawer-section h3{color:#f6e7cd}
.close{background:#35271b;border:1px solid #705132;color:#f7d7a6}
.close:hover{background:#4d3520}
.drawer-tabs button{background:#241a12;color:#d9c2a4;border:1px solid #614b35}
.drawer-tabs button.active{background:linear-gradient(130deg,#e8c38a,#a77940);color:#1d130c;border-color:#efd09c}
.info-box,.wealth-number,.stat-pair,.vault-month-item,.vault-category-row,.vault-opening-chip,.case-member,.wealth-total-row,.contact-choice,.contact-suggestions,.contact-choice-avatar,.chip,.shared-case-chips span{background:#241b14;border-color:#765839;color:#f2e2cb}
.info-box small,.wealth-number>span,.contact-line p,.contact-card p,.vault-category-row small{color:#cbb79a}
.info-box strong,.wealth-number>strong,.vault-category-row strong{color:#f7e8ce}
.data-table{color:#f3e3cb}
.data-table th{background:#2a1d13;border-color:#73512e;color:#edc995}
.data-table td{border-color:#463423}
.data-table tbody tr:hover{background:#291e13}
.table-scroll{background:#15110e;border:1px solid #604b33;border-radius:11px}
.empty{background:#19130f;border:1px dashed #7a5834;color:#eadcc5}
.empty strong{color:#f6e4c5}.empty p{color:#c6b39a}
.empty .empty-ico{background:#302315;color:#dbb274}
.progress-label,.meta{color:#c9b69a}
progress{accent-color:#d8a968}progress::-webkit-progress-bar{background:#3b2a19}progress::-webkit-progress-value{background:#d8a968}progress::-moz-progress-bar{background:#d8a968}
.contact-avatar,.contact-choice-avatar{background:#342518;border:1px solid #745633;color:#e8c48a}
.contact-card,.project-card{color:#eee0c9}
.contact-choice:hover{background:#30251a}
.network-canvas{background:radial-gradient(rgba(211,159,86,.22) .8px,transparent .8px),#15100d;background-size:21px 21px;border-color:#795631}
.network-summary>div,.network-aside-num,.network-suggestion-card,.case-directory-card,.case-member,.case-add-panel,.case-directory-search,.case-directory-grid>.relation-empty{background:#1e1711;border-color:#765839;color:#eee2d0}
.network-summary strong,.network-aside-num strong,.case-directory-total strong{color:#efd2a3}
.network-intro-art span,.network-intro-steps span{background:#2c1e13;border-color:#896a45;color:#ebc899}
.network-intro-art .net-demo-center{background:#aa7c46;color:#160f0a}
.graph-project{fill:#d8a869}.graph-contact{fill:#1e1711;stroke:#b48a59}.graph-label{fill:#e5caa2}.graph-label-on{fill:#12100d}
.graph-edge{stroke:#a9845b}.graph-edge.suggested{stroke:#d8b67e}
.timeline{border-right-color:#78593a}.timeline-item:before{background:#d8a968;border-color:#211913;box-shadow:0 0 0 1px #9d7952}
.wealth-intro,.vault-hero{background:linear-gradient(112deg,#23180f,#0c0a08 87%);border:1px solid #957044;color:#f1e5d1}
.wealth-intro h2,.vault-hero h2{color:#f6e5cb}
.wealth-intro p,.vault-hero p{color:#d2bfa4}
.wealth-intro .btn-primary,.vault-hero-actions .btn-primary{background:linear-gradient(140deg,#f2d6a5,#b8874a);color:#23180d;border-color:#f6d99f}
.wealth-card,.wealth-total,.wealth-panel,.vault-panel,.vault-balance{background:linear-gradient(120deg,#241a12,#15110e 90%);border-color:#86623e}
.wealth-card-head strong,.wealth-total-title strong,.vault-balance>header>span:first-child{color:#f1dfbf}
.wealth-card-meta,.wealth-note,.wealth-list-head p,.wealth-total-row,.vault-bal-row>span,.vault-ledger-meta{color:#cbb79c}
.wealth-card-mark,.vault-ledger-icon,.vault-currency,.vault-opening-chip{background:#352619;border-color:#87623c;color:#efc889}
.wealth-blank-summary,.wealth-note-line,.wealth-unknown-count,.unvalued-badge{background:#2c2117;border-color:#765532;color:#efdbb8}
.vault-hero .btn:not(.btn-primary){background:#302216;color:#f4dbb0;border-color:#927047}
.vault-guidance,.vault-month-item,.vault-categories,.vault-category-row,.vault-ledger-item,.vault-opening-chip,.vault-cutover-note{background:#201811;border-color:#725637;color:#efe1c9}
.vault-hero .eyebrow,.wealth-intro .eyebrow{color:#e2b97e}
.vault-section-top p,.vault-list-head p,.vault-net-label,.vault-total-title span{color:#cbb698}
.vault-net,.vault-balance{color:#f4e4cd}
.vault-balance-divider{border-top-color:#6e5335}
.vault-ledger-icon.in{color:#9acfa8}.vault-ledger-icon.out{color:#f0a094}
.vault-ledger-info>strong{color:#fae8ca}
.vault-category-row{border:1px solid #5d442e}
.vault-category-row>span{color:#e9d4b2}
.vault-openings h4,.vault-categories h4,.vault-month-item h4{color:#f6e3bf}
.cash-source-tag{background:#392918;border-color:#85623b;color:#edcf9f}
.money-input-words,.amount-words{color:#d9bd91;background:#231a12;border-color:#715533}
.delete-confirm-pane h3{color:#f7e4c8}.delete-item-name{color:#f5dfbc;background:#2d2118;border-color:#9d6c42}
.delete-confirm-mark{background:#3d1713;color:#ffaaa2;border-color:#a35c55}
#toast{background:#241a12;color:#f6e3c3;border-color:#ad8050}
/* Login must retain visibility and work without a founder session. */
.auth-shell{background:#0c0908}
.auth-aside{background:radial-gradient(circle at 30% 25%,#3a2616,#0b0908 65%);border-inline-end:1px solid #73512f;color:#f5e6ca}
.auth-aside-inner{max-width:510px}.auth-aside h1{font-size:2rem;color:#fae8c7}
.auth-aside p,.auth-points{color:#dbc6a6}
.auth-card{background:linear-gradient(135deg,#251b14,#120e0b);color:#f4e5cb;border:1px solid #98713f;box-shadow:0 20px 60px #0008}
.auth-card h2{color:#f7e9d3}.auth-card p{color:#cbb79a}
.auth-card .brand{display:flex;align-items:center;justify-content:center;flex-direction:column;padding:0 0 14px!important}
.auth-card .thecontrol-wordmark{width:min(100%,280px)}
.auth-aside .thecontrol-wordmark{width:min(100%,325px)}
.auth-points span{border-inline-start:2px solid #a77b49;padding-inline-start:12px}
/* PWA navigation */
.mobile-bottom{background:rgba(13,10,7,.98);border-top:1px solid #946b3b;backdrop-filter:blur(12px)}
.mobile-bottom button{color:#dbc39e}.mobile-bottom button span{color:#d8a869}
.mobile-bottom button.active{color:#ffdfae;background:#2b1d13}
@media(max-width:1300px){.layout{grid-template-columns:257px minmax(0,1fr)}.topbar{padding:13px 22px}.royal-dashboard-layout{grid-template-columns:1fr}.royal-primary-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:1050px){.command-search{max-width:340px}.header-profile-name{max-width:110px}.royal-section-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:780px){
 .layout{display:block}.topbar{position:relative;top:auto;z-index:auto;flex-wrap:wrap;padding:15px 13px;gap:11px}
 .topbar h1{font-size:1.14rem}.header-profile{display:none}.topbar-mobile-emblem{display:block}
 .command-search{order:3;width:100%;max-width:none;flex-basis:100%}
 .content{padding:15px 12px 96px}
 .royal-hero{padding:19px 16px;min-height:170px}.royal-hero h2{font-size:1.25rem}.royal-hero-crest{display:none}
 .royal-primary-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.royal-stat{min-height:105px;padding:12px}.royal-stat strong{font-size:1.45rem}.royal-stat-icon{width:35px;height:35px}.royal-stat-icon svg{width:22px;height:22px}
 .royal-panel{padding:15px 12px}.royal-financial-cards{grid-template-columns:1fr}.royal-section-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 .royal-secondary-counts{grid-template-columns:repeat(2,minmax(0,1fr))}.royal-quick-actions strong{flex-basis:100%}
 .modal,.drawer{border-radius:13px 13px 0 0}.modal-head,.drawer-head{padding:14px}.modal-body,.drawer-body{padding:14px}
 .royal-donut{width:130px;height:130px;flex-basis:130px}.royal-donut:after{inset:24px}
}
@media(max-width:370px){.royal-primary-stats{grid-template-columns:1fr 1fr}.royal-stat{padding:9px 8px;gap:5px}.royal-stat-icon{width:30px;height:30px}.royal-stat strong{font-size:1.22rem}.royal-section-shortcuts{grid-template-columns:1fr 1fr}.royal-shortcut strong{font-size:.77rem}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

.royal-chart-empty{min-height:225px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;border:1px dashed #735331;border-radius:9px;color:#e6d0ad;padding:20px}
.royal-chart-empty strong{font-size:.93rem}.royal-chart-empty span{font-size:.82rem;color:#c2af91}.royal-panel-footnote{border-top:1px solid #62492e;padding-top:10px;margin-top:12px;color:#c5b192;font-size:.78rem;line-height:1.6}.royal-obligations{display:grid;gap:10px}.royal-obligations>div{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid #46301f;color:#d8c3a2}.royal-obligations>div strong{font-size:1.15rem;color:#f2d3a0;font-variant-numeric:tabular-nums}
@media(max-width:780px){.royal-hero-crest{display:block;position:absolute;top:35px;inset-inline-start:-8px;width:105px;height:100px;min-width:0;opacity:.18;pointer-events:none}.royal-stat small{font-size:.84rem}.royal-shortcut small{font-size:.82rem}}

/* Mobile legibility: never place the large decorative crest behind Arabic copy. */
@media(max-width:780px){.royal-hero-crest{display:none!important}}
/* Keep the global-search dropdown in front of page content on mobile. */
@media(max-width:780px){.topbar{position:relative;z-index:30}}

/* Founder-only whitelisted accent customization. */
:root{--founder-accent:#d9ae70}
.brand-caption,.topbar h1{color:var(--founder-accent)}
/* CTZ visual contrast correction: dark surfaces with readable warm-ivory text.
   Replaces unthemed legacy light backgrounds across every founder workflow. */
:root{
 --ctz-surface:#201811;--ctz-surface-raised:#291f17;--ctz-surface-active:#3c2918;
 --ctz-text:#f5e7d2;--ctz-text-muted:#d2bfa5;--ctz-line:#866747;
 --ctz-focus:#f4cb87;
}
.match-card,.advanced,.currency-item,.visit-head,.tender-financial,
.finance-tile,.share-cell,.founder-projection,.import-country-table tr,
.contact-category-chip,.relation-hub-count,.relation-person-card,
.relation-empty-symbol,.contact-picked,.relation-avatar,.relation-sensitive,
.case-match-note,.company-children,.project-company-assignment,
.relation-counter,.relation-status,.network-intro,.network-intro-steps span{
 background:var(--ctz-surface)!important;
 border-color:var(--ctz-line)!important;
 color:var(--ctz-text)!important;
}
.contact-category-chip:hover,.contact-category-chip:focus-visible,
.dashboard-stat:hover,.relation-person-card:hover,.contact-picked:hover{
 background:var(--ctz-surface-raised)!important;
 border-color:#d1a66f!important;
 color:var(--ctz-text)!important;
}
.contact-category-chip.selected{
 background:var(--ctz-surface-active)!important;
 border-color:#e5b977!important;
 box-shadow:inset 3px 0 0 #e5b977;
 color:#ffebca!important;
}
.contact-category-chip strong,.contact-category-chip.selected strong{
 color:#f4d5a3!important;
}
.contact-category-chip span,.relation-person-card p,.visit-head p,
.finance-tile span,.share-cell small,.founder-projection small,
.relation-hub-count,.currency-item small,.advanced p{
 color:var(--ctz-text-muted)!important;
}
.relation-counter.verified,.relation-status.verified{
 background:#1c3328!important;color:#bcebd0!important;border-color:#4b866b!important;
}
.relation-counter.recorded,.relation-status.recorded,
.relation-counter.unverified,.relation-status.unverified{
 background:#2d271e!important;color:#e6d0af!important;border-color:#8b7051!important;
}
.relation-counter.suggested,.relation-status.suggested{
 background:#342819!important;color:#f4d39e!important;border-color:#a47a42!important;
}
.relation-counter.caution,.relation-status.caution,.relation-sensitive{
 background:#3b201e!important;color:#ffb8a9!important;border-color:#a75c51!important;
}
.relation-hub-count{color:#f6dbac!important;font-weight:750}
.relation-avatar{color:#f3d5a3!important}
.relation-empty-symbol{color:#e5bd84!important}
.project-company-assignment input,.project-company-assignment select,
.advanced input,.advanced select{background:#1a1511!important;color:#f5e7d2!important;border:1px solid #92704d!important}
.match-card h2,.match-card h3,.tender-financial h2,.tender-financial h3,
.finance-tile strong,.share-cell strong,.founder-projection strong,
.visit-head h2,.visit-head strong,.relation-person-card strong{
 color:#f7e6cb!important;
}
.contact-category-chip:focus-visible,.relation-person-card:focus-visible,
.match-card:focus-within{outline:3px solid var(--ctz-focus);outline-offset:2px}
/* Prevent fixed mobile navigation from covering actionable controls after auto-scroll. */
@media(max-width:780px){
 html{scroll-padding-bottom:116px}
 #view button,#view a,#view input,#view select,#view textarea{scroll-margin-bottom:116px}
 .content{padding-bottom:calc(140px + env(safe-area-inset-bottom))}
}
