/* apps.css: casefile (preview), photos, notes, monogram, music, terminal, settings, about.
   Class prefix .app-<id>. Relies only on the 4.3 variables: --font --mono --text --text-2 --text-3 --bg-window --bg-content
   --bg-sidebar --bg-toolbar --bg-hover --bg-selected --sep --accent --accent-text --radius-window --radius-control --shadow-window --ease
   and the shared `.scroll` class. Everything else (buttons, segmented control, switch, range) is defined here with an app- or st-/cf-/... prefix. */

[class*="app-"] { box-sizing: border-box; }
[class*="app-"] *, [class*="app-"] *::before, [class*="app-"] *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

.app-casefile, .app-photos, .app-notes, .app-notes-side, .app-notes-tb, .app-monogram, .app-music, .app-terminal,
.app-settings, .app-settings-side, .app-about, .app-photos-tb {
  font: 400 13px/1.4 var(--font);
  color: var(--text);
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}
.app-casefile button, .app-photos button, .app-notes button, .app-notes-side button, .app-monogram button, .app-music button,
.app-settings button, .app-settings-side button, .app-about button {
  font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; margin: 0;
}

/* ---------- shared bits ---------- */
.app-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 22px; padding: 0 11px;
  font: 400 13px/1 var(--font); color: var(--text); text-decoration: none; text-transform: lowercase;
  background: var(--bg-hover); border: 1px solid var(--sep); border-radius: 5px; cursor: default; white-space: nowrap;
  transition: background .15s var(--ease), opacity .15s var(--ease);
}
.app-btn:hover { background: var(--bg-selected); }
.app-btn:active { opacity: .8; }
.app-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app-btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-text); }
.app-btn.primary:hover { background: var(--accent); filter: brightness(1.08); }
.app-btn:disabled { opacity: .5; pointer-events: none; }

.app-seg { display: inline-flex; padding: 2px; gap: 1px; background: var(--bg-hover); border: 1px solid var(--sep); border-radius: 7px; }
.app-seg-b { height: 22px; padding: 0 12px; border: 0; border-radius: 5px; background: transparent; color: var(--text-2); font-size: 12px; cursor: default; white-space: nowrap; }
.app-seg-b:hover { color: var(--text); }
.app-seg-b.on { background: var(--bg-selected); color: var(--text); box-shadow: 0 0 0 .5px var(--sep), 0 1px 2px rgba(0,0,0,.18); }
.app-seg-b:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.app-range { -webkit-appearance: none; appearance: none; width: 120px; height: 18px; background: transparent; margin: 0; }
.app-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--bg-selected); }
.app-range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--bg-selected); }
.app-range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 .5px rgba(0,0,0,.25), 0 1px 3px rgba(0,0,0,.35); }
.app-range::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 .5px rgba(0,0,0,.25), 0 1px 3px rgba(0,0,0,.35); }

/* =====================================================================
   casefile (preview): fixed text column, scrolling image column
   ===================================================================== */
