/* ============================================================
   APP STYLES — SYSTEM / UTILITY
   Calendar, Notes, Maps, Clock, Web, Settings, Phone
   ============================================================ */

/* ----------------------------------------------------------
   Calendar
   ---------------------------------------------------------- */
.cal-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 6; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: var(--bg); border-bottom: .5px solid var(--sep); }
.cal-nav h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.cal-nav .acts { display: flex; align-items: center; gap: 16px; }
.cal-nav svg { width: 22px; height: 22px; }
.cal .scroll { padding-top: 54px; }
.cal-weeks { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; font-weight: 600; color: var(--label2); text-transform: uppercase; letter-spacing: .05em; padding: 10px 8px; border-bottom: .5px solid var(--sep); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 8px; }
.cal-day { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 17px; font-weight: 500; border-radius: 50%; position: relative; }
.cal-day.today { color: var(--blue); font-weight: 600; }
.cal-day.sel { background: var(--blue); color: #fff; }
.cal-day.has::after { content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--blue); }
.cal-day.other { color: var(--label3); }
.cal-events { padding: 16px; border-top: .5px solid var(--sep); }
.cal-event { display: flex; gap: 12px; padding: 10px 0; border-bottom: .5px solid var(--sep); }
.cal-event:last-child { border-bottom: none; }
.cal-ev-time { width: 70px; font-size: 15px; color: var(--label2); font-variant-numeric: tabular-nums; }
.cal-ev-det { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.cal-ev-title { font-size: 17px; font-weight: 600; }
.cal-ev-loc { font-size: 14px; color: var(--label2); }

/* ----------------------------------------------------------
   Notes
   ---------------------------------------------------------- */
.notes-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 6; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: var(--bg); border-bottom: .5px solid var(--sep); }
.notes-nav h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.notes-nav .acts { display: flex; align-items: center; gap: 16px; }
.notes-nav svg { width: 22px; height: 22px; }
.notes .scroll { padding-top: 54px; }
.notes-search { position: sticky; top: 54px; z-index: 5; padding: 8px 16px; background: var(--bg); border-bottom: .5px solid var(--sep); }
.notes-search .srch { background: var(--fill); border: 0; border-radius: 10px; padding: 8px 12px 8px 40px; font-size: 17px; color: var(--label); width: 100%; position: relative; }
.notes-search .srch::placeholder { color: var(--label3); }
.notes-search .srch-ico { position: absolute; left: 28px; top: 50%; transform: translateY(-50%); color: var(--label3); width: 20px; height: 20px; pointer-events: none; }
.notes-list { padding: 8px; }
.note-card { background: var(--cell); border-radius: 12px; padding: 16px; margin-bottom: 8px; }
.note-card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; line-height: 1.3; }
.note-card p { margin: 0; font-size: 15px; color: var(--label2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-card .date { font-size: 12px; color: var(--label3); margin-top: 8px; }
.note-empty { text-align: center; padding: 40px 20px; color: var(--label2); }
.note-empty svg { width: 60px; height: 60px; margin-bottom: 16px; opacity: .5; }

/* ----------------------------------------------------------
   Maps
   ---------------------------------------------------------- */
.maps { background: #d1d1d6; }
.maps .nav { background: var(--bg); }
.maps .scroll { background: #d1d1d6; }
.map-frame { position: absolute; inset: 54px 0 0; background: #c7c7cc; }
.map-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; }
.map-search { margin: 16px; padding: 10px 16px; background: var(--bg); border-radius: 10px; display: flex; align-items: center; gap: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.map-search svg { width: 20px; height: 20px; color: var(--label3); }
.map-search input { flex: 1; border: 0; background: transparent; font-size: 17px; color: var(--label); }
.map-search input::placeholder { color: var(--label3); }
.map-marker { position: absolute; width: 32px; height: 32px; transform: translate(-50%, -100%); display: flex; align-items: center; justify-content: center; }
.map-marker svg { width: 32px; height: 32px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.map-marker.pulse::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: var(--blue); opacity: .4; animation: markerPulse 2s ease-out infinite; }
@keyframes markerPulse { 0% { transform: scale(1); opacity: .4; } 100% { transform: scale(2.5); opacity: 0; } }
.map-fab { position: absolute; bottom: 30px; right: 16px; width: 50px; height: 50px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.map-fab svg { width: 22px; height: 22px; }
.map-bottom { position: absolute; bottom: 0; left: 0; right: 0; background: var(--bar); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 24px 24px 0 0; padding: 12px 16px 30px; max-height: 50vh; display: flex; flex-direction: column; }
.map-bottom .handle { width: 36px; height: 5px; border-radius: 3px; background: var(--label3); margin: 0 auto 12px; }
.map-route { font-size: 17px; font-weight: 600; }
.map-route span { color: var(--label2); font-weight: 400; }
.map-steps { flex: 1; overflow-y: auto; margin-top: 12px; }
.map-step { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: .5px solid var(--sep); }
.map-step:last-child { border-bottom: none; }
.map-step svg { width: 24px; height: 24px; color: var(--blue); flex: none; margin-top: 2px; }
.map-step .info { flex: 1; }
.map-step .street { font-size: 15px; font-weight: 500; }
.map-step .dist { font-size: 13px; color: var(--label2); margin-top: 2px; }

/* ----------------------------------------------------------
   Clock
   ---------------------------------------------------------- */
.clock-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 6; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: var(--bg); border-bottom: .5px solid var(--sep); }
.clock-nav h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.clock-nav .acts { display: flex; align-items: center; gap: 16px; }
.clock-nav svg { width: 22px; height: 22px; }
.clock .scroll { padding-top: 54px; }
.clock-tabs { display: flex; justify-content: center; gap: 8px; padding: 16px; border-bottom: .5px solid var(--sep); position: sticky; top: 54px; z-index: 5; background: var(--bg); }
.clock-tab { padding: 8px 16px; border-radius: 20px; font-size: 15px; font-weight: 600; color: var(--label2); }
.clock-tab.sel { background: var(--fill); color: var(--label); }
.world-clock { padding: 16px; }
.wc-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: .5px solid var(--sep); }
.wc-row:last-child { border-bottom: none; }
.wc-info { display: flex; flex-direction: column; gap: 2px; }
.wc-city { font-size: 17px; font-weight: 500; }
.wc-offset { font-size: 13px; color: var(--label2); }
.wc-time { font-size: 34px; font-weight: 200; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.alarm-list { padding: 16px; }
.alarm-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: .5px solid var(--sep); }
.alarm-time { font-size: 48px; font-weight: 200; letter-spacing: -.02em; }
.alarm-label { font-size: 17px; color: var(--label2); margin-left: 16px; }
.stopwatch { display: flex; flex-direction: column; align-items: center; padding: 40px 16px; }
.sw-time { font-size: 80px; font-weight: 200; font-variant-numeric: tabular-nums; letter-spacing: -.03em; font-family: var(--mono); line-height: 1; }
.sw-laps { width: 100%; max-height: 300px; overflow-y: auto; margin-top: 24px; }
.sw-lap { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: .5px solid var(--sep); font-size: 17px; }
.sw-lap span:first-child { color: var(--label2); }
.sw-controls { display: flex; gap: 20px; margin-top: 30px; }
.sw-btn { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 600; }
.sw-btn.lap { background: var(--fill); color: var(--label); }
.sw-btn.start { background: var(--green); color: #fff; }
.sw-btn.stop { background: #ff3b30; color: #fff; }
.sw-btn.reset { background: var(--fill); color: var(--label); }
.timer { display: flex; flex-direction: column; align-items: center; padding: 40px 16px; }
.tm-picker { display: flex; gap: 8px; margin-bottom: 30px; }
.tm-col { display: flex; flex-direction: column; align-items: center; }
.tm-val { font-size: 80px; font-weight: 200; font-variant-numeric: tabular-nums; letter-spacing: -.03em; font-family: var(--mono); width: 70px; text-align: center; }
.tm-label { font-size: 13px; color: var(--label2); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.tm-time { font-size: 80px; font-weight: 200; font-variant-numeric: tabular-nums; letter-spacing: -.03em; font-family: var(--mono); line-height: 1; margin-bottom: 30px; }
.tm-controls { display: flex; gap: 20px; }
.tm-btn { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 600; }
.tm-btn.start { background: var(--green); color: #fff; }
.tm-btn.pause { background: #ff9f0a; color: #fff; }
.tm-btn.cancel { background: var(--fill); color: var(--label); }

/* ----------------------------------------------------------
   Web (Safari-like)
   ---------------------------------------------------------- */
.web .nav { background: var(--bg); border-bottom: .5px solid var(--sep); }
.web .nav-t { display: flex; align-items: center; gap: 10px; justify-content: center; flex: 1; }
.web .nav-t .urlbar { flex: 1; max-width: 100%; background: var(--fill); border-radius: 18px; padding: 6px 12px; font-size: 15px; color: var(--label); display: flex; align-items: center; gap: 8px; }
.web .nav-t .urlbar svg { width: 16px; height: 16px; color: var(--label3); }
.web .nav-t .urlbar input { flex: 1; border: 0; background: transparent; font: inherit; color: inherit; outline: none; width: 100%; }
.web .scroll { padding-top: 54px; background: #fff; color: #1d1d1f; }
.web-view { position: absolute; inset: 54px 0 0; background: #fff; }
.web-loading { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); font-size: 13px; color: var(--label2); }
.web-bottom { position: absolute; bottom: 0; left: 0; right: 0; height: 50px; background: var(--bar); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: .5px solid var(--sep); display: flex; align-items: center; justify-content: space-around; padding: 0 8px; }
.web-bottom button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--label2); }
.web-bottom button svg { width: 22px; height: 22px; }
.web-bottom button.sel { color: var(--blue); }

/* ----------------------------------------------------------
   Settings
   ---------------------------------------------------------- */
.set-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 6; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: var(--bg); border-bottom: .5px solid var(--sep); }
.set-nav h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.set-nav .acts { display: flex; align-items: center; gap: 16px; }
.set-nav svg { width: 22px; height: 22px; }
.settings .scroll { padding-top: 54px; }
.set-group { background: var(--cell); margin: 16px; border-radius: 16px; overflow: hidden; }
.set-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: .5px solid var(--sep); min-height: 52px; }
.set-row:last-child { border-bottom: none; }
.set-row .left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.set-row .ico { width: 29px; height: 29px; border-radius: 7px; display: grid; place-items: center; color: #fff; flex: none; }
.set-row .ico svg { width: 18px; height: 18px; }
.set-row .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-row .txt b { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-row .txt span { font-size: 13px; color: var(--label2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-row .chev { width: 20px; height: 20px; color: var(--label3); flex: none; }
.set-row .chev svg { width: 20px; height: 20px; }
.set-row .tgl { flex: none; }
.swch { width: 52px; height: 32px; border-radius: 16px; background: var(--sep); position: relative; transition: background .2s; }
.swch.on { background: var(--green); }
.swch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.swch.on::after { transform: translateX(20px); }
.set-arrow { width: 20px; height: 20px; color: var(--label3); }
.set-badge { background: #ff3b30; color: #fff; font-size: 11px; font-weight: 700; border-radius: 8px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; margin-left: 8px; }
.set-ver { text-align: center; padding: 20px; font-size: 12px; color: var(--label3); }

/* ----------------------------------------------------------
   Phone
   ---------------------------------------------------------- */
.ph-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 6; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: var(--bg); border-bottom: .5px solid var(--sep); }
.ph-nav h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.ph-nav .acts { display: flex; align-items: center; gap: 16px; }
.ph-nav svg { width: 22px; height: 22px; }
.phone-app .scroll { padding-top: 54px; }
.phone-tabs { display: flex; justify-content: space-around; border-bottom: .5px solid var(--sep); position: sticky; top: 54px; z-index: 5; background: var(--bg); }
.phone-tab { flex: 1; text-align: center; padding: 12px 0; font-size: 13px; font-weight: 600; color: var(--label2); text-transform: uppercase; letter-spacing: .05em; position: relative; }
.phone-tab.sel { color: var(--label); }
.phone-tab.sel::after { content: ""; position: absolute; bottom: -1px; left: 20%; right: 20%; height: 3px; background: var(--blue); border-radius: 2px; }
.ph-fav { padding: 16px; }
.fav-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.fav-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fav-item .av { width: 60px; height: 60px; }
.fav-item span { font-size: 13px; text-align: center; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-rec { padding: 0 16px 16px; }
.rec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.rec-head h3 { margin: 0; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--label2); }
.rec-list { display: flex; flex-direction: column; gap: 8px; }
.rec-row { display: flex; align-items: center; gap: 14px; padding: 10px; background: var(--cell); border-radius: 12px; }
.rec-row .av { width: 44px; height: 44px; }
.rec-row .info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rec-row .name { font-size: 15px; font-weight: 600; }
.rec-row .time { font-size: 13px; color: var(--label2); }
.rec-row .type { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.rec-row .type svg { width: 14px; height: 14px; }
.rec-row .type.missed { background: #ff3b30; color: #fff; }
.rec-row .type.out { background: var(--fill); color: var(--blue); }
.rec-row .type.in { background: var(--green); color: #fff; }
.ph-key { padding: 16px; }
.ph-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ph-keybtn { aspect-ratio: 1; max-width: 100%; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-size: 28px; font-weight: 300; color: var(--label); }
.ph-keybtn:active { background: var(--fill2); }
.ph-keybtn .letters { font-size: 11px; color: var(--label2); margin-top: -8px; }
.ph-keybtn.act { background: var(--label); color: var(--bg); }
.ph-keybtn.act:active { background: var(--label2); }
.ph-dial { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 20px; background: var(--bar); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 24px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.ph-dial .num { font-size: 36px; font-weight: 300; letter-spacing: .1em; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.ph-dial .name { font-size: 17px; color: var(--label2); }
.ph-dial .actions { display: flex; gap: 20px; }
.ph-dial .act-btn { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; }
.ph-dial .act-btn svg { width: 26px; height: 26px; }
.ph-dial .act-btn.end { background: #ff3b30; color: #fff; }
.ph-dial .act-btn.mute { background: var(--fill); color: var(--label); }
.ph-dial .act-btn.keypad { background: var(--fill); color: var(--label); }
.ph-dial .act-btn.add { background: var(--fill); color: var(--label); }
.ph-dial .act-btn.contacts { background: var(--fill); color: var(--label); }
.incall { background: #000; color: #fff; }
.incall .nav { color: #fff; --tint: #fff; background: transparent; border: 0; }
.incall .call-top { position: absolute; top: 100px; left: 0; right: 0; text-align: center; padding: 0 20px; }
.incall .call-name { font-size: 34px; font-weight: 600; margin-bottom: 4px; }
.incall .call-status { font-size: 15px; color: rgba(255,255,255,.7); }
.incall .call-dur { font-size: 28px; font-weight: 200; font-variant-numeric: tabular-nums; margin-top: 8px; font-family: var(--mono); }
.incall .call-avatar { width: 140px; height: 140px; margin: 40px auto 0; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 4px rgba(255,255,255,.1); }
.incall .call-avatar .media { width: 100%; height: 100%; }
.incall .call-actions { position: absolute; bottom: 100px; left: 0; right: 0; display: flex; justify-content: center; gap: 24px; padding: 0 20px; }
.incall .call-btn { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; }
.incall .call-btn svg { width: 28px; height: 28px; }
.incall .call-btn.mute { background: rgba(255,255,255,.2); color: #fff; }
.incall .call-btn.keypad { background: rgba(255,255,255,.2); color: #fff; }
.incall .call-btn.spkr { background: rgba(255,255,255,.2); color: #fff; }
.incall .call-btn.add { background: rgba(255,255,255,.2); color: #fff; }
.incall .call-btn.contacts { background: rgba(255,255,255,.2); color: #fff; }
.incall .call-btn.end { background: #ff3b30; color: #fff; }
.voicemail { padding: 16px; }
.vm-row { display: flex; align-items: flex-start; gap: 14px; padding: 16px 0; border-bottom: .5px solid var(--sep); }
.vm-row:last-child { border-bottom: none; }
.vm-row .av { width: 56px; height: 56px; flex: none; }
.vm-row .info { flex: 1; min-width: 0; }
.vm-row .name { font-size: 17px; font-weight: 600; }
.vm-row .meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; color: var(--label2); }
.vm-row .play { width: 44px; height: 44px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; color: var(--blue); flex: none; }
.vm-row .play svg { width: 18px; height: 18px; }
.vm-row .transcript { font-size: 15px; color: var(--label); margin-top: 8px; line-height: 1.4; }