:root{color-scheme:light}
:root[data-theme="dark"]{color-scheme:dark;--ink:#f3eef0;--muted:#c0adb8;--ruby:#f394b2;--bg:#181419;--border:#50434d;--surface:#251e25;--surface-alt:#322731;--accent-bg:#482b3c;--button-ink:#24131d;--theme-bar:#251e25}
:root[data-theme="ruby"]{color-scheme:dark;--ink:#fff1ef;--muted:#ffd0c9;--ruby:#ff9b98;--bg:#3a0208;--border:#99313a;--surface:#5b0611;--surface-alt:#790914;--accent-bg:#8b101d;--button-ink:#390009;--theme-bar:#5b0611}
:root[data-theme="neon"]{color-scheme:dark;--ink:#f5fff9;--muted:#c5e1ef;--ruby:#a7ffd1;--bg:#15122a;--border:#54516d;--surface:#251d3a;--surface-alt:#332449;--accent-bg:#43325d;--button-ink:#092419;--theme-bar:#251d3a}
:root[data-theme="rinka"]{color-scheme:dark;--ink:#fff2f2;--muted:#d0c6c8;--ruby:#ff8b95;--bg:#242428;--border:#695a5f;--surface:#36363c;--surface-alt:#424147;--accent-bg:#602832;--button-ink:#32080e;--theme-bar:#36363c}
:root:is([data-theme="dark"],[data-theme="ruby"],[data-theme="neon"],[data-theme="rinka"]) :is(body,.workspace){background-color:var(--bg);color:var(--ink)}
:root:is([data-theme="dark"],[data-theme="ruby"],[data-theme="neon"],[data-theme="rinka"]) :is(.sidebar,.topbar,.panel,.settings-panel,dialog:not(#photoViewer),.login-card,.login-page,.shade+.sidebar,.ticket-details,.ticket-thread,.ticket-messages,.table-wrap,.notification-banner,.toast){background:var(--surface);color:var(--ink);border-color:var(--border)}
:root:is([data-theme="dark"],[data-theme="ruby"],[data-theme="neon"],[data-theme="rinka"]) :is(input,textarea,select,.btn,.icon-btn,.menu-toggle,.back-button,.segmented,.ticket-bubble,.ticket-bubble.own,.ticket-row,.ticket-info,.agency-select,.side-note,.month-weekdays,.month-day,.day-column,.week-days,.upload-zone,.message,.history-item){background:var(--surface-alt);color:var(--ink);border-color:var(--border)}
:root:is([data-theme="dark"],[data-theme="ruby"],[data-theme="neon"],[data-theme="rinka"]) :is(.subtitle,.modal-subtitle,.breadcrumb strong,.nav-item,.date-label,.calendar-head p,footer,.field label,.field small,th,.ticket-system,.ticket-bubble p,.ticket-bubble-head b,.ticket-bubble time,.ticket-info dt,.ticket-info dd,.empty,.bottom-info){color:var(--muted)}
:root:is([data-theme="dark"],[data-theme="ruby"],[data-theme="neon"],[data-theme="rinka"]) :is(.nav-item.active,.nav-item:hover,.segmented button.active,.month-day.today,.day.current,.day-column.current,.ticket-row:hover){background:var(--accent-bg);color:var(--ink)}
:root:is([data-theme="dark"],[data-theme="ruby"],[data-theme="neon"],[data-theme="rinka"]) :is(.btn.primary,.month-day.today .month-number){background:var(--ruby);color:var(--button-ink)}
:root:is([data-theme="dark"],[data-theme="ruby"],[data-theme="neon"],[data-theme="rinka"]) :is(.month-number,.month-weekdays>div,.calendar-head h1,.page-heading h1,.ticket-detail-title h1,.settings-panel h3){color:var(--ink)}
:root:is([data-theme="dark"],[data-theme="ruby"],[data-theme="neon"],[data-theme="rinka"]) :is(.month-grid,.month-day,.timeline,.day-column,.calendar-head,.calendar-tools,.ticket-thread-heading,.ticket-reply,.profile,td,th){border-color:var(--border)}
:root:is([data-theme="dark"],[data-theme="ruby"],[data-theme="neon"],[data-theme="rinka"]) .match-event,:root:is([data-theme="dark"],[data-theme="ruby"],[data-theme="neon"],[data-theme="rinka"]) .month-day .month-event{background:var(--match-color);color:var(--match-ink)}
:root[data-theme="neon"]{
  --neon-spectrum:linear-gradient(112deg,#a9ff75 0%,#36ffc5 20%,#31ddff 40%,#9c8bff 60%,#ff79ce 83%,#a9ff75 100%);
  --neon-sheen:linear-gradient(115deg,#008a76 0%,#074158 24%,#43207c 53%,#771552 75%,#006252 100%);
}
:root[data-theme="neon"] :is(body,.workspace){
  background-image:radial-gradient(ellipse at 7% 15%,#00887990,transparent 58%),radial-gradient(ellipse at 91% 19%,#922da7b5,transparent 56%),radial-gradient(ellipse at 66% 95%,#5636c5a6,transparent 70%),linear-gradient(145deg,#08272c,#171330 52%,#36153e);
}
:root[data-theme="neon"] :is(.topbar,.sidebar){
  background:linear-gradient(115deg,#073b42,#2e2059 55%,#5e1b54);
  border-color:#a681ff9c;
}
:root[data-theme="neon"] :is(.panel,.settings-panel,.login-card,.ticket-thread,dialog:not(#photoViewer)){
  border:1px solid transparent;
  background:linear-gradient(122deg,#092b32 0%,#201835 55%,#351a3b) padding-box,var(--neon-spectrum) border-box;
  box-shadow:0 12px 30px #140b3580;
}
:root[data-theme="neon"] :is(.month-day,.day-column,.month-weekdays,.week-days){
  background:linear-gradient(135deg,#102d37,#252042 60%,#392140);
}
:root[data-theme="neon"] :is(.nav-item.active,.nav-item:hover,.segmented button.active,.month-day.today,.day.current,.day-column.current){
  background:var(--neon-sheen);
  color:#fff;
}
:root[data-theme="neon"] :is(.btn.primary,.month-day.today .month-number){
  background:var(--neon-spectrum);
  color:#061625;
  background-size:240% 100%;
  box-shadow:0 0 16px #59efc55c;
  animation:ruby-neon-shift 9s ease-in-out infinite alternate;
}
:root[data-theme="neon"] :is(.page-heading h1,.calendar-head h1,.drawer-heading .brand){
  background:var(--neon-spectrum);
  background-clip:text;
  -webkit-text-fill-color:transparent;
}
:root[data-theme="neon"] .drawer-heading .brand img{-webkit-text-fill-color:initial}
:root[data-theme="neon"] :is(.btn,.nav-item,input,textarea,select):focus-visible{
  outline:2px solid #6affdb;
  outline-offset:3px;
}
@keyframes ruby-neon-shift{to{background-position:100% 50%}}
@media(prefers-reduced-motion:reduce){
  :root[data-theme="neon"] :is(.btn.primary,.month-day.today .month-number){
    animation:none;
    background-size:100% 100%;
  }
}
:root:is([data-theme="ruby"],[data-theme="rinka"]) :is(.workspace,.sidebar){position:relative}
:root:is([data-theme="ruby"],[data-theme="rinka"]) :is(.workspace,.sidebar)::before{content:"";position:absolute;inset:0;pointer-events:none;background:url("ruby-motif.png") repeat;background-size:128px;opacity:.16}
:root:is([data-theme="ruby"],[data-theme="rinka"]) .sidebar{position:fixed}
:root:is([data-theme="ruby"],[data-theme="rinka"]) .workspace>main{position:relative}
.theme-settings{margin-block:0 20px}
.theme-settings label{display:block;font-weight:700;margin-bottom:8px}
.theme-settings select{width:min(100%,360px)}