.app-casefile { position: relative; height: 100%; min-height: 0; background: var(--bg-content); container-type: inline-size; outline: none; overflow: hidden; }
.cf-doc { display: flex; height: 100%; min-height: 0; }
.cf-side { flex: none; width: 320px; padding: 28px 24px 32px; overflow-y: auto; border-right: 1px solid var(--sep); background: var(--bg-content); }
.cf-title { margin: 0 0 14px; font: 700 26px/1.1 var(--font); letter-spacing: -0.025em; }
.cf-p { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--text); }
.cf-info { margin: 20px 0 0; padding: 0; border-top: 1px solid var(--sep); }
.cf-row { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--sep); font-size: 12px; }
.cf-row dt { color: var(--text-2); }
.cf-row dd { margin: 0; }
.cf-count { margin-top: 14px; font-size: 11px; color: var(--text-3); }
.cf-open { margin-top: 16px; height: 28px; padding: 0 16px; border-radius: 6px; }
.cf-scroll { position: relative; flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 28px 16px 16px; background: var(--bg-window); scroll-behavior: auto; }
.cf-shot { margin: 0 0 16px; }
.cf-frame { display: block; width: 100%; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--bg-hover); cursor: zoom-in; position: relative; min-height: 40px; }
.cf-frame img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s var(--ease); }
.cf-frame.loaded img { opacity: 1; }
.cf-frame.missing img { display: none; }
.cf-frame:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cf-shot figcaption { margin: 6px 2px 0; font-size: 11px; line-height: 1.4; color: var(--text-2); }
.cf-video { display: block; width: 100%; border-radius: 6px; background: var(--bg-hover); }
.cf-vid { margin-bottom: 16px; }
.cf-end { height: 8px; }
.cf-rail { position: absolute; top: 14px; bottom: 14px; right: 6px; width: 14px; display: flex; flex-direction: column; gap: 2px; z-index: 2; }
.cf-tick { position: relative; flex: 1 1 0; min-height: 2px; max-height: 18px; padding: 0; border: 0; background: transparent; cursor: default; }
.cf-tick::after { content: ""; position: absolute; top: 0; bottom: 0; right: 4px; width: 3px; border-radius: 2px; background: var(--sep); transition: background .15s, width .15s; }
.cf-tick.past::after { background: var(--text-3); }
.cf-tick.on::after { background: var(--accent); width: 5px; right: 3px; }
.cf-tick:hover::after { background: var(--text-2); }
.cf-tick.on:hover::after { background: var(--accent); }

/* single column: text first, then the images, in one scroll */
@container (max-width: 700px) {
  .cf-doc { display: block; overflow-y: auto; overflow-x: hidden; }
  .cf-side { width: auto; overflow: visible; border-right: 0; padding: 22px 16px 8px; }
  .cf-title { font-size: 24px; }
  .cf-scroll { overflow: visible; padding: 8px 16px 24px; background: var(--bg-content); }
  .cf-rail { display: none; }
}

/* =====================================================================
   photos: album picker
   ===================================================================== */
.app-photos-tb { flex: 1; display: flex; align-items: center; justify-content: center; min-width: 0; }
.ph-tb-title { font-weight: 600; font-size: 13px; }
.app-photos { height: 100%; padding: 24px 28px 32px; background: var(--bg-content); overflow-y: auto; }
.ph-h { margin: 0 0 18px; font: 700 26px/1.1 var(--font); letter-spacing: -0.025em; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 18px; }
.ph-card { display: flex; flex-direction: column; gap: 2px; padding: 0; border: 0; background: transparent; text-align: left; cursor: default; }
.ph-cover { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--bg-hover); margin-bottom: 7px; box-shadow: 0 0 0 .5px var(--sep); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.ph-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ph-card:hover .ph-cover { transform: translateY(-2px); box-shadow: 0 0 0 .5px var(--sep), 0 8px 22px rgba(0,0,0,.2); }
.ph-card:active .ph-cover { transform: none; }
.ph-card:focus-visible { outline: none; }
.ph-card:focus-visible .ph-cover { box-shadow: 0 0 0 3px var(--accent); }
.ph-name { font-size: 13px; font-weight: 500; }
.ph-count { font-size: 11px; color: var(--text-2); }
.ph-empty { padding: 60px 0; text-align: center; color: var(--text-2); }

/* =====================================================================
   notes: folders | list | note
   ===================================================================== */
