/* SPDX-FileCopyrightText: 2026 leauny
 * SPDX-License-Identifier: GPL-3.0-only */

:root {
  --bg: #F2F2F7; --surface: #FFFFFF; --surface-2: #F2F2F7; --elevated: #FFFFFF;
  --fill: rgba(120,120,128,.12); --fill-2: rgba(120,120,128,.20);
  --label: #000; --label-2: rgba(60,60,67,.60); --label-3: rgba(60,60,67,.30);
  --sep: rgba(60,60,67,.18);
  --tint: #007AFF; --tint-soft: rgba(0,122,255,.12);
  --green: #34C759; --orange: #FF9500; --red: #FF3B30;
  --material: rgba(249,249,249,.82); --side: rgba(232,232,237,.94);
  --key: #FFFFFF; --key-shadow: 0 1px 0 rgba(0,0,0,.28);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000; --surface: #1C1C1E; --surface-2: #2C2C2E; --elevated: #2C2C2E;
    --fill: rgba(118,118,128,.24); --fill-2: rgba(118,118,128,.36);
    --label: #FFF; --label-2: rgba(235,235,245,.60); --label-3: rgba(235,235,245,.30);
    --sep: rgba(84,84,88,.60);
    --tint: #0A84FF; --tint-soft: rgba(10,132,255,.22);
    --green: #30D158; --orange: #FF9F0A; --red: #FF453A;
    --material: rgba(30,30,30,.82); --side: rgba(28,28,30,.96);
    --key: #3A3A3C; --key-shadow: 0 1px 0 rgba(0,0,0,.6);
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); font-size: 15px; line-height: 1.4; background: var(--bg); color: var(--label);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .4; cursor: default; }
a { color: var(--tint); text-decoration: none; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sp { flex: 1; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; padding: 0 20px;
  border-radius: 14px; background: var(--tint); color: #fff; font-size: 17px; font-weight: 600; }
.btn.gray { background: var(--fill); color: var(--tint); }
.btn.red { background: var(--red); }
.btn.sm { width: auto; height: 34px; border-radius: 17px; font-size: 14px; padding: 0 14px; flex: none; }
.btn:active:not(:disabled), .k:active, .tile:active { opacity: .7; }
.ibtn { width: 34px; height: 34px; border-radius: 17px; background: var(--fill); color: var(--tint); display: grid; place-items: center; flex: none; }

.seg { display: flex; padding: 2px; border-radius: 9px; background: var(--fill); }
.seg button { flex: 1; padding: 6px 8px; border-radius: 7px; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--elevated); font-weight: 600; box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); }
@media (prefers-color-scheme: dark) { .seg button[aria-pressed="true"] { background: #636366; } }

.dot { width: 8px; height: 8px; border-radius: 50%; background: #8E8E93; flex: none; }
.dot.on, [data-online="true"] > .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(52,199,89,.18); }
.dot.busy { background: var(--orange); box-shadow: 0 0 0 3px rgba(255,149,0,.18); }

.switch { position: relative; flex: none; width: 51px; height: 31px; border-radius: 16px; background: var(--fill-2);
  appearance: none; -webkit-appearance: none; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }
.switch.sm { width: 40px; height: 24px; } .switch.sm::after { width: 20px; height: 20px; }
.switch.sm:checked::after { transform: translateX(16px); }

.ghead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 16px 6px; font-size: 13px; color: var(--label-2); }
.ghead button, .ghead a { color: var(--tint); font-size: 13px; }
.gnote { padding: 7px 16px 0; font-size: 12.5px; line-height: 1.45; color: var(--label-2); }
.group { border-radius: 12px; background: var(--surface); overflow: hidden; }
.li { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 6px 16px;
  font-size: 16px; text-align: left; color: var(--label); }
.li + .li::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.li .grow { flex: 1; min-width: 0; }
.li small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .v { color: var(--label-2); font-size: 15px; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .chev { color: var(--label-3); }
.li .ck { color: var(--tint); font-weight: 600; }
.li.tint { color: var(--tint); } .li.red { color: var(--red); } .li.center { justify-content: center; }
button.li:active:not(:disabled), a.li:active { background: var(--fill); }
.li .lab { width: 120px; flex: none; }
.li input:not([type=checkbox]) { flex: 1; min-width: 0; border: 0; outline: none; background: none; text-align: right; font-size: 16px; }
.li input::placeholder { color: var(--label-3); }

.toast { position: fixed; z-index: 90; left: 50%; top: calc(var(--safe-t) + 10px); max-width: min(92vw, 520px);
  transform: translate(-50%, -160%); padding: 10px 16px; border-radius: 20px; font-size: 14px; text-align: center;
  background: var(--material); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 30px rgba(0,0,0,.15), 0 0 0 .5px var(--sep); transition: transform .3s, opacity .3s; pointer-events: none; opacity: 0; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

dialog.sheet { margin: auto auto 0; width: 100%; max-width: 640px; max-height: 92dvh; overflow: auto; border: 0;
  padding: 0 0 calc(var(--safe-b) + 20px); border-radius: 22px 22px 0 0; background: var(--bg); color: var(--label);
  box-shadow: 0 -8px 30px rgba(0,0,0,.15); overscroll-behavior: contain; }
dialog.sheet::backdrop { background: rgba(0,0,0,.3); }
dialog.sheet[open] { animation: sheet-up .25s ease-out; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .5; } }
.grab { width: 36px; height: 5px; margin: 6px auto 2px; border-radius: 3px; background: var(--fill-2); }
.sh-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 8px 16px 10px; background: var(--bg); }
.sh-head h2 { flex: 1; font-size: 17px; font-weight: 600; }
.x { width: 30px; height: 30px; border-radius: 15px; background: var(--fill); color: var(--label-2); display: grid; place-items: center; font-size: 14px; flex: none; }
.sh-body { padding: 0 16px; }
html[data-form="desktop"] dialog.sheet { margin: auto; max-width: 520px; border-radius: 14px; padding-bottom: 20px;
  box-shadow: 0 24px 70px rgba(0,0,0,.28), 0 0 0 .5px var(--sep); }
html[data-form="desktop"] dialog.sheet[open] { animation: none; }
html[data-form="desktop"] .grab { display: none; }

/* App frame: sidebar only for the desktop form on wide windows. */
.layout { display: flex; height: var(--app-h, 100dvh); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side { display: none; width: 236px; flex: none; flex-direction: column; padding: 14px 10px; overflow: auto;
  background: var(--side); border-right: .5px solid var(--sep); }
.side .brand { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 10px; font-size: 14px; font-weight: 600; }
.side .h { padding: 14px 10px 5px; font-size: 11px; font-weight: 600; color: var(--label-2); }
.side .it { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 30px; padding: 4px 10px; border-radius: 7px;
  font-size: 13.5px; text-align: left; color: var(--label); }
.side .it:hover { background: var(--fill); }
.side .it .ico { width: 18px; text-align: center; color: var(--tint); }
.side .it .r { margin-left: auto; font-size: 12px; color: var(--label-2); }
.side .it[aria-current="page"] { background: var(--tint); color: #fff; }
.side .it[aria-current="page"] .ico, .side .it[aria-current="page"] .r { color: #fff; }
.side .grow { flex: 1; }
.side .seg { margin: 10px 4px 0; } .side .seg button { font-size: 12px; padding: 4px 0; }
.tbar { display: none; flex: none; align-items: center; gap: 12px; height: 54px; padding: 0 22px; background: var(--surface); border-bottom: .5px solid var(--sep); }
.tbar h1 { font-size: 15px; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 11px; background: var(--fill); font-size: 12px; color: var(--label-2); }
@media (min-width: 1024px) {
  html[data-form="desktop"] .side { display: flex; }
  html[data-form="desktop"] .tbar { display: flex; }
  html[data-form="desktop"] .narrow-only { display: none !important; }
}
@media (max-width: 1023px) { .wide-only { display: none !important; } }
html[data-form="phone"] .wide-only { display: none !important; }
