:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #f4f6fb;
  background: #0b0d15;
  --muted: #aeb8cf;
  --focus: #a6c1ff;
  --border: #343c55;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 85% 0%, #202341 0%, transparent 50%), #0b0d15; }
.shell { width: min(100% - clamp(2rem, 9vw, 10rem), 100rem); margin: auto; padding: clamp(1.2rem, 4vh, 3rem) 0; }
header, .section-head, footer, .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
header { padding-bottom: clamp(1rem, 4vh, 3rem); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; font-size: clamp(1.15rem, 2.4vw, 2rem); font-weight: 750; letter-spacing: -.045em; }
.brand > span:last-child { color: #adbcff; }
.brand-icon { display: grid; place-items: center; background: #b6c3ff; color: #13162a; border-radius: .65rem; width: 2em; aspect-ratio: 1.2; margin-right: .6em; font-size: .8em; }
.time { display: grid; justify-items: end; text-align: right; }
#clock { font-size: clamp(1.75rem, 3.6vw, 3.25rem); font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1; }
#date { color: var(--muted); margin-top: .4rem; }
.section-head { margin: clamp(1rem, 3vh, 2rem) 0 1rem; flex-wrap: wrap; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { margin-bottom: 0; letter-spacing: -.035em; }
h1 { font-size: clamp(1.65rem, 3vw, 2.75rem); }
.toolbar { display: flex; flex-wrap: wrap; gap: .55rem; }
button, input { font: inherit; }
button { cursor: pointer; padding: .65rem .9rem; background: #232941; color: inherit; border: 1px solid #465172; border-radius: .65rem; }
button:hover { background: #333d5e; }
button:disabled { opacity: .45; cursor: default; }
:where(button, a, input):focus-visible, .tile:focus { outline: 3px solid var(--focus); outline-offset: 4px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.65rem, 1.6vw, 1.25rem); }
.tile { display: flex; align-items: center; gap: clamp(.65rem, 1.6vw, 1.35rem); min-width: 0; min-height: clamp(5.5rem, 16vh, 12rem); padding: clamp(.8rem, 2.35vw, 2.4rem); border: 1px solid #3b455d; border-radius: 1rem; color: inherit; background: #161b2b; text-align: left; text-decoration: none; font-size: clamp(1.15rem, 2.6vw, 2.65rem); line-height: 1.15; font-weight: 720; letter-spacing: -.025em; overflow-wrap: anywhere; }
.tile:hover, .tile:focus { background: #222b44; border-color: var(--focus); }
.mark { display: grid; flex: 0 0 auto; place-items: center; width: 2.05em; aspect-ratio: 1; border-radius: .34em; background: #303953; color: #fff; }
.tile[data-theme="red"] .mark { background: #c51439; }
.tile[data-theme="blue"] .mark { background: #1751a0; }
.tile[data-theme="purple"] .mark { background: #5540a3; }
.tile[data-theme="yellow"] .mark { background: #f7d856; color: #181600; }
.tile[data-theme="green"] .mark { background: #45de87; color: #092116; }
.tile[data-theme="teal"] .mark { background: #147c75; }
.tile.add { border-style: dashed; color: #d0d9f4; }
footer { margin-top: 1.25rem; flex-wrap: wrap; color: var(--muted); }
kbd { display: inline-block; border: 1px solid var(--border); border-radius: .3rem; padding: .05rem .4rem; font-family: inherit; }
dialog { width: min(44rem, calc(100% - 2rem)); max-height: min(85vh, 52rem); color: inherit; background: #171c2c; border: 1px solid #505c80; border-radius: 1rem; padding: clamp(1rem, 3vw, 2rem); }
dialog::backdrop { background: #060811d9; }
.dialog-head { margin-bottom: 1rem; }
.homepage-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; margin-top: 1.25rem; }
.homepage-steps section { border: 1px solid var(--border); border-radius: .65rem; padding: 1rem; }
.homepage-steps h3 { margin-bottom: .6rem; }
.homepage-steps p { margin-bottom: .65rem; }
.homepage-steps p:last-child { margin-bottom: 0; }
#homepage-local-note { margin: 1rem 0 0; color: var(--muted); }
input:not([type="file"]) { display: block; width: 100%; min-width: 0; margin: .35rem 0 .7rem; padding: .65rem .75rem; border: 1px solid #5d698d; border-radius: .55rem; background: #0d1020; color: inherit; }
.catalog-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: .45rem; margin: 1rem 0; }
#custom { border-top: 1px solid var(--border); padding-top: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 2fr; gap: .8rem; }
#edit-list { padding-left: 1.6rem; }
#edit-list li { padding: .45rem 0; border-bottom: 1px solid var(--border); }
.edit-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.edit-name { flex: 1 1 8rem; overflow-wrap: anywhere; }
.edit-row button { padding: .4rem .55rem; }
.feedback { margin: .9rem 0 0; color: #c2d1ff; }
.feedback:empty { display: none; }
#pending-import { margin-top: 1rem; }
@media (max-width: 700px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { min-height: 5rem; }
}
@media (max-width: 390px) {
  .tile { flex-direction: column; align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  #date { font-size: .85rem; }
}
