/* ============================================================
   macOS Web — styles for deepened apps (part 4)
   ============================================================ */

/* ---------- Finder ---------- */
.finder-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.finder-toolbar { height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 0.5px solid rgba(0,0,0,0.08); }
body.dark .finder-toolbar { border-bottom-color: rgba(255,255,255,0.08); }
.fbtn { border: none; background: rgba(0,0,0,0.05); border-radius: 7px; height: 26px; min-width: 28px; padding: 0 9px; cursor: pointer; font-size: 14px; color: #444; font-family: var(--font); }
.fbtn:hover { background: rgba(0,0,0,0.1); }
.fbtn:disabled { opacity: 0.32; cursor: default; }
body.dark .fbtn { background: rgba(255,255,255,0.1); color: #ddd; }
.finder-path { font-weight: 600; font-size: 14px; margin-left: 4px; }
.finder-view { display: inline-flex; background: rgba(0,0,0,0.06); border-radius: 7px; }
.finder-view button { border: none; background: transparent; width: 30px; height: 26px; cursor: pointer; border-radius: 6px; color: #666; }
.finder-view button.active { background: rgba(0,0,0,0.14); color: #111; }
body.dark .finder-view button.active { background: rgba(255,255,255,0.18); color: #fff; }
.finder-search { width: 128px; height: 26px; border: none; border-radius: 7px; background: rgba(0,0,0,0.06); padding: 0 10px; outline: none; font-family: var(--font); font-size: 12.5px; }
body.dark .finder-search { background: rgba(255,255,255,0.1); color: #eee; }
.finder-content { flex: 1; overflow-y: auto; }
.finder-content.fv-icon { display: grid; grid-template-columns: repeat(auto-fill, 96px); gap: 14px 6px; padding: 16px; align-content: start; }
.finder-file { cursor: default; border-radius: 8px; }
.fv-icon .finder-file { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px; text-align: center; }
.fv-icon .finder-file .ff-icon { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; }
.fv-icon .ff-emoji { font-size: 46px; }
.fv-icon .finder-file .ff-name { font-size: 12px; line-height: 1.2; word-break: break-word; max-width: 88px; }
.fv-icon .finder-file.selected { background: rgba(var(--accent-rgb),0.2); }
.fv-icon .finder-file.selected .ff-name { background: var(--accent); color: #fff; border-radius: 4px; padding: 0 4px; }
.finder-content.fv-list { padding: 4px 0; }
.fv-list .finder-file { display: flex; align-items: center; gap: 10px; padding: 5px 16px; }
.fv-list .finder-file:hover { background: rgba(0,0,0,0.04); }
.fv-list .finder-file.selected { background: var(--accent); color: #fff; }
.fv-list .ff-icon { width: 24px; display: flex; justify-content: center; }
.fv-list .ff-emoji { font-size: 20px; }
.fv-list .ff-name { flex: 1; font-size: 13px; }
.fv-list .ff-kind { font-size: 12px; opacity: 0.55; }
.fv-list .finder-file.selected .ff-kind { opacity: 0.85; }
.finder-empty { padding: 44px; text-align: center; color: #aaa; font-size: 14px; grid-column: 1 / -1; }
.finder-status { height: 22px; border-top: 0.5px solid rgba(0,0,0,0.08); display: flex; align-items: center; justify-content: center; font-size: 11px; color: #888; }
body.dark .finder-status { border-top-color: rgba(255,255,255,0.08); }

/* ---------- TextEdit ---------- */
.textedit { height: 100%; display: flex; flex-direction: column; }
.te-toolbar { height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 0.5px solid rgba(0,0,0,0.08); }
.te-name { font-size: 13px; font-weight: 600; color: #555; }
body.dark .te-name { color: #ccc; }
.te-save { background: rgba(var(--accent-rgb),0.15); color: var(--accent); font-weight: 600; }

/* ---------- Calendar events ---------- */
.cal-day { cursor: pointer; }
.cal-day:hover { background: rgba(var(--accent-rgb),0.06); }
.cal-event { cursor: pointer; }
.cal-pop { position: fixed; z-index: 6900; width: 252px; background: rgba(250,250,250,0.97); backdrop-filter: blur(30px); border: 0.5px solid rgba(0,0,0,0.12); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,0.3); padding: 12px; }
body.dark .cal-pop { background: rgba(44,44,46,0.97); color: #eee; }
.cal-pop-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.cal-pop-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 6px; border-radius: 6px; font-size: 12.5px; }
.cal-pop-row:hover { background: rgba(0,0,0,0.05); }
.cal-pop-del { cursor: pointer; opacity: 0.5; }
.cal-pop-del:hover { opacity: 1; color: #ff3b30; }
.cal-pop-add { display: flex; gap: 5px; margin-top: 8px; }
.cal-pop input { height: 28px; border: 1px solid #ccc; border-radius: 7px; padding: 0 8px; outline: none; font-family: var(--font); font-size: 12.5px; }
body.dark .cal-pop input { background: #333; color: #eee; border-color: #555; }
.cal-in-time { width: 50px; } .cal-in-title { flex: 1; min-width: 0; }
.cal-in-btn { background: var(--accent); color: #fff; border: none; border-radius: 7px; padding: 0 12px; cursor: pointer; }

/* ---------- Reminders ---------- */
.rem-main { flex: 1; display: flex; flex-direction: column; padding: 18px 24px; min-width: 0; }
.rem-title { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.rem-list { flex: 1; overflow-y: auto; }
.rem-item { display: flex; align-items: center; gap: 11px; padding: 8px 2px; border-bottom: 0.5px solid rgba(0,0,0,0.06); font-size: 14px; }
.rem-item:hover .rem-del { opacity: 0.5; }
.rem-check { width: 20px; height: 20px; border-radius: 50%; border: 1.8px solid #c8c8cc; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; }
.rem-check.on { background: var(--accent); border-color: var(--accent); }
.rem-text { flex: 1; }
.rem-item:has(.rem-check.on) .rem-text { opacity: 0.4; text-decoration: line-through; }
.rem-del { opacity: 0; cursor: pointer; color: #ff3b30; transition: opacity 0.15s; }
.rem-del:hover { opacity: 1 !important; }
.rem-new-row { display: flex; align-items: center; gap: 10px; padding-top: 12px; color: #bbb; }
.rem-new { flex: 1; border: none; outline: none; font-size: 14px; font-family: var(--font); background: transparent; color: inherit; }
.rem-count { margin-left: auto; opacity: 0.5; font-size: 12px; }
.rem-sidebar .sidebar-item { display: flex; align-items: center; }

/* ---------- FaceTime ---------- */
.facetime { height: 100%; background: #0a0a0c; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.ft-video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: none; }
.ft-video.on { display: block; }
.ft-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #9a9a9a; text-align: center; padding: 30px; }
.ft-placeholder p { font-size: 13px; max-width: 300px; line-height: 1.5; }
.ft-bar { position: absolute; bottom: 18px; left: 0; right: 0; display: flex; justify-content: center; gap: 14px; }
.ft-btn { border: none; border-radius: 20px; padding: 9px 24px; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,0.4); }
.ft-start { background: #34c759; color: #fff; }
.ft-end { background: #ff3b30; color: #fff; }

/* ---------- Calculator scientific + history ---------- */
.calc-hist { max-height: 0; overflow-y: auto; background: #1c1c1e; color: #8a8a8e; font-size: 11px; padding: 0 16px; transition: max-height 0.2s; font-variant-numeric: tabular-nums; }
.calc.sci-on .calc-hist { max-height: 60px; padding: 6px 16px; }
.calc-hrow { text-align: right; padding: 1px 0; }
.calc { overflow: hidden; }
.calc-display { flex: 0 0 auto; min-height: 76px; }
.calc-modebar { display: flex; gap: 6px; background: #1c1c1e; padding: 4px 8px; flex: 0 0 auto; }
.calc-mode, .calc-rad { background: #3a3a3c; color: #fff; border: none; padding: 5px 13px; font-size: 11px; cursor: pointer; border-radius: 6px; }
.calc-mode:hover, .calc-rad:hover { filter: brightness(1.2); }
.calc-body { flex: 1; display: flex; min-height: 0; }
.calc-sci { display: none; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; width: 168px; gap: 1px; background: #1c1c1e; }
.calc.sci-on .calc-sci { display: grid; }
.calc-keys { flex: 1; grid-auto-rows: 1fr; }
.calc-key { height: auto; min-height: 0; }
.calc-key.sci { background: #2c2c2e; color: #fff; font-size: 15px; }

/* ---------- Mail ---------- */
.mail-side { width: 196px; }
.mail-compose-btn { width: calc(100% - 12px); margin: 4px 6px 8px; background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 8px; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.mail-count { margin-left: auto; background: #b8b8bc; color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; min-width: 8px; text-align: center; }
.mail-list { width: 300px; border-right: 0.5px solid rgba(0,0,0,0.1); overflow-y: auto; flex-shrink: 0; }
body.dark .mail-list { border-right-color: rgba(255,255,255,0.08); }
.mail-item { display: flex; gap: 8px; padding: 11px 14px; border-bottom: 0.5px solid rgba(0,0,0,0.06); cursor: default; }
.mail-item.active { background: rgba(var(--accent-rgb),0.12); }
.mail-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.mail-dot.unread { background: var(--accent); }
.mail-meta { flex: 1; min-width: 0; }
.mail-row1 { display: flex; justify-content: space-between; gap: 8px; }
.mail-row1 b { font-size: 13.5px; }
.mail-time { font-size: 11px; color: #999; flex-shrink: 0; }
.mail-subj { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-prev { font-size: 12px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-read { flex: 1; overflow-y: auto; padding: 24px 30px; }
.mail-read-head h2 { font-size: 19px; }
.mail-read-meta { color: #888; font-size: 12.5px; margin: 6px 0 14px; }
.mail-read-actions { display: flex; gap: 8px; margin-bottom: 16px; }
.mail-body { font-size: 14px; line-height: 1.65; color: #333; }
body.dark .mail-body { color: #ddd; }
.mail-compose { position: fixed; inset: 0; z-index: 9600; background: rgba(0,0,0,0.25); display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh; }
.mc-window { width: 560px; max-width: 92vw; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,0.5); display: flex; flex-direction: column; animation: winPop 0.2s ease; }
body.dark .mc-window { background: #2a2a2c; color: #eee; }
.mc-bar { height: 38px; background: linear-gradient(180deg,#f6f6f6,#e8e8e8); display: flex; align-items: center; justify-content: space-between; padding: 0 14px; font-size: 13px; font-weight: 600; border-bottom: 0.5px solid rgba(0,0,0,0.1); }
body.dark .mc-bar { background: #3a3a3c; }
.mc-close { cursor: pointer; opacity: 0.6; }
.mc-window input, .mc-window textarea { border: none; border-bottom: 0.5px solid rgba(0,0,0,0.1); padding: 11px 16px; font-family: var(--font); font-size: 13.5px; outline: none; background: transparent; color: inherit; }
.mc-body { min-height: 200px; resize: none; border-bottom: none; line-height: 1.5; }
.mc-actions { padding: 10px 16px; display: flex; justify-content: flex-end; border-top: 0.5px solid rgba(0,0,0,0.1); }
.mc-send { background: var(--accent); color: #fff; font-weight: 600; padding: 7px 22px; }
