:root {
  color-scheme: light;
  --red: #c72d1c;
  --red-dark: #9f2015;
  --cream: #efe0bd;
  --cream-light: #f7ecd1;
  --ink: #171914;
  --olive: #777044;
  --line: rgba(43, 35, 20, .3);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Narrow", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #191b17; }
body { color: var(--ink); background-image: radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px); background-size: 4px 4px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.phone-shell { width: min(100%, 520px); min-height: 100dvh; margin: 0 auto; background: var(--cream); box-shadow: 0 0 80px #000; overflow: hidden; }
.screen { min-height: 100dvh; position: relative; background-color: var(--cream); background-image: repeating-linear-gradient(14deg, transparent 0 3px, rgba(70,45,15,.025) 3px 4px); }

.login-screen { padding: max(34px, env(safe-area-inset-top)) 24px 36px; overflow: hidden; }
.poster-corner { position: absolute; inset: 0 0 auto 0; height: 270px; background: linear-gradient(130deg, var(--red) 0 58%, transparent 58%); }
.poster-corner::after { content: ""; position: absolute; right: -15px; top: 110px; width: 210px; height: 170px; background: linear-gradient(46deg, var(--olive) 0 49%, transparent 50%); clip-path: polygon(50% 0,100% 100%,0 100%); opacity: .9; }
.brand-block { position: relative; z-index: 2; color: var(--cream-light); text-transform: uppercase; margin-top: 42px; }
.brand-block h1, .app-header h1 { font-size: clamp(54px, 16vw, 78px); line-height: .85; letter-spacing: .025em; margin: 0; transform: scaleX(.84); transform-origin: left; }
.brand-block > p:last-child, .app-header p { font-family: "Arial Narrow", sans-serif; font-weight: 900; letter-spacing: .1em; font-size: 12px; margin: 12px 0 0; }
.star-rule { letter-spacing: .35em; margin: 0 0 18px; text-transform: uppercase; }
.radio-mark { position: absolute; z-index: 3; top: 74px; right: 40px; width: 110px; height: 110px; }
.radio-mark i { position: absolute; border: 2px solid var(--ink); border-radius: 50%; inset: 12px; opacity: .75; }
.radio-mark i:nth-child(2) { inset: 26px; }.radio-mark i:nth-child(3) { inset: 40px; }
.radio-mark span { position: absolute; width: 7px; height: 62px; background: var(--ink); left: 52px; top: 50px; clip-path: polygon(50% 0,100% 100%,0 100%); }
.paper-card { background: rgba(247,236,209,.88); border: 2px solid var(--line); box-shadow: inset 0 0 26px rgba(83,54,17,.07); }
.login-card { position: relative; z-index: 4; margin-top: 175px; padding: 22px; border-radius: 6px; }
.section-kicker, .section-title, .call-heading { text-transform: uppercase; letter-spacing: .08em; font-size: 19px; }
.section-kicker { margin: 0 0 12px; color: var(--red); }
label { display: block; margin: 16px 0; font-family: "Arial Narrow", Arial, sans-serif; font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: .08em; }
input, select { width: 100%; margin-top: 7px; padding: 14px; border: 2px solid var(--ink); border-radius: 0; background: var(--cream-light); color: var(--ink); outline: none; font-family: Arial, sans-serif; font-weight: 700; }
input:focus, select:focus { box-shadow: 5px 5px 0 var(--red); }
.poster-btn, .outline-btn { width: 100%; padding: 14px 16px; border: 2px solid var(--ink); text-transform: uppercase; letter-spacing: .08em; }
.poster-btn { color: var(--cream-light); background: var(--red); box-shadow: 4px 4px 0 var(--ink); }
.outline-btn { color: var(--ink); background: transparent; margin-top: 10px; }
.error { min-height: 20px; color: var(--red-dark); font-family: Arial, sans-serif; font-weight: 700; margin: 13px 0 0; }

.app-screen { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
.line-ready-overlay { position: fixed; z-index: 24; inset: 0; width: min(100%, 520px); margin: 0 auto; padding: max(70px, env(safe-area-inset-top)) 30px max(45px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--cream-light); background-color: var(--red); background-image: repeating-linear-gradient(17deg, transparent 0 4px, rgba(0,0,0,.03) 4px 5px); }
.line-ready-overlay::before, .line-ready-overlay::after { content: ""; position: absolute; width: 180px; height: 180px; background: var(--ink); transform: rotate(45deg); }
.line-ready-overlay::before { top: -110px; right: -100px; }.line-ready-overlay::after { bottom: -125px; left: -110px; }
.line-ready-overlay > * { position: relative; z-index: 1; }
.ready-star { width: 110px; height: 110px; display: grid; place-items: center; border: 3px solid var(--cream-light); border-radius: 50%; font-size: 52px; margin-bottom: 28px; box-shadow: 0 0 0 18px transparent, 0 0 0 20px rgba(247,236,209,.65), 0 0 0 37px transparent, 0 0 0 39px rgba(247,236,209,.35); }
.line-ready-overlay h2 { margin: 0; font-size: 46px; line-height: .95; text-transform: uppercase; letter-spacing: .03em; }
.line-ready-overlay > p:not(.section-kicker) { max-width: 340px; margin: 20px 0 26px; font: 700 15px/1.5 Arial, sans-serif; }
.line-ready-overlay .poster-btn { max-width: 330px; background: var(--cream-light); color: var(--red); box-shadow: 5px 5px 0 var(--ink); }
.line-ready-overlay small { margin-top: 16px; font: 11px Arial, sans-serif; opacity: .8; }
.app-header { height: 245px; position: relative; padding: max(28px, env(safe-area-inset-top)) 24px 20px; color: var(--cream-light); background: linear-gradient(130deg, var(--red) 0 63%, transparent 63%), linear-gradient(42deg, var(--olive) 0 37%, transparent 37%); overflow: hidden; }
.app-header h1 { font-size: 61px; margin-top: 34px; }
.small-link { position: absolute; z-index: 4; top: max(20px, env(safe-area-inset-top)); right: 18px; border: 0; background: var(--ink); color: var(--cream-light); padding: 7px 10px; text-transform: uppercase; font-size: 10px; letter-spacing: .08em; }
.tower { position: absolute; right: 44px; top: 80px; width: 64px; height: 150px; border-left: 6px solid var(--ink); border-right: 6px solid var(--ink); clip-path: polygon(45% 0,55% 0,100% 100%,0 100%); }
.tower::before, .tower::after, .tower span { content: ""; position: absolute; left: -12px; right: -12px; border-top: 5px solid var(--ink); transform: rotate(24deg); }
.tower::before { top: 43px; }.tower::after { top: 91px; }.tower span { top: 124px; transform: rotate(-24deg); }
.tab-pages { min-height: calc(100dvh - 331px); }
.tab-page { display: none; padding: 20px 16px 28px; }
.tab-page.active { display: block; }
.section-title { display: flex; align-items: center; gap: 12px; margin: 0 6px 18px; }
.section-title::after { content: ""; width: 46px; border-top: 3px solid var(--red); }
.contact-card { min-height: 255px; display: grid; grid-template-columns: 145px 1fr; grid-template-rows: 1fr auto; gap: 8px 14px; align-items: center; padding: 14px; border: 2px solid var(--line); background: rgba(247,236,209,.75); position: relative; }
.contact-card::before { content: ""; position: absolute; left: -2px; bottom: 0; width: 16px; height: 72px; background: var(--red); }
.portrait { border-radius: 50%; overflow: hidden; border: 5px solid var(--red); background: var(--olive); display: grid; place-items: center; }
.portrait svg { width: 100%; height: 100%; }
.portrait svg circle { fill: var(--olive); }
.portrait svg path { fill: var(--ink); }
.portrait-peer { width: 138px; height: 138px; grid-row: 1 / span 2; }
.portrait-peer svg { transform: scaleX(-1); }
.contact-copy h2 { text-transform: uppercase; font-size: 36px; line-height: 1; letter-spacing: .02em; margin: 4px 0 10px; }
.mini-label { font-family: Arial, sans-serif; text-transform: uppercase; font-weight: 900; font-size: 10px; letter-spacing: .12em; color: var(--red); margin: 0; }
.status { display: flex; align-items: center; gap: 7px; font-family: Arial, sans-serif; font-size: 12px; font-weight: 700; margin: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #777; }
.status.online .dot { background: #178142; box-shadow: 0 0 0 3px rgba(23,129,66,.15); }
.call-disc { width: 94px; height: 94px; border: 0; border-radius: 50%; background: var(--red); color: var(--cream-light); display: grid; place-items: center; justify-self: center; box-shadow: 4px 4px 0 var(--ink); }
.call-disc svg { width: 37px; height: 37px; fill: currentColor; }
.call-disc span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-top: -13px; }
.call-disc:disabled { filter: grayscale(1); opacity: .5; }
.signal-copy { margin: 22px 5px 0; display: flex; justify-content: center; align-items: center; gap: 17px; color: var(--red); text-align: center; }
.signal-copy p { color: var(--ink); font-family: Arial, sans-serif; font-size: 12px; line-height: 1.55; text-transform: uppercase; }

.bottom-nav { position: fixed; z-index: 15; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 520px); min-height: 78px; padding-bottom: env(safe-area-inset-bottom); background: var(--ink); display: grid; grid-template-columns: repeat(4, 1fr); border-top: 5px solid var(--red); }
.nav-btn { position: relative; border: 0; border-right: 1px solid rgba(239,224,189,.18); background: transparent; color: #bdb292; padding: 9px 2px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.nav-btn:last-child { border-right: 0; }
.nav-btn > span { font-size: 24px; line-height: 1; }
.nav-btn b { text-transform: uppercase; font-size: 9px; letter-spacing: .05em; }
.nav-btn.active { color: var(--red); background: rgba(255,255,255,.03); }
.badge { position: absolute; top: 5px; right: 21px; min-width: 18px; height: 18px; padding: 2px 4px; border-radius: 9px; background: var(--red); color: white; font: 700 11px Arial; }

.messages { height: calc(100dvh - 390px); min-height: 330px; overflow-y: auto; padding: 10px 5px; display: flex; flex-direction: column; gap: 10px; border-top: 2px solid var(--ink); }
.empty-state { margin: auto; color: #756c56; font: 700 13px Arial, sans-serif; text-align: center; }
.message { max-width: 82%; padding: 11px 13px 8px; align-self: flex-start; color: var(--cream-light); background: var(--olive); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); overflow-wrap: anywhere; }
.message.mine { align-self: flex-end; background: var(--red); }
.message-text { margin: 0; white-space: pre-wrap; font: 700 14px/1.4 Arial, sans-serif; }
.message-time { display: block; margin-top: 5px; font: 10px Arial, sans-serif; opacity: .8; text-align: right; }
.message-form { position: sticky; bottom: 85px; display: flex; gap: 8px; padding-top: 10px; background: var(--cream); }
.message-form input { margin: 0; min-width: 0; }
.send-btn { flex: 0 0 52px; border: 2px solid var(--ink); background: var(--red); color: var(--cream-light); font-size: 23px; box-shadow: 3px 3px 0 var(--ink); }

.call-history { padding: 10px 16px; }
.history-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 13px 0; border-top: 2px solid rgba(23,25,20,.2); }
.history-item:first-child { border-top: 0; }
.history-symbol { font-size: 23px; color: var(--olive); }
.history-item.missed .history-symbol, .history-item.missed .history-status { color: var(--red); }
.history-name { text-transform: uppercase; font-size: 18px; }
.history-status, .history-time { display: block; font: 700 11px Arial, sans-serif; color: #716a56; }
.history-time { text-align: right; }
.setup-card { position: relative; padding: 17px 16px 16px 64px; margin-bottom: 16px; }
.setting-number { position: absolute; left: 14px; top: 17px; width: 36px; height: 36px; display: grid; place-items: center; background: var(--red); color: var(--cream-light); font-size: 20px; }
.setup-card h3 { text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px; }
.setup-card p { font: 13px/1.45 Arial, sans-serif; margin: 0 0 13px; }
.setup-card .poster-btn, .setup-card .outline-btn { margin-left: -50px; width: calc(100% + 50px); }
.hint { color: var(--red-dark); margin: 14px 0 0 !important; }
.version-line { text-align: center; color: #756c56; font: 11px Arial, sans-serif; }

.call-layer { position: fixed; inset: 0; z-index: 30; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; text-align: center; overflow: hidden; padding: max(34px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom)); }
.incoming-layer { color: var(--cream-light); background-color: var(--red); background-image: repeating-linear-gradient(17deg, transparent 0 4px, rgba(0,0,0,.025) 4px 5px); }
.call-heading { margin: 28px 0 6px; font-size: 23px; }
.signal-rings { width: 270px; height: 270px; margin: 30px 0 15px; border: 2px dotted var(--cream-light); border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 24px transparent, 0 0 0 25px rgba(247,236,209,.6), 0 0 0 50px transparent, 0 0 0 51px rgba(247,236,209,.45); }
.call-portrait { width: 182px; height: 182px; border-color: var(--cream-light); }
.incoming-layer h2 { font-size: 46px; text-transform: uppercase; letter-spacing: .02em; margin: 22px 0 2px; }
.incoming-hint { min-height: 21px; font: 700 13px Arial, sans-serif; }
.call-actions { display: flex; gap: 54px; margin-top: auto; padding-bottom: 26px; }
.round-call { width: 112px; border: 0; color: var(--cream-light); background: transparent; text-transform: uppercase; }
.round-call svg { width: 86px; height: 86px; padding: 22px; border: 4px solid currentColor; border-radius: 50%; fill: currentColor; }
.round-call span { display: block; margin-top: 9px; font-size: 14px; letter-spacing: .06em; }
.round-call.reject svg { transform: rotate(135deg); }
.round-call.answer { color: var(--cream-light); }
.round-call.answer svg { background: var(--olive); }

.active-layer { background: var(--cream); color: var(--red); }
.active-layer::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 150px; background: linear-gradient(135deg, var(--red) 0 33%, transparent 33%), linear-gradient(225deg, var(--ink) 0 25%, transparent 25%); }
.active-layer > * { position: relative; z-index: 1; }
.conversation-pair { display: flex; align-items: center; justify-content: center; gap: 17px; margin-top: 90px; color: var(--ink); }
.mini-person { display: flex; flex-direction: column; gap: 10px; text-transform: uppercase; font-size: 18px; }
.portrait.small { width: 105px; height: 105px; border-width: 4px; }
.portrait.small.peer { border-color: var(--olive); }
.waveform { color: var(--red); font: 20px monospace; letter-spacing: -4px; }
.timer { font-size: 42px; letter-spacing: .06em; margin: 34px 0; }
.active-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: min(100%, 330px); }
.square-action { height: 112px; border: 3px solid var(--cream); background: var(--ink); color: var(--cream-light); font-size: 38px; box-shadow: 0 0 0 2px var(--ink); }
.square-action:nth-child(2) { background: var(--olive); }
.square-action span { display: block; margin-top: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.square-action.muted { background: var(--red); }
.hangup-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 150px; border: 0; background: var(--red); color: var(--cream-light); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; text-transform: uppercase; letter-spacing: .06em; }
.hangup-bar svg { width: 58px; height: 58px; fill: currentColor; transform: rotate(135deg); }

.toast { position: fixed; left: 50%; bottom: 100px; z-index: 50; transform: translateX(-50%); width: min(calc(100% - 32px), 450px); padding: 14px 18px; background: var(--ink); color: var(--cream-light); border: 3px solid var(--red); text-align: center; font: 700 13px Arial, sans-serif; box-shadow: 5px 5px 0 rgba(0,0,0,.35); }
@media (max-width: 380px) {
  .contact-card { grid-template-columns: 120px 1fr; }.portrait-peer { width: 116px; height: 116px; }.call-actions { gap: 22px; }.round-call { width: 100px; }
}
