/* ===== Shared app UI ===== */
.app { position: absolute; inset: 0; display: flex; flex-direction: column; font-size: 13.5px; color: var(--win-text); }
.app-row { display: flex; flex: 1; min-height: 0; }
.app-main { flex: 1; min-width: 0; overflow: auto; position: relative; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: .5px solid var(--hairline); }
.list-row:hover { background: var(--control-bg); }
.list-row.sel { background: rgba(var(--accent-rgb), .16); }

/* ---------- Finder ---------- */
.finder-grid { display: grid; grid-template-columns: repeat(auto-fill, 104px); gap: 6px; padding: 16px; align-content: start; }
.fi { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: 9px; text-align: center; }
.fi:hover { background: var(--control-bg); }
.fi.sel { background: rgba(var(--accent-rgb), .18); }
.fi .fi-ico { width: 52px; height: 52px; display: grid; place-items: center; filter: drop-shadow(0 2px 3px rgba(0,0,0,.18)); }
.fi .fi-name { font-size: 12.5px; line-height: 1.25; max-width: 92px; word-break: break-word; }
.finder-list .fl-row { display: grid; grid-template-columns: 2fr 1fr 1fr 90px; padding: 5px 14px; border-bottom: .5px solid var(--hairline); align-items: center; }
.finder-list .fl-head { position: sticky; top: 0; background: var(--win-bg); font-size: 11.5px; color: var(--win-text-dim); font-weight: 600; z-index: 1; }
.finder-list .fl-row .fl-name { display: flex; align-items: center; gap: 8px; }
.path-bar { height: 24px; display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--win-text-dim); padding: 0 14px; border-top: .5px solid var(--hairline); }

