/* Duo New Tab © 2026 DevRoshdi. All rights reserved. See LICENSE.txt. */
/*
 * Settings, styled after Settings in iPadOS 27: a floating sidebar with a large title, a search field
 * and grouped rows with coloured icons; the detail pane with inset grouped lists on the grouped
 * background, iOS switches, capsule segmented controls and sliders. Window chrome comes from
 * notes.css (.napp, .n-win, .n-ctrl …), which Settings shares with Notes.
 */

/* ---------- the Settings icon: a silver gear with a three-spoke hub on grey, as on iPad ---------- */

.tile.builtin-settings { background: #8e8e93; }
/* The other icon styles draw the gear alone, as a silhouette. */
.tile.builtin-settings::before {
  content: ""; position: absolute; inset: 7%; display: none;
  -webkit-mask: url("icons/settings-gear.svg") center / contain no-repeat; mask: url("icons/settings-gear.svg") center / contain no-repeat;
}
body.icons-dark .tile.builtin-settings::before, body.icons-clear .tile.builtin-settings::before, body.icons-tinted .tile.builtin-settings::before { display: block; }
body.icons-dark .tile.builtin-settings { background: linear-gradient(180deg, #2c2c2e, #0c0c0e); }
body.icons-dark .tile.builtin-settings::before { background: radial-gradient(circle at 50% 38%, #d1d1d6, #8e8e93); }
body.icons-clear .tile.builtin-settings::before { background: rgba(255, 255, 255, 0.96); }
body.icons-tinted .tile.builtin-settings::before { background: hsl(var(--hue), 95%, 72%); }

/* ---------- colours ---------- */

.sapp {
  --st-bg: #f2f2f7;
  --st-side: rgba(255, 255, 255, 0.72);
  --st-cell: #fff;
  --st-text: #000;
  --st-sub: rgba(60, 60, 67, 0.6);
  --st-sep: rgba(60, 60, 67, 0.2);
  --st-tint: #007aff;
  --st-fill: rgba(118, 118, 128, 0.12);
  --st-press: rgba(0, 0, 0, 0.05);
  --st-sel: #007aff;
  --st-red: #ff3b30;
  --st-green: #34c759;
  --n-bg: var(--st-bg);
  --n-fill: rgba(118, 118, 128, 0.16);
}
body.mode-dark .sapp {
  --st-bg: #000;
  --st-side: rgba(28, 28, 30, 0.82);
  --st-cell: #1c1c1e;
  --st-text: #fff;
  --st-sub: rgba(235, 235, 245, 0.6);
  --st-sep: rgba(84, 84, 88, 0.6);
  --st-tint: #0a84ff;
  --st-fill: rgba(118, 118, 128, 0.24);
  --st-press: rgba(255, 255, 255, 0.07);
  --st-sel: #0a84ff;
  --st-red: #ff453a;
  --st-green: #30d158;
  --n-fill: rgba(118, 118, 128, 0.3);
}

/* ---------- layout: the sidebar floats over the grouped background, the page fills the rest ---------- */

.st-win {
  display: grid; grid-template-columns: minmax(260px, min(340px, 32%)) minmax(0, 1fr); background: var(--st-bg); color: var(--st-text);
  font: 17px/1.3 var(--font); letter-spacing: -0.01em; -webkit-font-smoothing: antialiased;
}
.st-side {
  position: relative; display: flex; flex-direction: column; min-height: 0; margin: calc(var(--n-top) + 6px) 0 10px 10px;
  border-radius: 28px; background: var(--st-side); overflow: hidden;
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 8px 30px rgba(0, 0, 0, 0.06);
}
body.mode-dark .st-side { box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.08); }
.napp.windowed .st-side { margin-top: 10px; }
.st-side-head { flex: none; padding: 46px 16px 8px; }
.st-side-title { margin: 0 0 10px 4px; font: 700 34px/1.15 var(--font); letter-spacing: 0.01em; }
.st-search {
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 18px;
  background: var(--st-fill); color: var(--st-sub); cursor: text;
}
.st-search .st-sym { width: 17px; height: 17px; flex: none; }
.st-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--st-text); font: 17px var(--font); user-select: text; text-overflow: ellipsis; }
.st-search input::-webkit-search-cancel-button { display: none; }
.st-side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 12px 24px; scrollbar-width: none; }

.st-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.st-bar {
  position: absolute; z-index: 3; top: var(--n-top); left: 0; right: 0; height: 52px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 16px; pointer-events: none;
}
.st-bar::before {
  content: ""; position: absolute; inset: calc(var(--n-top) * -1) 0 0; z-index: -1; opacity: 0; transition: opacity 0.2s ease;
  background: color-mix(in srgb, var(--st-bg) 78%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 0.5px 0 var(--st-sep);
}
.st-main.scrolled .st-bar::before { opacity: 1; }
.st-back {
  justify-self: start; display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 14px 0 8px; border: 0; border-radius: 18px;
  background: color-mix(in srgb, var(--st-cell) 70%, transparent); color: var(--st-text); font: 17px var(--font); cursor: pointer; pointer-events: auto;
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 2px 10px rgba(0, 0, 0, 0.06);
}
.st-back[hidden] { display: none; }
.st-back .st-sym { width: 20px; height: 20px; }
.st-back span { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-title { grid-column: 2; font: 600 17px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; --scroll-inset-top: calc(var(--n-top) + 52px); }
.st-page { max-width: 720px; margin: 0 auto; padding: calc(var(--n-top) + 62px) 28px 60px; }

/* ---------- grouped lists ---------- */

.st-section { margin: 0 0 22px; }
.st-head { margin: 0 16px 7px; font: 400 13px/1.3 var(--font); color: var(--st-sub); text-transform: uppercase; letter-spacing: 0.02em; }
.st-label-sec { margin: 26px 16px 7px; font: 400 13px var(--font); color: var(--st-sub); text-transform: uppercase; letter-spacing: 0.02em; }
.st-foot { margin: 7px 16px 0; font: 400 13px/1.38 var(--font); color: var(--st-sub); }
.st-err { color: var(--st-red); }
.st-group { border-radius: 26px; background: var(--st-cell); overflow: hidden; }
.st-side .st-group { background: transparent; border-radius: 14px; }
.st-side .st-section { margin-bottom: 18px; }
.st-row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; margin: 0; padding: 10px 20px;
  border: 0; background: transparent; color: var(--st-text); font: 17px/1.3 var(--font); text-align: left;
}
button.st-row { cursor: pointer; }
button.st-row:hover { background: var(--st-press); }
button.st-row:active { background: color-mix(in srgb, var(--st-text) 12%, transparent); }
.st-row + .st-row::before, .st-row + .st-form::before { content: ""; position: absolute; top: 0; left: 20px; right: 0; height: 0.5px; background: var(--st-sep); }
.st-row.has-ico + .st-row::before { left: 62px; }
.st-side .st-row { min-height: 44px; padding: 7px 10px; border-radius: 12px; }
.st-side .st-row + .st-row::before { display: none; }
.st-side .st-row.sel { background: var(--st-sel); color: #fff; }
.st-side .st-row.sel .st-s, .st-side .st-row.sel .st-chev { color: rgba(255, 255, 255, 0.8); }
.st-label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-s { font-size: 13px; line-height: 1.3; color: var(--st-sub); white-space: normal; }
.st-value { flex: none; max-width: 55%; color: var(--st-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-chev { flex: none; width: 14px; height: 14px; margin-left: -4px; color: color-mix(in srgb, var(--st-sub) 70%, transparent); stroke-width: 3.2 !important; }
.st-row.tint { color: var(--st-tint); }
.st-row.danger { color: var(--st-red); }
.st-row.flash { animation: st-flash 1.4s ease; }
@keyframes st-flash { 0%, 40% { background: color-mix(in srgb, var(--st-tint) 22%, transparent); } }
.st-block { display: block; padding: 14px 20px; }
.st-none { padding: 30px 10px; color: var(--st-sub); text-align: center; }

/* Symbols: white on the coloured squares, the text colour elsewhere. */
.st-sym { display: block; width: 18px; height: 18px; }
.st-sym .s { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.st-sym .f { fill: currentColor; }
.st-badge { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #fff; }
.st-badge .st-sym { width: 19px; height: 19px; }
.st-app-ico { --icon: 30px; flex: none; width: 30px; height: 30px; border-radius: 8px; }
/* Widget kinds, coloured like their apps. */
.st-k-weather { background: linear-gradient(180deg, #4ba2ff, #1c6ee0); }
.st-k-clock { background: #000; box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.2); }
.st-k-clock .st-sym { color: #fff; }
.st-k-clock .st-sym::before { content: none; }
.st-k-calendar { background: #fff; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12); position: relative; }
.st-k-calendar::before { content: "31"; position: absolute; inset: 9px 0 0; font: 500 15px/1 var(--font); color: #000; text-align: center; }
.st-k-calendar::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; border-radius: 8px 8px 0 0; background: #ff3b30; }
.st-k-calendar .st-sym { display: none; }
.st-k-countdown { background: linear-gradient(180deg, #ffb340, #ff9500); }
.st-k-reminders { background: #fff; color: #ff9500; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12); }
.st-k-battery { background: #34c759; }
.st-k-search { background: linear-gradient(180deg, #7a78ff, #4f4cd9); }

/* The card at the top of each sidebar page. */
.st-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0 0 24px; padding: 22px 26px 24px; border-radius: 26px; background: var(--st-cell); text-align: center; }
.st-hero-ico { width: 62px !important; height: 62px !important; border-radius: 15px !important; --icon: 62px; margin-bottom: 6px; }
.st-hero-ico .st-sym { width: 40px; height: 40px; }
.st-hero-t { font: 700 22px/1.2 var(--font); }
.st-hero-d { max-width: 460px; font: 15px/1.4 var(--font); color: var(--st-sub); }

/* The FoldTab card at the top of the sidebar, in place of the Apple Account. */
.st-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border: 0; border-radius: 18px; background: var(--st-cell); color: var(--st-text); text-align: left; cursor: pointer; }
.st-card:hover { background: color-mix(in srgb, var(--st-cell) 90%, var(--st-text)); }
.st-card-ico { --icon: 54px; flex: none; width: 54px; height: 54px; border-radius: 13px; }
.st-card-t { font: 600 19px/1.2 var(--font); }

/* ---------- controls ---------- */

/* The iOS switch. */
.st-switch {
  appearance: none; flex: none; position: relative; width: 51px; height: 31px; margin: 0; border-radius: 16px; cursor: pointer;
  background: color-mix(in srgb, var(--st-text) 16%, transparent); transition: background 0.25s ease;
}
.st-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06); transition: translate 0.3s var(--spring-pop, ease);
}
.st-switch:checked { background: var(--st-green); }
.st-switch:checked::after { translate: 20px 0; }
.st-switch:focus-visible { outline: 2px solid var(--st-tint); outline-offset: 2px; }

/* The segmented control: a capsule with the chosen part raised. */
.st-seg { flex: none; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 18px; background: var(--st-fill); }
.st-seg button {
  min-width: 70px; height: 30px; padding: 0 12px; border: 0; border-radius: 16px; background: transparent; color: var(--st-text);
  font: 500 14px var(--font); cursor: pointer; transition: background 0.2s ease, box-shadow 0.2s ease;
}
.st-seg button.on { background: var(--st-cell); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04); font-weight: 600; }
body.mode-dark .st-seg button.on { background: #636366; }

/* A pop-up menu: the value and up-down chevrons. */
.st-menu { position: relative; flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--st-sub); }
.st-select { appearance: none; border: 0; outline: 0; background: transparent; color: inherit; font: 17px var(--font); text-align: right; cursor: pointer; padding-right: 2px; }
.st-select option { background: var(--st-cell); color: var(--st-text); }

/* Sliders: a thin track filled in the tint up to a round white knob. */
.st-slider { display: flex; align-items: center; gap: 12px; width: 100%; }
.st-end { flex: none; font-size: 13px; color: var(--st-sub); }
.st-range {
  --p: 50%; flex: 1; min-width: 0; height: 28px; margin: 0; appearance: none; background: transparent; cursor: pointer;
}
.st-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--st-tint) var(--p), color-mix(in srgb, var(--st-text) 16%, transparent) var(--p)); }
.st-range::-webkit-slider-thumb {
  appearance: none; width: 28px; height: 28px; margin-top: -12px; border-radius: 50%; background: #fff;
  box-shadow: 0 0.5px 4px rgba(0, 0, 0, 0.12), 0 6px 13px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}
.tinted .st-range { --st-tint: hsl(var(--hue), 80%, 55%); }
.tinted .st-range::-webkit-slider-runnable-track { background: linear-gradient(90deg, hsl(0, 85%, 58%), hsl(60, 85%, 55%), hsl(120, 70%, 50%), hsl(180, 75%, 50%), hsl(240, 80%, 62%), hsl(300, 75%, 58%), hsl(360, 85%, 58%)); }

/* Appearance: Light and Dark pictures of the Home Screen with a round check under each. */
.st-looks { display: flex; justify-content: center; gap: 48px; padding: 20px 20px 16px; }
.st-look { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 0; background: none; color: var(--st-text); font: 15px var(--font); cursor: pointer; }
.st-look-pic {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; align-content: center; justify-items: center; width: 116px; height: 82px; padding: 0 16px; border-radius: 12px;
  background: linear-gradient(160deg, #7fb2ff, #c084fc 60%, #ffb38a); box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.15);
}
.st-look-pic i { width: 16px; height: 16px; border-radius: 4.5px; background: rgba(255, 255, 255, 0.92); }
.st-look-pic.look-dark { background: linear-gradient(160deg, #1d2a6b, #3d1f63 60%, #6b2c3a); }
.st-look-pic.look-dark i { background: rgba(40, 40, 46, 0.95); box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.2); }
.st-radio { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--st-sub) 60%, transparent); color: transparent; }
.st-radio .st-sym { width: 14px; height: 14px; }
.st-radio .s { stroke-width: 3; }
.st-look.on .st-radio { background: var(--st-tint); box-shadow: none; color: #fff; }

/* Icon & widget style: the four Customize looks. */
.st-styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 16px 14px; }
.st-style { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 4px; border: 0; border-radius: 16px; background: transparent; color: var(--st-text); font: 14px var(--font); cursor: pointer; }
.st-style .sw { --hue: var(--hue); }
.st-style:hover { background: var(--st-press); }
.st-style.on { background: var(--st-fill); box-shadow: inset 0 0 0 2px var(--st-tint); }

/* Wallpapers: a grid of pictures, the chosen one ringed. */
.st-walls { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; padding: 16px; }
.st-wall { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; color: var(--st-text); font: 13px var(--font); cursor: pointer; }
.st-wall-pic { display: block; aspect-ratio: 16 / 10; border-radius: 12px; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.15); transition: box-shadow 0.2s ease, scale 0.25s var(--spring-pop, ease); }
.st-wall:hover .st-wall-pic { scale: 1.03; }
.st-wall.on .st-wall-pic { box-shadow: 0 0 0 3px var(--st-cell), 0 0 0 5.5px var(--st-tint); }
/* Your photos: a − on the corner removes one (shown on hover or focus, as in edit mode). */
.st-wall { position: relative; }
.st-wall-rm {
  position: absolute; top: -7px; left: -7px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(120, 120, 128, 0.9); color: #fff; font: 600 18px/1 var(--font); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  opacity: 0; scale: 0.6; transition: opacity 0.15s ease, scale 0.25s var(--spring-pop, ease);
}
.st-wall:hover .st-wall-rm, .st-wall:focus-within .st-wall-rm { opacity: 1; scale: 1; }
.st-wall-rm:hover { background: #ff3b30; }

/* Battery level. */
.st-battery { display: flex; flex-direction: column; gap: 10px; }
.st-bat-top { display: flex; align-items: baseline; gap: 10px; }
.st-bat-pct { font: 700 28px/1 var(--font); }
.st-bat-state { color: var(--st-sub); font-size: 15px; }
.st-bat-bar { height: 10px; border-radius: 5px; background: var(--st-fill); overflow: hidden; }
.st-bat-bar span { display: block; height: 100%; border-radius: 5px; background: var(--st-green); }
.st-bat-bar.low span { background: var(--st-red); }

/* A widget's own options, shown as rows. */
.st-form .field { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; margin: 0; padding: 8px 20px; font-size: 17px; }
.st-form .field[hidden] { display: none; }
.st-form .field + .field::before { content: ""; position: absolute; top: 0; left: 20px; right: 0; height: 0.5px; background: var(--st-sep); }
.st-form .field > span { flex: none; color: var(--st-text); }
.st-form .field input, .st-form .field select {
  flex: 1; min-width: 0; height: 34px; border: 0; outline: 0; background: transparent; color: var(--st-sub); text-align: right; font: 17px var(--font); user-select: text;
}
.st-form .field input:focus { color: var(--st-text); }
.st-form .field select { cursor: pointer; text-align-last: right; }
.st-form .field select option { background: var(--st-cell); color: var(--st-text); }
.st-form .field .pm-btn, .st-menu .pm-btn { color: var(--st-sub); font: 17px var(--font); }
/* A menu's button is as wide as its value: its negative margin (lining the chevrons up with the row's
   edge) made its box 6 px narrower than its text, so every value was cut short ("15 …", "D…"). */
.st-menu .pm-btn { flex: none; max-width: none; }
/* The city picker inside a widget's options. */
.st-form .cp { --label: var(--st-text); --label2: var(--st-sub); --fill: var(--st-fill); --cell-sep: var(--st-sep); --tint: var(--st-tint); --cell: var(--st-cell); }
.st-form .cp-list { max-height: 360px; }

/* ---------- a narrow window: one column, the list or a page ---------- */

.st-win.st-narrow { grid-template-columns: minmax(0, 1fr); }
.st-win.st-narrow .st-side { margin: calc(var(--n-top) + 6px) 10px 10px; }
.st-win.st-narrow:not(.st-show-list) .st-side { display: none; }
.st-win.st-narrow.st-show-list .st-main { display: none; }
.st-win.st-narrow .st-page { padding-left: 16px; padding-right: 16px; }
/* With the sidebar away, the back button starts after the window controls at the top left. */
.st-win.st-narrow .st-bar { padding-left: 88px; }

/* The App Switcher card. */
.sw-shot.sapp { background: var(--st-bg); }

/* A sidebar page shows its name in the bar only once its card has scrolled away, as in iPadOS. */
.st-main.top-page .st-title { opacity: 0; transition: opacity 0.2s ease; }
.st-main.top-page.scrolled .st-title { opacity: 1; }

/* Each style's sample icon sits on a little wallpaper, since Clear and Tinted are glass over it. */
.st-style-pic {
  display: grid; place-items: center; width: 70px; height: 70px; border-radius: 18px;
  background: linear-gradient(160deg, #6f8cff 0%, #b26dff 55%, #ff9a7a 100%); box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12);
}
.st-style-pic .sw { width: 42px; height: 42px; }
