/* SMM-студия Вечернего — тёмная «вечерняя» тема */
:root {
  --bg: #100e19;
  --bg-2: #161322;
  --panel: #1b1829;
  --panel-2: #221e33;
  --field: #13111d;
  --ink: #f1edf8;
  --muted: #9b94b0;
  --dim: #6c6582;
  --line: #2d2842;
  --line-2: #3a3453;
  --pink: #ff5f8f;
  --peach: #ffb36b;
  --violet: #9b6bff;
  --dusk: linear-gradient(120deg, #ffb36b 0%, #ff5f8f 48%, #9b6bff 100%);
  --pink-soft: rgba(255, 95, 143, .12);
  --ok: #8fdc6a;
  --warn: #ff8c8c;
  --warn-soft: rgba(255, 110, 110, .1);
  --radius: 18px;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  font-family: "Onest", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(155, 107, 255, .16), transparent 60%),
    radial-gradient(700px 420px at 5% -5%, rgba(255, 140, 110, .12), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(255, 95, 143, .35); }

/* ---------- шапка ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 28px; position: sticky; top: 0; z-index: 5;
  background: rgba(16, 14, 25, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; }
.moon { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 0 14px rgba(255, 95, 143, .45)); }
.brand h1 { margin: 0; font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.brand h1 em {
  font-style: normal; background: var(--dusk); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }

.tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 14px; border: 1px solid var(--line); }
.tab {
  border: 0; background: transparent; padding: 9px 18px; border-radius: 10px; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--muted); transition: color .15s, background .15s;
}
.tab small { font-size: 11px; font-weight: 500; opacity: .7; margin-left: 4px; }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2), 0 4px 14px rgba(0, 0, 0, .3); }

/* ---------- раскладка ---------- */
.tab-panel { display: none; }
.tab-panel.active { display: grid; }
#tab-media { grid-template-columns: 300px minmax(0, 1fr) 310px; gap: 22px; padding: 24px 28px; align-items: start; }
#tab-texts, #tab-team { grid-template-columns: minmax(320px, 460px) minmax(0, 1fr); gap: 22px; padding: 24px 28px; align-items: start; }

.side, .gen-form, .gen-results {
  background: linear-gradient(180deg, var(--panel), #18152499);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, .8);
}
.side { position: sticky; top: 96px; }
.side section + section { margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--line); }
.side[hidden] { display: none; }
h2 {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font-family: var(--display); font-size: 13px; font-weight: 500; letter-spacing: .02em; color: var(--ink);
}
h2 b {
  font-family: "Onest", sans-serif; font-size: 11px; font-weight: 700; color: var(--pink);
  padding: 3px 7px; border-radius: 6px; background: var(--pink-soft); letter-spacing: .04em;
}

/* ---------- форматы ---------- */
.formats { display: grid; gap: 6px; }
.fmt {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 9px 11px; cursor: pointer;
  border: 1px solid var(--line); background: var(--field); border-radius: 12px; transition: .15s;
}
.fmt:hover { border-color: var(--line-2); background: var(--panel-2); }
.fmt.active { border-color: transparent; background: linear-gradient(var(--panel-2), var(--panel-2)) padding-box, var(--dusk) border-box; border: 1px solid transparent; }
.fmt i { display: block; flex: none; border: 1.5px solid var(--dim); border-radius: 4px; max-width: 30px; max-height: 30px; }
.fmt.active i { border-color: var(--pink); box-shadow: 0 0 10px rgba(255, 95, 143, .4); }
.fmt span { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.fmt strong { font-size: 14px; font-weight: 600; }
.fmt small { color: var(--muted); font-size: 12px; }

/* ---------- файлы ---------- */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 12px; cursor: pointer;
  border: 1.5px dashed var(--line-2); border-radius: 14px; text-align: center; color: var(--muted);
  background: var(--field); transition: .15s;
}
.drop svg { width: 26px; height: 26px; color: var(--pink); margin-bottom: 4px; }
.drop strong { color: var(--ink); font-weight: 600; font-size: 14px; }
.drop span { font-size: 12.5px; }
.drop:hover, .drop.over { border-color: var(--pink); background: var(--pink-soft); }

.items { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; max-height: 38vh; overflow: auto; }
.items li { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 11px; cursor: pointer; border: 1px solid transparent; transition: .12s; }
.items li:hover { background: var(--panel-2); }
.items li.active { border-color: var(--line-2); background: var(--panel-2); box-shadow: inset 3px 0 0 var(--pink); }
.items img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; background: var(--field); }
.items span { display: flex; flex-direction: column; min-width: 0; }
.items strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.items small { font-size: 12px; color: var(--muted); }

