/* Дизайн «Ночь, светлая палитра»: белый фон, Manrope, салатовый акцент заливкой */
:root {
  --bg: #FFFFFF; --ink: #0B0F14; --muted: #475569; --muted-2: #64748B; --line: #E2E8F0;
  --soft: #F1F5F9; --softer: #F8FAFC; --off: #94A3B8;
  --lime: #C6F432; --lime-hover: #B5E61D; --on-accent: #0B0F14; --green: #3F6212; --dot: #65A30D;
  --pending: #F5B400; --pending-soft: #FEF3C7; --pending-ink: #713F12;
  --danger: #B42318; --danger-soft: #FEE4E2; --ok: #15803D; --ok-soft: #DCFCE7;
  --radius: 16px;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
a { color: var(--green); }
button { font: inherit; cursor: pointer; border: 0; border-radius: 14px; padding: 10px 16px; color: inherit; background: none; }
button:disabled { cursor: default; }
input, textarea { font: inherit; color: var(--ink); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--dot); outline-offset: 2px; }

/* кнопки */
.btn-lime { background: var(--lime); color: var(--on-accent); font-weight: 800; }
.btn-lime:hover:not(:disabled) { background: var(--lime-hover); }
.btn-dark { background: var(--ink); color: #fff; font-weight: 700; }
.btn-soft { background: var(--soft); color: var(--ink); font-weight: 700; }
.btn-ghost { background: transparent; color: var(--muted); font-weight: 600; }
.btn-ghost:hover { background: var(--soft); color: var(--ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.btn-ok { background: var(--ink); color: #fff; font-weight: 700; }
.btn-sm { padding: 8px 12px; font-size: 14px; border-radius: 12px; }
.icon-btn { width: 44px; height: 44px; padding: 0; border-radius: 12px; background: var(--soft); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:disabled { opacity: .4; }

/* каркас */
.page { max-width: 1040px; margin: 0 auto; padding: 0 20px 140px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 0 0; min-height: 44px; }
.topbar .me { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); min-width: 0; }
.mini-avatar { width: 32px; height: 32px; border-radius: 10px; background: var(--soft); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; overflow: hidden; flex-shrink: 0; }
.mini-avatar img, .owner-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar .actions { display: flex; gap: 6px; align-items: center; }

.hero { padding: 18px 0 4px; display: flex; flex-direction: column; gap: 12px; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--green); letter-spacing: .08em; text-transform: uppercase; }
.owner { display: flex; align-items: center; gap: 14px; }
.owner-avatar { width: 52px; height: 52px; border-radius: 16px; background: var(--lime); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; font-size: 18px; flex-shrink: 0; overflow: hidden; }
.owner h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.owner .sub { font-size: 14px; color: var(--muted); font-weight: 500; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.col { min-width: 0; }

/* неделя-слайдер */
.week-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 10px; }
.week-head b { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.week-head .arrows { display: flex; gap: 6px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; touch-action: pan-y; }
.wd { height: 72px; padding: 0; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; position: relative; }
.wd .dw { font-size: 12px; font-weight: 600; color: var(--muted); }
.wd .n { font-size: 19px; font-weight: 800; }
.wd .d { width: 5px; height: 5px; border-radius: 3px; }
.wd.has .d { background: var(--dot); }
.wd.pend .d { background: var(--pending); width: 7px; height: 7px; border-radius: 4px; }
.wd.sel { background: var(--lime); border-color: var(--lime); color: var(--on-accent); }
.wd.sel .dw { color: var(--on-accent); font-weight: 700; }
.wd.sel.has .d { background: var(--on-accent); }
.wd.off { border-color: transparent; background: var(--softer); color: var(--off); }
.wd.off .dw { color: var(--off); }
.wd.today::after { content: "сегодня"; position: absolute; top: -9px; font-size: 9px; font-weight: 700; color: var(--green); background: var(--bg); padding: 0 4px; letter-spacing: .02em; }

/* день и список слотов */
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 22px 0 10px; }
.day-head h2 { margin: 0; font-size: 17px; font-weight: 800; }
.pill { font-size: 13px; font-weight: 700; color: #334155; background: var(--soft); padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.slot-list { display: flex; flex-direction: column; gap: 8px; }
.slot { width: 100%; min-height: 54px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 16px; text-align: left; }
.slot .t { font-size: 17px; font-weight: 700; }
.slot .t span { font-weight: 500; color: var(--muted-2); }
.slot .radio { width: 22px; height: 22px; border-radius: 11px; border: 2px solid #CBD5E1; flex-shrink: 0; }
.slot:hover:not(:disabled):not(.picked):not(.pending):not(.busy) { border-color: #94A3B8; }
.slot.picked { background: var(--lime); border-color: var(--lime); color: var(--on-accent); }
.slot.picked .t span { color: var(--on-accent); font-weight: 600; opacity: .85; }
.slot .side { font-size: 13px; font-weight: 700; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* вид владельца */
.slot.busy { background: var(--softer); border-color: var(--softer); }
.slot.busy .side { color: var(--muted); font-weight: 600; }
.slot.pending { background: var(--pending-soft); border-color: var(--pending); }
.slot.pending .side { color: var(--pending-ink); }
.slot.blocked { background: transparent; border-style: dashed; color: var(--muted-2); }
.slot.blocked .t, .slot.blocked .t span { color: var(--muted-2); text-decoration: line-through; }
.slot.free-admin .side { color: var(--muted-2); font-weight: 600; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); font-size: 15px; font-weight: 500; border: 1px dashed #CBD5E1; border-radius: 16px; }
.day-tools { margin-top: 12px; }

/* нижняя панель с кнопкой */
.cta-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--bg); border-top: 1px solid #EEF2F6; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
.cta-bar .inner { max-width: 1040px; margin: 0 auto; }
.cta-bar button { width: 100%; height: 56px; border-radius: 16px; font-size: 17px; }
.cta-bar button:disabled { background: var(--soft); color: var(--muted-2); font-weight: 700; }
.cta-bar .tz { margin-top: 8px; text-align: center; font-size: 12px; color: var(--muted-2); font-weight: 500; }

/* списки встреч */
.section { padding-top: 28px; }
.section h2 { margin: 0 0 10px; font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--pending); color: #2B1F00; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.item { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.item.is-pending { background: var(--pending-soft); border-color: var(--pending); }
.item .when { font-weight: 800; font-size: 16px; }
.item .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.item .meta { font-size: 14px; color: var(--muted); }
.item .acts { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.st { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.st-pending { background: var(--pending-soft); color: var(--pending-ink); border: 1px solid var(--pending); }
.st-ok { background: var(--ok-soft); color: var(--ok); }
.meet-link { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; font-size: 14px; text-decoration: none; word-break: break-all; }
.meet-link:hover { text-decoration: underline; }

/* модальное окно: на телефоне — шторка снизу */
.modal-bg { position: fixed; inset: 0; background: rgba(11,15,20,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.modal { width: 100%; max-width: 480px; background: var(--bg); border-radius: 24px 24px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; }
.modal::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: #D4D8E0; margin: 0 auto 14px; }
.modal h3 { margin: 0 0 4px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.modal .lead { color: var(--muted); font-weight: 600; }
.field-label { display: block; margin-top: 16px; font-size: 13px; font-weight: 700; }
.modal input, .modal textarea { width: 100%; margin-top: 6px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 16px; }
.modal input:focus, .modal textarea:focus { outline: none; border-color: var(--ink); }
.modal textarea { min-height: 76px; resize: vertical; }
.modal .actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.modal .actions button { flex: 1 1 140px; height: 52px; }
.note-pending { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--pending-soft); color: var(--pending-ink); font-size: 14px; font-weight: 600; }
.req { color: var(--danger); }
.share-row { display: flex; gap: 8px; margin-top: 16px; }
.share-row input { flex: 1; min-width: 0; margin: 0; }
.share-row button { flex: 0 0 auto !important; }
.share-more { display: flex; gap: 18px; margin-top: 12px; font-size: 14px; font-weight: 700; flex-wrap: wrap; }
.share-more a { text-decoration: none; }

.toast { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 30; font-size: 14px; font-weight: 600; max-width: calc(100% - 32px); text-align: center; }

/* страница статуса / результат */
.done { max-width: 480px; margin: 24px auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.done .badge-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 6px; }
.done .badge-ic.pending { background: var(--pending-soft); color: var(--pending-ink); }
.done .badge-ic.ok { background: var(--lime); color: var(--on-accent); }
.done .badge-ic.neutral { background: var(--soft); color: var(--muted); }
.done h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.done .when { font-size: 18px; font-weight: 800; margin-top: 8px; }
.done .save { width: 100%; margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--soft); font-size: 14px; text-align: left; font-weight: 600; }
.done .save input { width: 100%; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; background: var(--bg); }
.done .acts { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; justify-content: center; }

/* вход */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 20px; }
.login { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 10px; }
.login h1 { margin: 6px 0 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.tg-btn { width: 100%; height: 56px; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--lime); color: var(--on-accent); font-weight: 800; font-size: 17px; margin-top: 18px; border-radius: 16px; }
.tg-btn:disabled { background: var(--soft); color: var(--muted-2); }
.tg-btn svg { width: 22px; height: 22px; }
.divider { margin: 18px 0 6px; font-size: 13px; color: var(--muted-2); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.waiting { margin-top: 8px; padding: 14px; background: var(--soft); border-radius: 14px; font-size: 14px; font-weight: 500; }
.error { margin-top: 10px; color: var(--danger); font-size: 14px; font-weight: 600; }
.dev { display: flex; gap: 8px; }
.dev input { flex: 1; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 16px; }

/* планшет и шире: неделя и список рядом */
@media (min-width: 768px) {
  .page { padding: 0 32px 48px; }
  .hero { padding-top: 28px; }
  .owner h1 { font-size: 30px; }
  .owner-avatar { width: 60px; height: 60px; font-size: 20px; }
  .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .layout .col-right { position: sticky; top: 16px; }
  .wd { height: 80px; }
  .cta-bar { position: sticky; bottom: 16px; border: 0; padding: 0; margin-top: 14px; background: transparent; }
  .cta-bar .inner { max-width: none; }
  .modal-bg { align-items: center; padding: 24px; }
  .modal { border-radius: 24px; padding: 24px; }
  .modal::before { display: none; }
  .toast { bottom: 32px; }
}
@media (min-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; }
}

/* профиль */
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 700; color: var(--ink); text-decoration: none; }
a.me { text-decoration: none; border-radius: 12px; padding: 4px 8px 4px 4px; margin-left: -4px; }
a.me:hover { background: var(--soft); color: var(--ink); }
a.me .chev { color: var(--off); }
.sec { border: 1px solid var(--line); border-radius: 20px; padding: 18px; margin: 16px 0 0; min-width: 0; }
fieldset.sec { display: flex; flex-direction: column; gap: 8px; }
.sec legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; }
.sec h2 { margin: 0; font-size: 17px; font-weight: 800; }
.sec .hint { font-size: 14px; color: var(--muted); margin-top: 4px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch { position: relative; flex-shrink: 0; width: 56px; height: 34px; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: 17px; background: #CBD5E1; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .track { background: var(--lime); }
.switch input:checked + .track::after { transform: translateX(22px); background: var(--on-accent); }
.switch input:focus-visible + .track { outline: 3px solid var(--dot); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.opt input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 0; border-radius: 11px; border: 2px solid #CBD5E1; flex-shrink: 0; display: grid; place-items: center; cursor: pointer; }
.opt input:checked { border: 7px solid var(--on-accent); }
.opt:has(input:checked) { background: var(--lime); border-color: var(--lime); color: var(--on-accent); }
.opt:has(input:focus-visible) { outline: 3px solid var(--dot); outline-offset: 2px; }
.opt-body { display: flex; flex-direction: column; }
.opt-body b { font-size: 16px; font-weight: 800; }
.opt-body span { font-size: 13px; color: var(--muted); font-weight: 600; }
.opt:has(input:checked) .opt-body span { color: var(--on-accent); opacity: .8; }
.day-chips { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.chip { height: 48px; padding: 0; border: 1px solid var(--line); border-radius: 12px; font-weight: 800; font-size: 14px; background: var(--bg); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.time-row { display: flex; align-items: flex-end; gap: 10px; }
.time-field { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.time-field select { height: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font: inherit; font-size: 18px; font-weight: 800; color: var(--ink); appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.time-row .dash { padding-bottom: 14px; color: var(--off); font-weight: 800; }
.preview { margin-top: 4px; padding: 12px 14px; border-radius: 12px; background: var(--soft); font-size: 14px; font-weight: 700; }
.preview .bad { color: var(--danger); }
form.is-closed #rulesDays, form.is-closed #rulesTime { opacity: .5; }
.btn-block { display: flex; align-items: center; justify-content: center; height: 52px; border-radius: 14px; text-decoration: none; }
.closed-note { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--soft); font-weight: 600; font-size: 14px; }
.closed-note a { font-weight: 800; }
/* профиль: на планшете и компьютере — две колонки, ширина как у календаря */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 32px; }
.profile-grid .span-all { grid-column: 1 / -1; }
@media (min-width: 768px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .profile-grid .cta-bar { position: sticky; bottom: 16px; margin-top: 20px; }
}
@media (min-width: 1024px) { .profile-grid { gap: 0 48px; } }

/* выбор основного цвета */
.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.swatch { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; font-weight: 700; font-size: 14px; }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch .sw { width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); display: grid; place-items: center; }
.swatch .sw svg { opacity: 0; }
.swatch:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.swatch:has(input:checked) .sw svg { opacity: 1; }
.swatch:has(input:focus-visible) { outline: 3px solid var(--dot); outline-offset: 2px; }

/* ссылка на встречу — кнопка */
.join { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; min-height: 40px; padding: 8px 14px; border-radius: 12px; background: var(--soft); color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; max-width: 100%; }
.join:hover { background: #E2E8F0; }
.join .url { font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.item.is-pending .join { background: rgba(255,255,255,.7); }
.topbar .me span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .actions button { white-space: nowrap; }
@media (max-width: 520px) { .wide-only { display: none; } .topbar .me span { max-width: 38vw; } }

/* основной цвет (выбирается в профиле) */
[data-accent="pink"]   { --lime: #F9A8D4; --lime-hover: #F48DC4; --on-accent: #0B0F14; --green: #9D174D; --dot: #DB2777; }
[data-accent="blue"]   { --lime: #7DD3FC; --lime-hover: #5CC6F8; --on-accent: #0B0F14; --green: #0369A1; --dot: #0284C7; }
[data-accent="black"]  { --lime: #0B0F14; --lime-hover: #1F2937; --on-accent: #FFFFFF; --green: #0B0F14; --dot: #0B0F14; }
[data-accent="purple"] { --lime: #7C3AED; --lime-hover: #6D28D9; --on-accent: #FFFFFF; --green: #6D28D9; --dot: #7C3AED; }
[data-accent="red"]    { --lime: #DC2626; --lime-hover: #B91C1C; --on-accent: #FFFFFF; --green: #B91C1C; --dot: #DC2626; }

/* стартовая страница: логотип и название */
.brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin-bottom: 18px; }
.brand-logo { width: 72px; height: 72px; display: block; margin-bottom: 8px; }
.brand-name { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.brand-tagline { margin: 0; font-size: 15px; color: var(--muted); font-weight: 600; max-width: 280px; }
.login-card { border: 1px solid var(--line); border-radius: 20px; padding: 16px; }
.owner .owner-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
@media (min-width: 768px) { .brand-logo { width: 88px; height: 88px; } .brand-name { font-size: 40px; } .brand-tagline { max-width: none; } }

/* встреча идёт сейчас */
.item.is-live { border: 2px solid var(--lime); gap: 8px; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 99px; background: var(--lime); color: var(--on-accent); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.pulse { width: 8px; height: 8px; border-radius: 4px; background: currentColor; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.join.join-primary { background: var(--lime); color: var(--on-accent); min-height: 48px; padding: 10px 16px; font-size: 15px; }
.join.join-primary:hover { background: var(--lime-hover); }
.join.join-primary .url { color: inherit; opacity: .75; }
.item.onboarding { background: var(--soft); border-color: var(--soft); }
.item .acts a { display: inline-flex; align-items: center; }
.text-input { width: 100%; margin-top: 6px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 16px; font-weight: 600; }
.text-input:focus { outline: none; border-color: var(--ink); }
.sec .share-row { margin-top: 12px; }
.sec .share-row .text-input { margin: 0; font-weight: 500; font-size: 14px; }
.features { list-style: none; margin: 0 0 6px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--muted); }
.features li { display: flex; gap: 10px; align-items: flex-start; }
.features li::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--lime); flex-shrink: 0; margin-top: 7px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.features b { color: var(--ink); }

/* история и особые строки дня */
.wd.past:not(.off):not(.sel) { background: var(--softer); }
.slot.past-meet { background: var(--softer); border-color: var(--softer); }
.slot.past-meet .t, .slot.past-meet .t span, .slot.past-meet .side { color: var(--muted-2); }
.slot.outgoing { border-style: dashed; border-color: #94A3B8; }
.slot.outgoing .side { color: var(--ink); }
.slot.break { background: repeating-linear-gradient(135deg, var(--bg) 0 8px, var(--softer) 8px 16px); border-style: dashed; color: var(--muted-2); cursor: default; }
.slot.break .t, .slot.break .t span { color: var(--muted-2); }
.slot.break .side { color: var(--muted-2); font-weight: 600; }
.date-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.date-field input { height: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 17px; font-weight: 800; background: var(--bg); color: var(--ink); }
.break-row { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.break-row .hint { font-size: 13px; color: var(--muted); padding-left: 34px; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 4px; background: var(--soft); border-radius: 14px; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-opt span { display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 10px; font-weight: 800; cursor: pointer; color: var(--muted); }
.seg-opt input:checked + span { background: var(--lime); color: var(--on-accent); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--dot); outline-offset: 2px; }
#durationSec .hint { font-size: 13px; color: var(--muted); }
form.is-closed #durationSec { opacity: .5; }
.brand-mini { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand-mini img { width: 32px; height: 32px; display: block; }
.auth-btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; min-height: 40px; }

/* имя и подпись правятся прямо в шапке профиля */
.owner-edit { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; flex: 1; }
.inline-edit { position: relative; display: inline-flex; align-items: center; min-width: 0; max-width: 100%; margin: 0; }
.inline-edit input { font: inherit; color: inherit; letter-spacing: inherit; width: 100%; min-width: 0; margin: 0; position: relative; left: -9px; padding: 2px 34px 2px 8px;
  border: 1px solid transparent; border-radius: 10px; background: transparent; text-overflow: ellipsis; }
.inline-edit input:hover { background: var(--soft); }
.inline-edit input:focus { outline: none; border-color: var(--ink); background: var(--bg); }
.inline-edit input::placeholder { color: var(--off); font-weight: 500; }
.inline-edit .pencil { position: absolute; right: 19px; color: var(--off); pointer-events: none; }
.inline-edit input:focus ~ .pencil { display: none; }
.name-edit { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.name-edit input { height: 40px; }
.sub-edit { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.sub-edit #durPrefix { white-space: nowrap; flex-shrink: 0; }
.note-edit { flex: 1; font-size: 14px; font-weight: 500; color: var(--muted); }
.note-edit input { height: 32px; left: -4px; padding-left: 4px; }
.note-edit .pencil { width: 15px; height: 15px; right: 14px; }
.inline-edit input { max-width: 100%; }
.note-edit { min-width: 0; }
.note-edit { flex: 0 1 auto; }
@media (min-width: 768px) { .name-edit { font-size: 30px; } .name-edit input { height: 46px; } }

/* профиль: «Сохранить» в шапке, шапка прилипает при прокрутке */
.topbar-sticky { position: sticky; top: 0; z-index: 15; background: var(--bg); margin: 0 -20px; padding: 10px 20px; min-height: 64px; box-shadow: 0 1px 0 transparent; transition: box-shadow .15s; }
.topbar-sticky.scrolled { box-shadow: 0 1px 0 var(--line); }
.btn-dark:disabled { background: var(--soft); color: var(--muted-2); }
.btn-dark:hover:not(:disabled) { background: #1F2937; }
.tz-hint { font-size: 12px; color: var(--muted-2); font-weight: 500; margin-top: 2px; }
@media (min-width: 768px) { .topbar-sticky { margin: 0 -32px; padding: 12px 32px; } }
@media (max-width: 520px) { .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.btn-lime:disabled { background: var(--soft); color: var(--muted-2); font-weight: 700; }

/* автосохранение профиля */
.save-state { font-size: 13px; font-weight: 700; color: var(--muted-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.save-state.saving::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--off); animation: pulse 1s ease-in-out infinite; }
.save-state.ok { color: var(--ok); }
.save-state.ok::before { content: "✓"; font-weight: 800; }
.save-state.bad, .save-state.err { color: var(--danger); white-space: normal; text-align: right; max-width: 46vw; }
@media (max-width: 520px) { .save-state { font-size: 12px; } }

/* подписка на календарь */
.ics-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.ics-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 14px; text-decoration: none; font-weight: 800; font-size: 15px; text-align: center; }
.ics-btn:hover { background: #E2E8F0; }
.link-btn { padding: 8px 0 0; background: none; border: 0; color: var(--muted); font-weight: 600; font-size: 13px; text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--ink); }
#icsSec .hint { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* статус «подтверждена» — основным цветом */
.st-ok { background: var(--lime); color: var(--on-accent); }

/* публичная страница записи: на любом экране — одна колонка, как на телефоне */
.single .page { max-width: 560px; padding: 0 20px 150px; }
.single .layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.single .layout .col-right { position: static; }
.single .owner h1 { font-size: 24px; }
.single .owner-avatar { width: 52px; height: 52px; font-size: 18px; }
.single .wd { height: 72px; }
.single .cta-bar { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; border-top: 1px solid #EEF2F6; background: var(--bg); padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
.single .cta-bar .inner { max-width: 520px; margin: 0 auto; }
.single .hero { padding-top: 18px; }

/* ===== Стартовая страница (вариант «Переписка», зелёный) — один экран без прокрутки ===== */
.landing { background: #F5FBEA; }
.ld { min-height: 100vh; min-height: 100dvh; box-sizing: border-box; display: flex; flex-direction: column; padding: 32px clamp(20px, 5vw, 72px) 28px;
  font-family: 'Onest', 'Manrope', system-ui, sans-serif; color: #0B0F14; max-width: 1440px; margin: 0 auto; }
.ld-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ld-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #0B0F14; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.ld-brand img { display: block; }
.ld-head-login { font-weight: 700; font-size: 15px; color: #FFFFFF; padding: 10px 18px; border-radius: 12px; background: #0B0F14; }
.ld-head-login:hover:not(:disabled) { background: #1F2937; }
.ld-main { flex-grow: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 56px; padding: 32px 0; }
.ld-text { flex: 1 1 440px; max-width: 580px; display: flex; flex-direction: column; gap: 22px; }
.ld-badge { align-self: flex-start; font-size: 14px; font-weight: 700; color: #33500C; background: #E6F7BE; padding: 7px 14px; border-radius: 99px; }
.ld-text h1 { margin: 0; font-size: clamp(40px, 5.6vw, 78px); line-height: 1; font-weight: 800; letter-spacing: -.04em; }
.ld-text h1 span { color: #4D7C0F; }
.ld-lead { margin: 0; font-size: 20px; line-height: 1.5; color: #3F4A3C; max-width: 500px; }
.ld-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 6px; }
.ld-tg { height: 60px; padding: 0 28px; border-radius: 30px; background: #C6F432; color: #0B0F14; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 24px rgba(101,140,10,.28); }
.ld-tg:hover:not(:disabled) { background: #B5E61D; }
.ld-tg:disabled, .ld-head-login:disabled { opacity: .55; box-shadow: none; }
.ld-note { font-size: 15px; color: #525C4E; font-weight: 600; }
.ld-box { padding: 14px 16px; border-radius: 16px; background: #FFFFFF; font-size: 15px; line-height: 1.5; color: #3F4A3C; display: flex; flex-direction: column; gap: 2px; max-width: 480px; }
.ld-box a { color: #33500C; font-weight: 700; }
.ld-muted { color: #6B7567; font-size: 14px; }
.ld-err { color: var(--danger); font-weight: 600; font-size: 14px; }
.ld-alt { display: flex; flex-direction: column; gap: 8px; }
.ld-dev { display: flex; gap: 8px; max-width: 420px; }
.ld-dev input { flex: 1; min-width: 0; padding: 12px; border: 1px solid #DCE6CF; border-radius: 12px; font: inherit; font-size: 15px; background: #FFFFFF; }

.ld-chat { flex: 0 1 470px; max-width: 470px; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.ld-bubble { max-width: 78%; padding: 14px 18px; font-size: 17px; line-height: 1.4; background: #FFFFFF; box-shadow: 0 1px 2px rgba(51,80,12,.08); box-sizing: border-box; }
.ld-in { align-self: flex-start; border-radius: 22px 22px 22px 6px; }
.ld-out { align-self: flex-end; border-radius: 22px 22px 6px 22px; }
.ld-old { color: #959E91; text-decoration: line-through; }
.ld-link { max-width: 86%; background: #C6F432; color: #0B0F14; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; box-shadow: 0 12px 28px rgba(101,140,10,.25); }
.ld-url { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.6); font-weight: 700; }
.ld-request { width: 86%; max-width: 86%; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ld-req-label { font-size: 14px; font-weight: 700; color: #525C4E; }
.ld-req-when { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.ld-req-who { font-size: 15px; color: #3F4A3C; }
.ld-req-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ld-req-acts span { display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 12px; font-weight: 700; font-size: 15px; }
.ld-ok { background: #C6F432; color: #0B0F14; }
.ld-no { background: #EEF6DD; color: #33500C; }
.ld-foot { display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 14px; font-weight: 600; color: #525C4E; }

/* ноутбуки с невысоким экраном — всё ужимаем, чтобы не было прокрутки */
@media (min-width: 900px) and (max-height: 800px) {
  .ld { padding-top: 22px; padding-bottom: 20px; }
  .ld-main { padding: 16px 0; gap: 40px; }
  .ld-text { gap: 16px; }
  .ld-text h1 { font-size: clamp(38px, 4.8vw, 64px); }
  .ld-lead { font-size: 18px; }
  .ld-chat { gap: 9px; }
  .ld-bubble { padding: 11px 16px; font-size: 16px; }
  .ld-req-when { font-size: 20px; }
}
/* планшет: иллюстрация компактнее, под текстом */
@media (max-width: 899px) {
  .ld-main { justify-content: center; gap: 28px; padding: 20px 0; }
  .ld-text { max-width: 640px; }
  .ld-chat { max-width: 520px; }
}
/* телефон: один экран — только главное */
@media (max-width: 640px) {
  .ld { padding: 18px 20px calc(18px + env(safe-area-inset-bottom)); }
  .ld-main { align-items: flex-start; align-content: center; padding: 12px 0; }
  .ld-text { gap: 16px; }
  .ld-text h1 { font-size: 40px; }
  .ld-lead { font-size: 17px; }
  .ld-cta { flex-direction: column; align-items: stretch; gap: 10px; }
  .ld-tg { justify-content: center; width: 100%; }
  .ld-note { text-align: center; }
  .ld-chat { gap: 8px; }
  .ld-old { display: none; }
  .ld-bubble { font-size: 15px; padding: 10px 14px; }
  .ld-request { display: none; }
  .ld-foot { display: none; }
}
@media (max-width: 640px) and (max-height: 740px) {
  .ld-chat { display: none; }
  .ld-text h1 { font-size: 34px; }
  .ld-text { gap: 12px; }
  .ld-badge { font-size: 12px; }
}
@media (max-width: 640px) { .ld-badge { font-size: 13px; } }
