/* Boise Body Slimming studio app: calendar, inbox, phone, clients. Brand: ink, ivory, rose gold. */
:root {
  --ink: #0B0A0C; --ink-2: #17121A; --ink-3: #241C24;
  --bg: #F7F2EF; --panel: #FFFFFF; --soft: #FBF6F3; --blush: #F6E7E3; --line: #EADBD6; --line-2: #F1E6E2;
  --rose: #E7B2A6; --rose-deep: #B76E79; --rose-ink: #8E4D57; --champagne: #D9B99B;
  --text: #241B1F; --muted: #76666B; --faint: #A3959A;
  --ok: #2F7A57; --ok-bg: #E4F2EA; --warn: #A0303F; --warn-bg: #FBE6E8; --amber: #8A5A00; --amber-bg: #FFF1D6; --blue: #3F5F8F;
  --gold: linear-gradient(100deg, #B76E79 0%, #F2C6C2 38%, #E9C9A6 62%, #C98E86 100%);
  --serif: 'Cormorant Garamond', Georgia, serif; --sans: 'Jost', 'Helvetica Neue', Arial, sans-serif;
  --r: 14px; --r-s: 10px; --shadow: 0 18px 40px -22px rgba(43, 20, 28, .35); --shadow-s: 0 4px 14px -8px rgba(43, 20, 28, .3);
  --side: 248px; --hour: 64px;
  color-scheme: light;
}
* , *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--rose-ink); }
:focus-visible { outline: 2px solid var(--rose-deep); outline-offset: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; height: 100vh; height: 100dvh; }
.side { background: var(--ink); color: #EFE3E0; display: flex; flex-direction: column; padding: 18px 14px; gap: 6px; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.side .brand img { height: 44px; width: auto; }
.side .brand small { display: block; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--rose); }
.new-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border: 0; border-radius: 999px; background: var(--gold); color: var(--ink); font-weight: 600; cursor: pointer; margin: 0 4px 12px; box-shadow: 0 10px 24px -14px rgba(231, 178, 166, .9); }
.new-btn:hover { filter: brightness(1.05); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: #D9CBC8; cursor: pointer; text-align: left; font-size: 15px; }
.nav button svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; }
.nav button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav button[aria-current="page"] { background: rgba(231, 178, 166, .16); color: #fff; }
.nav button[aria-current="page"] svg { stroke: var(--rose); }
.nav .badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--rose); color: var(--ink); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.side .sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 10px 8px; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; color: #BFAFAC; }
.side .me .av { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-weight: 600; }
.side .me button { margin-left: auto; background: none; border: 1px solid rgba(255, 255, 255, .18); color: #D9CBC8; border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; height: 100dvh; }
.top { display: flex; align-items: center; gap: 14px; padding: 14px 24px; background: var(--panel); border-bottom: 1px solid var(--line); min-height: 68px; }
.top h1 { font: 500 28px/1.1 var(--serif); margin: 0; white-space: nowrap; }
.top .grow { flex: 1; }
.search { position: relative; flex: 1; max-width: 560px; }
.search input[type=search] { width: 100%; height: 42px; min-height: 42px; border-radius: 999px; border: 1px solid var(--line); background: var(--soft); padding: 0 16px 0 44px !important; }
.search svg { position: absolute; left: 14px; top: 11px; width: 20px; height: 20px; stroke: var(--muted); fill: none; stroke-width: 1.7; }
.view { flex: 1; overflow: auto; padding: 22px 24px 40px; }
.view.flush { padding: 0; overflow: hidden; display: flex; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--ink-3); }
.btn.gold { background: var(--gold); border-color: transparent; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { background: var(--warn); border-color: var(--warn); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%; border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--blush); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.icon-btn.on svg { fill: #E0A23B; stroke: #C88A22; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--soft); }
.seg button { border: 0; background: none; padding: 6px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow-s); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 500; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; padding: 9px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rose-deep); box-shadow: 0 0 0 3px rgba(183, 110, 121, .16); }
textarea { min-height: 100px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.err { color: var(--warn); font-size: 14px; min-height: 1em; margin: 4px 0 10px; }
.ok { color: var(--ok); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.card h3 { font: 500 22px/1.2 var(--serif); margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--blush); color: var(--rose-ink); font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.gray { background: #EEE9E8; color: #6B6164; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty svg { width: 56px; height: 56px; stroke: var(--rose); fill: none; stroke-width: 1.3; margin-bottom: 10px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.list td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--soft); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.stat p { margin: 0; font-size: 13px; color: var(--muted); }
.stat b { display: block; font: 500 34px/1.1 var(--serif); margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 18px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow); z-index: 90; font-size: 14px; display: flex; gap: 14px; align-items: center; }
.toast button { background: none; border: 0; color: var(--rose); font-weight: 600; cursor: pointer; }

/* ---------- drawer + modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(11, 10, 12, .38); z-index: 60; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--panel); z-index: 61; box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slide .2s ease-out; }
.drawer header { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer header h2 { font: 500 26px/1.1 var(--serif); margin: 0; flex: 1; }
.drawer .body { padding: 18px 20px 30px; overflow-y: auto; flex: 1; }
.drawer .actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(620px, calc(100% - 24px)); max-height: calc(100vh - 40px); overflow: auto; background: var(--panel); border-radius: 18px; z-index: 61; box-shadow: var(--shadow); padding: 22px 24px; animation: pop .16s ease-out; }
.modal h2 { font: 500 28px/1.1 var(--serif); margin: 0 0 16px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: 14px; margin: 0 0 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
@keyframes pop { from { transform: translate(-50%, -48%); opacity: 0; } }

/* ---------- calendar ---------- */
.cal { display: flex; flex-direction: column; flex: 1; min-width: 0; background: var(--panel); }
.cal-bar { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cal-bar h2 { font: 500 26px/1 var(--serif); margin: 0 8px; min-width: 200px; }
.cal-bar .grow { flex: 1; }
.cal-legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.tg { display: grid; flex: 1; min-height: 0; grid-template-rows: auto 1fr; }
.tg-head { display: grid; border-bottom: 1px solid var(--line); padding-right: var(--sbw, 0px); }
.tg-head div { padding: 8px 6px 10px; text-align: center; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; cursor: pointer; }
.tg-head div b { display: block; font: 500 26px/1.1 var(--serif); color: var(--text); letter-spacing: 0; text-transform: none; margin-top: 2px; }
.tg-head div.today b { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: #fff; }
.tg-scroll { overflow-y: auto; position: relative; }
.tg-body { display: grid; position: relative; }
.tg-times { position: relative; }
.tg-times span { position: absolute; right: 8px; font-size: 11px; color: var(--faint); transform: translateY(-50%); }
.tg-col { position: relative; border-left: 1px solid var(--line-2); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--line-2) calc(var(--hour) - 1px), var(--line-2) var(--hour)); cursor: copy; }
.tg-col .closed { position: absolute; left: 0; right: 0; background: rgba(240, 232, 229, .55); pointer-events: none; }
.tg-col .block { position: absolute; left: 2px; right: 2px; border-radius: 8px; background: repeating-linear-gradient(135deg, #EFE7E5 0 6px, #E5DAD7 6px 12px); color: #6B5E62; font-size: 12px; padding: 4px 8px; overflow: hidden; z-index: 1; cursor: default; }
.ev { position: absolute; border-radius: 8px; padding: 4px 8px; font-size: 12px; line-height: 1.3; overflow: hidden; cursor: pointer; z-index: 2; border-left: 4px solid var(--rose-deep); background: #F9E4E1; color: #4A2A31; box-shadow: 0 1px 0 rgba(0,0,0,.04); transition: box-shadow .12s, transform .12s; }
.ev:hover { box-shadow: var(--shadow-s); transform: translateY(-1px); z-index: 3; }
.ev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.hold { background: #FFF6E6; border-left-color: #D89A2B; border-style: dashed; border-width: 1px 1px 1px 4px; border-color: #E9C98E; }
.ev.completed { background: #E9F3EE; border-left-color: var(--ok); color: #234D3A; }
.ev.no_show { background: #EFEBEA; border-left-color: #9A8F92; color: #5E5458; text-decoration: line-through; }
.ev.flag { box-shadow: inset 0 0 0 1px #E3A1AA; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: #D93A4A; z-index: 4; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #D93A4A; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(118px, 1fr); flex: 1; overflow: auto; }
.month .dow { min-height: 0; height: 34px; text-align: center; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding-top: 9px; border-bottom: 1px solid var(--line); }
.month .cell { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px; cursor: copy; min-width: 0; }
.month .cell.out { background: #FCFAF9; }
.month .cell.out .d { color: var(--faint); }
.month .cell .d { font-size: 13px; font-weight: 500; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }
.month .cell.today .d { background: var(--ink); color: #fff; }
.chip { display: block; font-size: 12px; padding: 2px 6px; border-radius: 6px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; background: #F9E4E1; color: #4A2A31; }
.chip i { font-style: normal; color: var(--rose-ink); font-weight: 600; margin-right: 4px; }
.chip.hold { background: #FFF6E6; }
.chip.completed { background: #E9F3EE; color: #234D3A; }
.chip.block { background: repeating-linear-gradient(135deg, #EFE7E5 0 6px, #E5DAD7 6px 12px); color: #6B5E62; }
.more { font-size: 12px; color: var(--muted); padding: 2px 6px; cursor: pointer; }

/* ---------- inbox ---------- */
.mail { display: grid; grid-template-columns: 230px 1fr; flex: 1; min-width: 0; min-height: 0; }
.boxes { border-right: 1px solid var(--line); padding: 14px 10px; overflow-y: auto; background: var(--panel); }
.boxes .compose { width: calc(100% - 8px); margin: 0 4px 14px; }
.boxes button.box { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 12px; border: 0; border-radius: 0 999px 999px 0; background: none; cursor: pointer; color: var(--text); font-size: 14px; text-align: left; }
.boxes button.box svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; flex: none; }
.boxes button.box:hover { background: var(--soft); }
.boxes button.box[aria-current="true"] { background: var(--blush); font-weight: 600; color: var(--rose-ink); }
.boxes button.box .n { margin-left: auto; font-size: 12px; font-weight: 600; }
.boxes .dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.boxes h4 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 18px 12px 6px; display: flex; align-items: center; }
.boxes h4 button { margin-left: auto; border: 0; background: none; color: var(--rose-ink); cursor: pointer; font-size: 18px; line-height: 1; }
.mpane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel); }
.mbar { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-bottom: 1px solid var(--line); min-height: 50px; }
.mbar .grow { flex: 1; }
.mbar select { width: auto; min-height: 34px; padding: 4px 10px; font-size: 14px; }
.threads { overflow-y: auto; flex: 1; }
.th { display: grid; grid-template-columns: 34px 34px 200px 1fr 80px; align-items: center; gap: 4px; padding: 0 12px; height: 52px; border-bottom: 1px solid var(--line-2); cursor: pointer; background: #FCFAF9; }
.th.unread { background: #fff; }
.th.unread .who, .th.unread .subj { font-weight: 600; }
.th:hover { box-shadow: inset 0 -1px 0 var(--line), 0 1px 4px -2px rgba(0,0,0,.18); position: relative; z-index: 1; }
.th.sel { background: #FBEDEA; }
.th .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th .line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.th .subj { color: var(--text); }
.th .when { text-align: right; font-size: 12px; color: var(--muted); }
.th.unread .when { color: var(--text); font-weight: 600; }
.lab { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; margin-right: 6px; color: #fff; vertical-align: 1px; }
.reader { overflow-y: auto; flex: 1; padding: 6px 28px 40px; }
.reader h2 { font: 500 30px/1.2 var(--serif); margin: 18px 0 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.msg { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; background: #fff; }
.msg header { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; cursor: pointer; }
.msg .av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: #fff; flex: none; }
.msg header .meta { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.msg header .meta b { color: var(--text); font-size: 15px; }
.msg .content { padding: 0 16px 16px 68px; }
.msg.collapsed .content { display: none; }
.msg.collapsed .meta .snip { display: block; }
.msg .meta .snip { display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg pre { white-space: pre-wrap; font: inherit; margin: 0; word-break: break-word; }
.msg iframe { width: 100%; border: 0; min-height: 60px; display: block; }
.msg .quote { color: var(--muted); }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.att { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; text-decoration: none; color: var(--text); background: var(--soft); }
.att:hover { border-color: var(--rose-deep); }
.reply-bar { display: flex; gap: 8px; margin: 6px 0 0 0; }
.who-card { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 0 0 14px; background: var(--soft); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.composer { position: fixed; right: 24px; bottom: 0; width: min(560px, calc(100% - 16px)); background: #fff; border-radius: 14px 14px 0 0; box-shadow: 0 -10px 40px -10px rgba(43, 20, 28, .4); z-index: 70; display: flex; flex-direction: column; max-height: calc(100vh - 60px); }
.composer header { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 14px 14px 0 0; display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.composer header span { flex: 1; }
.composer header button { background: none; border: 0; color: #fff; cursor: pointer; font-size: 18px; width: 28px; height: 28px; border-radius: 6px; }
.composer header button:hover { background: rgba(255,255,255,.12); }
.composer .cf { display: flex; align-items: center; border-bottom: 1px solid var(--line-2); padding: 0 14px; }
.composer .cf label { font-size: 13px; color: var(--muted); width: 54px; }
.composer .cf input { border: 0 !important; box-shadow: none !important; padding: 10px 0; min-height: 0; border-radius: 0; }
.composer .cf .cc { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.composer textarea { border: 0 !important; box-shadow: none !important; min-height: 240px; padding: 14px; border-radius: 0; flex: 1; }
.composer footer { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.composer.min textarea, .composer.min .cf, .composer.min footer, .composer.min .files { display: none; }
.composer .files { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.composer .files span { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 12px; }
.composer .files button { border: 0; background: none; cursor: pointer; color: var(--muted); }

/* ---------- phone ---------- */
.phone-wrap { display: flex; gap: 40px; align-items: flex-start; justify-content: center; flex-wrap: wrap; padding: 10px 0 30px; }
.iphone { width: 390px; height: 800px; border-radius: 56px; background: #0E0D10; padding: 14px; box-shadow: 0 40px 80px -30px rgba(20, 10, 14, .6), inset 0 0 0 2px #2A262C; position: relative; flex: none; }
.iphone .screen { width: 100%; height: 100%; border-radius: 44px; overflow: hidden; background: #fff; display: flex; flex-direction: column; position: relative; font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', var(--sans); }
.iphone .island { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 120px; height: 34px; border-radius: 20px; background: #000; z-index: 5; }
.iphone .status { height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 14px 26px 0 34px; font-size: 15px; font-weight: 600; flex: none; }
.iphone .status small { font-size: 11px; margin-left: 132px; font-weight: 500; display: flex; align-items: center; gap: 5px; }
.iphone .status .dot { width: 8px; height: 8px; border-radius: 50%; background: #C7C2C4; }
.iphone .status .dot.on { background: #34C759; }
.iphone .status .dot.bad { background: #FF3B30; }
.ph-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.ph-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #E5E5EA; padding: 6px 0 22px; background: #F9F9F9; flex: none; }
.ph-tabs button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: #8E8E93; cursor: pointer; padding-top: 4px; }
.ph-tabs button svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.ph-tabs button[aria-pressed="true"] { color: var(--rose-deep); }
.ph-title { font-size: 32px; font-weight: 700; padding: 6px 18px 8px; letter-spacing: -.02em; }
.ph-search { margin: 0 16px 8px; position: relative; }
.ph-search input[data-q] { background: #EEEEF0 !important; border: 0 !important; border-radius: 10px !important; min-height: 36px !important; padding: 6px 10px 6px 32px !important; font-size: 16px; }
.ph-search svg { position: absolute; left: 9px; top: 9px; width: 18px; height: 18px; stroke: #8E8E93; fill: none; stroke-width: 2; }
.ph-list { list-style: none; margin: 0; padding: 0 0 0 18px; }
.ph-list li { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 0; border-bottom: 1px solid #E5E5EA; cursor: pointer; }
.ph-list li:hover { background: #F7F7F8; }
.ph-list .nm { flex: 1; min-width: 0; }
.ph-list .nm b { display: block; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-list .nm b.missed { color: #FF3B30; }
.ph-list .nm span { font-size: 13px; color: #8E8E93; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-list .tm { font-size: 13px; color: #8E8E93; }
.ph-list .ic { width: 18px; color: #8E8E93; font-size: 13px; }
.ph-list .info { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #0A84FF; color: #0A84FF; display: grid; place-items: center; font: italic 700 13px Georgia, serif; background: none; cursor: pointer; flex: none; }
.ph-sec { position: sticky; top: 0; background: #F2F2F7; font-size: 13px; font-weight: 600; color: #8E8E93; padding: 2px 18px; margin-left: -18px; }
.ph-dial { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 18px; }
.ph-num { font-size: 36px; font-weight: 400; min-height: 52px; text-align: center; letter-spacing: .02em; padding: 0 20px; word-break: break-all; }
.ph-who { font-size: 15px; color: #0A84FF; min-height: 22px; margin-bottom: 16px; }
.ph-pad { display: grid; grid-template-columns: repeat(3, 78px); gap: 16px 26px; }
.ph-pad button { width: 78px; height: 78px; border-radius: 50%; border: 0; background: #E5E5EA; font-size: 34px; line-height: 1; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ph-pad button:active { background: #C7C7CC; }
.ph-pad button small { font-size: 10px; font-weight: 600; letter-spacing: .15em; margin-top: 2px; }
.ph-row { display: grid; grid-template-columns: repeat(3, 78px); gap: 26px; margin-top: 18px; align-items: center; justify-items: center; }
.ph-call { width: 78px; height: 78px; border-radius: 50%; border: 0; background: #34C759; cursor: pointer; display: grid; place-items: center; }
.ph-call svg, .ph-end svg { width: 34px; height: 34px; fill: #fff; }
.ph-end { width: 78px; height: 78px; border-radius: 50%; border: 0; background: #FF3B30; cursor: pointer; display: grid; place-items: center; }
.ph-del { border: 0; background: none; font-size: 26px; color: #8E8E93; cursor: pointer; }
.ph-incall { position: absolute; inset: 0; background: linear-gradient(180deg, #3A2A30 0%, #17121A 100%); color: #fff; z-index: 4; display: flex; flex-direction: column; align-items: center; padding: 110px 30px 60px; }
.ph-incall h3 { font-size: 32px; font-weight: 500; margin: 0; text-align: center; }
.ph-incall p { color: rgba(255,255,255,.7); margin: 6px 0 0; font-size: 17px; }
.ph-incall .ctl { display: grid; grid-template-columns: repeat(3, 76px); gap: 26px; margin-top: auto; margin-bottom: 40px; }
.ph-incall .ctl button { width: 76px; height: 76px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; gap: 4px; }
.ph-incall .ctl button svg { width: 28px; height: 28px; stroke: #fff; fill: none; stroke-width: 1.7; }
.ph-incall .ctl button[aria-pressed="true"] { background: #fff; color: #000; }
.ph-incall .ctl button[aria-pressed="true"] svg { stroke: #000; }
.ph-card { padding: 20px 18px; text-align: center; }
.ph-card .big { width: 96px; height: 96px; border-radius: 50%; margin: 10px auto 12px; background: linear-gradient(180deg, #B9B3B6, #8D878A); color: #fff; display: grid; place-items: center; font-size: 40px; font-weight: 500; }
.ph-card h3 { font-size: 26px; font-weight: 600; margin: 0 0 16px; }
.ph-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.ph-acts button { border: 0; border-radius: 12px; background: #F2F2F7; color: #0A84FF; padding: 10px 4px; cursor: pointer; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ph-acts button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.ph-acts button:disabled { color: #B5B5BA; cursor: default; }
.ph-field { text-align: left; background: #F2F2F7; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; font-size: 15px; }
.ph-field small { display: block; font-size: 12px; color: #8E8E93; }
.ph-back { border: 0; background: none; color: #0A84FF; font-size: 17px; cursor: pointer; padding: 4px 12px; align-self: flex-start; }
.phone-side { max-width: 380px; }
.phone-side h2 { font: 500 34px/1.1 var(--serif); margin: 0 0 10px; }
.callbar { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); background: #34C759; color: #fff; border-radius: 999px; padding: 8px 10px 8px 18px; display: flex; gap: 12px; align-items: center; z-index: 80; box-shadow: var(--shadow); font-size: 14px; font-weight: 500; }
.callbar button { background: #FF3B30; color: #fff; border: 0; border-radius: 999px; padding: 6px 14px; cursor: pointer; }

/* ---------- mid widths ---------- */
@media (max-width: 1280px) { .grid3 { grid-template-columns: 1fr 1fr; } .grid3 > :first-child { grid-column: 1 / -1; } }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, 1fr); } .grid2 { grid-template-columns: 1fr; } .th { grid-template-columns: 34px 34px 150px 1fr 70px; } .mail { grid-template-columns: 190px 1fr; } }

/* ---------- mobile ---------- */
.tabbar { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { height: calc(100dvh - 64px); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: 64px; background: var(--ink); z-index: 50; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar button { border: 0; background: none; color: #BFAFAC; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; position: relative; }
  .tabbar button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; }
  .tabbar button[aria-current="page"] { color: var(--rose); }
  .tabbar .badge { position: absolute; top: 6px; left: 54%; background: var(--rose); color: var(--ink); border-radius: 999px; font-size: 10px; font-weight: 700; padding: 0 5px; }
  .top { padding: 10px 14px; min-height: 58px; }
  .top h1 { font-size: 24px; }
  .view { padding: 14px 14px 30px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid2, .grid3, .row { grid-template-columns: 1fr; }
  .mail { grid-template-columns: 1fr; }
  .boxes { display: none; }
  .mail.show-boxes .boxes { display: block; position: fixed; inset: 0 30% 64px 0; z-index: 55; box-shadow: var(--shadow); }
  .th { grid-template-columns: 30px 1fr 64px; grid-template-rows: auto auto; height: auto; padding: 10px 12px; row-gap: 2px; }
  .th .cb { display: none; }
  .th .star { grid-row: 1 / 3; }
  .th .who { grid-row: 1; grid-column: 2; }
  .th .when { grid-row: 1; grid-column: 3; white-space: nowrap; }
  .th .line { grid-row: 2; grid-column: 2 / 4; }
  .reader { padding: 4px 14px 30px; }
  .msg .content { padding: 0 14px 14px; }
  .iphone { width: 100%; height: calc(100dvh - 140px); max-width: 430px; border-radius: 0; padding: 0; background: none; box-shadow: none; }
  .iphone .screen { border-radius: 16px; border: 1px solid var(--line); }
  .iphone .island, .iphone .status { display: none; }
  .phone-side { display: none; }
  .phone-wrap { padding: 0; }
  .cal-bar h2 { font-size: 22px; min-width: 0; }
  .cal-legend { display: none; }
  .composer { right: 0; left: 0; width: 100%; bottom: 64px; max-height: calc(100dvh - 80px); }
  .month { grid-auto-rows: minmax(80px, 1fr); }
  .chip i { display: none; }
}
@media print { .side, .top, .tabbar, .cal-bar .seg { display: none; } }