/* ---------- сцена ---------- */
.stage {
  display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0;
  min-height: calc(100vh - 140px); padding: 26px; border-radius: 24px;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .06) 1px, transparent 0) 0 0 / 22px 22px,
    var(--bg-2);
  border: 1px solid var(--line);
}
#tab-media:has(.props[hidden]) .stage { grid-column: span 2; }
.empty { margin: auto; max-width: 380px; text-align: center; padding: 30px 10px; }
.empty-title {
  font-family: var(--display); font-size: 30px; font-weight: 700; margin: 0 0 14px;
  background: var(--dusk); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.empty p { margin: 6px 0; line-height: 1.5; }
.empty[hidden] { display: none; }
.canvas-wrap { display: flex; justify-content: center; width: 100%; }
.canvas-wrap[hidden], .video-bar[hidden] { display: none; }
#preview {
  max-width: 100%; max-height: calc(100vh - 220px); height: auto; border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 30px 80px -20px rgba(0, 0, 0, .9), 0 0 120px -40px rgba(255, 95, 143, .35);
  cursor: grab; touch-action: none; background: #fff;
}
#preview:active { cursor: grabbing; }
.video-bar {
  display: flex; align-items: center; gap: 12px; padding: 6px 14px 6px 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
}
.video-bar .btn { border-radius: 999px; width: 36px; height: 36px; padding: 0; }
#timeLabel { font-variant-numeric: tabular-nums; font-size: 13px; }

