body { font-family:var(--font-master); }
button,input,select,textarea { font-family:inherit; }
.theme-layout { max-width:760px; margin:0 auto; display:grid; gap:12px; }
.theme-heading { letter-spacing:2px; font-family:var(--font-master); font-weight:400; }
.theme-card { overflow:hidden; }
.theme-card > summary { list-style:none; display:flex; align-items:center; gap:14px; padding:19px 17px; cursor:pointer; min-height:74px; }
.theme-card > summary::-webkit-details-marker { display:none; }
.theme-card > summary > svg { width:27px; height:27px; color:var(--logo-master); flex:none; }
.theme-card > summary > span { display:grid; gap:4px; }
.theme-card strong { font-size:calc(15px * var(--ui-scale)); font-weight:500; }
.theme-card small { font-size:12px; color:var(--muted-master); }
.theme-card > summary::after { content:''; width:7px; height:7px; border-right:1.5px solid var(--muted-master); border-bottom:1.5px solid var(--muted-master); transform:rotate(45deg); margin-left:auto; }
.theme-card[open] > summary::after { transform:rotate(225deg); }
.theme-body { padding:0 17px 20px; display:grid; gap:16px; }
.theme-body .field { font-size:calc(14px * var(--ui-scale)); }
.theme-body .field input,.theme-body .field select { font-size:calc(16px * var(--ui-scale)); }
.theme-body .toggle { display:flex; flex-direction:row; justify-content:space-between; align-items:center; }
.theme-body p { margin:0; font-size:13px; line-height:1.7; color:var(--muted-master); }
.theme-body button,.theme-actions button,.theme-lock button,.theme-dialog button { min-height:44px; padding:10px 14px; border:var(--shell-border-master); border-radius:var(--icon-radius); background:var(--soft-master); color:var(--text-master); font-size:14px; cursor:pointer; }
.theme-actions { display:flex; flex-wrap:wrap; gap:9px; }
.theme-actions > * { flex:1; }
.theme-preview { position:relative; aspect-ratio:1.7; overflow:hidden; border-radius:var(--icon-radius); background:var(--page-master); display:grid; place-items:center; }
.theme-preview img { width:100%; height:100%; object-fit:cover; position:absolute; inset:0; }
.theme-preview span { color:var(--muted-master); font-size:13px; }
.theme-color-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.theme-body input[type=color] { width:100%; height:48px; padding:5px; cursor:pointer; }
.theme-body input[type=range] { accent-color:var(--muted-master); padding:0; border:0; }
.theme-icon-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:18px 8px; }
.theme-icon-choice { display:grid; justify-items:center; gap:8px; cursor:pointer; min-width:0; font-size:12px; }
.theme-icon-choice input { width:17px; height:17px; accent-color:var(--muted-master); }
.theme-icon-choice .icon-shell { width:50px; height:50px; }
.theme-icon-choice .iconsax-inline { width:32px; height:32px; }
.custom-app-icon { width:100%;height:100%;object-fit:contain;position:absolute;inset:0;pointer-events:none; }
.theme-sample { padding:18px; background:var(--page-master); border-radius:var(--icon-radius); font-size:calc(20px * var(--ui-scale)); line-height:1.8; overflow-wrap:anywhere; }
#theme-status { min-height:20px; margin:4px 0; font-size:12px; color:var(--muted-master); }
#theme-back svg { width:24px;height:24px; fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round; }
.theme-dialog { width:min(90vw,400px); color:var(--text-master); max-height:85dvh; overflow:auto; padding:24px; }
.theme-dialog::backdrop { background:color-mix(in srgb,var(--text-master) 25%,transparent); }
.theme-dialog h2 { margin:0 0 12px; font-size:20px; font-weight:500; }
.theme-dialog p { font-size:14px;line-height:1.6;white-space:pre-line; }
.theme-dialog form { display:grid;gap:14px; }
.theme-float { position:fixed; z-index:80; width:48px;height:48px; border-radius:50%; border:var(--shell-border-master);background:var(--surface-master);box-shadow:var(--shell-shadow-master); color:var(--logo-master);touch-action:none;cursor:grab;display:grid;place-items:center; }
.theme-float svg { width:26px;height:26px;pointer-events:none; }
.theme-float-menu { position:fixed;right:var(--grid-edge);bottom:calc(85px + var(--safe-bottom)); z-index:81;padding:12px;display:grid;gap:8px; }
.theme-lock { position:fixed;inset:0;z-index:100;height:var(--viewport-height);padding:calc(60px + var(--safe-top)) var(--grid-edge) calc(30px + var(--safe-bottom));background-color:var(--page-master);background-size:cover;background-position:center;display:flex;flex-direction:column;align-items:center;justify-content:space-between; }
.theme-lock-clock,.theme-lock-panel { background:var(--surface-master);border-radius:var(--icon-radius);box-shadow:var(--shell-shadow-master);padding:20px 26px;text-align:center; }
.theme-lock time { display:block;font-size:56px;line-height:1.2;font-weight:300; }
.theme-lock-panel { width:min(100%,340px);display:grid;gap:14px; }
.theme-lock-panel input { text-align:center; }
.theme-lock-panel p { margin:0;font-size:13px;color:var(--muted-master); }
.app-page .page-nav h1 { font-size:calc(22px * var(--ui-scale)); }
#settings-page .section-title { font-size:calc(15px * var(--ui-scale)); }
#settings-page .field input,#settings-page .field select,#settings-page .field textarea { font-size:calc(16px * var(--ui-scale)); }
:where(.theme-dialog) { scrollbar-width:var(--vertical-scrollbar-master); }
:where(.theme-dialog)::-webkit-scrollbar:vertical { display:var(--vertical-scrollbar-master); }
button:disabled { cursor:wait;opacity:.55; }
@media(max-width:350px) { .theme-icon-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }.theme-color-row { grid-template-columns:1fr; } }

.theme-startup { position:fixed;inset:0;z-index:120;background:var(--page-master);color:var(--muted-master);display:flex;flex-direction:column;justify-content:center;align-items:center;gap:16px;font-size:14px; }
.theme-startup button { background:var(--surface-master);border:var(--shell-border-master);border-radius:var(--icon-radius);padding:12px 18px;color:var(--text-master); }