/* ---------- Calculator ---------- */
.calc { display: flex; flex-direction: column; height: 100%; background: linear-gradient(180deg, rgba(0,0,0,.02), rgba(0,0,0,.06)); }
:root[data-theme="dark"] .calc { background: #1c1c1e; }
.calc-display { flex: none; text-align: right; padding: 20px 22px 10px; font-size: 52px; font-weight: 300; overflow: hidden; letter-spacing: -1px; min-height: 92px; display: flex; align-items: flex-end; justify-content: flex-end; }
.calc-keys { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; padding: 1px; }
.calc-key { display: grid; place-items: center; font-size: 24px; font-weight: 400; background: rgba(120,120,128,.16); transition: filter .1s; user-select: none; }
.calc-key:hover { filter: brightness(1.12); }
.calc-key:active { filter: brightness(.85); }
.calc-key.op { background: var(--accent); color: #fff; font-size: 27px; }
.calc-key.op.sel { background: #fff; color: var(--accent); }
.calc-key.fn { background: rgba(120,120,128,.32); font-size: 20px; }
.calc-key.zero { grid-column: span 2; }

/* ---------- Notes ---------- */
.notes-sidebar { width: 240px; flex: none; border-right: .5px solid var(--hairline); overflow-y: auto; background: var(--win-sidebar); }
.note-item { padding: 9px 14px; border-bottom: .5px solid var(--hairline); }
.note-item.sel { background: rgba(255,214,10,.28); border-radius: 8px; margin: 2px 6px; border-bottom: none; }
:root[data-theme="dark"] .note-item.sel { background: rgba(255,214,10,.18); }
.note-item .ni-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-item .ni-prev { font-size: 12px; color: var(--win-text-dim); display: flex; gap: 6px; margin-top: 2px; }
.note-editor { flex: 1; display: flex; flex-direction: column; }
.note-editor .ne-date { text-align: center; font-size: 11.5px; color: var(--win-text-dim); padding: 8px; }
.note-editor .ne-body { flex: 1; border: none; outline: none; resize: none; background: none; color: var(--win-text); font-size: 15px; line-height: 1.55; padding: 4px 24px 24px; }

/* ---------- Terminal ---------- */
.term { height: 100%; background: rgba(20,20,22,.86); color: #e6e6e6; font-family: var(--font-mono); font-size: 13px; padding: 10px 12px; overflow-y: auto; line-height: 1.5; }
.term .prompt { color: #5af78e; }
.term .path { color: #57c7ff; }
.term .cmd-in { color: #e6e6e6; }
.term-input-line { display: flex; gap: 6px; }
.term-input { flex: 1; background: none; border: none; outline: none; color: #e6e6e6; font-family: var(--font-mono); font-size: 13px; }
.term .err { color: #ff6c6b; }
.term .muted { color: #9aa0a6; }

/* ---------- Generic content pages ---------- */
.pane-head { padding: 20px 24px 8px; font-size: 26px; font-weight: 700; }
.pane-sub { padding: 0 24px; color: var(--win-text-dim); }
.card { border-radius: 12px; background: var(--control-bg); padding: 14px 16px; margin: 8px 0; }
.settings-list { max-width: 720px; margin: 0 auto; padding: 18px 22px; }
.set-group { border-radius: 12px; overflow: hidden; background: rgba(var(--glass-tint), .4); margin-bottom: 20px; box-shadow: inset 0 0 0 .5px var(--hairline); }
.set-row { display: flex; align-items: center; gap: 12px; padding: 11px 15px; border-bottom: .5px solid var(--hairline); }
.set-row:last-child { border-bottom: none; }
.set-row .set-ico { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: #fff; flex: none; }
.set-row .set-label { flex: 1; }
.set-row .set-value { color: var(--win-text-dim); font-size: 13px; display: flex; align-items: center; gap: 6px; }

/* swatches */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6), 0 1px 3px rgba(0,0,0,.2); }
.swatch.sel { box-shadow: inset 0 0 0 2px rgba(255,255,255,.9), 0 0 0 2.5px var(--accent); }
.wall-thumb { width: 116px; height: 74px; border-radius: 10px; background-size: cover; background-position: center; cursor: pointer; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.1); }
.wall-thumb.sel { box-shadow: 0 0 0 3px var(--accent); }

/* Music / media */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 18px; padding: 20px; }
.media-card { cursor: default; }
.media-cover { aspect-ratio: 1; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.22); overflow: hidden; position: relative; }
.media-card .mt { font-size: 13px; font-weight: 600; margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card .ms { font-size: 12px; color: var(--win-text-dim); }
.now-playing { height: 66px; border-top: .5px solid var(--hairline); display: flex; align-items: center; gap: 12px; padding: 0 16px; flex: none; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; padding: 4px; }
.photo-cell { aspect-ratio: 1; border-radius: 4px; overflow: hidden; cursor: default; }
.photo-cell > * { width: 100%; height: 100%; object-fit: cover; }

/* Reminders / list */
.todo { display: flex; align-items: center; gap: 12px; padding: 9px 18px; border-bottom: .5px solid var(--hairline); }
.todo .tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--win-text-dim); flex: none; display: grid; place-items: center; cursor: pointer; }
.todo.done .tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.todo.done .todo-text { color: var(--win-text-dim); text-decoration: line-through; }
.todo-text { flex: 1; outline: none; }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; background: var(--hairline); border: .5px solid var(--hairline); }
.cal-cell { background: var(--win-bg); min-height: 88px; padding: 6px 8px; font-size: 12px; position: relative; }
.cal-cell .cc-num { font-weight: 600; }
.cal-cell.other { opacity: .35; }
.cal-cell.today .cc-num { background: var(--accent); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal-head { display: grid; grid-template-columns: repeat(7,1fr); text-align: right; padding: 8px; font-size: 11px; font-weight: 600; color: var(--win-text-dim); }
.cal-event { font-size: 10.5px; border-radius: 4px; padding: 1px 5px; margin-top: 3px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Weather */
.weather { height: 100%; color: #fff; display: flex; flex-direction: column; padding: 22px; background: linear-gradient(180deg,#3a7bd5,#3a6073); }
.weather .w-city { font-size: 30px; font-weight: 600; }
.weather .w-temp { font-size: 76px; font-weight: 200; line-height: 1; }
.weather .w-days { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.weather .w-day { display: flex; align-items: center; gap: 14px; padding: 6px 0; border-top: .5px solid rgba(255,255,255,.2); font-size: 14px; }

/* generic pill toolbar for apps */
.app-toolbar { height: 46px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-bottom: .5px solid var(--hairline); }
.app-title { font-size: 15px; font-weight: 700; }
.chip { padding: 4px 12px; border-radius: 999px; background: var(--control-bg); font-size: 12.5px; }
.chip.sel { background: var(--accent); color: #fff; }

/* iframe host (Safari/Maps) */
.web-frame { width: 100%; height: 100%; border: none; background: #fff; }
.safari-omnibox { flex: 1; max-width: 640px; margin: 0 auto; height: 30px; border-radius: 8px; background: var(--control-bg); display: flex; align-items: center; gap: 8px; padding: 0 12px; font-size: 13px; color: var(--win-text); }
.safari-omnibox input { flex: 1; background: none; border: none; outline: none; color: var(--win-text); font-size: 13px; text-align: center; }
.safari-omnibox input:focus { text-align: left; }