/* ---------- поля ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; font-size: 14px; }
.field > span { font-weight: 600; font-size: 13px; color: var(--ink); }
.field > span em { font-style: normal; font-weight: 400; }
.field.row { flex-direction: row; align-items: center; gap: 10px; margin-bottom: 12px; }
.field.row > span { width: 72px; flex: none; font-weight: 500; color: var(--muted); }
.field.row input[type="number"] { width: 100px; }
.field output { width: 44px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; }
input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--field);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 95, 143, .18); }
textarea { resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%239b94b0' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center; }

input[type="range"] { flex: 1; appearance: none; -webkit-appearance: none; height: 4px; border-radius: 4px; background: var(--line-2); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--pink); box-shadow: 0 0 10px rgba(255, 95, 143, .6); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--pink); }

.check { display: flex; gap: 9px; align-items: center; font-size: 14px; margin: 8px 0; cursor: pointer; color: var(--ink); }
.check input { accent-color: var(--pink); width: 16px; height: 16px; }
.check[hidden], .field[hidden], section[hidden] { display: none; }
.grid2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.seg { flex: 1; display: flex; background: var(--field); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 6px 4px; border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: .12s; }
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2), inset 0 -2px 0 var(--pink); }
#bannerOpts[hidden] { display: none; }
.swatches button { display: grid; place-items: center; padding: 6px 4px; }
.swatches i { display: block; width: 22px; height: 22px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.swatches button.active i { box-shadow: 0 0 0 2px var(--panel-2), 0 0 0 4px #fff; }

/* ---------- кнопки ---------- */
.btn {
  border: 1px solid var(--line-2); background: var(--panel-2); padding: 11px 16px; border-radius: 12px;
  cursor: pointer; font-weight: 600; font-size: 14px; transition: transform .12s, filter .15s, border-color .15s, background .15s;
}
.btn:hover { border-color: #4b4469; background: #29243d; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--dusk); border: 0; color: #1a0f1c; font-weight: 700;
  box-shadow: 0 10px 30px -10px rgba(255, 95, 143, .7);
}
.btn.primary:hover { filter: brightness(1.08) saturate(1.05); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.wide { width: 100%; margin-top: 12px; padding: 14px; font-size: 15px; }
.btn.danger { color: var(--warn); border-color: transparent; }
.btn.danger:hover { background: var(--warn-soft); }
.btn:disabled { opacity: .6; cursor: wait; }
.export { display: grid; gap: 8px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.warn { color: var(--warn); background: var(--warn-soft); padding: 9px 11px; border-radius: 10px; border: 1px solid rgba(255, 110, 110, .2); }
.status { font-size: 13px; padding: 9px 12px; border-radius: 10px; margin: 0 0 16px; border: 1px solid transparent; }
.status.ok { background: rgba(143, 220, 106, .08); color: var(--ok); border-color: rgba(143, 220, 106, .2); }
.status.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(255, 110, 110, .2); }
code { font-size: 12px; background: var(--field); padding: 2px 5px; border-radius: 5px; }

/* ---------- тексты ---------- */
.gen-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.gen-head h2 { margin: 0; font-size: 15px; }
.gen-results { min-height: 300px; }
.results { display: grid; gap: 14px; }
.results > p.muted { margin: 0; line-height: 1.55; }
.result { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 10px; background: var(--bg-2); }
.result header { display: flex; justify-content: space-between; align-items: baseline; }
.result header strong { font-family: var(--display); font-weight: 500; font-size: 13px; }
.result textarea { background: var(--field); }
.result .warn { margin: 0; }
.row-btns { display: flex; gap: 8px; }
.skeleton { height: 170px; border-radius: 14px; background: linear-gradient(90deg, var(--panel), var(--panel-2), var(--panel)); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }

/* ---------- окна ---------- */
dialog { border: 1px solid var(--line-2); border-radius: 20px; padding: 0; width: min(460px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
dialog::backdrop { background: rgba(8, 6, 14, .7); backdrop-filter: blur(4px); }
.dlg { padding: 24px; }
.dlg h2 { font-size: 16px; }
.dlg p { line-height: 1.5; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.busy { position: fixed; inset: 0; background: rgba(8, 6, 14, .7); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 20; }
.busy[hidden] { display: none; }
.busy-box { background: var(--panel); border: 1px solid var(--line-2); border-radius: 20px; padding: 28px 30px; width: min(380px, calc(100vw - 32px)); text-align: center; }
.busy-box p { margin: 10px 0; }
.spinner { width: 40px; height: 40px; margin: 0 auto 8px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--pink); border-right-color: var(--peach); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 6px; background: var(--field); border-radius: 3px; overflow: hidden; }
.bar[hidden] { display: none; }
.done-actions { display: none; gap: 8px; margin-top: 16px; }
.busy.done .done-actions { display: grid; }
.busy.done .spinner, .busy.done .busy-note, .busy.done .bar { display: none; }
#busyBar { height: 100%; background: var(--dusk); transition: width .2s; }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 30; max-width: calc(100vw - 32px);
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--line-2); padding: 12px 18px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.toast[hidden] { display: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

@media (max-width: 1150px) {
  #tab-media { grid-template-columns: 270px minmax(0, 1fr); }
  #tab-media .props { grid-column: 1 / -1; position: static; }
}
/* ---------- профиль и команда ---------- */
.top { gap: 14px; }
.tabs { margin-left: auto; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; transition: border-color .15s;
}
.user-chip:hover { border-color: var(--line-2); }
.user-chip[hidden] { display: none; }
.avatar {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--dusk); color: #1a0f1c; font-weight: 700; font-size: 13px; letter-spacing: .02em;
}
.avatar.big { width: 52px; height: 52px; font-size: 18px; }
.user-meta { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-meta strong { font-size: 13px; font-weight: 600; }
.user-meta small { font-size: 11.5px; color: var(--muted); }

.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-head h2 { margin: 0 0 2px; font-size: 16px; }
.profile-head p { margin: 0; }
.pw { margin: 4px 0 14px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.pw summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.pw[open] summary { margin-bottom: 12px; color: var(--ink); }
.dlg-actions.spread { justify-content: space-between; align-items: center; }
.dlg-actions span { display: flex; gap: 8px; }

.invite-result { display: grid; gap: 10px; margin-top: 16px; padding: 14px; border-radius: 14px; background: var(--pink-soft); border: 1px solid rgba(255, 95, 143, .25); }
.invite-result[hidden] { display: none; }
.invite-result p { margin: 0; }
.invite-result input { font-size: 13px; }
h3.sub { font-size: 13px; font-weight: 600; color: var(--muted); margin: 22px 0 8px; }
.invite-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px dashed var(--line); }
.invite-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.invite-row strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-row small { font-size: 12px; }

.team { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.member {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px;
  padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2);
}
.member.off { opacity: .55; }
.member .avatar { width: 40px; height: 40px; }
.member-info { display: flex; flex-direction: column; min-width: 0; }
.member-info strong { font-size: 14.5px; font-weight: 600; }
.member-info small { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line-2); }
.badge.owner { background: var(--dusk); color: #1a0f1c; border: 0; }
.badge.admin { color: var(--peach); border-color: rgba(255, 179, 107, .35); }
.member-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.member-actions select { width: auto; padding: 6px 30px 6px 10px; font-size: 13px; }

/* подписи «мышью / пальцем» */
.mob { display: none; }
@media (hover: none) and (pointer: coarse) {
  .desk { display: none; }
  .mob { display: revert; }
}

/* ---------- телефон ---------- */
@media (max-width: 760px) {
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  /* без backdrop-filter: иначе нижнее меню «прилипает» к шапке */
  .top { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; background: transparent; padding: calc(12px + env(safe-area-inset-top)) 16px 4px; border-bottom: 0; }
  .moon { width: 32px; height: 32px; }
  .brand h1 { font-size: 16px; }
  .brand p { font-size: 11px; }

  /* вкладки — нижнее меню, как в приложении */
  .tabs {
    position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 10;
    background: rgba(27, 24, 41, .88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-color: var(--line-2); border-radius: 18px; padding: 5px; box-shadow: 0 14px 40px rgba(0, 0, 0, .6);
  }
  .tab { flex: 1; padding: 12px 8px; font-size: 14px; border-radius: 13px; }
  .tab.active { background: var(--dusk); color: #1a0f1c; box-shadow: none; }
  .tab small { display: none; }

  #tab-media, #tab-texts, #tab-team { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 12px; }
  .top { flex-wrap: nowrap; }
  .user-meta { display: none; }
  .user-chip { padding: 3px; }
  .member { grid-template-columns: 40px minmax(0, 1fr); }
  .member .badge { grid-column: 2; justify-self: start; }
  .member-actions { grid-column: 1 / -1; }
  #tab-media:has(.props[hidden]) .stage { grid-column: auto; }
  .side, .gen-form, .gen-results { position: static; padding: 16px; border-radius: 16px; }
  .side section + section { margin-top: 16px; padding-top: 16px; }

  /* форматы и файлы — горизонтальная лента */
  .formats { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .formats::-webkit-scrollbar, .items::-webkit-scrollbar { display: none; }
  .fmt { flex: 0 0 auto; scroll-snap-align: start; padding: 10px 12px; }
  .drop { padding: 16px 12px; }
  .items { display: flex; overflow-x: auto; max-height: none; gap: 8px; margin: 12px -16px 0; padding: 0 16px; scrollbar-width: none; }
  .items li { flex: 0 0 76px; flex-direction: column; gap: 5px; padding: 5px; }
  .items li.active { box-shadow: inset 0 -3px 0 var(--pink); }
  .items img { width: 64px; height: 64px; }
  .items span { width: 100%; text-align: center; }
  .items small { display: none; }
  .items strong { font-size: 11px; font-weight: 500; }

  .stage { min-height: 0; padding: 12px; border-radius: 18px; }
  .empty { padding: 26px 6px; }
  .empty-title { font-size: 24px; }
  #preview { max-height: 64vh; border-radius: 8px; }

  /* крупнее для пальцев; 16px — чтобы iPhone не приближал поле при вводе */
  input[type="text"], input[type="password"], input[type="number"], textarea, select { font-size: 16px; padding: 11px 12px; }
  .field.row > span { width: 64px; }
  input[type="range"] { height: 6px; }
  input[type="range"]::-webkit-slider-thumb { width: 24px; height: 24px; }
  .seg button { padding: 10px 4px; font-size: 13px; }
  .btn { padding: 13px 16px; }
  .btn.small { padding: 10px 14px; }
  .check input { width: 20px; height: 20px; }
  .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
  .grid2 > :first-child { grid-column: 1 / -1; }
  .grid2 select { padding-left: 10px; padding-right: 26px; background-position: right 9px center; }
  .row-btns .btn { flex: 1; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
}

/* ---------- вход ---------- */
.auth-page { display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.auth { width: min(420px, 100%); display: grid; gap: 22px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.auth-brand .moon { width: 56px; height: 56px; }
.auth-brand h1 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; }
.auth-brand h1 em { font-style: normal; background: var(--dusk); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-card {
  background: linear-gradient(180deg, var(--panel), #18152499); border: 1px solid var(--line);
  border-radius: 22px; padding: 26px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
}
.auth-card h2 { font-size: 17px; margin-bottom: 6px; }
.auth-card > p.muted { margin: 0 0 18px; line-height: 1.5; }
.auth-card input { font-size: 16px; }
.auth-card .warn { margin: 0 0 4px; }
.center { text-align: center; }
.auth-card .center { margin: 14px 0 0; }
.auth-card [hidden] { display: none; }

/* ---------- контент-план ---------- */
#tab-plan { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 22px; padding: 24px 28px; align-items: start; }
#tab-plan .gen-form { position: sticky; top: 96px; }
.plan-dates { grid-template-columns: 1fr 1fr; }
.plan-dates .field:last-child { grid-column: 1 / -1; }
#pAdd { margin-top: 8px; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.plan-head h2 { margin: 0; font-size: 15px; }
.plan-head .row-btns { align-items: center; gap: 14px; }
a.btn { text-decoration: none; display: inline-block; }
.count-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 999px; background: var(--pink); color: #1a0f1c; font-size: 11px; font-weight: 700;
}
.plan-list { display: grid; gap: 10px; margin-top: 12px; }
.plan-empty { padding: 40px 0; text-align: center; }
.plan-month { margin: 14px 0 0; font-family: var(--display); font-size: 13px; font-weight: 500; color: var(--muted); text-transform: capitalize; }
.plan-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 132px 150px; gap: 12px; align-items: start;
  padding: 12px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line);
}
.plan-row.past { opacity: .6; }
.plan-row textarea { min-height: 132px; font-size: 13.5px; }
.plan-photo {
  position: relative; width: 132px; height: 132px; border-radius: 10px; overflow: hidden; cursor: pointer;
  background: var(--field); border: 1px dashed var(--line-2); display: grid; place-items: center; text-align: center;
  color: var(--muted); font-size: 12px; padding: 6px;
}
.plan-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.plan-photo .ph-note { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; }
.plan-photo:hover { border-color: var(--pink); }
.plan-photo-actions { display: flex; gap: 4px; margin-top: 6px; }
.plan-photo-actions .btn { padding: 4px 8px; font-size: 11.5px; flex: 1; }
.plan-side { display: grid; gap: 8px; }
.plan-side small { color: var(--muted); font-size: 12px; }
.plan-side .btn { justify-self: start; }
@media (max-width: 1100px) { #tab-plan { grid-template-columns: minmax(0, 1fr); } #tab-plan .gen-form { position: static; } }
@media (max-width: 760px) {
  #tab-plan { padding: 12px; gap: 14px; }
  .plan-row { grid-template-columns: 110px minmax(0, 1fr); }
  .plan-row textarea { grid-column: 1 / -1; grid-row: 2; }
  .plan-photo { width: 110px; height: 110px; }
}
.tab { white-space: nowrap; }
@media (max-width: 760px) {
  .tab { padding: 12px 4px; font-size: 13px; }
  .tab .count-badge { margin-left: 3px; }
}
.plan-photo > span:not(.ph-note) { white-space: pre-line; }
