
  :root {
    /* Pager — единственный эталон общих размеров. Лента использует эти же значения;
       размеры рисунков намеренно остаются отдельными. */
    --pager-meta-size: 9.5px;
    --pager-meta-line-height: 1.3;
    --pager-meta-tracking: .08em;
    --pager-copy-size: 15.8px;
    --pager-copy-line-height: 1.38;
    --pager-action-size: 34px;
    --pager-action-gap: 8px;
    --pager-action-top: 11px;
    --pager-action-icon-size: 16px;
    --pager-action-label-size: 8.5px;
    --pager-action-label-tracking: .075em;
    --pager-composer-top: 12px;
    --pager-composer-field-height: 46px;
    --pager-composer-field-max-height: 168px;
    --pager-composer-icon-size: 21px;
    --pager-composer-footer-height: 18px;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  html, body { height: 100%; overflow: hidden; }
  body {
    position: fixed; inset: 0;
    background: #0c0f0d; color: #c9d4c0;
    font-family: ui-monospace, 'Cascadia Mono', Menlo, Consolas, monospace;
    display: flex; flex-direction: column; align-items: center;
    -webkit-text-size-adjust: 100%;
  }
  /* гибрид: длинные тексты — гуманистическим, LCD/цифры/меты — моно */
  .tagline, .wraptext, .step span, .rules li span, .okbtn, .g-msg p,
  .row, .empty, textarea, .send button, .dlg input, .callcard .cbody,
  .vline p, .undercta { font-family: -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif; }
  .row small, .stagechip, .vbrand, .vtop, .vnum, .vsub, .vline small { font-family: ui-monospace, Menlo, Consolas, monospace; }

  .col {
    width: 100%; max-width: 420px; flex: 1; min-height: 0;
    display: flex; flex-direction: column;
    padding: calc(16px + env(safe-area-inset-top)) 16px 0;
    overflow-y: auto; overscroll-behavior: contain;
    scroll-padding: 12px 0 max(18px, env(safe-area-inset-bottom));
  }
  /* iOS оставляет над клавиатурой собственную панель со стрелками. Пока открыт
     композер, даём странице реальный запас для прокрутки — тогда книга и весь
     блок отправки поднимаются над системной панелью, как в старой версии. */
  body.composer-keyboard .col { padding-bottom: var(--composer-keyboard-inset, 0px); }
  #app { flex: 1; min-height: 0; display: flex; flex-direction: column; }

  /* ===== устройство ===== */
  .device { flex: none;
    background: linear-gradient(180deg, #262e20, #171d13);
    border: 2px solid #3a4630; border-radius: 24px;
    padding: 13px; box-shadow: 0 14px 36px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.07); }
  /* верхушка корпуса: марка слева, питание справа (отдельной строки под дисплеем больше нет) */
  .brand { display: flex; justify-content: space-between; align-items: center;
    font-size: 11px; letter-spacing: .26em; color: #cbd5c6; font-weight: 600; padding: 0 3px 10px; }
  .brand-mark { display: flex; align-items: center; gap: 7px; }
  .brand-logo { width: 18px; height: 18px; color: #9fc9c0; flex: none; }
  .brand .pw { color: #778370; font-size: 8px; font-weight: 500; letter-spacing: .12em; }
  .brand .pw { display: flex; align-items: center; gap: 8px; }
  .mode-tabs { display: flex; align-items: center; gap: 12px; }
  .mode-tab { position: relative; border: 0; background: none; color: #66715f; cursor: pointer;
    padding: 2px 0 7px; font: inherit; font-size: 9.5px; font-weight: 500; letter-spacing: .2em; }
  .mode-tab.active { color: #d0dacb; }
  .mode-tab.active::after { content: ''; position: absolute; left: 0; right: .2em; bottom: 1px; height: 1px;
    background: #93a873; box-shadow: 0 0 5px rgba(159,180,127,.5); }
  .mode-info { flex: none; width: 18px; height: 18px; border: 1px solid #52604a; border-radius: 50%;
    background: rgba(159,180,127,.07); color: #87947f; cursor: pointer; font: inherit;
    font-size: 8px; font-weight: 500; line-height: 1; }
  .feed-dot { position: absolute; top: -1px; right: -6px; width: 4px; height: 4px; border-radius: 50%;
    background: #b8cc91; box-shadow: 0 0 5px rgba(184,204,145,.9); }
  .glass {
    position: relative; border-radius: 13px; overflow: hidden;
    background: linear-gradient(165deg, #b3c791, #9cb27a 58%, #92a771);
    color: #1d2415;
    box-shadow: inset 0 4px 12px rgba(20,28,12,.45), inset 0 -1px 3px rgba(255,255,255,.3);
    padding: 12px 14px 14px;
  }
  .glass::after { content: ''; position: absolute; inset: 0; pointer-events: none;
    z-index: 5; background: repeating-linear-gradient(0deg, rgba(20,28,12,.05) 0 1px, transparent 1px 3px); }
  .pager-screen { position: relative; z-index: 1; }
  #app.feed-mode { gap: 0; }
  #app.feed-mode .device { flex: 1; min-height: 300px; display: flex; flex-direction: column; }
  #app.feed-mode .glass { flex: 1; min-height: 0; padding: 0; }
  #app.feed-mode .pw, #app.feed-mode .hist, #app.feed-mode #pagerComposer { display: none !important; }
  #app.feed-mode #feedComposer { display: block !important; }
  .feed-screen { position: relative; z-index: 1; height: 100%; min-height: 0;
    display: flex; flex-direction: column; padding: 3px 14px 8px; }
  .feed-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  .feed-list::-webkit-scrollbar { width: 0; height: 0; }
  .feed-scroll-indicator { position: absolute; z-index: 6; top: 8px; right: 5px; bottom: 8px; width: 2px;
    border-radius: 999px; background: rgba(29,36,21,.09); opacity: .46; pointer-events: none;
    transition: opacity .18s ease; }
  .feed-scroll-indicator.active { opacity: .78; }
  .feed-scroll-indicator span { position: absolute; top: 0; left: 0; width: 2px; min-height: 24px;
    border-radius: 999px; background: rgba(29,36,21,.46); transform: translateY(0); will-change: transform; }
  .feed-post { padding: 13px 1px 12px; border-bottom: 1px dashed rgba(20,28,12,.27); }
  .post-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
    color: #1d2415; font-size: var(--pager-meta-size); line-height: var(--pager-meta-line-height);
    font-weight: 500; letter-spacing: var(--pager-meta-tracking); opacity: .7; text-transform: uppercase; }
  .post-meta span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .post-meta time { flex: none; }
  .post-text { margin-top: 8px; color: #1d2415; font-family: -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif;
    font-size: var(--pager-copy-size); font-weight: 400; line-height: var(--pager-copy-line-height);
    white-space: pre-wrap; word-break: break-word; }
  .post-graffiti { display: block; width: 116px; height: 116px; margin: 9px auto 2px;
    image-rendering: pixelated; background: transparent; }
  .post-actions { display: flex; justify-content: flex-end; align-items: center;
    gap: var(--pager-action-gap); margin-top: var(--pager-action-top); }
  .post-action { min-height: var(--pager-action-size); display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border: 1px solid rgba(20,28,12,.3); background: rgba(184,202,150,.2);
    color: rgba(29,36,21,.68); border-radius: 999px; padding: 0 10px; cursor: pointer;
    font: inherit; font-size: var(--pager-action-label-size); font-weight: 500;
    letter-spacing: var(--pager-action-label-tracking); text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
  .post-action.icon-only { width: var(--pager-action-size); padding: 0; }
  .post-action svg { width: var(--pager-action-icon-size); height: var(--pager-action-icon-size);
    fill: none; stroke: currentColor; stroke-width: 1.8; }
  .post-action.remove-action { font-size: var(--pager-action-icon-size); line-height: 1; }
  .post-action.liked { background: #1d2415; color: #b3c791; border-color: #1d2415; }
  .post-action.liked svg { fill: currentColor; }
  .post-action:disabled { opacity: .48; cursor: default; }
  .feed-empty, .feed-state { color: rgba(29,36,21,.55); text-align: center; font-size: 9px;
    line-height: 1.5; letter-spacing: .09em; padding: 26px 10px; text-transform: uppercase;
    overflow-wrap: anywhere; }
  .feed-state { padding: 10px; }
  .g-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 9px; letter-spacing: 1.5px; font-weight: 500; opacity: .72; }
  .number { font-size: 46px; font-weight: 600; letter-spacing: .14em; text-indent: .14em; text-align: center; margin: 6px 0 3px; white-space: nowrap; text-shadow: 0 1px 0 rgba(255,255,255,.2); }
  .number.dim { opacity: .35; }
  .g-status { text-align: center; font-size: 10px; letter-spacing: 2px; opacity: .65; font-weight: 700; }

  .g-msg { position: relative; border-top: 1px dashed rgba(20,28,12,.32); margin-top: 11px; padding-top: 11px; }
  .g-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    font-size: var(--pager-meta-size); line-height: var(--pager-meta-line-height);
    letter-spacing: var(--pager-meta-tracking); font-weight: 500;
    opacity: .7; margin-bottom: 7px; text-transform: uppercase; }
  .g-meta span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .g-meta time { flex: none; white-space: nowrap; }
  .g-msg p { font-size: var(--pager-copy-size); line-height: var(--pager-copy-line-height);
    font-weight: 400; word-break: break-word; min-height: 22px; }
  .gdraw { display: block; width: min(128px, 48vw); height: auto; margin: 2px auto 0;
    image-rendering: pixelated; border: 0; background: transparent; }
  /* длинное сообщение не раздувает корпус на пол-экрана: четыре строки, остальное по тапу
     со своим скроллом — как листали строки на настоящих пейджерах */
  .g-msg.clip p { max-height: 5.6em; overflow: hidden; }
  .g-msg.clip.open p { max-height: 11.2em; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: rgba(20,28,12,.35) transparent; }
  /* курсор набора: новое сообщение «печатается» на экранчике */
  .cur { display: inline-block; width: 6px; height: 15px; vertical-align: -2px; background: #1d2415;
    margin-left: 2px; animation: curb .9s steps(1) infinite; }
  @keyframes curb { 50% { opacity: 0 } }
  .more { display: none; margin-top: 7px; font-size: 8.5px; letter-spacing: 2px; font-weight: 700;
    color: rgba(29,36,21,.6); background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
  .g-msg.clip .more { display: inline-block; }
  .g-actions { display: flex; align-items: center; gap: var(--pager-action-gap);
    margin-top: var(--pager-action-top); justify-content: flex-end; }
  /* до нажатия — пустой контур, после — залитая кнопка. Раньше было наоборот:
     нетронутое сердечко выглядело нажатым, а отправленное блёкло от :disabled */
  .g-actions button { font: inherit; cursor: pointer; background: rgba(184,202,150,.2);
    color: rgba(29,36,21,.68); border: 1px solid rgba(20,28,12,.3);
    min-height: var(--pager-action-size); padding: 0; display: inline-flex; align-items: center; justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
  .g-actions .round-action { flex: none; width: var(--pager-action-size); border-radius: 50%; }
  .g-actions .round-action svg { width: var(--pager-action-icon-size); height: var(--pager-action-icon-size); fill: none; }
  .g-actions .save-number { width: auto; padding: 0 10px; gap: 7px; border-radius: 9px;
    color: #1d2415; font-size: var(--pager-action-label-size); font-weight: 500;
    letter-spacing: var(--pager-action-label-tracking); text-transform: uppercase; }
  .g-actions .save-number svg { width: 14px; height: 14px; flex: none; }
  .g-actions button:disabled { opacity: .45; }
  .g-actions button.liked { background: #1d2415; color: #b3c791; border-color: #1d2415; opacity: 1; }
  .g-actions button.liked svg { fill: currentColor; }

  .switch { position: relative; width: 40px; height: 21px; border-radius: 999px; cursor: pointer; flex: none;
    background: #10140e; border: 1px solid #333d29; transition: background .15s, opacity .15s; }
  .switch .knob { position: absolute; top: 1.5px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: #55614d; transition: left .15s, background .15s; }
  .switch.on { background: #1f2a1a; border-color: #46543f; box-shadow: inset 0 0 8px rgba(159,180,127,.3); }
  .switch.on .knob { left: 20px; background: #9fb47f; box-shadow: 0 0 8px rgba(159,180,127,.85); }
  .switch.busy { opacity: .45; }
  @keyframes swpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(159,180,127,0); } 50% { box-shadow: 0 0 12px 3px rgba(159,180,127,.5); } }
  .switch.attn { animation: swpulse 1.6s ease-in-out infinite; }

  /* ===== история: без коробки, на волосяных линиях ===== */
  .hist { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 18px; }
  /* заголовок живёт только в свёрнутом виде: подпись на линии */
  .hist-head { flex: none; display: flex; align-items: center; gap: 12px; }
  .hist-head::before, .hist-head::after { content: ''; flex: 1; height: 1px; background: #1a2016; }
  .hist-head button { font: inherit; font-size: 10px; letter-spacing: 2px; font-weight: 500; cursor: pointer;
    background: none; color: #64705d; border: 0; border-radius: 0; padding: 0; }
  .hist-head button span { display: inline-block; margin-left: 4px; transition: transform .16s ease; }
  /* панель открытой ленты: селектор адресата + корзина + свернуть */
  .histbar { flex: none; display: flex; align-items: center; gap: 6px; padding: 0 2px 9px;
    border-bottom: 1px solid #1a2016; }
  .selwrap { position: relative; flex: 1; min-width: 0; }
  .peersel { font: inherit; font-size: 11px; letter-spacing: 2px; font-weight: 700; cursor: pointer;
    background: none; border: 0; padding: 4px 0; color: #cfe0c8; display: inline-flex; align-items: center; gap: 7px;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .peersel i { font-style: normal; font-size: 9px; color: #7f9463; }
  .histbar .ic { flex: none; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    background: none; border: 0; color: #55614d; cursor: pointer; font-size: 13px; font-family: inherit; }
  .histbar .ic svg { width: 16px; height: 16px; }
  .histbar .ic:active { color: #9fb47f; }
  .menu { position: absolute; z-index: 40; left: -6px; top: calc(100% + 6px); min-width: 190px; max-height: 44vh;
    overflow-y: auto; background: #12160f; border: 1px solid #2c3524; border-radius: 14px; padding: 5px;
    box-shadow: 0 14px 34px rgba(0,0,0,.6); }
  .menu button { display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 12px;
    font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; background: none; border: 0;
    color: #b7c4ab; padding: 9px 11px; border-radius: 9px; }
  .menu button.on { background: #1c2317; color: #cfe0c8; }
  .menu button span { font-size: 10px; color: #55614d; }
  .histbox { flex: 1; min-height: 120px; margin: 4px 0 0;
    display: flex; flex-direction: column; overflow: hidden; }
  .histlist { flex: 1; min-height: 0; padding: 12px 0 4px; display: flex; flex-direction: column; gap: 8px;
    overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: #2c3524 transparent; }
  .histlist::-webkit-scrollbar { width: 4px; }
  .histlist::-webkit-scrollbar-thumb { background: #2c3524; border-radius: 2px; }
  /* лайк не занимает строку в ленте: он висит сердечком на самом сообщении */
  .likemark { position: absolute; right: 10px; bottom: -9px; font-size: 10px; line-height: 1;
    background: #1a2016; color: #c07a5e; border: 1px solid #2c3524; border-radius: 999px; padding: 3px 6px; }
  .row.hasmark { margin-bottom: 6px; }
  .row { position: relative; border-radius: 12px; padding: 9px 12px; font-size: 13.5px; cursor: pointer; word-break: break-word; flex: none;
    font-family: -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif; }
  .row small { display: block; font-size: 9.5px; letter-spacing: 1px; opacity: .8; margin-bottom: 3px; font-weight: 700;
    font-family: ui-monospace, Menlo, monospace; }
  .row.in { background: linear-gradient(165deg, #a3b884, #93a873); color: #1d2415; box-shadow: inset 0 2px 6px rgba(20,28,12,.25); margin-right: 30px; }
  .row.out { background: #161b13; border: 1px solid #262e21; color: #99a58f; margin-left: 30px; }
  .row .pixelmsg { display: block; width: 112px; height: 112px; margin: 5px 0 2px;
    image-rendering: pixelated; border: 1px solid currentColor; background: #b3c791; }
  .empty { font-size: 12.5px; color: #4e5a45; text-align: center; padding: 22px 14px; line-height: 1.6; }
  .histspacer { flex: 1; }

  /* ===== композер ===== */
  .composer { flex: none; padding-bottom: max(10px, env(safe-area-inset-bottom));
    padding-top: var(--pager-composer-top); }
  /* при открытой ленте композер становится доком: переписка уходит ПОД него */
  body.dock .composer { margin: 0 -16px; padding: var(--pager-composer-top) 16px max(10px, env(safe-area-inset-bottom));
    background: #0a0d09; border-top: 1px solid #1a2016; box-shadow: 0 -14px 26px rgba(6,8,6,.75); }
  /* затухание меряем в пикселях и добавляем такой же запас снизу, иначе последняя
     запись ленты навсегда остаётся в тумане — доскроллить до читаемого невозможно */
  body.dock .histlist { padding-bottom: 30px;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent); }
  /* растущее поле забирает место у ленты — она обязана уметь ужиматься, иначе наезжает на док */
  body.dock .histbox { min-height: 0; }
  body.dock .hist { overflow: hidden; }
  .panel { display: flex; flex-direction: column; gap: 9px; }
  /* строка «кому» появляется, только когда номер набран целиком */
  .toline { font-size: 10px; letter-spacing: 2px; font-weight: 700; color: #55614d; padding: 0 4px 2px; }
  .toline b { color: #9fb47f; font-weight: 700; }
  .toline button { font: inherit; font-size: 10px; letter-spacing: 1px; background: none; border: 0;
    color: #7f9463; text-decoration: underline dotted; cursor: pointer; padding: 0 0 0 8px; }
  .numwrap { position: relative; flex: none; }
  /* список частых адресатов всплывает НАД полем: снизу на телефоне клавиатура */
  .numMenu { left: -4px; right: auto; top: auto; bottom: calc(100% + 8px);
    width: min(276px, calc(100vw - 42px)); min-width: 176px; max-height: min(310px, 48dvh); }
  .number-option { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: stretch; border-radius: 9px; }
  .number-option.no-edit { grid-template-columns: minmax(0, 1fr); }
  .number-option:focus-within { background: #1a2117; }
  .number-option .number-pick, .number-option .number-edit, .number-save-new {
    border: 0; color: #adb9a7; background: transparent; cursor: pointer; }
  .number-option .number-pick { display: block; min-width: 0; min-height: 45px; padding: 7px 9px; text-align: left; }
  .number-option .number-pick strong { display: block; overflow: hidden; color: #c9d3c4;
    font-size: 12.5px; font-weight: 400; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
  .number-option .number-pick small { display: block; margin-top: 4px; color: #65715e;
    font-size: 9px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
  .number-option .number-edit { display: grid; place-items: center; width: 38px; min-height: 42px;
    padding: 0; color: #697561; font-size: 14px; }
  .number-option .number-edit svg { width: 14px; height: 14px; }
  .number-save-new { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 42px;
    margin-top: 4px; padding: 0 9px; border-top: 1px solid #2b3425; color: #95a976;
    font-size: 9px; font-weight: 500; letter-spacing: .065em; text-align: left; text-transform: uppercase; }
  .io { display: flex; align-items: flex-start; gap: 0;
    background: #0e120c; border: 1px solid #232a20; border-radius: 14px; padding: 3px; }
  .io input, .io textarea { font: inherit; background: none; color: #d7e0d4; border: 0; outline: none; }
  .io input { width: 78px; flex: none; padding: 10px; font-size: 17px; font-weight: 500; text-align: center; letter-spacing: 3px; }
  /* поле растёт под текст (growText); номер и трубка за ним не тянутся */
  .io textarea { flex: 1; resize: none; height: var(--pager-composer-field-height);
    min-height: var(--pager-composer-field-height); max-height: var(--pager-composer-field-max-height); overflow-y: auto;
    padding: 11px; font-size: 16px; line-height: 1.35;
    border-left: 1px solid #1e2519; border-right: 1px solid #1e2519;
    scrollbar-width: thin; scrollbar-color: #2c3524 transparent;
    font-family: -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif; }
  .io .callbtn { flex: none; width: var(--pager-composer-field-height); height: var(--pager-composer-field-height);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    background: none; color: #6d7a64; border: 0; }
  .io .callbtn:disabled { opacity: .4; }
  .io .callbtn svg { width: var(--pager-composer-icon-size); height: var(--pager-composer-icon-size); }
  .send button { width: 100%; font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 2.2px; cursor: pointer;
    background: linear-gradient(180deg, #a8bd86, #90a76e); color: #131a0e; border: 0; border-radius: 13px; padding: 14px;
    box-shadow: 0 6px 18px rgba(159,180,127,.18), inset 0 1px 0 rgba(255,255,255,.35); }
  .send button.sending { color: #b0bda7; background: #252d21; }
  .send button.sent { color: #172011; background: linear-gradient(180deg, #c0d19b, #9db879); }
  .send button.failed { color: #d9c9aa; background: #3a3020; }
  .send button:active { transform: translateY(1px); }
  .send button:disabled { opacity: .4; }
  .sstatus { font-size: 11px; color: #6d7a64; text-align: center; min-height: 14px; }
  .sstatus.ok { color: #7fc86a; } .sstatus.err { color: #d99a4e; }
  /* остаток символов: абсолютом, чтобы появление счётчика не двигало статус и композер */
  .sline { position: relative; }
  .ccount { position: absolute; right: 2px; top: 0; font-size: 11px; color: #6d7a64; pointer-events: none; }
  .ccount.low { color: #d99a4e; }
  .howlink { height: 12px; line-height: 12px; text-align: center; font-size: 10px; margin-top: 6px; }
  .howlink a { color: #55614d; text-decoration: underline dotted; cursor: pointer; }
  /* У ленты нет ссылки под кнопкой, но её пустое место сохраняется: поэтому оба
     нижних блока начинаются и заканчиваются на одной высоте. */
  .feed-composer::after { content: ''; display: block; height: var(--pager-composer-footer-height); }
  .feed-composer .io textarea { width: 100%; border-left: 0; }


  /* ===== оверлеи ===== */
  .backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(5,7,5,.72);
    display: flex; align-items: center; justify-content: center; padding: 20px; }
  .sheet { position: relative; width: 100%; max-width: 360px; background: #12160f;
    border: 1px solid #2c3524; border-radius: 18px; padding: 18px; box-shadow: 0 12px 44px rgba(0,0,0,.6);
    display: flex; flex-direction: column; max-height: 84dvh; overflow-y: auto; }
  /* z-index: крестик правил лежал ПОД зелёной шапкой и не нажимался */
  .sheet .x { position: absolute; top: 10px; right: 12px; background: none; border: none;
    color: #55614d; font-size: 18px; cursor: pointer; padding: 4px; z-index: 2; }
  .sheet.rules .x { color: rgba(29,36,21,.6); } /* на светлой шапке тёмный читается, серый — нет */
  .sheet h2 { font-size: 11px; letter-spacing: 3px; color: #8a967f; margin-bottom: 12px; text-align: center; }
  /* правила оформлены как страницы установки: экранчик-шапка, номера шагов, волоски */
  /* лист не скроллится (иначе поедет скруглённая шапка), зато скроллится сам список правил:
     шапка и кнопка «Понятно» всегда на экране — иначе на 320×568 выхода из гейта нет */
  .sheet.rules { padding: 0; overflow: hidden; }
  .sheet.rules .okbtn { flex: none; }
  .sheethead { position: relative; text-align: center; padding: 15px 16px 14px; color: #1d2415;
    background: linear-gradient(165deg, #b3c791, #9cb27a 60%, #92a771); }
  .sheethead::after { content: ''; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(20,28,12,.055) 0 1px, transparent 1px 3px); }
  .sheethead .t { font-size: 13px; letter-spacing: 3px; font-weight: 800; }
  .sheethead .s { font-size: 9px; letter-spacing: 2px; font-weight: 700; opacity: .6; margin-top: 3px; }
  .rules ul { list-style: none; display: flex; flex-direction: column; padding: 4px 18px 0;
    flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: #2c3524 transparent; }
  .rules li { display: flex; gap: 12px; align-items: baseline; font-size: 13px; line-height: 1.5;
    color: #a9b59e; padding: 13px 0; border-bottom: 1px solid #1a2016; text-align: left; }
  .rules li:last-child { border-bottom: 0; }
  .rules li b { flex: none; width: 16px; font-size: 10px; color: #4e5a45; font-weight: 400; }
  .rules li span b { width: auto; font-size: inherit; color: #cfe0c8; font-weight: 600; }
  .okbtn { margin-top: 14px; width: 100%; font-size: 14px; cursor: pointer;
    background: #2a3328; color: #cfe0c8; border: 1px solid #46543f; border-radius: 10px; padding: 11px; }
  .rules .okbtn { width: calc(100% - 36px); margin: 4px 18px 18px; font-weight: 700; letter-spacing: 1.5px;
    background: linear-gradient(180deg, #a8bd86, #90a76e); color: #131a0e; border: 0; border-radius: 13px;
    padding: 14px; box-shadow: 0 6px 18px rgba(159,180,127,.18), inset 0 1px 0 rgba(255,255,255,.35); }
  /* главный выход из тупика — скачать готовое приложение: делаем его заметным */
  a.okbtn { display: block; text-align: center; text-decoration: none; box-sizing: border-box;
    font-weight: 700; letter-spacing: 1.5px; background: linear-gradient(180deg, #a8bd86, #90a76e);
    color: #131a0e; border: 0; padding: 13px; box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
  /* спрашиваем по-своему: системное окно рядом с этим дизайном выглядело чужим и пугало */
  .sheet.ask { max-width: 320px; padding: 20px 18px 16px; text-align: center; }
  .askhead { font-size: 9px; letter-spacing: 3px; font-weight: 700; color: #7f9463; }
  .asktext { font-size: 18px; font-weight: 700; color: #e2ead9; margin: 9px 0 16px; line-height: 1.35;
    overflow-wrap: anywhere; } /* длинное имя из книжки резалось краем окна */
  .asktext span { color: #9fb47f; font-family: ui-monospace, Menlo, monospace; }
  .askrow { display: flex; gap: 8px; }
  .askrow button { flex: 1; font: inherit; font-size: 13px; font-weight: 700; letter-spacing: 1px;
    padding: 13px; border-radius: 12px; cursor: pointer; }
  .askno { background: #171d13; color: #8a967f; border: 1px solid #333d29; }
  .askyes { background: linear-gradient(180deg, #a8bd86, #90a76e); color: #131a0e; border: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
  .askyes.danger { background: linear-gradient(180deg, #c98a6a, #b2704f); color: #1a0f09; }
  .dlg { display: flex; flex-direction: column; gap: 8px; }
  .dlg label { font-size: 9px; letter-spacing: 2px; color: #6d7a64; font-weight: 700; text-align: center; }
  .dlg input { font-size: 14px; padding: 9px; border-radius: 10px; background: #0e120c;
    color: #d7e0d4; border: 1px solid #2c3524; text-align: center; }
  .dlg input.num { letter-spacing: 4px; font-family: ui-monospace, Menlo, monospace; font-size: 16px; }
  .dlg .drow { display: flex; gap: 8px; margin-top: 6px; }
  .dlg .drow button { flex: 1; font: inherit; font-size: 13px; padding: 10px; border-radius: 10px; cursor: pointer; }
  .dlg .save { background: #2a3328; color: #cfe0c8; border: 1px solid #46543f; }
  .dlg .cancel { background: transparent; color: #6d7a64; border: 1px solid #2a3224; }

  /* редактор рисунка появляется только по кнопке-карандашу; основной экран не меняем */
  .sheet.drawsheet { max-width: 380px; overflow: hidden; }
  .drawcanvas { display: block; width: min(100%, 320px); aspect-ratio: 1; margin: 0 auto 12px;
    image-rendering: pixelated; background: #b3c791; border: 1px solid #46543f;
    border-radius: 8px; touch-action: none; cursor: crosshair; }
  .drawphoto { margin: -2px 0 11px; }
  .drawphoto button { width: 100%; border: 1px solid #40534b; border-radius: 9px; padding: 9px 10px;
    background: #18211f; color: #a8d0c7; font: 700 9px/1 ui-monospace, Menlo, Consolas, monospace;
    letter-spacing: 1.2px; cursor: pointer; }
  .drawphoto button:disabled { opacity: .48; cursor: wait; }
  .palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; margin-bottom: 13px; }
  .palette button { aspect-ratio: 1; min-width: 0; border-radius: 7px; border: 2px solid #2c3524;
    cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
  .palette button.on { outline: 2px solid #cfe0c8; outline-offset: 1px; }
  .drawrow { display: flex; gap: 8px; }
  .drawrow button { flex: 1; font: inherit; font-size: 12px; font-weight: 700; padding: 11px 7px;
    border-radius: 10px; cursor: pointer; }
  .drawclear, .drawcancel { background: transparent; color: #8a967f; border: 1px solid #2a3224; }
  .drawsend { background: #2a3328; color: #cfe0c8; border: 1px solid #46543f; }
  .drawsend:disabled { opacity: .4; }
  .drawprivacy { margin: 10px 3px 0; color: #65736a; font-size: 10px; line-height: 1.45;
    text-align: center; font-family: -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif; }
  .regtext { font-size: 13px; line-height: 1.55; color: #a9b59e; text-align: center;
    font-family: -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif; }
  .sheet.feedinfo { max-width: 380px; }
  .feedinfo .feedkicker { color: #738068; font-size: 8px; letter-spacing: .18em; text-align: center;
    text-transform: uppercase; margin-bottom: 9px; }
  .feedinfo p { color: #aab6a2; font-family: -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif;
    font-size: 14px; font-weight: 400; line-height: 1.5; }
  .feedinfo p strong { color: #d0dacb; font-weight: 600; }
  .feedcontrast { margin-top: 16px; border-left: 2px solid #91a873; background: #192016;
    color: #c9d5c1; padding: 12px 13px; font-family: -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif;
    font-size: 13.5px; line-height: 1.45; }
  .feedcontrast strong { color: #e0e8dc; font-weight: 600; }
  @media (max-height: 700px) {
    #app.feed-mode .device { min-height: 260px; }
    .feed-post { padding: 10px 1px; }
    .post-graffiti { width: 96px; height: 96px; }
  }
  @media (max-width: 350px) {
    .brand-mark { gap: 5px; }
    .mode-tabs { gap: 9px; }
    .mode-tab { font-size: 8.5px; letter-spacing: .15em; }
    .feed-screen { padding-left: 11px; padding-right: 11px; }
    .post-action .action-word { display: none; }
  }

  /* номер открывается как лотерейный билет; остальной интерфейс не меняется */
  .sheet.lottery { max-width: 340px; overflow: hidden; text-align: center; }
  .lotteryhead { font-size: 9px; letter-spacing: 3px; font-weight: 700; color: #7f9463; }
  .lotteryticket { position: relative; width: 100%; aspect-ratio: 8 / 3; margin: 13px 0 10px;
    overflow: hidden; border: 1px solid #46543f; border-radius: 13px;
    background: linear-gradient(165deg, #b3c791, #9cb27a 58%, #92a771);
    box-shadow: inset 0 4px 12px rgba(20,28,12,.35); }
  .lotterynum { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: #1d2415; font-size: 52px; line-height: 1; font-weight: 800; letter-spacing: 11px;
    text-indent: 11px; text-shadow: 0 1px 0 rgba(255,255,255,.25); }
  .lotteryticket canvas { position: absolute; inset: 0; width: 100%; height: 100%;
    touch-action: none; cursor: crosshair; opacity: 1; transition: opacity .32s ease; }
  .lotteryticket.revealed canvas { opacity: 0; pointer-events: none; }
  .lotteryhint { min-height: 18px; color: #8a967f; font-size: 11px; line-height: 1.45;
    letter-spacing: 1.5px; font-weight: 700; }
  .lottery .okbtn { font-weight: 700; letter-spacing: 1px; }
  @media (prefers-reduced-motion: reduce) {
    .lotteryticket canvas { transition: none; }
  }

  /* карточка входящего звонка */
  .callcard { position: fixed; top: 0; left: 0; right: 0; z-index: 70;
    display: flex; justify-content: center; padding: calc(10px + env(safe-area-inset-top)) 14px 0; }
  .callcard .inner { width: 100%; max-width: 392px;
    background: linear-gradient(165deg, #a3b884, #8fa46e); color: #1d2415;
    border-radius: 16px; padding: 13px 16px; box-shadow: 0 10px 34px rgba(0,0,0,.55);
    animation: drop .25s ease-out; }
  @keyframes drop { from { transform: translateY(-120%); } to { transform: translateY(0); } }
  .callcard .cmeta { font-size: 10px; letter-spacing: 2px; font-weight: 700; opacity: .7; }
  .callcard .cbody { font-size: 17px; font-weight: 700; margin: 3px 0 10px; }
  .callcard .crow { display: flex; gap: 8px; }
  .callcard .crow button { flex: 1; font: inherit; font-size: 14px; font-weight: 700; padding: 10px;
    border-radius: 10px; cursor: pointer; }
  .callcard .answer { background: #1d2415; color: #cfe0c8; border: 0; }
  .callcard .dismiss { background: rgba(20,28,12,.12); color: #1d2415; border: 1px solid rgba(20,28,12,.35); }

  /* ===== витрина (дизайн v6.1) ===== */
  /* margin:auto по вертикали — центр на длинных экранах, обычный скролл на коротких */
  .hero { text-align: center; margin: auto 0; padding: 6px 0 20px; }
  .stagechip { font-size: 9.5px; letter-spacing: 3px; color: #4e5a45; font-weight: 700; margin: 0 0 14px; }

  /* герой: сам пейджер. Префикс v- — у приложения свои .device/.glass, их не трогаем */
  .vdev { margin: 0 auto 22px; width: 100%; max-width: 312px;
    background: linear-gradient(180deg, #262e20, #171d13);
    border: 1px solid #333d29; border-radius: 24px; padding: 11px;
    box-shadow: 0 18px 44px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06); }
  .vbrand { display: flex; justify-content: space-between; align-items: center;
    font-size: 8px; letter-spacing: 2.5px; color: #5d6b52; font-weight: 700; padding: 0 3px 8px; }
  .vbrand-mark { display: flex; align-items: center; gap: 6px; }
  .vbrand-logo { width: 15px; height: 15px; color: #89afa8; flex: none; }
  .vbrand i { width: 5px; height: 5px; border-radius: 50%; background: #9fb47f;
    box-shadow: 0 0 7px #9fb47f; animation: vblink 2.4s ease-in-out infinite; }
  @keyframes vblink { 0%,72%,100% { opacity: 1 } 80%,92% { opacity: .25 } }
  .vglass { position: relative; border-radius: 12px; overflow: hidden;
    background: linear-gradient(165deg, #b3c791, #9cb27a 58%, #92a771);
    color: #1d2415; padding: 11px 13px 13px;
    box-shadow: inset 0 4px 12px rgba(20,28,12,.45), inset 0 -1px 3px rgba(255,255,255,.3); }
  .vglass::after { content: ''; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(20,28,12,.055) 0 1px, transparent 1px 3px); }
  .vtop { display: flex; justify-content: space-between; align-items: baseline;
    font-size: 8.5px; letter-spacing: 2px; font-weight: 700; opacity: .72; }
  .vnum { font-size: 44px; font-weight: 800; letter-spacing: 9px; text-indent: 9px;
    text-align: center; margin: 5px 0 1px; white-space: nowrap; text-shadow: 0 1px 0 rgba(255,255,255,.2); }
  .vnum.dim { opacity: .3; font-size: 34px; letter-spacing: 7px; }
  .vsub { text-align: center; font-size: 8.5px; letter-spacing: 2.5px; opacity: .6; font-weight: 700; }
  .vline { border-top: 1px dashed rgba(20,28,12,.32); margin-top: 9px; padding-top: 9px; min-height: 42px; }
  .vline small { display: block; font-size: 8.5px; letter-spacing: 2px; font-weight: 700; opacity: .65; margin-bottom: 4px; }
  .vline p { font-size: 13.5px; line-height: 1.4; font-weight: 600; min-height: 19px; }
  .vcur { display: inline-block; width: 6px; height: 14px; vertical-align: -2px;
    background: #1d2415; margin-left: 2px; animation: vcurb .9s steps(1) infinite; }
  @keyframes vcurb { 50% { opacity: 0 } }
  .vkeys { display: flex; gap: 6px; justify-content: center; margin-top: 9px; }
  .vkeys i { width: 30px; height: 6px; border-radius: 4px; background: #10140e;
    border: 1px solid #333d29; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
  .vkeys i.wide { width: 52px; }

  .undercta { font-size: 11.5px; line-height: 1.5; color: #5d6b52; margin-top: 11px; }
  .undercta a { color: #7f9463; text-decoration: underline dotted; display: inline-block; margin-top: 4px; }
  .wraptext { font-size: 13px; line-height: 1.55; color: #7f8c75; max-width: 330px; margin: 0 auto;
    font-family: -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif; }
  .linkrow { display: flex; gap: 8px; margin-top: 12px; }
  .linkrow .lnk { flex: 1; display: flex; align-items: center; justify-content: center;
    background: #10140e; border: 1px solid #232a20; border-radius: 13px; font-size: 13px;
    letter-spacing: .5px; color: #a9b59e; padding: 13px 6px; user-select: all; -webkit-user-select: all; }
  .linkrow button { font: inherit; font-size: 11.5px; letter-spacing: 1px; background: #171d13; color: #9fb47f;
    border: 1px solid #333d29; border-radius: 13px; padding: 13px 14px; cursor: pointer; }
  /* видимый канал сообщений там, где composer скрыт (витрина, экран обёртки) */
  .toast { position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 80; max-width: 340px;
    background: #1c2317; border: 1px solid #46543f; border-radius: 12px;
    padding: 11px 16px; font-size: 13px; line-height: 1.4; color: #cfe0c8; text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,.55); }
  /* единственное яркое пятно на экране — действие */
  .installBanner { display: block; width: 100%; font: inherit; font-size: 14.5px; font-weight: 700;
    letter-spacing: 2px; cursor: pointer; text-align: center; text-decoration: none; box-sizing: border-box;
    background: linear-gradient(180deg, #a8bd86, #90a76e); color: #131a0e;
    border: 0; border-radius: 15px; padding: 16px; margin: 22px 0 0;
    box-shadow: 0 8px 26px rgba(159,180,127,.22), inset 0 1px 0 rgba(255,255,255,.35); }
  .installBanner:active { transform: translateY(1px); }
  .installBanner:disabled { opacity: .55; }
  /* статусы установки — длинные фразы: капсовый разрядкой моно их распирает на 3 строки */
  .installBanner.note { font-size: 12.5px; font-weight: 600; letter-spacing: 0; padding: 13px;
    font-family: -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif; }
  .installBanner.busy { animation: instblink 1.2s ease-in-out infinite; }
  /* 0%/100% заданы явно: иначе крайние кадры берут opacity от :disabled и мигание пропадает */
  @keyframes instblink { 0%,100% { opacity: 1 } 50% { opacity: .5 } }
  /* режим обёртки: из витрины остаётся только выход наружу
     (.wrapstep — подсказка самой обёртки, её прятать нельзя: без неё тупик) */
  .hero.wrapped .tagline, .hero.wrapped .steps:not(.wrapstep),
  .hero.wrapped .undercta:not(.wrapstep), .hero.wrapped button.installBanner { display: none; }
  .undercta.wrapstep { max-width: 330px; margin-left: auto; margin-right: auto; }
  #wrapIc { font-size: 15px; }
  .hero h1 { font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -.2px;
    color: #e2ead9; margin-bottom: 9px;
    font-family: -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif; }
  .tagline { font-size: 13px; line-height: 1.55; color: #7f8c75; max-width: 330px; margin: 0 auto; }
  .tagline + .tagline { margin-top: 8px; }
  .tagline b { color: #9fb47f; font-weight: 600; }
  /* блок шагов стоит на центральной оси страницы, строки внутри ровные:
     центровка каждой строки рассыпала бы колонку иконок */
  .steps { display: flex; flex-direction: column; max-width: 292px; margin: 20px auto 0; text-align: left; }
  .step { display: flex; gap: 13px; align-items: center; font-size: 12.5px; line-height: 1.45;
    color: #9aa791; padding: 11px 2px; border-top: 1px solid #1a2016; }
  .steps .step:last-child { border-bottom: 1px solid #1a2016; }
  .step .ic { flex: none; width: 26px; height: 26px; color: #9fb47f;
    display: flex; align-items: center; justify-content: center; }
  .step .ic svg { width: 23px; height: 23px; }
  .step span i { color: #d7e0d4; font-style: normal; }

  /* низкие экраны (SE, 8, mini): поджимаем витрину ровно настолько, чтобы влезла без скролла */
  @media (max-height: 730px) {
    .vdev { max-width: 300px; margin-bottom: 16px; }
    .vnum { font-size: 38px; letter-spacing: 7px; text-indent: 7px; }
    .vline { min-height: 38px; margin-top: 8px; padding-top: 8px; }
    .vline p { font-size: 12.5px; }
    .hero h1 { font-size: 20px; }
    .tagline { font-size: 12.5px; }
    .steps { margin-top: 14px; }
    .step { padding: 9px 2px; font-size: 12px; }
    .installBanner { margin-top: 16px; padding: 14px; }
  }

  .hidden { display: none !important; }