.app-notes-side { padding: 6px 10px 10px; height: 100%; overflow-y: auto; }
.nt-side-h { padding: 10px 8px 4px; font-size: 11px; font-weight: 600; color: var(--text-3); }
.nt-folders { display: flex; flex-direction: column; gap: 1px; }
.nt-folder { display: flex; align-items: center; gap: 7px; height: 26px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: default; }
.nt-folder:hover { background: var(--bg-hover); }
.nt-folder.on { background: var(--bg-selected); }
.nt-ico { display: inline-flex; color: var(--accent); }
.nt-fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-fcount { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nt-folder:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.app-notes-tb { flex: 1; display: flex; justify-content: flex-end; align-items: center; min-width: 0; }
.nt-search { width: 180px; height: 24px; padding: 0 9px 0 26px; border: 1px solid var(--sep); border-radius: 6px; background: var(--bg-hover) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='6' cy='6' r='4'/%3E%3Cpath d='M9.2 9.2L12 12'/%3E%3C/svg%3E") 8px 50% no-repeat; color: var(--text); font: 400 13px var(--font); text-transform: lowercase; outline: none; -webkit-appearance: none; appearance: none; }
.nt-search:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.nt-search::placeholder { color: var(--text-3); }
.nt-search::-webkit-search-cancel-button { -webkit-appearance: none; }

.app-notes { position: relative; display: flex; height: 100%; min-height: 0; background: var(--bg-content); container-type: inline-size; }
.nt-list { flex: none; width: 250px; height: 100%; overflow-y: auto; padding: 6px; border-right: 1px solid var(--sep); background: var(--bg-content); }
.nt-item { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: default; }
.nt-item:hover { background: var(--bg-hover); }
.nt-item.on { background: var(--accent); color: var(--accent-text); }
.nt-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nt-it { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-ip { display: flex; gap: 8px; font-size: 11px; color: var(--text-2); min-width: 0; }
.nt-item.on .nt-ip { color: color-mix(in srgb, var(--accent-text) 75%, transparent); }
.nt-if { flex: none; }
.nt-is { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-none { padding: 30px 12px; text-align: center; color: var(--text-3); }
.nt-note { position: relative; flex: 1; min-width: 0; height: 100%; overflow-y: auto; padding: 28px 40px 48px; }
.nt-note > * { max-width: 560px; margin-left: auto; margin-right: auto; }
.nt-back { display: none; align-items: center; justify-content: center; width: 28px; height: 28px; margin: -10px 0 8px -10px !important; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--accent); }
.nt-folderline { margin-bottom: 4px; font-size: 11px; color: var(--text-3); }
.nt-h { margin: 0 0 16px; font: 700 26px/1.15 var(--font); letter-spacing: -0.025em; }
.nt-p { margin: 0 0 14px; font-size: 14px; line-height: 1.55; }
.nt-info { margin: 22px auto 0; padding: 0; border-top: 1px solid var(--sep); }
.nt-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--sep); font-size: 12px; }
.nt-row dt { color: var(--text-2); }
.nt-row dd { margin: 0; }
@container (max-width: 640px) {
  .nt-list { width: 100%; border-right: 0; }
  .nt-note { position: absolute; inset: 0; width: 100%; z-index: 2; background: var(--bg-content); padding: 20px 20px 40px; transform: translateX(100%); transition: transform .3s var(--ease); }
  .app-notes.show-detail .nt-note { transform: none; }
  .nt-back { display: inline-flex; }
}

/* =====================================================================
   monogram (hud / dark)
   ===================================================================== */
.app-monogram { display: flex; flex-direction: column; height: 100%; min-height: 0; background: #0c0c0e; color: rgba(255,255,255,.92); }
.mg-stage { position: relative; flex: 1; min-height: 160px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mg-canvas { position: absolute; left: 0; top: 0; display: block; touch-action: pan-y; cursor: grab; outline: none; }
.mg-canvas.grab { cursor: grabbing; }
.mg-canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mg-status { position: absolute; left: 14px; bottom: 10px; font-size: 11px; color: rgba(255,255,255,.45); font-variant-numeric: tabular-nums; pointer-events: none; }
.mg-status:empty { display: none; }
.mg-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.mg-fallback img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mg-fallback .mg-mark { display: none; width: 34%; max-width: 220px; aspect-ratio: 5 / 6; background: rgba(255,255,255,.9); -webkit-mask: url("../assets/monogram/mark.svg") center / contain no-repeat; mask: url("../assets/monogram/mark.svg") center / contain no-repeat; }
.mg-fallback.mark .mg-mark { display: block; }
.mg-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid rgba(255,255,255,.1); }
.app-monogram .app-seg { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.1); }
.app-monogram .app-seg-b { color: rgba(255,255,255,.62); }
.app-monogram .app-seg-b:hover { color: #fff; }
.app-monogram .app-seg-b.on { background: rgba(255,255,255,.2); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.app-monogram .app-btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.14); color: #fff; }
.app-monogram .app-btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-text); }
.mg-art { flex: none; padding: 10px 16px 14px; border-top: 1px solid rgba(255,255,255,.1); }
.mg-art-h { margin-bottom: 8px; font-size: 11px; color: rgba(255,255,255,.5); }
.mg-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.mg-thumb { flex: none; width: 112px; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.08); box-shadow: 0 0 0 .5px rgba(255,255,255,.18); cursor: default; }
.mg-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mg-thumb.on { box-shadow: 0 0 0 2px #0c0c0e, 0 0 0 4px var(--accent); }
.mg-thumb:hover { filter: brightness(1.12); }
.mg-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* =====================================================================
   music
   ===================================================================== */
.app-music { height: 100%; min-height: 0; background: var(--bg-content); outline: none; container-type: inline-size; overflow: hidden; }
.mu-wrap { display: flex; height: 100%; min-height: 0; }
.mu-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 22px 24px 20px; overflow-y: auto; }
.mu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.mu-head h1 { margin: 0; font: 700 26px/1.1 var(--font); letter-spacing: -0.025em; }
.mu-vol { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-2); }
.mu-kb { position: relative; height: 260px; flex: none; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 6px; overflow: hidden; background: #111; padding: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.18); }
.mu-key { position: absolute; top: 0; display: flex; align-items: flex-end; justify-content: center; cursor: default; }
.mu-key.white { height: 100%; background: #fafafa; border-right: 1px solid #c9c9cc; padding-bottom: 8px; color: rgba(0,0,0,.4); }
.mu-key.white.on { background: color-mix(in srgb, var(--accent) 35%, #fff); }
.mu-key.black { height: 60%; z-index: 2; background: #16161a; border-radius: 0 0 4px 4px; padding-bottom: 6px; color: rgba(255,255,255,.4); box-shadow: inset 0 -3px 0 rgba(255,255,255,.08), 0 2px 4px rgba(0,0,0,.4); }
.mu-key.black.on { background: var(--accent); color: var(--accent-text); }
.mu-k { font-size: 11px; pointer-events: none; }
.mu-hint { margin: 12px 0 0; font-size: 11px; line-height: 1.5; color: var(--text-2); max-width: 520px; }
.mu-tracks { margin-top: 20px; }
.mu-tracks h2 { margin: 0 0 6px; font-size: 11px; font-weight: 600; color: var(--text-3); }
.mu-track { display: flex; align-items: center; gap: 10px; width: 100%; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: default; }
.mu-track:hover { background: var(--bg-hover); }
.mu-track.playing { background: var(--bg-selected); }
.mu-play { display: inline-flex; color: var(--accent); }
.mu-tt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-ts { font-size: 11px; color: var(--text-2); }
.mu-notes { flex: none; width: 300px; overflow-y: auto; padding: 22px 22px 24px; border-left: 1px solid var(--sep); background: var(--bg-window); }
.mu-note + .mu-note { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--sep); }
.mu-note h2 { margin: 0 0 8px; font: 700 15px/1.25 var(--font); letter-spacing: -0.015em; }
.mu-note p { margin: 0 0 10px; font-size: 13px; line-height: 1.5; }
.mu-info { margin: 12px 0 0; }
.mu-info div { display: grid; grid-template-columns: 80px 1fr; gap: 10px; padding: 6px 0; border-top: 1px solid var(--sep); font-size: 12px; }
.mu-info dt { color: var(--text-2); }
.mu-info dd { margin: 0; }
@container (max-width: 700px) {
  .mu-wrap { flex-direction: column; overflow-y: auto; }
  .mu-notes { width: auto; border-left: 0; border-top: 1px solid var(--sep); overflow: visible; }
  .mu-main { overflow: visible; }
  .mu-kb { height: 150px; }
  .mu-k { display: none; }
}

/* =====================================================================
   terminal
   ===================================================================== */
.app-terminal { height: 100%; padding: 8px 12px 12px; overflow-y: auto; background: rgba(12,12,14,.55); color: #ececee; font: 400 12px/1.4 var(--mono); text-transform: none; letter-spacing: 0; cursor: text; }
.app-terminal ::selection { background: rgba(110,91,217,.55); }
.tm-line { white-space: pre-wrap; word-break: break-word; min-height: 1.4em; }
.tm-live { display: flex; align-items: baseline; }
.tm-prompt { white-space: pre; flex: none; }
.tm-user { color: #b2a8f5; }
.tm-cwd { color: #8fb3e6; }
.tm-dim { color: rgba(236,236,238,.55); }
.tm-b { font-weight: 700; }
.tm-link { color: #8fb3e6; text-decoration: underline; }
.tm-cmd { color: #b2a8f5; white-space: pre; }
.tm-input { flex: 1; min-width: 0; padding: 0; margin: 0; border: 0; outline: none; background: transparent; color: #fff; font: inherit; caret-color: #fff; text-transform: none; }
.tm-ls { display: flex; flex-wrap: wrap; gap: 0 22px; }
.tm-dir { color: #8fb3e6; font-weight: 700; }
.tm-neo { display: flex; gap: 22px; margin: 6px 0 0; }
.tm-art { margin: 0; font: inherit; line-height: 1.15; color: #b2a8f5; flex: none; }
.tm-facts > div { white-space: pre; }
.tm-k { color: #b2a8f5; font-weight: 700; }
.tm-sw { display: flex; margin-top: 8px; }
.tm-sw i { width: 16px; height: 16px; display: block; }

/* =====================================================================
   settings
   ===================================================================== */
.app-settings-side { height: 100%; padding: 6px 10px 10px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.st-item { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: default; }
.st-item:hover { background: var(--bg-hover); }
.st-item.on { background: var(--accent); color: var(--accent-text); }
.st-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.st-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; flex: none; }
.st-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 16px; padding: 0 0 2px; scrollbar-width: none; }
.st-tabs .st-item { flex: none; height: 28px; padding: 0 10px 0 6px; background: var(--bg-hover); }
.st-tabs .st-item.on { background: var(--accent); }
.app-settings { height: 100%; background: var(--bg-window); min-height: 0; }
.st-body { height: 100%; overflow-y: auto; padding: 22px 26px 30px; }
.st-pane { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.st-group { background: var(--bg-content); border: 1px solid var(--sep); border-radius: 10px; overflow: hidden; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding: 9px 14px; }
.st-row + .st-row { border-top: 1px solid var(--sep); }
.st-l1 { font-size: 13px; }
.st-l2 { font-size: 11px; color: var(--text-2); margin-top: 1px; }
.st-empty { padding: 20px; text-align: center; color: var(--text-2); }
.st-switch { position: relative; flex: none; width: 38px; height: 22px; padding: 0; border: 0; border-radius: 11px; background: var(--bg-selected); box-shadow: inset 0 0 0 .5px var(--sep); transition: background .2s var(--ease); cursor: default; }
.st-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .2s var(--ease); }
.st-switch[aria-checked="true"] { background: var(--accent); }
.st-switch[aria-checked="true"]::after { transform: translateX(16px); }
.st-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.st-prev { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.st-prev-screen { width: 100%; max-width: 320px; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: #111; box-shadow: 0 0 0 4px #1b1b1d, 0 0 0 5px rgba(255,255,255,.12), 0 10px 26px rgba(0,0,0,.3); margin: 4px 0; }
.st-prev-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.st-prev-name { font-size: 11px; color: var(--text-2); }
.st-walls { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 14px 12px; }
.st-wall { display: flex; flex-direction: column; gap: 5px; padding: 0; border: 0; background: transparent; text-align: center; cursor: default; }
.st-wall-img { display: block; aspect-ratio: 16 / 10; border-radius: 7px; overflow: hidden; background: var(--bg-hover); box-shadow: 0 0 0 .5px var(--sep); }
.st-wall-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.st-wall.on .st-wall-img { box-shadow: 0 0 0 2px var(--bg-window), 0 0 0 4px var(--accent); }
.st-wall-name { font-size: 11px; color: var(--text-2); }
.st-wall.on .st-wall-name { color: var(--text); }
.st-wall:focus-visible .st-wall-img { box-shadow: 0 0 0 2px var(--bg-window), 0 0 0 4px var(--accent); }

.st-themes { display: flex; gap: 14px; justify-content: center; }
.st-theme { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; cursor: default; }
.st-theme-img { position: relative; width: 96px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--sep); background: #d9dbe6; }
.st-theme-img .a { position: absolute; left: 14px; top: 12px; right: 14px; bottom: 0; border-radius: 6px 6px 0 0; background: #fff; box-shadow: 0 0 0 .5px rgba(0,0,0,.2); }
.st-theme-img .b { position: absolute; left: 14px; top: 12px; width: 22px; bottom: 0; border-radius: 6px 0 0 0; background: #ececf1; }
.st-theme-img .c { position: absolute; left: 41px; top: 20px; width: 34px; height: 4px; border-radius: 2px; background: rgba(0,0,0,.18); }
.st-theme[data-mode="dark"] .st-theme-img { background: #2a2c3a; }
.st-theme[data-mode="dark"] .a { background: #1e1e20; }
.st-theme[data-mode="dark"] .b { background: #2c2c30; }
.st-theme[data-mode="dark"] .c { background: rgba(255,255,255,.25); }
.st-theme[data-mode="auto"] .st-theme-img { background: linear-gradient(90deg, #d9dbe6 50%, #2a2c3a 50%); }
.st-theme[data-mode="auto"] .a { background: linear-gradient(90deg, #fff 50%, #1e1e20 50%); }
.st-theme[data-mode="auto"] .b { background: linear-gradient(90deg, #ececf1 100%, #ececf1); width: 22px; }
.st-theme-name { font-size: 11px; color: var(--text-2); }
.st-theme.on .st-theme-img { border-color: transparent; box-shadow: 0 0 0 2px var(--accent); }
.st-theme.on .st-theme-name { color: var(--text); }
.st-theme:focus-visible .st-theme-img { box-shadow: 0 0 0 2px var(--accent); }
.st-accents { display: flex; gap: 8px; }
.st-accent { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 .5px rgba(0,0,0,.25); cursor: default; }
.st-accent.on { box-shadow: 0 0 0 2px var(--bg-content), 0 0 0 4px var(--c); }
.st-accent:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* =====================================================================
   about (this luca)
   ===================================================================== */
.app-about { position: relative; display: flex; flex-direction: column; align-items: center; height: 100%; padding: 36px 26px 24px; text-align: center; background: var(--bg-content); }
.ab-lights { position: absolute; top: 12px; left: 14px; display: flex; gap: 8px; z-index: 2; }
.ab-light { width: 12px; height: 12px; padding: 0; border: 0; border-radius: 50%; background: #ff5f57; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.2); cursor: default; }
.ab-light.off { background: var(--text-3); opacity: .45; }
.ab-hero { position: relative; width: 100%; aspect-ratio: 3 / 2; border-radius: 10px; overflow: hidden; background: #0c0c0e; display: grid; place-items: center; }
.ab-hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ab-hero .ab-mark { display: none; width: 34%; aspect-ratio: 5 / 6; background: rgba(255,255,255,.9); -webkit-mask: url("../assets/monogram/mark.svg") center / contain no-repeat; mask: url("../assets/monogram/mark.svg") center / contain no-repeat; }
.ab-hero.fallback .ab-mark { display: block; }
.ab-name { margin: 18px 0 0; font: 700 24px/1.15 var(--font); letter-spacing: -0.025em; }
.ab-sub { margin-top: 2px; font-size: 13px; color: var(--text-2); }
.ab-rows { width: 100%; margin: 18px 0 20px; display: grid; gap: 5px; text-align: left; }
.ab-row { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12px; font-size: 11px; line-height: 1.45; }
.ab-row dt { text-align: right; font-weight: 600; color: var(--text-2); }
.ab-row dd { margin: 0; color: var(--text); }
.ab-more { margin-top: auto; flex: none; height: 24px; padding: 0 14px; }

@media (max-width: 759px) { .app-photos { padding: 16px 16px 24px; } .ph-grid { gap: 18px 12px; } .st-body { padding: 16px 16px 24px; } }

@media (prefers-reduced-motion: reduce) {
  .cf-frame img, .ph-cover, .st-switch, .st-switch::after, .nt-note { transition: none; }
}

/* mobile app touch: phone-only fixes, nothing here changes the desktop (mouse) layout */
.ql-close { display: none; }
@media (max-width: 759.98px) {
  .app-photos, .app-notes, .app-music, .app-settings, .app-terminal, .app-casefile, .app-about, .app-monogram, .spotlight, .menu { -webkit-tap-highlight-color: transparent; }
  button, .mu-key { touch-action: manipulation; }
  .cf-doc { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
  .cf-frame { cursor: pointer; min-height: 120px; }
  .cf-open { height: 44px; padding: 0 22px; font-size: 15px; display: inline-flex; align-items: center; }
  .cf-count { font-size: 12px; }
  .cf-p { font-size: 15px; }
  .cf-row { font-size: 14px; }

  /* quick look as a full-screen sheet: 44 px bar, a clear "done" button, swipe on the picture */
  .win-ql.win-mobile { --bar-h: 44px !important; }
  .win-ql.win-mobile .win-title { inset: 0 132px 0 84px; line-height: 62px; font-size: 14px; }
  .win-ql.win-mobile .win-frame { background: #121214; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .win-ql.win-mobile .win-toolbar { position: relative; z-index: 2; }
  .win-ql.win-mobile .ql-tb { padding: 0 4px 0 6px; gap: 0; }
  .ql-tb .ql-close { display: inline-flex; align-items: center; height: 44px; min-width: 64px; padding: 0 14px 0 8px; border: 0; background: none; color: var(--accent-hud, #b2a8f5); font: 600 16px/1 var(--font); order: 0; }
  .ql-tb .tb-spacer { order: 1; }
  .ql-tb .ql-open { order: 2; height: 32px; padding: 0 12px; font-size: 14px; }
  .ql-tb .tb-group { order: 3; display: flex; }
  .ql-tb .tb-btn:last-child { order: 4; }
  .win-ql.win-mobile .ql-tb .tb-btn { width: 44px; height: 44px; }
  .ql-photo, .ql-card { touch-action: none; }
  .ql-page { padding: 28px 22px 36px; }
  .ql-doc { touch-action: pan-y; }

  /* photos: bigger, steadier targets; no sticky hover lift after a tap */
  .ph-card:hover .ph-cover { transform: none; box-shadow: 0 0 0 .5px var(--sep); }
  .ph-card:active .ph-cover { transform: scale(.97); }
  .ph-name { font-size: 15px; }
  .ph-count { font-size: 12px; }

  /* notes: search no longer cut off, list rows are real tap targets, 16px so ios does not zoom */
  .app-notes-tb { justify-content: stretch; padding: 0 12px 0 0; }
  .nt-search { width: 100%; height: 34px; font-size: 16px; border-radius: 9px; }
  .nt-item { padding: 12px 12px; }
  .nt-it { font-size: 16px; }
  .nt-ip { font-size: 13px; }
  .nt-back { width: 44px; height: 44px; margin: -14px 0 4px -14px !important; }
  .nt-back svg { width: 22px; height: 22px; }
  .nt-p { font-size: 16px; }
  .nt-row { font-size: 14px; grid-template-columns: 96px 1fr; }

  /* music */
  .mu-main { padding: 18px 16px 18px; }
  .mu-kb { height: 190px; }
  .mu-track { height: 48px; font-size: 15px; }
  .mu-hint { display: none; }
  .mu-note p { font-size: 15px; }
  .app-range { min-height: 32px; }

  /* settings */
  .st-tabs { margin-bottom: 18px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .st-tabs .st-item { height: 40px; padding: 0 14px 0 8px; font-size: 14px; border-radius: 20px; }
  .st-switch { width: 52px; height: 32px; border-radius: 16px; }
  .st-switch::after { top: 2px; left: 2px; width: 28px; height: 28px; }
  .st-switch[aria-checked="true"]::after { transform: translateX(20px); }
  .st-row { min-height: 56px; }
  .st-l1 { font-size: 15px; }
  .st-l2 { font-size: 12px; }
  .st-accents { gap: 12px; }
  .st-accent { width: 32px; height: 32px; }
  .st-themes { gap: 10px; }
  .st-theme { padding: 4px; }
  .st-theme-img { width: 92px; }
  .st-theme-name, .st-wall-name, .st-prev-name { font-size: 12px; }
  .st-walls { grid-template-columns: repeat(2, 1fr); }
  .st-pane .app-btn, .app-settings .app-btn { height: 36px; padding: 0 16px; font-size: 14px; }

  /* monogram: bar wraps, material tabs and thumbs are easy to hit */
  .mg-bar { padding: 10px 12px; }
  .app-monogram .app-seg-b { min-height: 34px; padding: 0 12px; font-size: 14px; }
  .app-monogram .app-btn { height: 36px; padding: 0 16px; font-size: 14px; }
  .mg-thumb { width: 132px; cursor: pointer; }

  /* about */
  .app-about { overflow-y: auto; justify-content: flex-start; padding: 30px 22px 24px; }
  .ab-more { height: 40px; margin-top: 12px; padding: 0 20px; font-size: 15px; }
  .ab-row { font-size: 14px; }

  /* terminal: 16px input so focusing it does not zoom the page; the whole pane is the tap target */
  .app-terminal { font-size: 13px; -webkit-overflow-scrolling: touch; padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); }
  .tm-input { font-size: 16px; }
  .tm-neo { flex-direction: column; gap: 8px; }
  .tm-ls { gap: 0 16px; }

  /* spotlight: one column (list over a short preview), big rows */
  .spotlight { top: calc(var(--sb-h, 50px) + 12px); width: calc(100vw - 20px); max-height: calc(100dvh - var(--sb-h, 50px) - 24px); display: flex; flex-direction: column; }
  .spotlight .sp-field { flex: none; height: 56px; }
  .sp-input { font-size: 20px; }
  .spotlight.has-results .sp-body { display: flex; flex-direction: column; height: auto; min-height: 0; flex: 1; }
  .sp-list { flex: 1; min-height: 0; max-height: 50dvh; border-right: 0; -webkit-overflow-scrolling: touch; }
  .sp-row { height: 44px; margin: 0 6px; }
  .sp-title, .sp-sub { font-size: 15px; }
  .sp-preview { display: none; }

  /* menus (right-click / long-press): finger-sized rows */
  .menu { max-width: calc(100vw - 8px); }
  .menu-item { height: 40px; font-size: 15px; }
  .menu-label { white-space: nowrap; }
}
