/* Distinct material and shape systems for each theme. Archival and Cutout are untouched. */

/* NOIR — black stage, moving spotlight, crisp white editorial sheets. */
:root[data-theme="noir"] body{
  background-color:#080909;
  background-image:radial-gradient(ellipse 68% 95% at 82% 18%,#f5f4e82b,transparent 66%),
    repeating-linear-gradient(115deg,transparent 0 44px,#fff4 45px 46px,transparent 47px 92px),
    linear-gradient(115deg,#050606 8%,#202223 52%,#080909 95%);
  background-attachment:fixed;
}
:root[data-theme="noir"] .sidebar{background:linear-gradient(140deg,#18191a,#090a0b 72%);border-right:5px solid #f2f2ed}
:root[data-theme="noir"] .topbar{background:#eeeeea;color:#111314;border-bottom:5px solid #111314;box-shadow:0 5px 0 #eeeeea}
:root[data-theme="noir"] .breadcrumb,:root[data-theme="noir"] .breadcrumb strong{color:#111314}
:root[data-theme="noir"] .breadcrumb span{color:#646968}
:root[data-theme="noir"] .topbar .mode-badge,:root[data-theme="noir"] .topbar .pill,:root[data-theme="noir"] .topbar .icon-btn{background:#17191a;color:#f8f8f3;border-color:#17191a}
:root[data-theme="noir"] .top-avatar{background:#111;color:#fff}
:root[data-theme="noir"] .page-head{border-bottom:5px solid #f4f4ee}
:root[data-theme="noir"] .page-head::after{display:none}
:root[data-theme="noir"] .page-head h1{font-weight:950;letter-spacing:-1.8px;font-size:clamp(32px,3.2vw,49px);text-shadow:4px 4px 0 #000}
:root[data-theme="noir"] .card{
  background:#f1f1ec;color:#17191a;border:2px solid #131516;border-radius:0;
  box-shadow:9px 9px 0 #111,9px 9px 0 2px #ededeb;
}
:root[data-theme="noir"] .card::before,:root[data-theme="noir"] .card::after{display:none}
:root[data-theme="noir"] .card:nth-child(2n){background:#dedfda}
:root[data-theme="noir"] .card-title,:root[data-theme="noir"] .item-card h3,:root[data-theme="noir"] .block-head strong,
:root[data-theme="noir"] .big-status,:root[data-theme="noir"] .metric .value{color:#121414}
:root[data-theme="noir"] .card-title,:root[data-theme="noir"] .item-card h3{font-size:19px;font-weight:950;letter-spacing:-.5px}
:root[data-theme="noir"] .card-header{border-bottom:4px solid #111}
:root[data-theme="noir"] .mini-label,:root[data-theme="noir"] .field label,:root[data-theme="noir"] .section-label{color:#343838;font-weight:850}
:root[data-theme="noir"] .divider{border-top:2px solid #111}
:root[data-theme="noir"] .metric-grid,:root[data-theme="noir"] .feed,:root[data-theme="noir"] .list-plain,
:root[data-theme="noir"] .table-wrap{background:#fff;color:#121414;border:2px solid #151717;border-radius:0;box-shadow:none}
:root[data-theme="noir"] .metric-grid .mini-label,:root[data-theme="noir"] .metric-grid .value,
:root[data-theme="noir"] .feed li span,:root[data-theme="noir"] .list-plain li{color:#121414}
:root[data-theme="noir"] .feed li .muted,:root[data-theme="noir"] .list-plain li strong{color:#292d2d}
:root[data-theme="noir"] .feed li time,:root[data-theme="noir"] .feed li strong,:root[data-theme="noir"] .list-plain .micro{color:#545959}
:root[data-theme="noir"] .feed li,:root[data-theme="noir"] .list-plain li{border-color:#777}
:root[data-theme="noir"] .table th{background:#151718;color:#fff;border-bottom:4px solid #555}
:root[data-theme="noir"] .table td{color:#191b1b;border-bottom:1px solid #8b8d88}
:root[data-theme="noir"] .table tbody tr:nth-child(even) td{background:#e3e4e0}
:root[data-theme="noir"] .table tr:hover td{background:#c5c7c3}
:root[data-theme="noir"] .table .btn.ghost{background:#fff;color:#131516;border:2px solid #151718}
:root[data-theme="noir"] .btn{background:#fff;color:#101112;border:2px solid #121414;border-radius:0;box-shadow:3px 3px 0 #141616;font-weight:850}
:root[data-theme="noir"] .btn.primary{background:#121414;color:#fff;box-shadow:4px 4px 0 #909390}
:root[data-theme="noir"] .btn.secondary,:root[data-theme="noir"] .btn.ghost{background:#e6e7e2;color:#121414}
:root[data-theme="noir"] .btn.danger{background:#363a3b;color:#fff}
:root[data-theme="noir"] .input,:root[data-theme="noir"] textarea,:root[data-theme="noir"] select{background:#fff;color:#141616;border:2px solid #161818;border-radius:0;box-shadow:none}
:root[data-theme="noir"] .input::placeholder,:root[data-theme="noir"] textarea::placeholder{color:#555b5b}
:root[data-theme="noir"] select option{background:#fff;color:#141616}
:root[data-theme="noir"] .muted,:root[data-theme="noir"] .micro,:root[data-theme="noir"] .hint,
:root[data-theme="noir"] .item-card p{color:#4a5050}
:root[data-theme="noir"] .composer-actions,:root[data-theme="noir"] .composer-block,
:root[data-theme="noir"] .tabbar,:root[data-theme="noir"] .plan-tile,
:root[data-theme="noir"] .emoji-picker,:root[data-theme="noir"] .mode-panel{background:#e6e7e2;color:#141616;border:2px solid #151717;border-radius:0}
:root[data-theme="noir"] .tabbar button{color:#424646;border-radius:0}
:root[data-theme="noir"] .tabbar button.active{background:#17191a;color:#fff;box-shadow:none}
:root[data-theme="noir"] .plan-tile.selected{background:#c8cac6;color:#111;border-color:#111;box-shadow:5px 5px 0 #111}
:root[data-theme="noir"] .plan-tile .micro{color:#4a5050}
:root[data-theme="noir"] .mock-notice{background:#f1f1ec;color:#121414;border:3px solid #141616;border-radius:0;box-shadow:5px 5px 0 #0a0a0a}
:root[data-theme="noir"] .mock-notice b{color:#121414;border-color:#121414}
.theme-choice[data-theme-choice="noir"]{background:#e8e9e5;color:#111;border:2px solid #111;border-radius:0;box-shadow:4px 4px 0 #111}
.theme-choice[data-theme-choice="noir"] .theme-description{color:#4a5050}
:root[data-theme="noir"] dialog{background:#f4f4f0;color:#171919;border:3px solid #111;border-radius:0;box-shadow:10px 10px 0 #080909}
:root[data-theme="noir"] dialog h2{color:#111}:root[data-theme="noir"] dialog p{color:#4a5050}
:root[data-theme="noir"] .badge{background:#fff;color:#151718;border-color:#151718}
:root[data-theme="noir"] .badge.good,:root[data-theme="noir"] .badge.warn,:root[data-theme="noir"] .badge.bad{background:#fff;color:#151718;border-color:#151718}
:root[data-theme="noir"] .switch{background:#777;border:1px solid #111}:root[data-theme="noir"] .switch:checked{background:#191b1b}
:root[data-theme="noir"] .switch:before{background:#fff}
:root[data-theme="noir"] .channel-results{background:#fff;border-color:#111;border-radius:0}
:root[data-theme="noir"] .channel-option{color:#111}:root[data-theme="noir"] .channel-option:hover{background:#dcdeda}
:root[data-theme="noir"] .channel-option small{color:#505656}
:root[data-theme="noir"] .warning{background:#d8d9d4;color:#292b2b;border:2px solid #111;border-radius:0}
:root[data-theme="noir"] .scope-group,:root[data-theme="noir"] .attachment-chip{border:2px solid #111;border-radius:0;color:#171919}
:root[data-theme="noir"] .attachment-chip{background:#fff}:root[data-theme="noir"] .checkbox-row{color:#111}
:root[data-theme="noir"] .log-details{background:#dadbd7;color:#151717}
:root[data-theme="noir"] .scope-group legend,:root[data-theme="noir"] .empty{color:#3b4040}
:root[data-theme="noir"] .emoji-choice,:root[data-theme="noir"] .emoji-selected #emoji-preview{background:#fff;color:#111;border:2px solid #111;border-radius:0}
:root[data-theme="noir"] .emoji-choice:hover,:root[data-theme="noir"] .emoji-choice[aria-pressed="true"]{background:#171919;color:#fff}

/* ABYSSAL — water pressure contours, deep glass, and bioluminescent edges. */
:root[data-theme="abyssal"] body{
  background-color:#01060b;
  background-image:repeating-radial-gradient(ellipse 62% 56% at 83% 28%,#75d9dc26 0 2px,transparent 3px 54px),
    radial-gradient(ellipse 45% 32% at 79% 27%,#3986a456,transparent 85%),
    radial-gradient(ellipse 75% 60% at 5% 110%,#164365aa,transparent 76%),
    linear-gradient(155deg,#01060b,#061c2c 58%,#01070d);
  background-attachment:fixed;
}
:root[data-theme="abyssal"] .sidebar{background:linear-gradient(165deg,#0c2b3aaa,#02111ce8),repeating-radial-gradient(circle at 30% 8%,#b2faff0c 0 1px,transparent 2px 29px),#04131e;border-right:1px solid #62b9c7}
:root[data-theme="abyssal"] .topbar{background:#041721c9;backdrop-filter:blur(12px);border-bottom:1px solid #7bd6d499;box-shadow:0 10px 30px #0009}
:root[data-theme="abyssal"] .page-head{border-bottom:1px solid #7bd6d488}
:root[data-theme="abyssal"] .page-head::after{width:45%;height:1px;background:linear-gradient(90deg,#b3ffff,transparent);box-shadow:0 0 15px #55f5db}
:root[data-theme="abyssal"] .page-head h1{font-weight:450;letter-spacing:-1.5px;font-size:clamp(32px,3vw,46px)}
:root[data-theme="abyssal"] .card{
  background:radial-gradient(ellipse at 100% 0%,#6ad9df24,transparent 55%),linear-gradient(152deg,#0e3546e8,#061b29f0);
  border:1px solid #8be4df77;border-radius:28px 7px 28px 7px;
  box-shadow:inset 0 1px #daffff41,inset 0 0 45px #4acfe314,0 24px 40px #000b,0 0 0 4px #57d4da0c;
}
:root[data-theme="abyssal"] .card::before,:root[data-theme="abyssal"] .card::after{display:none}
:root[data-theme="abyssal"] .card:nth-child(2n){border-radius:7px 28px 7px 28px}
:root[data-theme="abyssal"] .card-header{border-bottom:1px solid #75cbd58c}
:root[data-theme="abyssal"] .card-title,:root[data-theme="abyssal"] .item-card h3{font-weight:500;letter-spacing:.15px;font-size:20px;color:#d9fffc}
:root[data-theme="abyssal"] .metric-grid,:root[data-theme="abyssal"] .feed,:root[data-theme="abyssal"] .list-plain,
:root[data-theme="abyssal"] .table-wrap{background:#072432b8;color:#e7fafb;border:1px solid #83d9de69;border-radius:19px 4px 19px 4px;box-shadow:inset 0 1px #d8ffff26}
:root[data-theme="abyssal"] .table th{background:#0b3a49;color:#b3faf0;border-bottom:1px solid #73c9c9}
:root[data-theme="abyssal"] .btn,:root[data-theme="abyssal"] .input,:root[data-theme="abyssal"] textarea,
:root[data-theme="abyssal"] select,:root[data-theme="abyssal"] .tabbar,:root[data-theme="abyssal"] .plan-tile,
:root[data-theme="abyssal"] dialog{border-radius:22px 5px 22px 5px}
:root[data-theme="abyssal"] .btn.primary{background:#9ce8dc;color:#06333d;box-shadow:0 0 23px #5de7d159}
:root[data-theme="abyssal"] .tabbar{background:#061e2cbb;border:1px solid #76c8cc}
:root[data-theme="abyssal"] .tabbar button{border-radius:16px 3px}
:root[data-theme="abyssal"] .plan-tile{background:#092b39;border-color:#6bc1c3;box-shadow:inset 0 0 30px #53cad318}
:root[data-theme="abyssal"] .plan-tile.selected{background:#164754;border-color:#aefff1;box-shadow:0 0 21px #74e8d564}
:root[data-theme="abyssal"] .mock-notice{border:1px solid #81d4d0;border-radius:20px 4px;background:#0c3643;box-shadow:inset 3px 0 #a8fff3,0 8px 25px #00141f}
.theme-choice[data-theme-choice="abyssal"]{background:#092736;border-color:#64b7bb;border-radius:22px 5px 22px 5px;box-shadow:inset 0 1px #affff033}
.theme-choice[data-theme-choice="abyssal"]:hover,.theme-choice[data-theme-choice="abyssal"][aria-pressed="true"]{box-shadow:0 0 25px #5ce8dc6b}

/* PRISMATIC — dark faceted stage with refracted color in every surface. */
:root[data-theme="prismatic"] body{
  background-color:#03040a;
  background-image:linear-gradient(136deg,transparent 0 16%,#6b2aa835 16.2% 24%,transparent 24.2% 100%),
    linear-gradient(51deg,transparent 0 54%,#087fb638 54.2% 61%,transparent 61.2% 100%),
    linear-gradient(161deg,transparent 0 76%,#df763023 76.2% 85%,transparent 85.2% 100%),
    conic-gradient(from 65deg at 83% 31%,#03040a,#261152 16%,#071b43 24%,#03040a 35%,#35111f 55%,#03040a 70%,#0d342e 85%,#03040a);
  background-attachment:fixed;
}
:root[data-theme="prismatic"] .sidebar{background:linear-gradient(159deg,#201039,#070911 53%,#082532);border-right:3px solid transparent;border-image:linear-gradient(#ff6aab,#84eece,#6bbafa,#f2bd72) 1}
:root[data-theme="prismatic"] .topbar{background:#080b13ee;backdrop-filter:blur(12px);border-bottom:3px solid transparent;border-image:linear-gradient(90deg,#ff70a3,#f0c466,#70d5a2,#58c9f1,#bf8af4) 1}
:root[data-theme="prismatic"] .page-head{border-bottom:2px solid #754ca7}
:root[data-theme="prismatic"] .page-head h1{font-size:clamp(32px,3vw,46px);font-weight:900;letter-spacing:-1.8px}
:root[data-theme="prismatic"] .page-head::after{width:38%;height:4px;background:linear-gradient(90deg,#fc6c9b,#ffca69,#72e2a9,#6acbff,#be88ff,transparent);box-shadow:0 0 20px #dc6bff64}
:root[data-theme="prismatic"] .card{
  background:linear-gradient(#0d1020ee,#0d1020ee) padding-box,
    linear-gradient(128deg,#fc79a3,#f5c36e 26%,#61d6aa 52%,#6abff4 74%,#c28aff) border-box;
  color:#f4f1ff;border:2px solid transparent;border-radius:3px 26px 3px 26px;
  box-shadow:0 14px 32px #000e,0 0 31px #a05de72a;
}
:root[data-theme="prismatic"] .card:nth-child(3n+2){border-radius:26px 3px 26px 3px;background:linear-gradient(#101521ee,#101521ee) padding-box,linear-gradient(45deg,#6bd2ff,#af87ff,#fa7cab,#ffe289) border-box}
:root[data-theme="prismatic"] .card:nth-child(3n+3){background:linear-gradient(#0c111cee,#0c111cee) padding-box,linear-gradient(110deg,#7ee3ad,#6abff4,#ff7da7) border-box}
:root[data-theme="prismatic"] .card::before{top:0;left:17px;width:calc(100% - 34px);height:3px;background:linear-gradient(90deg,#f86da0,#e7c362,#59dbad,#5cbdf5,#b480f6)}
:root[data-theme="prismatic"] .card::after{display:none}
:root[data-theme="prismatic"] .card-header{border-bottom:1px solid #9a6fb9}
:root[data-theme="prismatic"] .card-title,:root[data-theme="prismatic"] .item-card h3{color:#f8d8ff;font-weight:800}
:root[data-theme="prismatic"] .card:nth-child(3n+2) .card-title,:root[data-theme="prismatic"] .card:nth-child(3n+2) h3{color:#a6e5ff}
:root[data-theme="prismatic"] .card:nth-child(3n+3) .card-title,:root[data-theme="prismatic"] .card:nth-child(3n+3) h3{color:#b0f5d1}
:root[data-theme="prismatic"] .metric-grid,:root[data-theme="prismatic"] .feed,:root[data-theme="prismatic"] .list-plain,
:root[data-theme="prismatic"] .table-wrap{background:linear-gradient(130deg,#231735,#102031);border:1px solid #a06ee0;border-radius:2px 16px 2px 16px;box-shadow:inset 0 1px #ffffff36}
:root[data-theme="prismatic"] .metric-grid .metric:nth-child(4n+1) .value{color:#ffc19a}
:root[data-theme="prismatic"] .metric-grid .metric:nth-child(4n+2) .value{color:#94f1cd}
:root[data-theme="prismatic"] .metric-grid .metric:nth-child(4n+3) .value{color:#9fdcff}
:root[data-theme="prismatic"] .metric-grid .metric:nth-child(4n+4) .value{color:#e6bdff}
:root[data-theme="prismatic"] .table th{background:#281a40;color:#ffbbde;border-bottom:2px solid #a579e7}
:root[data-theme="prismatic"] .table th:nth-child(3n+2){color:#a2efff}
:root[data-theme="prismatic"] .table th:nth-child(3n+3){color:#a5f0cd}
:root[data-theme="prismatic"] .nav-item.active{background:linear-gradient(115deg,#cc91eb,#88d4f6,#84e5b3);border-left-color:#ff9daa;color:#151027}
:root[data-theme="prismatic"] .nav-item.active span{color:#191433}
:root[data-theme="prismatic"] .tabbar{background:#0b1020;border:1px solid #a478e2;border-radius:2px 16px}
:root[data-theme="prismatic"] .tabbar button.active{background:linear-gradient(105deg,#d877c9,#8179dc,#65c8e4);color:#10101b}
:root[data-theme="prismatic"] .btn.primary{background:linear-gradient(110deg,#f6a9cc,#f4ca85,#89e7d7);border-color:#ffddc5;color:#171225;box-shadow:0 0 19px #e689ef69}
:root[data-theme="prismatic"] .btn.secondary{background:#14404b;color:#bff8ee;border-color:#76ddd1}
:root[data-theme="prismatic"] .btn.danger{background:#4d1b3a;color:#ffc1d3;border-color:#f684b4}
:root[data-theme="prismatic"] .input,:root[data-theme="prismatic"] textarea,:root[data-theme="prismatic"] select{border:1px solid #ab86ed;border-radius:3px 13px 3px 13px;background:#181629;color:#f6f1ff;box-shadow:inset 3px 0 #db79d054}
:root[data-theme="prismatic"] .mock-notice{background:#20192f;color:#f3e8ff;border:2px solid transparent;border-image:linear-gradient(90deg,#ff89bd,#8ae8d5,#98aafa) 1;box-shadow:none}
:root[data-theme="prismatic"] .plan-tile{background:#151c2f;border-color:#8f79cd;border-radius:3px 19px}
:root[data-theme="prismatic"] .plan-tile.selected{background:#282040;border-color:#ee97d5;box-shadow:0 0 22px #e47fca6b}
.theme-choice[data-theme-choice="prismatic"]{background:#141629;border:2px solid #8f75c6;border-radius:3px 20px 3px 20px;box-shadow:inset 0 3px #cf7bd7}

/* MOONLIT — a night sky chart over rounded porcelain and silver. */
:root[data-theme="moonlit"] body{
  background-color:#071124;
  background-image:radial-gradient(circle at 20% 20%,#fff8ddcc 0 1px,transparent 2px),
    radial-gradient(circle at 70% 60%,#e2ebffbb 0 1px,transparent 2px),
    radial-gradient(circle at 53% 18%,#d8e7ff88 0 1px,transparent 2px),
    repeating-radial-gradient(circle at 90% -12%,transparent 0 135px,#a5c8ff24 136px 137px,transparent 138px 190px),
    radial-gradient(circle at 83% 3%,#a6c0ef63,transparent 25%),linear-gradient(160deg,#061024,#192e56 65%,#070f21);
  background-size:239px 271px,347px 323px,421px 367px,auto,auto,auto;
  background-attachment:fixed;
}
:root[data-theme="moonlit"] .sidebar{background:radial-gradient(circle at 60% -8%,#acc9ff49,transparent 42%),linear-gradient(#142544,#09162e);border-right:1px solid #acc8ed;box-shadow:7px 0 26px #030b1dcc}
:root[data-theme="moonlit"] .brandmark{border-radius:50%;background:#e1e7f5;color:#1a2f52;box-shadow:0 0 0 5px #bdcfed28,0 0 24px #bdd7ff77}
:root[data-theme="moonlit"] .topbar{background:#142749d9;border-bottom:1px solid #b0c3e0;box-shadow:0 7px 25px #03091a99;backdrop-filter:blur(9px)}
:root[data-theme="moonlit"] .page-head{border-bottom:1px solid #b6c9e1}
:root[data-theme="moonlit"] .page-head::after{width:110px;height:4px;bottom:-2px;border:0;border-radius:8px;background:#e8e0bd;box-shadow:0 0 19px #fff5d2;transform:none}
:root[data-theme="moonlit"] .page-head h1{font:500 clamp(33px,3vw,46px)/1.12 Georgia,serif;letter-spacing:-1px;text-shadow:0 0 24px #c4daff66}
:root[data-theme="moonlit"] .nav-item{border-radius:30px}
:root[data-theme="moonlit"] .nav-item.active{background:#dce5f5;color:#142744;border-left:0;box-shadow:0 0 18px #c2d7ff66}
:root[data-theme="moonlit"] .card{
  background:linear-gradient(145deg,#f6f8ff,#dce5f5 83%);color:#192c4a;
  border:1px solid #f8fbff;border-radius:26px;
  box-shadow:inset 0 1px #fff,0 15px 35px #02081ec2,0 0 0 3px #d6e3f42b;
}
:root[data-theme="moonlit"] .card::before,:root[data-theme="moonlit"] .card::after{display:none}
:root[data-theme="moonlit"] .card-title,:root[data-theme="moonlit"] .item-card h3,:root[data-theme="moonlit"] .block-head strong{font:600 21px Georgia,serif;color:#1c3051}
:root[data-theme="moonlit"] .card-header{border-bottom:1px solid #9db3d0}
:root[data-theme="moonlit"] .mini-label,:root[data-theme="moonlit"] .field label,:root[data-theme="moonlit"] .section-label{color:#405d84}
:root[data-theme="moonlit"] .big-status,:root[data-theme="moonlit"] .metric .value{color:#193454}
:root[data-theme="moonlit"] .divider{border-top:1px solid #9baec8}
:root[data-theme="moonlit"] .metric-grid,:root[data-theme="moonlit"] .feed,:root[data-theme="moonlit"] .list-plain,
:root[data-theme="moonlit"] .table-wrap{background:#fff;color:#1c3051;border:1px solid #b2c4d9;border-radius:20px;box-shadow:0 5px 16px #20385a22}
:root[data-theme="moonlit"] .metric-grid .mini-label,:root[data-theme="moonlit"] .metric-grid .value,
:root[data-theme="moonlit"] .feed li span,:root[data-theme="moonlit"] .list-plain li,:root[data-theme="moonlit"] .list-plain li strong{color:#1c3051}
:root[data-theme="moonlit"] .feed li time,:root[data-theme="moonlit"] .feed li strong,:root[data-theme="moonlit"] .list-plain .micro{color:#4b6688}
:root[data-theme="moonlit"] .feed li,:root[data-theme="moonlit"] .list-plain li{border-color:#b4c5dd}
:root[data-theme="moonlit"] .table th{background:#d3dff0;color:#254363;border-bottom:1px solid #9aafcf}
:root[data-theme="moonlit"] .table td{color:#1c3051;border-bottom:1px solid #bdd0e4}
:root[data-theme="moonlit"] .table tr:hover td{background:#e6f0ff}
:root[data-theme="moonlit"] .table .btn.ghost{background:#f7faff;color:#1c3051;border-color:#8ea5cb}
:root[data-theme="moonlit"] .btn{background:#fff;color:#1c3051;border:1px solid #8fa8cd;border-radius:999px;box-shadow:0 3px 11px #233f7024}
:root[data-theme="moonlit"] .btn.primary{background:#244573;color:#fff;border-color:#244573;box-shadow:0 0 13px #6389c566}
:root[data-theme="moonlit"] .btn.secondary,:root[data-theme="moonlit"] .btn.ghost{background:#e0e9f6;color:#1a3052}
:root[data-theme="moonlit"] .btn.danger{background:#734457;color:#fff;border-color:#734457}
:root[data-theme="moonlit"] .input,:root[data-theme="moonlit"] textarea,:root[data-theme="moonlit"] select{background:#fff;color:#1b3252;border:1px solid #9bb2d1;border-radius:18px;box-shadow:inset 0 2px 5px #263d6415}
:root[data-theme="moonlit"] .input::placeholder,:root[data-theme="moonlit"] textarea::placeholder{color:#5f7798}
:root[data-theme="moonlit"] select option{background:#fff;color:#1b3252}
:root[data-theme="moonlit"] .hint,:root[data-theme="moonlit"] .micro,:root[data-theme="moonlit"] .muted,:root[data-theme="moonlit"] .item-card p{color:#4e6685}
:root[data-theme="moonlit"] .composer-actions,:root[data-theme="moonlit"] .composer-block,:root[data-theme="moonlit"] .tabbar,
:root[data-theme="moonlit"] .plan-tile,:root[data-theme="moonlit"] .emoji-picker,:root[data-theme="moonlit"] .mode-panel{background:#e5eefb;color:#1c3051;border:1px solid #a5bce0;border-radius:19px}
:root[data-theme="moonlit"] .tabbar button{color:#496288;border-radius:17px}
:root[data-theme="moonlit"] .tabbar button.active{background:#294976;color:#fff;box-shadow:0 3px 10px #29497644}
:root[data-theme="moonlit"] .plan-tile.selected{background:#c6d8f1;border-color:#4b6f9f;box-shadow:0 0 0 3px #91add052}
:root[data-theme="moonlit"] .plan-tile .micro{color:#4e6685}
:root[data-theme="moonlit"] .mock-notice{background:#f4f8ff;color:#213957;border:1px solid #adc1d9;border-radius:20px;box-shadow:0 5px 18px #233e6133}
:root[data-theme="moonlit"] .mock-notice b{color:#1c3051;border-color:#647da4}
.theme-choice[data-theme-choice="moonlit"]{background:#ecf2fc;color:#1c3051;border:1px solid #a9bdd8;border-radius:22px;box-shadow:0 5px 20px #0d1c3f55}
.theme-choice[data-theme-choice="moonlit"] .theme-description{color:#50688a}
:root[data-theme="moonlit"] dialog{background:#f2f6ff;color:#1c3051;border:1px solid #b0c5e0;border-radius:24px;box-shadow:0 20px 60px #020b21}
:root[data-theme="moonlit"] dialog h2{color:#1c3051}:root[data-theme="moonlit"] dialog p{color:#50688a}
:root[data-theme="moonlit"] .badge{background:#fff;color:#1c3051;border-color:#93a8c7}
:root[data-theme="moonlit"] .badge.good{color:#1c6548;background:#dff6e9;border-color:#7db39b}
:root[data-theme="moonlit"] .badge.warn{color:#765421;background:#fff0d4;border-color:#d3b477}
:root[data-theme="moonlit"] .badge.bad{color:#893e49;background:#ffe8ea;border-color:#dca9ad}
:root[data-theme="moonlit"] .channel-results{background:#fff;border-color:#9bb2d1}
:root[data-theme="moonlit"] .channel-option{color:#1c3051}:root[data-theme="moonlit"] .channel-option:hover{background:#e3ecfa}
:root[data-theme="moonlit"] .channel-option small{color:#587394}
:root[data-theme="moonlit"] .warning{background:#fff2db;color:#684922;border-color:#d7ba82;border-radius:16px}
:root[data-theme="moonlit"] .attachment-chip{background:#e5eefb;color:#1c3051;border:1px solid #a5bce0;border-radius:18px}
:root[data-theme="moonlit"] .scope-group{border:1px solid #a5bce0;border-radius:18px}
:root[data-theme="moonlit"] .checkbox-row{color:#1c3051}
:root[data-theme="moonlit"] .log-details{background:#e5eefb;color:#1c3051}
:root[data-theme="moonlit"] .scope-group legend,:root[data-theme="moonlit"] .empty{color:#405d84}
:root[data-theme="moonlit"] .emoji-choice,:root[data-theme="moonlit"] .emoji-selected #emoji-preview{background:#fff;color:#1c3051;border:1px solid #9bb2d1;border-radius:50%}
:root[data-theme="moonlit"] .emoji-choice:hover,:root[data-theme="moonlit"] .emoji-choice[aria-pressed="true"]{background:#244573;color:#fff}

/* ANTIQUE — leather desk, pressed grain, parchment sheets, and brass rules. */
:root[data-theme="antique"] body{
  background-color:#20120d;
  background-image:repeating-linear-gradient(96deg,transparent 0 3px,#d79f5a0b 4px 5px,transparent 6px 13px),
    repeating-linear-gradient(0deg,transparent 0 64px,#07030266 65px 68px,transparent 69px 210px),
    radial-gradient(ellipse at 80% 1%,#8c512c66,transparent 52%),
    linear-gradient(110deg,#1a0d09,#492817 55%,#170b08);
  background-attachment:fixed;
}
:root[data-theme="antique"] .sidebar{background:repeating-linear-gradient(95deg,transparent 0 8px,#a973420e 9px 10px,transparent 11px 17px),linear-gradient(90deg,#28140d,#50321f);border-right:6px ridge #bd8e5b;box-shadow:inset -10px 0 20px #110602a8,7px 0 20px #0c0402}
:root[data-theme="antique"] .topbar{background:linear-gradient(#5c3a24,#302014);border-bottom:5px ridge #d4a46b;box-shadow:0 6px 17px #100604bb}
:root[data-theme="antique"] .page-head{border-bottom:3px double #e3b978}
:root[data-theme="antique"] .page-head::after{width:90px;height:6px;background:#d9a96d;border:0;transform:none;border-radius:0}
:root[data-theme="antique"] .page-head h1{font:600 clamp(33px,3.1vw,47px)/1.1 Georgia,serif;font-variant:small-caps;letter-spacing:1px;text-shadow:2px 3px 0 #100805}
:root[data-theme="antique"] .card{
  background-image:repeating-linear-gradient(0deg,#72431c0a 0 1px,transparent 1px 5px),
    radial-gradient(ellipse at 85% 4%,#fff8dc,transparent 69%),linear-gradient(150deg,#f3e1bd,#dbc094);
  color:#422b1d;border:3px double #91653d;border-radius:2px;
  box-shadow:inset 0 0 0 5px #ecd4a6,inset 0 0 0 6px #9d784f70,7px 10px 0 #120905b3;
}
:root[data-theme="antique"] .card::before{display:block;top:9px;left:9px;width:13px;height:13px;border-top:2px solid #986c3d;border-left:2px solid #986c3d;background:none}
:root[data-theme="antique"] .card::after{display:block;bottom:9px;right:9px;width:13px;height:13px;border-bottom:2px solid #986c3d;border-right:2px solid #986c3d;background:none}
:root[data-theme="antique"] .card-title,:root[data-theme="antique"] .item-card h3,:root[data-theme="antique"] .block-head strong{color:#482714;font:700 22px Georgia,serif;font-variant:small-caps}
:root[data-theme="antique"] .card-header{border-bottom:3px double #96734b}
:root[data-theme="antique"] .mini-label,:root[data-theme="antique"] .field label,:root[data-theme="antique"] .section-label{color:#70472e}
:root[data-theme="antique"] .big-status,:root[data-theme="antique"] .metric .value{color:#3d271c}
:root[data-theme="antique"] .divider{border-top:2px solid #ad8b5e}
:root[data-theme="antique"] .metric-grid,:root[data-theme="antique"] .feed,:root[data-theme="antique"] .list-plain,
:root[data-theme="antique"] .table-wrap{background:#f6e8c9;color:#462d1d;border:1px solid #98734c;border-radius:0;box-shadow:inset 0 0 0 4px #e7d1a7}
:root[data-theme="antique"] .metric-grid .mini-label,:root[data-theme="antique"] .metric-grid .value,
:root[data-theme="antique"] .feed li span,:root[data-theme="antique"] .list-plain li,:root[data-theme="antique"] .list-plain li strong{color:#462d1d}
:root[data-theme="antique"] .feed li time,:root[data-theme="antique"] .feed li strong,:root[data-theme="antique"] .list-plain .micro{color:#76563d}
:root[data-theme="antique"] .feed li,:root[data-theme="antique"] .list-plain li{border-color:#ac875c}
:root[data-theme="antique"] .table th{background:#68432b;color:#f8dfab;border-bottom:2px solid #e4bd82}
:root[data-theme="antique"] .table td{color:#452c1c;border-bottom:1px solid #a77d54;font-family:Georgia,serif}
:root[data-theme="antique"] .table tbody tr:nth-child(even) td{background:#ebdab4}
:root[data-theme="antique"] .table tr:hover td{background:#d9bd8c}
:root[data-theme="antique"] .table .btn.ghost{background:#f7e8c8;color:#452c1c;border-color:#91633d}
:root[data-theme="antique"] .btn{background:#f4e1b9;color:#462917;border:1px solid #8c5e35;border-radius:2px;box-shadow:inset 0 1px #fff5d8,2px 3px 0 #79502d;font-family:Georgia,serif;font-weight:700}
:root[data-theme="antique"] .btn.primary{background:#58301b;color:#fff0cd;border-color:#d6a86a;box-shadow:inset 0 0 0 2px #ad7749,3px 3px 0 #201007}
:root[data-theme="antique"] .btn.secondary,:root[data-theme="antique"] .btn.ghost{background:#e8d1a4;color:#462917}
:root[data-theme="antique"] .btn.danger{background:#743a2c;color:#fff0da;border-color:#a66750}
:root[data-theme="antique"] .input,:root[data-theme="antique"] textarea,:root[data-theme="antique"] select{background:#fff3d7;color:#422b1d;border:1px solid #98724c;border-radius:2px;box-shadow:inset 2px 2px 5px #78533125}
:root[data-theme="antique"] .input::placeholder,:root[data-theme="antique"] textarea::placeholder{color:#866a50}
:root[data-theme="antique"] select option{background:#fff3d7;color:#422b1d}
:root[data-theme="antique"] .hint,:root[data-theme="antique"] .micro,:root[data-theme="antique"] .muted,:root[data-theme="antique"] .item-card p{color:#76573e}
:root[data-theme="antique"] .composer-actions,:root[data-theme="antique"] .composer-block,
:root[data-theme="antique"] .tabbar,:root[data-theme="antique"] .plan-tile,
:root[data-theme="antique"] .emoji-picker,:root[data-theme="antique"] .mode-panel{background:#ead5ad;color:#422b1d;border:2px solid #a77d4a;border-radius:2px}
:root[data-theme="antique"] .tabbar button{color:#69462e;border-radius:0;font-family:Georgia,serif}
:root[data-theme="antique"] .tabbar button.active{background:#67412a;color:#ffebbd;box-shadow:inset 0 0 0 2px #bd9560}
:root[data-theme="antique"] .plan-tile.selected{background:#f2e2bc;color:#422b1d;border-color:#684124;box-shadow:inset 0 0 0 3px #c49a63,4px 5px 0 #4b2916}
:root[data-theme="antique"] .plan-tile .micro{color:#76573e}
:root[data-theme="antique"] .mock-notice{background:#f1ddb7;color:#402918;border:3px double #805634;border-radius:1px;box-shadow:inset 0 0 0 4px #f6e7c5,4px 5px 0 #1c0c06}
:root[data-theme="antique"] .mock-notice b{color:#402918;border-color:#94683b}
.theme-choice[data-theme-choice="antique"]{background:#ead5ad;color:#422b1d;border:3px double #91643f;border-radius:2px;box-shadow:4px 5px 0 #1c0c06}
.theme-choice[data-theme-choice="antique"] .theme-description{color:#76573e}
:root[data-theme="antique"] dialog{background:#f0dfba;color:#422b1d;border:4px double #8e633b;border-radius:2px;box-shadow:9px 12px 0 #190a05}
:root[data-theme="antique"] dialog h2{color:#422b1d}:root[data-theme="antique"] dialog p{color:#76573e}
:root[data-theme="antique"] .badge{background:#f6e9c9;color:#422b1d;border-color:#98724c;border-radius:2px}
:root[data-theme="antique"] .badge.good{color:#365333;background:#e0e8bd;border-color:#75875a}
:root[data-theme="antique"] .badge.warn{color:#744d1d;background:#f7e1a9;border-color:#b88a45}
:root[data-theme="antique"] .badge.bad{color:#813e36;background:#f5d4bc;border-color:#c38972}
:root[data-theme="antique"] .channel-results{background:#fff0cb;border-color:#98724c;border-radius:2px}
:root[data-theme="antique"] .channel-option{color:#422b1d}:root[data-theme="antique"] .channel-option:hover{background:#e5cc9e}
:root[data-theme="antique"] .channel-option small{color:#76573e}
:root[data-theme="antique"] .warning{background:#f9e4b4;color:#67401c;border-color:#a77b45;border-radius:2px}
:root[data-theme="antique"] .attachment-chip{background:#f5e5bf;color:#422b1d;border:1px solid #98724c;border-radius:2px}
:root[data-theme="antique"] .scope-group{border:2px double #98724c;border-radius:2px}
:root[data-theme="antique"] .checkbox-row{color:#422b1d}
:root[data-theme="antique"] .log-details{background:#e9d5ad;color:#422b1d}
:root[data-theme="antique"] .scope-group legend,:root[data-theme="antique"] .empty{color:#70472e}
:root[data-theme="antique"] .emoji-choice,:root[data-theme="antique"] .emoji-selected #emoji-preview{background:#f6e8c9;color:#422b1d;border:1px solid #98724c;border-radius:2px}
:root[data-theme="antique"] .emoji-choice:hover,:root[data-theme="antique"] .emoji-choice[aria-pressed="true"]{background:#67412a;color:#fff0cd}

/* VOLCANIC — the actual basalt asset must be visible between molten slabs. */
:root[data-theme="volcanic"] body{
  background-color:#160c0a;
  background-image:linear-gradient(#db531114,#db531114),url('./volcanic-rock.webp');
  background-size:auto,1600px auto;
  background-position:center,center top;
  background-repeat:repeat,repeat;
  background-attachment:fixed,fixed;
}
:root[data-theme="volcanic"] .sidebar{
  background:linear-gradient(130deg,#1b0d08be,#150b09d2),url('./volcanic-rock.webp') center / 650px auto;
  border-right:4px solid #e85b24;box-shadow:5px 0 25px #f04e224a;
}
:root[data-theme="volcanic"] .card{
  background:radial-gradient(ellipse at 90% -25%,#b0461f51,transparent 55%),linear-gradient(145deg,#2a1812f0,#100d0cf4);
  border:2px solid #d66b30;border-radius:3px 21px 3px 13px;
  box-shadow:inset 0 1px #ffc6807a,inset 0 0 22px #e9581a24,0 16px 34px #090403da,0 0 0 4px #180b08;
}
:root[data-theme="volcanic"] .topbar{background:linear-gradient(100deg,#180e0ae9,#35160be9 55%,#100b09e9)}
:root[data-theme="volcanic"] .metric-grid,:root[data-theme="volcanic"] .feed,:root[data-theme="volcanic"] .list-plain,
:root[data-theme="volcanic"] .table-wrap{background:linear-gradient(145deg,#382016,#160f0de9);border-color:#bd5427;box-shadow:inset 0 1px #ffa56555,0 7px 19px #0b0303c7}
:root[data-theme="volcanic"] .card::before{height:5px;box-shadow:0 0 15px #fb7136a8}
:root[data-theme="volcanic"] .btn.primary{background:linear-gradient(110deg,#f05121,#ffba53,#e8612c);color:#220e08;border-color:#ffc983;box-shadow:0 0 18px #f76931a4,0 3px 0 #2e1008}
.theme-choice[data-theme-choice="volcanic"]{background:#20130feb;border-color:#a84a22;box-shadow:0 7px 21px #080302bd,inset 0 2px #e67237}

/* The picker previews the actual background material of each preset. */
.theme-swatch[data-theme-swatch="noir"]{background:radial-gradient(ellipse at 83% 21%,#eeeeeb55,transparent 55%),repeating-linear-gradient(115deg,transparent 0 16px,#ffffff13 17px 18px),#0d0e0f}
.theme-swatch[data-theme-swatch="noir"] i{background:#f1f1ec;border:2px solid #111;border-radius:0;box-shadow:3px 3px 0 #000}
.theme-swatch[data-theme-swatch="abyssal"]{background:repeating-radial-gradient(circle at 86% 35%,#80dce142 0 1px,transparent 2px 15px),linear-gradient(#0c3144,#010913)}
.theme-swatch[data-theme-swatch="abyssal"] i{background:#0c3846;border:1px solid #8eddd7;border-radius:10px 2px 10px 2px;box-shadow:0 0 8px #65dddd55}
.theme-swatch[data-theme-swatch="prismatic"]{background:linear-gradient(143deg,transparent 34%,#a142ba71 35% 46%,transparent 47%),linear-gradient(46deg,transparent 49%,#1ca5ae5e 50% 63%,transparent 64%),#05050b}
.theme-swatch[data-theme-swatch="prismatic"] i{background:#131523;border:2px solid #bb86dc;border-radius:2px 10px 2px 10px;box-shadow:inset 0 4px #f687b4}
.theme-swatch[data-theme-swatch="moonlit"]{background:radial-gradient(circle at 66% 22%,#fff 0 1px,transparent 2px),repeating-radial-gradient(circle at 90% -20%,transparent 0 20px,#b3cef045 21px 22px,transparent 23px 36px),#102344}
.theme-swatch[data-theme-swatch="moonlit"] i{background:#e5edfc;border:1px solid #d2e2ff;border-radius:12px;box-shadow:0 3px 9px #020b23}
.theme-swatch[data-theme-swatch="antique"]{background:repeating-linear-gradient(95deg,transparent 0 3px,#e3af6b24 4px 5px,transparent 6px 10px),#392115}
.theme-swatch[data-theme-swatch="antique"] i{background:#f1dcaf;border:3px double #714b2d;border-radius:1px;box-shadow:3px 3px 0 #150803}
.theme-swatch[data-theme-swatch="volcanic"]{--swatch-side:#261510;--swatch-top:linear-gradient(90deg,#812a17,#f27228,#631d13);--swatch-panel:#251511;--swatch-paper:#472419;--swatch-line:#ed7b32;--swatch-accent:#ffb257;background:url('./volcanic-rock.webp') center / 350px auto}
.theme-swatch[data-theme-swatch="volcanic"] i{border:1px solid #f27735;border-radius:2px 10px 2px 7px;box-shadow:inset 0 3px #ffb257,0 0 10px #ff57297d}

@media (prefers-reduced-motion:reduce){:root[data-theme="volcanic"] .card::before{animation:none}}

@media (max-width:760px){
  :root[data-theme="noir"] body,:root[data-theme="abyssal"] body,
  :root[data-theme="prismatic"] body,:root[data-theme="moonlit"] body,
  :root[data-theme="antique"] body{background-attachment:scroll}
  :root[data-theme="volcanic"] body{background-attachment:scroll,scroll}
}

/* Paint the workspace as well as the page. It spans the visible canvas on every view. */
:root[data-theme="noir"] .main-shell{
  background-color:#090a0b;
  background-image:radial-gradient(ellipse at 88% 16%,#e9e9e525,transparent 44%),
    linear-gradient(123deg,transparent 25%,#ededed10 26% 29%,transparent 30%),
    linear-gradient(110deg,#070808,#242627 55%,#070808);
}
:root[data-theme="abyssal"] .main-shell{
  background-color:#010b12;
  background-image:repeating-radial-gradient(ellipse 65% 54% at 88% 12%,#8bdae127 0 1px,transparent 2px 46px),
    radial-gradient(ellipse at 78% 14%,#20788d54,transparent 48%),
    linear-gradient(145deg,#02080e,#0b2e43 63%,#010810);
}
:root[data-theme="prismatic"] .main-shell{
  background-color:#05050c;
  background-image:linear-gradient(133deg,transparent 0 22%,#8e36b534 22.2% 34%,transparent 34.2%),
    linear-gradient(46deg,transparent 0 61%,#127bab3d 61.2% 73%,transparent 73.2%),
    conic-gradient(from 45deg at 84% 22%,#070710,#281544,#071d33,#120b1b,#3a1426,#06120f,#070710);
}
:root[data-theme="moonlit"] .main-shell{
  background-color:#07132c;
  background-image:radial-gradient(circle at 38% 25%,#f7f4dcac 0 1px,transparent 2px),
    radial-gradient(circle at 83% 70%,#e4efffb8 0 1px,transparent 2px),
    repeating-radial-gradient(circle at 86% -9%,transparent 0 111px,#b8ceee29 112px 113px,transparent 114px 168px),
    radial-gradient(circle at 84% 1%,#bacff370,transparent 27%),linear-gradient(150deg,#071225,#1b3159 70%,#071024);
  background-size:293px 313px,409px 383px,auto,auto,auto;
}
:root[data-theme="antique"] .main-shell{
  background-color:#29160d;
  background-image:repeating-linear-gradient(92deg,transparent 0 7px,#b77b3b10 8px 9px,transparent 10px 19px),
    radial-gradient(ellipse at 72% 5%,#a3653673,transparent 48%),linear-gradient(108deg,#170c08,#512d1a 57%,#1c0e09);
}
:root[data-theme="volcanic"] .main-shell{
  background:#19100d url('./volcanic-rock.webp') center top / 1250px auto repeat;
}
:root[data-theme="cutout"] .main-shell{
  background-color:#f8f3e9;
  background-image:radial-gradient(circle,#2438494d 1.2px,transparent 1.8px),linear-gradient(135deg,#fffaf0,#f3ece1);
  background-size:24px 24px,auto;
}
:root[data-theme="volcanic"] .sidebar{
  background:linear-gradient(130deg,#190b0873,#160b0b8a),url('./volcanic-rock.webp') center / 650px auto;
}
@media(max-width:760px){
  :root[data-theme="noir"] .main-shell,:root[data-theme="abyssal"] .main-shell,
  :root[data-theme="prismatic"] .main-shell,:root[data-theme="moonlit"] .main-shell,
  :root[data-theme="antique"] .main-shell,:root[data-theme="volcanic"] .main-shell{background-attachment:scroll}
}

/* Light surfaces always carry dark, readable type, including rendered cards. */
:root[data-theme="noir"] .card{--card-ink:#171919;--card-muted:#4a5050;color-scheme:light}
:root[data-theme="moonlit"] .card{--card-ink:#1b3050;--card-muted:#4e6685;color-scheme:light}
:root[data-theme="antique"] .card{--card-ink:#422b1d;--card-muted:#715238;color-scheme:light}
:root[data-theme="antique"] .card{
  color:var(--card-ink);
}
/* Keep parchment labels dark despite the shared accent-label styles. */
html:root[data-theme="antique"] .card .field label,
html:root[data-theme="antique"] .card .mini-label,
html:root[data-theme="antique"] .card .section-label{
  color:var(--card-muted);
}
:root[data-theme="antique"] .card .card-title,
:root[data-theme="antique"] .card .item-card h3,
:root[data-theme="antique"] .card .big-status,
:root[data-theme="antique"] .card .toggle-row{
  color:var(--card-ink) !important;
}
:root[data-theme="antique"] .card .micro,
:root[data-theme="antique"] .card .muted,
:root[data-theme="antique"] .card .hint{
  color:var(--card-muted);
}
:root[data-theme="antique"] .card .preview-card .micro{color:#a9afb8}
:root[data-theme="antique"] .card .preview-card .discord-text{color:#dbdee4}

/* Remove the shared pinstripes, then give each card a different material. */
:root[data-theme="noir"] .card{background-image:none !important;background-color:#f1f1ec}
:root[data-theme="noir"] .card:nth-child(even){background-color:#dedfda}
:root[data-theme="abyssal"] .card{
  background-image:radial-gradient(ellipse at 92% -10%,#59d9dc27,transparent 61%),linear-gradient(150deg,#0f394bdc,#061c2ae8) !important;
}
:root[data-theme="prismatic"] .card{
  background-image:linear-gradient(#0d1020f2,#0d1020f2),linear-gradient(128deg,#fc79a3,#f5c36e 26%,#61d6aa 52%,#6abff4 74%,#c28aff) !important;
  background-clip:padding-box,border-box;
}
:root[data-theme="prismatic"] .card:nth-child(3n+2){
  background-image:linear-gradient(#101521f2,#101521f2),linear-gradient(45deg,#6bd2ff,#af87ff,#fa7cab,#ffe289) !important;
}
:root[data-theme="prismatic"] .card:nth-child(3n+3){
  background-image:linear-gradient(#0c111cf2,#0c111cf2),linear-gradient(110deg,#7ee3ad,#6abff4,#ff7da7) !important;
}
:root[data-theme="moonlit"] .card{
  background-image:radial-gradient(ellipse at 90% 0%,#fff,transparent 65%),linear-gradient(145deg,#f6f8ff,#dce5f5) !important;
}
:root[data-theme="antique"] .card{
  background-image:radial-gradient(ellipse at 87% 8%,#fff9e5,transparent 68%),linear-gradient(150deg,#f3e1bd,#dbc094) !important;
}
:root[data-theme="volcanic"] .card{
  background-image:radial-gradient(ellipse at 90% -20%,#ac401d4d,transparent 54%),linear-gradient(145deg,#2a1812f0,#100d0cf4) !important;
}

/* Distinct header accents replace the repeated horizontal rule. */
:root[data-theme="noir"] .card-header{border:0;padding:0 0 8px}
:root[data-theme="noir"] .card-header .card-title{border-left:5px solid #111;padding-left:10px}
:root[data-theme="abyssal"] .card-header{border:0;padding-bottom:7px}
:root[data-theme="abyssal"] .card-header .card-title{border-left:3px solid #8de4dd;padding-left:12px}
:root[data-theme="prismatic"] .card-header{border:0;padding-bottom:7px}
:root[data-theme="prismatic"] .card-header .card-title{border-left:4px solid #f79bc4;padding-left:11px}
:root[data-theme="moonlit"] .card-header{border:0;padding-bottom:8px}
:root[data-theme="moonlit"] .card-header .card-title{border-left:4px solid #829fcb;padding-left:12px}
:root[data-theme="antique"] .card-header{border:0;padding-bottom:9px}
:root[data-theme="antique"] .card-header .card-title{border-left:4px double #95683e;padding-left:12px}
:root[data-theme="volcanic"] .card-header{border:0;padding-bottom:9px}
:root[data-theme="volcanic"] .card-header .card-title{border-left:4px solid #f06c2e;padding-left:11px}

/* The editor actions follow the editor; they no longer cover the message field. */
html[data-theme]:not([data-theme="archival"]) .composer-actions{
  position:static;
  margin-top:18px;
  z-index:auto;
}
:root[data-theme="abyssal"] .tabbar button{border-radius:15px 3px 15px 3px}
:root[data-theme="abyssal"] .btn,:root[data-theme="abyssal"] .icon-btn,
:root[data-theme="abyssal"] .input,:root[data-theme="abyssal"] textarea,:root[data-theme="abyssal"] select{
  border-radius:18px 4px 18px 4px;
}
:root[data-theme="prismatic"] .tabbar button{border-radius:2px 12px 2px 12px}
:root[data-theme="prismatic"] .btn,:root[data-theme="prismatic"] .icon-btn,
:root[data-theme="prismatic"] .mode-panel,:root[data-theme="prismatic"] .emoji-picker,
:root[data-theme="prismatic"] dialog{border-radius:3px 14px 3px 14px}
:root[data-theme="moonlit"] .tabbar button{border-radius:999px}
:root[data-theme="antique"] .tabbar button,:root[data-theme="noir"] .tabbar button{border-radius:0}
:root[data-theme="volcanic"] .tabbar button{border-radius:3px 10px 3px 7px}
:root[data-theme="volcanic"] .tabbar,:root[data-theme="volcanic"] .composer-block,
:root[data-theme="volcanic"] .emoji-picker,:root[data-theme="volcanic"] .mode-panel{
  border-radius:3px 13px 3px 9px;
}

/* Picker-local typography and state; never inherited from the global theme. */
.themes-gallery .theme-choice{font:400 14px/1.4 ui-sans-serif,system-ui,sans-serif}
.themes-gallery .theme-choice strong{font:750 18px/1.25 ui-sans-serif,system-ui,sans-serif}
.themes-gallery .theme-choice[data-theme-choice="archival"] strong,
.themes-gallery .theme-choice[data-theme-choice="antique"] strong{font-family:Georgia,"Times New Roman",serif;font-variant:small-caps}
.themes-gallery .theme-choice[data-theme-choice="antique"]{font-family:Georgia,"Times New Roman",serif}
.themes-gallery .theme-choice[data-theme-choice="moonlit"] strong{font-family:Georgia,"Times New Roman",serif;font-style:italic}
.themes-gallery .theme-choice[data-theme-choice="noir"] strong{text-transform:uppercase;letter-spacing:1.4px}
.themes-gallery .theme-choice[data-theme-choice="cutout"] strong{font-weight:900}
.themes-gallery .theme-description{font-size:14px}
.theme-choice-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;width:100%}
.theme-choice .theme-active{visibility:hidden;font:750 12px/1.4 ui-sans-serif,system-ui,sans-serif;padding:3px 7px;border:1px solid currentColor;border-radius:4px;color:inherit}
.themes-gallery .theme-choice[aria-pressed="true"] .theme-active{visibility:visible}
.themes-gallery .theme-choice[aria-pressed="true"]{outline:3px solid currentColor;outline-offset:3px}
.themes-gallery .theme-choice:focus-visible{outline:3px dashed currentColor;outline-offset:6px}
.saved-list{max-height:340px;overflow-y:auto}
.saved-item{display:flex;align-items:center;justify-content:space-between;gap:9px;padding:9px 0;border-bottom:1px solid var(--border)}
.saved-item:last-child{border-bottom:0}
.saved-item-name{min-width:0;flex:1;overflow-wrap:anywhere}
.saved-item-actions{flex:none;gap:6px}
#form-content [data-repeat-pane][hidden]{display:none}
.month-days-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.month-day-choice{display:flex;align-items:center;justify-content:center;gap:4px;min-height:38px;border:1px solid var(--border);border-radius:6px;background:var(--surface2);color:var(--text);font-size:14px;cursor:pointer}
.month-day-choice input{margin:0;accent-color:var(--accent)}
@media(max-width:480px){.month-days-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}
.role-menu-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.role-menu-preview{min-height:0;width:100%;padding:16px}
.role-menu-preview p{margin:12px 0;color:inherit;font-size:14px;white-space:pre-wrap}
.role-menu-preview fieldset{display:grid;gap:7px;border:0;padding:0;margin:0}
.role-menu-preview legend{font-size:12px;color:#bec5d0;font-weight:700;margin-bottom:7px}
.role-option{display:flex;align-items:center;gap:9px;padding:8px 10px;border:1px solid #626973;border-radius:5px;color:#f1f2f4;font-size:14px;cursor:pointer}
.role-option input{margin:0;accent-color:#7289da}
.role-option-clear{border-color:#9b4c5e;color:#ffd7de}
.role-option-clear input{accent-color:#ee7e92}
.role-color{display:inline-block;width:11px;height:11px;flex:none;border-radius:50%;border:1px solid #7778}
.role-menu-choices{display:grid;grid-template-columns:1fr 1fr;gap:10px;max-height:240px;overflow:auto}

/* Keep role-menu actions visible while the form scrolls, including on mobile. */
html:has(#form-dialog[open] .role-menu-choices),
body:has(#form-dialog[open] .role-menu-choices){overflow:hidden;overscroll-behavior:none}
#form-dialog[open]:has(.role-menu-choices){
  display:flex;flex-direction:column;
  max-height:calc(100vh - 2rem);
  max-height:calc(100dvh - 2rem);
  max-width:calc(100vw - 2rem);
  overflow:hidden;
}
#form-dialog:has(.role-menu-choices) #modal-form{
  display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden;
}
#form-dialog:has(.role-menu-choices) #form-content{
  min-height:0;overflow-y:auto;overscroll-behavior:contain;
  scrollbar-gutter:stable;padding:2px 4px 4px;
}
#form-dialog:has(.role-menu-choices) .dialog-actions{
  flex-shrink:0;flex-wrap:wrap;margin-top:12px;padding-top:12px;
  border-top:1px solid var(--border);
}
#form-dialog:has(.role-menu-choices) .scope-group{min-width:0}
#form-dialog:has(.role-menu-choices) .role-menu-choices{max-height:none;overflow:visible}
#form-dialog:has(.role-menu-choices) .checkbox-row{overflow-wrap:anywhere}
@media(max-width:1000px){.role-menu-grid{grid-template-columns:1fr}}
@media(max-width:480px){.role-menu-choices{grid-template-columns:1fr}}
