/* Applis ajoutées : Contacts, favoris de Messages, messagerie vocale, Safari, Calendrier, Notes, Réglages, Horloge. */

/* ---------- Messages : conversations épinglées ---------- */
.pins { list-style: none; margin: 0; padding: 4px 12px 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; box-shadow: 0 0.5px 0 var(--sep); }
.pin { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pin:active .avatar { filter: brightness(0.9); }
.pin-name { max-width: 100%; font-size: 13px; color: var(--label2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin.unread::before { content: ""; position: absolute; top: 4px; left: calc(50% - 44px); width: 11px; height: 11px; border-radius: 50%; background: var(--blue); }

/* ---------- Téléphone : messagerie vocale ---------- */
.vm-row { width: 100%; display: grid; grid-template-columns: 12px 1fr auto; column-gap: 10px; align-items: center; padding: 9px 16px 9px 10px; text-align: left; box-shadow: 0 0.5px 0 var(--sep); }
.vm-row:active { background: #e5e5ea; }
.vm-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.vm-text { margin: 0; padding: 8px 16px 12px 32px; font-size: 15px; line-height: 20px; color: #3c3c43; }

/* ---------- Contacts ---------- */
.ct-scroll { padding-right: 14px; }
.ct-me { width: 100%; display: flex; align-items: center; gap: 14px; padding: 4px 16px 14px; text-align: left; box-shadow: 0 0.5px 0 var(--sep); }
.ct-me b { display: block; font-size: 20px; font-weight: 600; }
.ct-me small { font-size: 14px; color: var(--label2); }
.ct-letter { position: sticky; top: 0; z-index: 1; margin: 0; padding: 12px 16px 3px; font-size: 15px; font-weight: 600; color: #8a8a8e; background: rgba(255, 255, 255, 0.96); }
.ct-list { list-style: none; margin: 0; padding: 0 0 0 16px; }
.ct-row { width: 100%; padding: 11px 16px 11px 0; text-align: left; font-size: 17px; box-shadow: 0 0.5px 0 var(--sep); }
.ct-row:active { background: #e5e5ea; }
.ct-row b { font-weight: 600; }
.ct-count { margin: 0; padding: 18px 0 calc(var(--bottom) + 24px); text-align: center; font-size: 15px; color: var(--label2); }
.ct-index { position: absolute; right: 1px; top: 50%; z-index: 4; transform: translateY(-50%); display: flex; flex-direction: column; }
.ct-index button { padding: 0.5px 5px; font-size: 11px; line-height: 13px; font-weight: 600; color: var(--blue); }
.ct-card { background: #f2f2f7; }
.ct-card .scroll { padding-bottom: calc(var(--bottom) + 20px); }
.ct-head { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 16px 18px; }
.ct-head h1 { margin: 0; font-size: 28px; line-height: 32px; font-weight: 600; text-align: center; }
.ct-acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0 16px 16px; }
.ct-act { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 0 7px; border-radius: 12px; background: #fff; color: var(--blue); }
.ct-act:active { background: #e5e5ea; }
.ct-act small { font-size: 12px; }
.ct-act.off { color: #c7c7cc; }
.ct-act span { display: grid; }
.ct-cell { margin: 0 16px 16px; border-radius: 12px; background: #fff; overflow: hidden; }
.ct-field { width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 10px 16px 11px; text-align: left; font-size: 17px; }
.ct-field small { font-size: 14px; color: #1c1c1e; }
.ct-blue { color: var(--blue); }
.ct-link { display: block; width: 100%; padding: 12px 16px; text-align: left; font-size: 17px; color: var(--blue); }
.ct-link + .ct-link { box-shadow: inset 16px 0.5px 0 #fff, inset 0 0.5px 0 var(--sep); }
.ct-link:active, button.ct-field:active { background: #e5e5ea; }
.ct-red { color: var(--red); }

/* ---------- Safari ---------- */
.app-safari { background: #000; }
.sf { position: absolute; inset: 0; display: flex; flex-direction: column; background: #fff; }
.sf-page { position: relative; flex: 1; min-height: 0; padding-top: var(--top); background: #000; }
.sf-frame { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.sf-bottom { flex: none; padding: 8px 10px max(4px, calc(var(--bottom) - 8px)); background: rgba(246, 246, 248, 0.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 -0.5px 0 var(--sep); }
.sf-bar { position: relative; height: 44px; display: flex; align-items: center; padding: 0 4px 0 12px; border-radius: 13px; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12); overflow: hidden; }
.sf-aa { font-size: 17px; font-weight: 600; letter-spacing: -0.5px; }
.sf-aa small { font-size: 12px; }
.sf-url { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 16px; }
.sf-url span { display: grid; color: #3c3c43; }
.sf-reload { width: 38px; height: 38px; display: grid; place-items: center; color: #1c1c1e; }
.sf-reload:active, .sf-tools button:active { opacity: 0.4; }
.sf-progress { position: absolute; left: 0; bottom: 0; width: 0; height: 2.5px; background: var(--blue); opacity: 0; }
.sf-progress.run { width: 72%; opacity: 1; transition: width 2.5s cubic-bezier(0.1, 0.6, 0.3, 1); }
.sf-progress.done { width: 100%; opacity: 0; transition: width 200ms ease, opacity 300ms ease 200ms; }
.sf-tools { display: flex; justify-content: space-between; padding: 6px 8px 0; }
.sf-tools button { width: 44px; height: 40px; display: grid; place-items: center; color: var(--blue); }
.sf-tools button:disabled { color: #c7c7cc; }
.sf-toast { position: absolute; left: 50%; bottom: calc(var(--bottom) + 120px); padding: 10px 16px; border-radius: 12px; background: rgba(30, 30, 30, 0.86); color: #fff; font-size: 15px; opacity: 0; transform: translate(-50%, 8px); transition: opacity 200ms ease, transform 200ms ease; pointer-events: none; }
.sf-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Calendrier ---------- */
.cal-red { color: #ff3b30; }
.cal-title { margin: 2px 16px 10px; font-size: 32px; font-weight: 700; letter-spacing: 0.3px; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0 8px 6px; font-size: 12px; font-weight: 500; color: #8a8a8e; text-align: center; box-shadow: 0 0.5px 0 var(--sep); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; padding: 6px 8px; }
.cal-day { height: 48px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 3px; font-size: 19px; }
.cal-day span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; transition: background-color 120ms ease; }
.cal-day.we { color: #8a8a8e; }
.cal-day.today span { color: #ff3b30; font-weight: 600; }
.cal-day.sel span { background: #1c1c1e; color: #fff; font-weight: 600; }
.cal-day.today.sel span { background: #ff3b30; }
.cal-day i { width: 5px; height: 5px; border-radius: 50%; background: #8e8e93; }
.cal-nav { display: flex; justify-content: space-between; padding: 2px 16px 12px; font-size: 15px; }
.cal-list { padding: 12px 16px calc(var(--bottom) + 24px); box-shadow: inset 0 0.5px 0 var(--sep); }
.cal-list h2 { margin: 2px 0 10px; font-size: 15px; font-weight: 600; }
.cal-evt { display: flex; align-items: stretch; gap: 10px; margin-bottom: 8px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--c) 13%, #fff); }
.cal-evt-bar { width: 4px; flex: none; border-radius: 2px; background: var(--c); }
.cal-evt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cal-evt-main b { font-size: 16px; font-weight: 600; }
.cal-evt-main small, .cal-evt-time { font-size: 14px; color: #6d6d72; }
.cal-none { margin: 0; font-size: 15px; color: var(--label2); }

/* ---------- Notes ---------- */
.nt { background: #f2f2f7; }
.nt .navbar.scrolled { background: rgba(242, 242, 247, 0.92); }
.nt-sec { margin: 20px 16px 8px; font-size: 20px; font-weight: 700; }
.nt-list { list-style: none; margin: 0 16px; padding: 0; border-radius: 12px; background: #fff; overflow: hidden; }
.nt-list li + li .nt-row { box-shadow: inset 16px 0.5px 0 #fff, inset 0 0.5px 0 var(--sep); }
.nt-row { width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 11px 16px; text-align: left; }
.nt-row:active { background: #e5e5ea; }
.nt-row b { font-size: 17px; font-weight: 600; }
.nt-row span { font-size: 15px; color: var(--label2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-row em { font-style: normal; color: #3c3c43; }
.nt-count { margin: 0; padding: 20px 0 calc(var(--bottom) + 20px); text-align: center; font-size: 13px; color: var(--label2); }
.nt-yellow { color: #d89b00; }
.nt-note { background: #fff; }
.nt-page { padding: 0 20px calc(var(--bottom) + 24px); }
.nt-date { margin: 2px 0 14px; text-align: center; font-size: 13px; color: var(--label2); }
.nt-page h1 { margin: 0 0 10px; font-size: 28px; line-height: 34px; }
.nt-body { margin: 0; white-space: pre-line; font-size: 17px; line-height: 1.45; user-select: text; -webkit-user-select: text; }

/* ---------- Réglages (et interrupteurs iOS, aussi utilisés par Horloge) ---------- */
.st { background: #f2f2f7; }
.st .navbar.scrolled { background: rgba(242, 242, 247, 0.92); }
.st-scroll { padding-bottom: calc(var(--bottom) + 20px); }
.st-search { margin-bottom: 18px; }
.st-group { list-style: none; margin: 0 16px 22px; padding: 0; border-radius: 12px; background: #fff; overflow: hidden; }
.st-group > li { position: relative; }
.st-group > li + li::before { content: ""; position: absolute; top: 0; left: 58px; right: 0; height: 0.5px; background: var(--sep); }
.st-row { width: 100%; min-height: 46px; display: flex; align-items: center; gap: 14px; padding: 0 14px; text-align: left; font-size: 17px; }
button.st-row:active { background: #e5e5ea; }
.st-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 7px; }
.st-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-value { max-width: 46%; font-size: 17px; color: var(--label2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-chev { display: grid; color: #c4c4c7; }
.st-me { min-height: 80px; }
.st-me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-me-text b { font-size: 20px; font-weight: 500; }
.st-me-text small { font-size: 13px; color: #3c3c43; }
.st-switch { position: relative; flex: none; width: 51px; height: 31px; border-radius: 16px; background: #e9e9eb; transition: background-color 200ms ease; }
.st-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16); transition: transform 240ms cubic-bezier(0.32, 0.72, 0, 1); }
.st-switch.on { background: #34c759; }
.st-switch.on::after { transform: translateX(20px); }
.ck .st-switch { background: #39393d; }
.ck .st-switch.on { background: #34c759; }

/* ---------- Horloge (sombre) ---------- */
.app-clock { background: #000; }
.ck { position: absolute; inset: 0; background: #000; color: #fff; }
.ck-body { position: absolute; inset: 0 0 calc(var(--bottom) + 49px) 0; }
.ck-view { background: #000; }
.ck-orange { color: #ff9f0a; }
.ck-tabs { grid-template-columns: repeat(3, 1fr); background: rgba(22, 22, 22, 0.94); box-shadow: 0 -0.5px 0 rgba(255, 255, 255, 0.15); }
.ck-tabs .tab { color: #8e8e93; }
.ck-tabs .tab.on { color: #ff9f0a; }
.ck-list { list-style: none; margin: 0; padding: 0 0 0 16px; }
.ck-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px 10px 0; box-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.15); }
.ck-city { min-width: 0; display: flex; flex-direction: column; }
.ck-city small { font-size: 14px; color: #8e8e93; }
.ck-city b { font-size: 21px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-time { flex: none; font-size: 50px; font-weight: 200; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.ck-big { font-size: 50px; font-weight: 200; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ck-alarm.off .ck-city { color: #8e8e93; }
.ck-sw { align-items: center; padding: calc(var(--top) + 40px) 0 20px; overflow-y: auto; }
.ck-chrono { margin: 30px 0 40px; font-size: clamp(56px, 19vw, 78px); font-weight: 200; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.ck-btns { width: 100%; display: flex; justify-content: space-between; padding: 0 20px; }
.ck-btn { width: 82px; height: 82px; border-radius: 50%; font-size: 16px; outline: 2px solid; outline-offset: 2px; transition: transform 120ms ease-out; }
.ck-btn:active { transform: scale(0.95); }
.ck-grey { background: #333; color: #fff; outline-color: #333; }
.ck-grey:disabled { color: #8e8e93; }
.ck-go { background: #0a2a12; color: #30d158; outline-color: #0a2a12; }
.ck-stop { background: #330e0c; color: #ff453a; outline-color: #330e0c; }
.ck-laps { width: 100%; list-style: none; margin: 26px 0 0; padding: 0 20px; }
.ck-laps li { display: flex; justify-content: space-between; padding: 10px 0; font-size: 17px; font-variant-numeric: tabular-nums; box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.15); }
/* Safari : barre d'état claire sur le site sombre, mais barre d'accueil foncée sur la barre d'outils claire */
#app.app-safari:not([hidden]) ~ .homebar span { background: #000; }
