/* Shared tokens also cover standalone pages without styles.css. */
:root{--border:var(--line);--danger:#b32424;--danger-soft:#ffeded;--on-accent:#fff;--bg: #f7f8fa;--surface:#fff;--surface-soft:#f5f7f8;--green-soft:#eaf5ef;--ink:#202a36;--muted:#727e8c;--line:#e9edf1;--green:#167964;--green-line:#d0e7da;--orange:#aa6a31;--orange-soft:#fff4e8}
:root[data-theme="dark"]{--danger:#f0a09b;--danger-soft:#462b2c;--orange:#e3b17e;--orange-soft:#3a3025;color-scheme:dark;--bg:#13191d;--surface:#1a2228;--surface-soft:#202a31;--ink:#e5ecee;--muted:#a0adb6;--line:#2c3840;--green:#87d5bc;--green-soft:#203b33;--green-line:#325047;--on-accent:#1a2228}
/* Site-wide seasonal palettes. Default leaves the existing design intact. */
:root[data-site-theme="festive"] {
  --bg:#fcf7f6; --surface:#fff; --surface-soft:#faf0ee;
  --ink:#332725; --muted:#847774; --line:#efe4e2;
  --green:#b8323b; --green-dark:#9c2932; --green-soft:#fceceb; --green-line:#efcfcd;
  --border:var(--line); --shadow:0 20px 80px #59312816;
  background:var(--bg); color:var(--ink);
}
:root[data-site-theme="festive"][data-theme="dark"] {
  --bg:#211819; --surface:#2b2022; --surface-soft:#35272a;
  --ink:#f2e7e7; --muted:#b9a4a5; --line:#4b3539;
  --green:#efa3a9; --green-dark:#ffc0c5; --green-soft:#4b2b31; --green-line:#75434b;
  --shadow:0 20px 80px #0005;
}
:root[data-site-theme="memorial"] {
  --bg:#f5f5f5; --surface:#fff; --surface-soft:#f0f0f0;
  --ink:#303030; --muted:#777; --line:#e5e5e5;
  --green:#626262; --green-dark:#494949; --green-soft:#ebebeb; --green-line:#d7d7d7;
  --orange:#777; --orange-soft:#eee; --blue:#626262; --blue-soft:#ececec;
  --border:var(--line); --shadow:0 20px 80px #00000016;
  background:var(--bg); color:var(--ink); filter:grayscale(1);
}
:root[data-site-theme="memorial"][data-theme="dark"] {
  --bg:#191919; --surface:#232323; --surface-soft:#2c2c2c;
  --ink:#e8e8e8; --muted:#aaa; --line:#3d3d3d;
  --green:#bcbcbc; --green-dark:#ddd; --green-soft:#363636; --green-line:#505050;
  --orange:#bbb; --orange-soft:#333; --blue:#bbb; --blue-soft:#333; --shadow:0 20px 80px #0005;
}
:root[data-site-theme="festive"] img[src$="/favicon.svg"] { filter:brightness(.82) sepia(1) saturate(5) hue-rotate(305deg); }
:root[data-site-theme]:not([data-site-theme="default"]) .arrangement-entry { background:var(--green-soft); }
:root[data-site-theme]:not([data-site-theme="default"]) :is(.arrangement-entry h3,.arrangement-status:not(.urgent):not(.overdue)) { color:var(--green); }
:root[data-site-theme]:not([data-site-theme="default"]) .admin-body {
  --admin-bg:var(--bg); --admin-border:var(--line); --admin-muted:var(--muted);
}
:root[data-site-theme="festive"] .admin-body { --admin-sidebar:#40262b; --admin-sidebar-text:#e2d1d2; }
:root[data-site-theme="memorial"] .admin-body { --admin-sidebar:#292929; --admin-sidebar-text:#ccc; }
:root[data-site-theme]:not([data-site-theme="default"]) .admin-nav button.active { background:var(--green); color:#fff; box-shadow:inset 3px 0 #ffffff80; }
:root[data-site-theme]:not([data-site-theme="default"]) .admin-nav button.active .admin-nav-icon { color:inherit; }
:root[data-site-theme]:not([data-site-theme="default"]) .admin-side-brand .admin-logo { background:var(--green); }
:root[data-site-theme]:not([data-site-theme="default"]) .admin-notice:not(.error) { background:var(--green); }
:root[data-site-theme="festive"][data-theme="dark"] :is(.admin-nav button.active,.admin-notice:not(.error)) { color:#352025; }
:root[data-site-theme]:not([data-site-theme="default"]) .maintenance-hero { background:linear-gradient(125deg,var(--green),var(--green-dark)); }
:root[data-site-theme]:not([data-site-theme="default"]) :is(.maintenance-status,.maintenance-hero-note) { color:color-mix(in srgb,var(--on-accent) 88%,transparent); }
:root[data-site-theme]:not([data-site-theme="default"]) .maintenance-status i { background:var(--on-accent); }
:root[data-site-theme]:not([data-site-theme="default"]) :is(.maintenance-end > span,.maintenance-end .maintenance-clock,.announcement-top,.notice-center-tools button,.notice-center-back) { color:var(--green); }
:root[data-site-theme]:not([data-site-theme="default"]) :is(.announcement-dialog,.maintenance-dialog) { background:var(--surface); color:var(--ink); border-color:var(--line); }
:root[data-site-theme]:not([data-site-theme="default"]) .announcement-dialog p { color:var(--muted); }
:root[data-site-theme]:not([data-site-theme="default"]) .announcement-confirm { background:var(--green); color:var(--surface); }
:root[data-site-theme]:not([data-site-theme="default"]) :is(.notice-center-tabs,.repayment-summary,.notice-center-more,.video-thumbnail,.loading-state .message-icon) { background:var(--green-soft); }
:root[data-site-theme]:not([data-site-theme="default"]) :is(.notice-center-tabs button[aria-selected="true"],.notice-center-more) { color:var(--green); }
:root[data-site-theme]:not([data-site-theme="default"]) .notice-center-tabs button[aria-selected="true"] { background:var(--surface); }
/* Standalone tool pages have their own base styles; share the same accents. */
:root[data-site-theme]:not([data-site-theme="default"]) body { background:var(--bg); }
:root[data-site-theme]:not([data-site-theme="default"]) :is(.library-shell a,.library-shell .eyebrow,.category-tabs button[aria-pressed="true"]) { color:var(--green); }
:root[data-site-theme]:not([data-site-theme="default"]) :is(.category-tabs button[aria-pressed="true"],.brand-icon) { background:var(--green-soft); }
:root[data-site-theme]:not([data-site-theme="default"]) :is(.icon-tile,.search-label,#icon-detail,.input-panel,.result-panel) { background:var(--surface); border-color:var(--line); }
:root[data-site-theme]:not([data-site-theme="default"]) .icon-tile:hover { background:var(--green-soft); border-color:var(--green-line); }
:root[data-site-theme]:not([data-site-theme="default"]) :is(.export-actions .primary-button,.tool-shell .button-primary) { background:var(--green); border-color:var(--green); }
:root[data-site-theme]:not([data-site-theme="default"]) :is(.export-actions .secondary-button,.close-button) { color:var(--green); background:var(--green-soft); }
:root[data-site-theme]:not([data-site-theme="default"]) :is(.tool-shell textarea,.video-card,.customize input,.customize select,#icon-preview,#png-result) { background:var(--surface); color:var(--ink); border-color:var(--line); }
:root[data-site-theme]:not([data-site-theme="default"]) :is(.tool-shell textarea:focus,.search-label:focus-within) { border-color:var(--green); outline-color:var(--green); }
:root[data-site-theme]:not([data-site-theme="default"]) .tool-shell .button-primary:hover { background:var(--green-dark); }
:root[data-site-theme]:not([data-site-theme="default"]) :is(#library-toast,.tool-toast) { background:var(--green); color:var(--surface); }
:root[data-site-theme]:not([data-site-theme="default"]) :is(.announcement-dialog button,.library-shell button,.library-shell a,.tool-shell button,.tool-shell a):focus-visible { outline-color:var(--green); }
:root[data-site-theme]:not([data-site-theme="default"]) body:has(> main > a[href$="#mine"]) > main { background:var(--surface); }
:root[data-site-theme]:not([data-site-theme="default"]) body:has(> main > a[href$="#mine"]) a { color:var(--green); }

.appearance-choices { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.appearance-choice { position:relative; display:grid; gap:8px; padding:16px 14px; border:1px solid var(--line); border-radius:12px; cursor:pointer; background:var(--surface); }
.appearance-choice:has(input:checked) { border-color:var(--green); outline:1px solid var(--green); }
.appearance-choice input { position:absolute; top:14px; right:12px; accent-color:var(--green); }
.appearance-choice strong { font-size:14px; font-weight:600; }
.appearance-choice small { font-size:11px; line-height:1.7; color:var(--muted); }
.appearance-swatch { display:flex; gap:5px; padding-right:22px; margin-bottom:6px; }
.appearance-swatch i { width:20px; height:30px; border-radius:5px; background:#167964; }
.appearance-swatch i:nth-child(2) { background:#eaf5ef; border:1px solid #d0e7da; }
.appearance-swatch i:nth-child(3) { background:#f7f8fa; border:1px solid #e9edf1; }
.appearance-choice-festive .appearance-swatch i:first-child { background:#b8323b; }
.appearance-choice-festive .appearance-swatch i:nth-child(2) { background:#fceceb; border-color:#efcfcd; }
.appearance-choice-festive .appearance-swatch i:nth-child(3) { background:#fcf7f6; border-color:#efe4e2; }
.appearance-choice-memorial .appearance-swatch i:first-child { background:#626262; }
.appearance-choice-memorial .appearance-swatch i:nth-child(2) { background:#ebebeb; border-color:#d7d7d7; }
.appearance-choice-memorial .appearance-swatch i:nth-child(3) { background:#f5f5f5; border-color:#e5e5e5; }
.appearance-period { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 16px; }
.appearance-period > .form-help { grid-column:1/-1; }
@media(max-width:520px) { .appearance-choices,.appearance-period { grid-template-columns:1fr; } .appearance-choice { padding:16px; grid-template-columns:80px 1fr; align-items:center; gap:4px 12px; } .appearance-swatch { grid-row:1/3; margin:0; padding:0; } .appearance-choice strong,.appearance-choice small { padding-right:16px; } }

/* Original candle illustration; flag adapted from flag-icons v7.5.0 (MIT).
   Decorations have their own title space, never a background behind cards. */
:root[data-site-theme="festive"] {
  --site-decoration:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20id%3D%22flag-icons-cn%22%20viewBox%3D%22-100%20-100%20840%20680%22%3E%0A%20%20%3Cg%20opacity%3D%22.12%22%20transform%3D%22rotate%28-12%20320%20240%29%22%3E%3Cdefs%3E%0A%20%20%20%20%3Cpath%20id%3D%22cn-a%22%20fill%3D%22%23ff0%22%20d%3D%22M-.6.8%200-1%20.6.8-1-.3h2z%22%2F%3E%0A%20%20%3C%2Fdefs%3E%0A%20%20%3Cpath%20fill%3D%22%23ee1c25%22%20d%3D%22M0%200h640v480H0z%22%2F%3E%0A%20%20%3Cuse%20xlink%3Ahref%3D%22%23cn-a%22%20width%3D%2230%22%20height%3D%2220%22%20transform%3D%22matrix%2871.9991%200%200%2072%20120%20120%29%22%2F%3E%0A%20%20%3Cuse%20xlink%3Ahref%3D%22%23cn-a%22%20width%3D%2230%22%20height%3D%2220%22%20transform%3D%22matrix%28-12.33562%20-20.5871%2020.58684%20-12.33577%20240.3%2048%29%22%2F%3E%0A%20%20%3Cuse%20xlink%3Ahref%3D%22%23cn-a%22%20width%3D%2230%22%20height%3D%2220%22%20transform%3D%22matrix%28-3.38573%20-23.75998%2023.75968%20-3.38578%20288%2095.8%29%22%2F%3E%0A%20%20%3Cuse%20xlink%3Ahref%3D%22%23cn-a%22%20width%3D%2230%22%20height%3D%2220%22%20transform%3D%22matrix%286.5991%20-23.0749%2023.0746%206.59919%20288%20168%29%22%2F%3E%0A%20%20%3Cuse%20xlink%3Ahref%3D%22%23cn-a%22%20width%3D%2230%22%20height%3D%2220%22%20transform%3D%22matrix%2814.9991%20-18.73557%2018.73533%2014.99929%20240%20216%29%22%2F%3E%0A%3C%2Fg%3E%3C%2Fsvg%3E%0A");
  --site-decoration-size:240px 180px;
}
:root[data-site-theme="memorial"] {
  --site-decoration:url("./theme-assets/memorial-candle.svg");
}
.appearance-choice:not(.appearance-choice-default) {
  background-image:var(--choice-decoration); background-repeat:no-repeat;
  background-position:right 12px bottom 10px; background-size:72px 54px;
}
.appearance-choice-festive { --choice-decoration:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20id%3D%22flag-icons-cn%22%20viewBox%3D%22-100%20-100%20840%20680%22%3E%0A%20%20%3Cg%20opacity%3D%22.12%22%20transform%3D%22rotate%28-12%20320%20240%29%22%3E%3Cdefs%3E%0A%20%20%20%20%3Cpath%20id%3D%22cn-a%22%20fill%3D%22%23ff0%22%20d%3D%22M-.6.8%200-1%20.6.8-1-.3h2z%22%2F%3E%0A%20%20%3C%2Fdefs%3E%0A%20%20%3Cpath%20fill%3D%22%23ee1c25%22%20d%3D%22M0%200h640v480H0z%22%2F%3E%0A%20%20%3Cuse%20xlink%3Ahref%3D%22%23cn-a%22%20width%3D%2230%22%20height%3D%2220%22%20transform%3D%22matrix%2871.9991%200%200%2072%20120%20120%29%22%2F%3E%0A%20%20%3Cuse%20xlink%3Ahref%3D%22%23cn-a%22%20width%3D%2230%22%20height%3D%2220%22%20transform%3D%22matrix%28-12.33562%20-20.5871%2020.58684%20-12.33577%20240.3%2048%29%22%2F%3E%0A%20%20%3Cuse%20xlink%3Ahref%3D%22%23cn-a%22%20width%3D%2230%22%20height%3D%2220%22%20transform%3D%22matrix%28-3.38573%20-23.75998%2023.75968%20-3.38578%20288%2095.8%29%22%2F%3E%0A%20%20%3Cuse%20xlink%3Ahref%3D%22%23cn-a%22%20width%3D%2230%22%20height%3D%2220%22%20transform%3D%22matrix%286.5991%20-23.0749%2023.0746%206.59919%20288%20168%29%22%2F%3E%0A%20%20%3Cuse%20xlink%3Ahref%3D%22%23cn-a%22%20width%3D%2230%22%20height%3D%2220%22%20transform%3D%22matrix%2814.9991%20-18.73557%2018.73533%2014.99929%20240%20216%29%22%2F%3E%0A%3C%2Fg%3E%3C%2Fsvg%3E%0A"); }
.appearance-choice-memorial { --choice-decoration:url("./theme-assets/memorial-candle.svg"); }

:root[data-site-theme]:not([data-site-theme="default"]) .page-title-row > div:first-child {
  position:relative; padding-right:156px; min-height:118px; min-width:0;
}
:root[data-site-theme]:not([data-site-theme="default"]) .page-title-row > div:first-child::after {
  content:""; position:absolute; right:0; top:0; width:140px; height:112px;
  background:var(--site-decoration) center/contain no-repeat; pointer-events:none;
}
:root[data-site-theme]:not([data-site-theme="default"]) :is(.tool-shell .intro,.tool-header) {
  background:var(--site-decoration) right center/140px 112px no-repeat; padding-right:156px;
}
:root[data-site-theme="memorial"] .page-title-row > div:first-child::after { opacity:.8; }
:root[data-site-theme="memorial"][data-theme="dark"] .page-title-row > div:first-child::after { opacity:.65; }
@media(max-width:760px) {
  :root[data-site-theme]:not([data-site-theme="default"]) .page-title-row > div:first-child { width:100%; padding-right:116px; min-height:104px; }
  :root[data-site-theme]:not([data-site-theme="default"]) .page-title-row > div:first-child::after { width:108px; height:100px; top:0; }
  :root[data-site-theme]:not([data-site-theme="default"]) :is(.tool-shell .intro,.tool-header) { padding-right:116px; background-size:108px 100px; }
  :root[data-site-theme]:not([data-site-theme="default"]) .page-title-row { flex-wrap:wrap; }
}
@media print {
  :root[data-site-theme]:not([data-site-theme="default"]) .page-title-row > div:first-child { padding-right:0; min-height:0; }
  :root[data-site-theme]:not([data-site-theme="default"]) .page-title-row > div:first-child::after { display:none; }
  :root[data-site-theme]:not([data-site-theme="default"]) :is(.tool-shell .intro,.tool-header) { background-image:none; padding-right:0; }
}

/* Pointer activation and dialog autofocus do not need a keyboard focus ring. */
:root:not([data-focus-input="keyboard"]) :is(button,a,[role="button"],summary):focus {
  outline:none;
}

/* State-bearing dialogs and tables inherit all modes, including default dark mode. */
:root .announcement-confirm,:root .app-update-now,:root .announcement-link{background:var(--green);color:var(--on-accent)}
:root .announcement-bottom:has(.announcement-link:not([hidden])) .announcement-confirm{background:transparent;color:var(--muted)}
:root .announcement-dialog,:root .maintenance-dialog{background:var(--surface);color:var(--ink);border-color:var(--line)}
:root .maintenance-message,:root .announcement-dialog p{color:var(--muted)}
:root .primary-button{color:var(--on-accent)}
:root .admin-table th{background:var(--surface-soft);color:var(--muted);border-color:var(--line)}
:root .admin-table td{border-color:var(--line)}
:root .admin-table tbody tr:hover{background:var(--surface-soft)}
:root :is(.panel,.result-panel,.input-panel,.video-card,.icon-tile,.search-label,#icon-detail){background:var(--surface);border-color:var(--line)}
:root :is(.tool-shell input,.tool-shell select,.tool-shell textarea,.tool-shell button,.library-shell input,.library-shell select){background:var(--surface);color:var(--ink);border-color:var(--line)}
:root :is(.tool-shell button.primary,.tool-shell .download,.tool-shell .button-primary){background:var(--green);color:var(--on-accent);border-color:var(--green)}
:root .tool-shell .tabs{background:var(--surface-soft)}
:root .tool-shell .tabs button[aria-pressed="true"]{background:var(--surface);color:var(--green)}

:root[data-site-theme="memorial"]{--danger:var(--ink);--danger-soft:var(--surface-soft)}
:root .maintenance-background{background:var(--bg)}
:root .library-shell :is(.customize input,.customize select,textarea,.icon-preview,#png-result){background:var(--surface);color:var(--ink);border-color:var(--line)}
:root .library-shell .secondary-button{background:var(--green-soft);color:var(--green)}
:root .tool-shell .button-primary:disabled{opacity:.5}
