/* ==========================================================================
   Nia Mobile UI — Dark Neo-Tokyo Theme (дизайн Gemini, перенесён в приложение)
   ========================================================================== */

:root {
  /* Базовая палитра фона и поверхностей */
  --bg: #090a10;
  --bg-subtle: #0d0f18;
  --card: #141724;
  --card-elevated: #1a1e30;
  --card-hover: #21263c;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);

  /* Текст */
  --text: #f4f6fc;
  --text-2: #9ea9c1;
  --muted: #66728a;

  /* Акценты */
  --pink: #ff387a;
  --pink-glow: rgba(255, 56, 122, 0.28);
  --violet: #8553f5;
  --violet-glow: rgba(133, 83, 245, 0.25);
  --grad: linear-gradient(135deg, #ff387a 0%, #8553f5 100%);
  --grad-surface: linear-gradient(145deg, rgba(255, 56, 122, 0.12), rgba(133, 83, 245, 0.06));
  --cyan: #8fd6fb;
  --cyan-subtle: rgba(143, 214, 251, 0.12);

  /* Статусы */
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #ff5c7c;

  /* Уровни откровенности */
  --tag-chill: #38bdf8;
  --tag-romance: #c084fc;
  --tag-spicy: #fb923c;
  --tag-explicit: #f43f5e;

  /* Типографика */
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-reading: "Noto Serif", Georgia, Cambria, serif;

  /* Безопасные отступы телефонов */
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;
  --shadow-float: 0 10px 30px -5px rgba(0, 0, 0, 0.65);
}

/* Сброс и базовые настройки */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  overscroll-behavior-y: none;
  overflow: hidden;
}

body {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* Обязательный класс логики */
.hidden {
  display: none !important;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  user-select: none;
}

button:active {
  transform: scale(0.97);
  transition: transform 0.08s ease;
}

input, textarea {
  font-family: inherit;
  color: var(--text);
}

.muted { color: var(--text-2); }
.hint { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.error { color: var(--danger); font-size: 13.5px; margin: 8px 0 0; font-weight: 500; }

/* ==========================================================================
   Экраны и верхние панели
   ========================================================================== */

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding-top: var(--top);
  background: var(--bg);
  z-index: 10;
}

.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 0 12px;
  background: rgba(9, 10, 16, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  flex: none;
  z-index: 20;
}

.bar h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.bar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.bar-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--pink);
  box-shadow: 0 0 10px var(--pink);
}

.bar-title {
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 4px 2px;
  border-radius: var(--radius-sm);
}

.bar-title:active {
  transform: none;
  background: rgba(255, 255, 255, 0.05);
}

.typing.autopilot {
  color: #ffb3cb;
}

.typing.autopilot .pulse-spark {
  background: var(--pink);
  box-shadow: 0 0 8px var(--pink);
}

.bar-title > div:first-child {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.typing {
  font-size: 12px;
  font-weight: 600;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
}

.pulse-spark {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulse-ring 1.3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  color: var(--text-2);
  display: grid;
  place-items: center;
  flex: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ==========================================================================
   Служебные плашки (Соединение, Обновление)
   ========================================================================== */

.conn {
  position: fixed;
  left: 14px;
  right: 14px;
  top: calc(var(--top) + 60px);
  width: fit-content;
  max-width: calc(100% - 28px);
  margin: 0 auto;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: rgba(26, 30, 48, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-float);
  animation: slide-down 0.22s ease-out;
}

.conn .dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--warn);
  flex: none;
  box-shadow: 0 0 8px var(--warn);
  animation: pulse 1.2s infinite ease-in-out;
}

.conn.bad .dot {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

.conn .link {
  color: var(--cyan);
  font-weight: 700;
  padding: 2px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.conn.update {
  top: auto;
  bottom: calc(var(--bottom) + 156px);
  border-color: rgba(143, 214, 251, 0.35);
  background: rgba(18, 24, 38, 0.96);
}

.update-icon {
  display: flex;
  align-items: center;
  color: var(--cyan);
}

/* ==========================================================================
   Формы входа и PIN
   ========================================================================== */

.center-card {
  margin: auto;
  width: min(390px, 100%);
  padding: 32px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-wrap {
  position: relative;
  margin-bottom: 8px;
}

.logo-wrap::after {
  content: "";
  position: absolute;
  inset: -6px;
  background: var(--grad);
  border-radius: 24px;
  opacity: 0.35;
  filter: blur(12px);
  z-index: 0;
}

.logo {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.center-card h1 {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 14px 0 6px;
}

.center-card .muted {
  font-size: 13.5px;
  line-height: 1.45;
  max-width: 320px;
}

.field-wrap {
  width: 100%;
}

.field {
  width: 100%;
  height: 50px;
  margin-top: 12px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.field:focus {
  border-color: var(--pink);
  background: #121420;
  box-shadow: 0 0 0 3px var(--pink-glow);
}

.code-field {
  text-align: center;
  font-size: 26px;
  letter-spacing: 0.32em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--card);
}

.code-field::placeholder {
  font-size: 16px;
  letter-spacing: 0.1em;
  font-weight: 400;
  color: var(--muted);
}

details {
  width: 100%;
  text-align: left;
  margin-top: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

details summary {
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}

details summary::-webkit-details-marker { display: none; }

details summary .chevron {
  transition: transform 0.2s ease;
}

details[open] summary .chevron {
  transform: rotate(180deg);
}

.details-content {
  padding: 0 12px 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 15px;
  margin-top: 18px;
  width: 100%;
  border: 1px solid transparent;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.btn.primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 20px var(--pink-glow);
}

.btn.ghost {
  background: var(--card);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ==========================================================================
   Вкладки и список историй
   ========================================================================== */

.tabs {
  display: flex;
  gap: 8px;
  padding: 10px 14px 6px;
  flex: none;
  background: var(--bg);
}

.tabs button {
  flex: 1;
  height: 40px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-2);
  background: var(--card);
  border: 1px solid var(--line);
  transition: all 0.2s ease;
}

.tabs button.active {
  color: #fff;
  background: var(--grad-surface);
  border-color: rgba(255, 56, 122, 0.45);
  box-shadow: inset 0 0 12px rgba(255, 56, 122, 0.15);
}

/* Раздел над нижним меню: своя прокрутка (отступ снизу под системную полосу даёт меню) */
.pane {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 24px;
}

.list {
  display: grid;
  gap: 12px;
  align-content: start;
}

.new-story {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  border-radius: var(--radius-lg);
  border: 1.5px dashed rgba(255, 56, 122, 0.45);
  background: rgba(255, 56, 122, 0.05);
  color: #ffd6e2;
  font-weight: 700;
  font-size: 15px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.new-story:active {
  background: rgba(255, 56, 122, 0.12);
  border-color: var(--pink);
}

.chat-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  text-align: left;
  width: 100%;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.chat-card:active {
  background: var(--card-elevated);
  border-color: var(--line-strong);
}

.chat-card img, .chat-card .noimg {
  width: 74px;
  height: 98px;
  border-radius: 10px;
  object-fit: cover;
  flex: none;
  background: #11131e;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.chat-card .t {
  font-weight: 700;
  font-size: 15.5px;
  color: var(--text);
  line-height: 1.3;
}

.chat-card .d {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
}

/* Теги и категории */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2);
  margin-top: 8px;
  margin-right: 4px;
  border: 1px solid transparent;
}

/* Цвет метки - по уровню откровенности (data-rating ставит app.js) и «Манхва» (data-kind). */
.tag[data-rating="explicit"] {
  background: rgba(244, 63, 94, 0.14);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.3);
}

.tag[data-rating="spicy"] {
  background: rgba(251, 146, 60, 0.14);
  color: #fed7aa;
  border-color: rgba(251, 146, 60, 0.3);
}

.tag[data-rating="romance"] {
  background: rgba(192, 132, 252, 0.14);
  color: #e9d5ff;
  border-color: rgba(192, 132, 252, 0.3);
}

.tag[data-rating="chill"] {
  background: rgba(56, 189, 248, 0.12);
  color: #bae6fd;
  border-color: rgba(56, 189, 248, 0.28);
}

.tag[data-kind="manhwa"] {
  background: rgba(143, 214, 251, 0.12);
  color: var(--cyan);
  border-color: rgba(143, 214, 251, 0.3);
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 60px 20px;
  font-size: 14.5px;
}

/* ==========================================================================
   Диалоговая лента истории
   ========================================================================== */

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overscroll-behavior: contain;
}

.msg {
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

.msg.user {
  align-self: flex-end;
  max-width: 86%;
}

.bubble {
  word-break: break-word;
  user-select: text;
}

/* Сообщение ИИ (Nia) — оптимизировано для комфортного длинного чтения */
.bubble.nia {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: rgba(20, 23, 36, 0.92);
  border: 1px solid var(--line);
  box-shadow: inset 3.5px 0 0 var(--pink);
  font-family: var(--font-reading);
  font-size: 16.5px;
  line-height: 1.68;
  color: #f7f8fc;
  letter-spacing: 0.01em;
}

/* Действия в тексте ролевой */
.rp-action {
  color: var(--cyan);
  font-style: italic;
}

/* Реплика пользователя */
.bubble.user {
  padding: 12px 16px;
  border-radius: 18px 18px 4px 18px;
  background: linear-gradient(135deg, rgba(133, 83, 245, 0.65), rgba(219, 39, 119, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 15.5px;
  line-height: 1.45;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.bubble.scene {
  text-align: center;
  font-family: var(--font-reading);
  font-style: italic;
  color: var(--text-2);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(133, 83, 245, 0.06);
  border: 1px dashed rgba(133, 83, 245, 0.28);
  font-size: 15px;
  line-height: 1.6;
}

.msg.pending .bubble {
  opacity: 0.5;
  filter: grayscale(0.2);
}

.bubble.pinned {
  position: relative;
  outline: 1.5px solid var(--cyan);
  outline-offset: 3px;
}

.bubble.pinned::after {
  content: "📌";
  position: absolute;
  top: -8px;
  right: -6px;
  font-size: 11px;
}

/* Служебные разделители */
.divider {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 6px 0;
}

.older {
  align-self: center;
  color: var(--muted);
  font-size: 12.5px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-full);
}

.drawing {
  align-self: stretch;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1.5px dashed rgba(133, 83, 245, 0.45);
  background: rgba(133, 83, 245, 0.05);
  color: var(--text-2);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: pulse 1.8s infinite ease-in-out;
}

/* Навигатор по вариантам ответов (ветки) */
.variant-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.03);
  padding: 2px 6px;
  border-radius: var(--radius-md);
  width: fit-content;
}

.variant-nav button {
  width: 36px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  background: var(--card);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--text);
}

.variant-nav button:disabled {
  opacity: 0.3;
}

/* Действия с сообщением */
.msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  animation: fade-in 0.15s ease-out;
}

.msg.user .msg-actions {
  justify-content: flex-end;
}

.msg-actions .chip {
  height: 32px;
  padding: 0 10px;
  font-size: 12.5px;
  background: var(--card-elevated);
}

.msg-actions .chip.on {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-subtle);
}

/* ==========================================================================
   Арт сцены и превью манхвы
   ========================================================================== */

.art {
  align-self: center;
  width: 100%;
  max-width: 440px;
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.art .stage {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0f1018;
}

.scene-img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  display: block;
}

video.scene-img {
  background: #0f1018;
}

.art .stage .live-badge,
.gallery-grid .live-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(133, 83, 245, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.art .row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.art .status {
  font-size: 13px;
  font-weight: 500;
  color: var(--cyan);
}

/* Кадры манхвы в ленте (.strip) */
.strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 10px;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.strip::-webkit-scrollbar { display: none; }

.strip > .thumb {
  flex: none;
  width: 150px;
  height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #0d0f17;
}

.strip > .thumb.pending {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
  font-size: 12px;
  color: var(--text-2);
  border: 1.5px dashed rgba(133, 83, 245, 0.45);
  background: rgba(20, 23, 36, 0.7);
}

.strip > .thumb.pending.wait {
  border-color: rgba(251, 191, 36, 0.5);
  color: #fde68a;
}

.strip > .thumb.pending.error {
  border-color: rgba(255, 92, 124, 0.5);
  color: #fca5a5;
}

.thumb .mh-panel {
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   Манхва: геометрия облачков (БЕЗ ИЗМЕНЕНИЙ РАЗМЕРОВ/ПОЗИЦИОНИРОВАНИЯ)
   ========================================================================== */

.mh-panel {
  position: relative;
  container-type: inline-size;
  overflow: hidden;
  background: #0f1018;
  user-select: none;
}

.mh-panel > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mh-shapes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.mh-bubble {
  position: absolute;
  box-sizing: border-box;
  font-family: 'Balsamiq Sans', var(--font-ui), sans-serif;
  font-size: 3.4cqw;
  line-height: 1.2;
  padding: .6em .9em;
  color: #12131a;
  text-align: center;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.mh-bubble.thought {
  font-style: italic;
}

.mh-bubble.narration {
  font-size: 2.9cqw;
  padding: .45em .6em;
  font-weight: 700;
}

.mh-bubble.sfx {
  font-family: 'Russo One', 'Balsamiq Sans', var(--font-ui), sans-serif;
  font-size: 7.5cqw;
  line-height: 1.1;
  padding: .05em .15em;
  color: #fff;
  transform: rotate(-6deg);
  white-space: nowrap;
  width: auto !important;
  text-shadow:
    -.06em -.06em 0 #15151a,
     .06em -.06em 0 #15151a,
    -.06em  .06em 0 #15151a,
     .06em  .06em 0 #15151a,
     0     .085em 0 #15151a,
     0    -.085em 0 #15151a,
     .085em 0     0 #15151a,
    -.085em 0     0 #15151a;
}

/* ==========================================================================
   Нижняя панель ввода (Composer) — под большой палец
   ========================================================================== */

.composer {
  flex: none;
  border-top: 1px solid var(--line);
  background: rgba(9, 10, 16, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 8px 12px calc(8px + var(--bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 30;
}

/* Быстрые подсказки реплик ИИ */
.quick {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick::-webkit-scrollbar { display: none; }

.quick:empty {
  display: none;
}

.quick .chip {
  background: var(--card-elevated);
  border-color: rgba(143, 214, 251, 0.25);
  color: var(--cyan);
  font-weight: 500;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

#input {
  flex: 1;
  min-height: 46px;
  max-height: 140px;
  resize: none;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

#input:focus {
  border-color: rgba(255, 56, 122, 0.5);
  background: #171a28;
}

.send {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-lg);
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 4px 14px var(--pink-glow);
  transition: opacity 0.2s, transform 0.1s;
}

.send:disabled {
  opacity: 0.4;
  box-shadow: none;
}

/* Ряд действий под полем ввода */
.actions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.actions::-webkit-scrollbar { display: none; }

/* Три главные кнопки помещаются в ширину телефона целиком (без прокрутки вбок). */
.actions { gap: 6px; }
.actions .chip { flex: 1 0 auto; justify-content: center; padding: 0 10px; }
@media (max-width: 400px) {
  .actions .chip svg { display: none; }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.chip:active {
  background: var(--card-hover);
}

.chip:disabled {
  opacity: 0.45;
}

.chip svg, .new-story svg, .drawing svg, .art .status svg {
  flex: none;
}

.art .status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Оверлеи: Читалка, Галерея, Полноэкранный просмотр
   ========================================================================== */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #06070a;
  display: flex;
  flex-direction: column;
  padding-top: var(--top);
  animation: fade-in 0.2s ease-out;
}

.reader-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 12px 0 calc(40px + var(--bottom));
}

.reader-list .mh-panel {
  width: 100%;
}

.reader-end {
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  padding: 24px 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gallery-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 6px 6px calc(24px + var(--bottom));
  align-content: start;
}

.gallery-grid .cell {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #11131e;
  border: 1px solid var(--line);
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-grid .kind {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 8px 6px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.viewer {
  align-items: center;
  justify-content: center;
  padding: 0;
  background: #000;
}

.viewer img, .viewer video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  touch-action: pinch-zoom;
}

.viewer-count {
  position: fixed;
  top: calc(var(--top) + 14px);
  left: 14px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  z-index: 60;
}

/* ==========================================================================
   Нижний лист (Bottom Sheet) & Toast
   ========================================================================== */

.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(4, 5, 8, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  animation: fade-in 0.2s ease-out;
}

.sheet {
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--line-strong);
  padding: 20px 18px calc(20px + var(--bottom));
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
  animation: slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sheet::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  margin: 0 auto 16px;
}

.sheet h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.sheet .cover {
  width: 100%;
  max-height: 40vh;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
  margin-bottom: 14px;
  border: 1px solid var(--line);
}

.sheet .starter {
  font-family: var(--font-reading);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-2);
  margin-top: 12px;
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.sheet textarea {
  width: 100%;
  min-height: 140px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.5;
  outline: none;
  resize: vertical;
}

.sheet textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-glow);
}

.sheet .seg {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.sheet .seg button {
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}

.sheet .seg button.active {
  color: #fff;
  border-color: rgba(255, 56, 122, 0.55);
  background: rgba(255, 56, 122, 0.16);
}

.sheet .btns {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.sheet .btns .btn {
  margin-top: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--bottom));
  transform: translateX(-50%);
  z-index: 80;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  background: var(--card-elevated);
  border: 1px solid var(--line-strong);
  font-size: 13.5px;
  font-weight: 500;
  color: #fff;
  box-shadow: var(--shadow-float);
  animation: slide-up 0.2s ease-out;
}

.toast.error {
  border-color: rgba(255, 92, 124, 0.5);
  background: #2a131b;
  color: #fda4af;
}

/* ==========================================================================
   Анимации
   ========================================================================== */

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.9); }
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(143, 214, 251, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(143, 214, 251, 0); }
  100% { box-shadow: 0 0 0 0 rgba(143, 214, 251, 0); }
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================================================
   Нижнее меню разделов
   ========================================================================== */

.nav {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + var(--bottom));
  background: rgba(9, 10, 16, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}

.nav button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0 4px;
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.nav button.active {
  color: #fff;
}

.nav button.active svg {
  color: var(--pink);
  filter: drop-shadow(0 0 6px var(--pink-glow));
}

.nav-dot {
  position: absolute;
  top: 4px;
  left: calc(50% + 9px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulse 1.4s ease-in-out infinite;
}

/* ==========================================================================
   Главная
   ========================================================================== */

.home {
  display: grid;
  gap: 14px;
  align-content: start;
}

.home-hero {
  position: relative;
  overflow: hidden;
  padding: 22px 18px 20px;
  border-radius: var(--radius-xl);
  background: var(--grad-surface), var(--card);
  border: 1px solid rgba(255, 56, 122, 0.22);
}

.home-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(133, 83, 245, 0.35), transparent 70%);
  pointer-events: none;
}

.home-hero .greet {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.home-hero .sub {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.home-hero .clock {
  margin-top: 14px;
  font-size: 34px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
}

.home-hero .date {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 13.5px;
}

.home-continue {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  text-align: left;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line-strong);
}

.home-continue .ic, .tile .ic {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: rgba(255, 56, 122, 0.12);
  border: 1px solid rgba(255, 56, 122, 0.25);
  color: var(--pink);
}

.home-continue .t {
  font-weight: 700;
  font-size: 15px;
}

.home-continue .s {
  color: var(--text-2);
  font-size: 12.5px;
  margin-top: 1px;
}

.home-continue > svg:last-child {
  margin-left: auto;
  color: var(--muted);
  flex: none;
}

.home-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.home-buttons .btn {
  margin: 0;
  padding: 0 12px;
  font-size: 14px;
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tile {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
  text-align: left;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
}

.tile.wide {
  grid-column: 1 / -1;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.tile .ic.violet {
  background: rgba(133, 83, 245, 0.14);
  border-color: rgba(133, 83, 245, 0.3);
  color: #b89bff;
}

.tile .ic.cyan {
  background: var(--cyan-subtle);
  border-color: rgba(143, 214, 251, 0.28);
  color: var(--cyan);
}

.tile .t {
  font-weight: 700;
  font-size: 15px;
}

.tile .s {
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.35;
}

.tile .s b {
  color: var(--text);
}

.tile .progress {
  margin-top: 6px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-2);
}

.status-chip b {
  color: var(--text);
  font-weight: 600;
}

.status-chip .d {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
}

.status-chip .d.busy {
  background: var(--warn);
  box-shadow: 0 0 6px var(--warn);
}

.progress {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--grad);
}

/* ==========================================================================
   Поиск, идеи, общие элементы форм
   ========================================================================== */

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--muted);
}

.search:focus-within {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-glow);
}

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: none;
  outline: none;
  font-size: 15px;
}

.idea-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.new-story.alt {
  border-color: rgba(133, 83, 245, 0.5);
  background: rgba(133, 83, 245, 0.07);
  color: #ddd0ff;
}

.idea-actions .new-story {
  font-size: 14px;
  gap: 8px;
  padding: 0 8px;
}

.loading-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: var(--cyan-subtle);
  border: 1px solid rgba(143, 214, 251, 0.25);
  color: #d4efff;
  font-size: 13.5px;
  line-height: 1.35;
}

.spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgba(143, 214, 251, 0.25);
  border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
}

.sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.sec-title .n {
  color: var(--text-2);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 600;
}

.sec-title .link {
  margin-left: auto;
  color: var(--pink);
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 600;
}

.seg {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.studio .seg button {
  flex: 1;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}

.studio .seg button.active {
  color: #fff;
  border-color: rgba(255, 56, 122, 0.55);
  background: rgba(255, 56, 122, 0.16);
}

.sheet .seg.fill button {
  flex: 1;
  padding: 0 8px;
}

/* Откровенность - 2×2, темп - «Как в настройках» строкой и четыре скорости под ней: без переносов на узком экране */
.sheet .seg.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.sheet .seg.pace {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.sheet .seg.pace button:first-child {
  grid-column: 1 / -1;
}

.sheet .seg.grid2 button, .sheet .seg.pace button {
  padding: 0 6px;
}

.sheet .btns .btn.ghost {
  flex: none;
  width: auto;
  padding: 0 22px;
}

.typing.autopilot {
  white-space: nowrap;
  overflow: hidden;
}

.stepper {
  display: inline-flex;
  align-items: center;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  flex: none;
}

.stepper button {
  width: 38px;
  height: 100%;
  font-size: 20px;
  line-height: 1;
  color: var(--text-2);
}

.stepper span {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stepper.zero span {
  color: var(--muted);
}

.select {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.select option {
  background: var(--card);
}

/* ==========================================================================
   Арт-студия
   ========================================================================== */

.studio {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
}

.studio textarea {
  width: 100%;
  min-height: 86px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.45;
  outline: none;
  resize: vertical;
}

.studio textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-glow);
}

.studio-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.studio .btn {
  margin-top: 2px;
}

.studio .loading-banner {
  margin: 0;
}

.gallery-grid.studio-grid {
  flex: none;
  overflow: visible;
  padding: 0;
}

.studio-grid .cell.fresh {
  border-color: rgba(255, 56, 122, 0.6);
  box-shadow: 0 0 0 1px rgba(255, 56, 122, 0.35);
}

#art-more {
  margin-top: 12px;
}

/* Действия под полноэкранным просмотром арта студии */
.viewer-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(18px + var(--bottom));
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
}

.viewer-actions .chip {
  background: rgba(20, 23, 36, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ==========================================================================
   Листы: генератор идей, своя история, карточка истории
   ========================================================================== */

.count-rows {
  display: grid;
  gap: 8px;
}

.count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.count-row .tag {
  margin: 0;
  font-size: 12.5px;
  padding: 4px 10px;
}

.cat-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 10px -18px 0;
  padding: 0 18px 2px;
}

.cat-pills::-webkit-scrollbar { display: none; }

.cat-pills button {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

.cat-pills button.active {
  color: #fff;
  border-color: rgba(255, 56, 122, 0.5);
  background: rgba(255, 56, 122, 0.14);
}

.cat-pills button.char.active {
  border-color: rgba(143, 214, 251, 0.5);
  background: var(--cyan-subtle);
}

.cat-pills .n {
  margin-left: 5px;
  color: var(--muted);
}

.cat-pills .n.sel {
  color: var(--pink);
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag-chips .sub {
  width: 100%;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.tchip {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.tchip.active {
  color: #fff;
  border-color: rgba(255, 56, 122, 0.55);
  background: rgba(255, 56, 122, 0.16);
}

.tchip.char.active {
  border-color: rgba(143, 214, 251, 0.55);
  background: rgba(143, 214, 251, 0.14);
}

.picked {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.picked:empty {
  display: none;
}

.pchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 4px 0 11px;
  border-radius: var(--radius-full);
  background: rgba(255, 56, 122, 0.14);
  border: 1px solid rgba(255, 56, 122, 0.4);
  font-size: 12.5px;
  font-weight: 600;
  color: #ffd6e2;
}

.pchip.char {
  background: rgba(143, 214, 251, 0.12);
  border-color: rgba(143, 214, 251, 0.4);
  color: #d4efff;
}

.pchip.custom {
  border-style: dashed;
}

.pchip .kind {
  color: var(--muted);
  font-weight: 500;
  margin-left: 2px;
}

.pchip button {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: inherit;
  opacity: 0.75;
}

.sheet .field.tag-input {
  height: 44px;
  margin-top: 8px;
  font-size: 14.5px;
}

.sheet .field.tag-input:disabled {
  opacity: 0.5;
}

.suggest {
  margin-top: 6px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--line-strong);
  overflow: hidden;
}

.suggest:empty {
  display: none;
}

.suggest button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}

.suggest button:last-child {
  border-bottom: none;
}

.suggest button:active {
  transform: none;
  background: var(--card-hover);
}

.suggest .nm {
  font-weight: 600;
  font-size: 14px;
}

.suggest .sub {
  color: var(--muted);
  font-size: 12px;
}

.suggest .miss {
  padding: 10px 14px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.4;
}

.sheet .sticky-btns {
  position: sticky;
  bottom: calc(-20px - var(--bottom));
  margin: 16px -18px calc(-20px - var(--bottom));
  padding: 12px 18px calc(14px + var(--bottom));
  background: linear-gradient(to top, var(--card) 75%, rgba(20, 23, 36, 0));
}

.sheet .sticky-btns .btn {
  margin-top: 0;
}

.attach {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
}

.attach img {
  width: 56px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex: none;
}

.attach .body {
  flex: 1;
  min-width: 0;
}

.attach .seg {
  margin-top: 6px;
}

.attach .seg button {
  height: 32px;
  padding: 0 10px;
  font-size: 12.5px;
}

.attach .icon-btn {
  width: 36px;
  height: 36px;
}

.btn-line {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  margin-top: 8px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 14.5px;
  text-align: left;
  color: var(--text);
}

.btn-line svg {
  flex: none;
  color: var(--text-2);
}

.btn-line.danger {
  color: #fda4af;
  border-color: rgba(255, 92, 124, 0.3);
}

.btn-line.danger svg {
  color: var(--danger);
}

.btn-line:disabled {
  opacity: 0.45;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  margin-top: 8px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  text-align: left;
}

.toggle-row:active {
  transform: none;
}

.toggle-row .t {
  font-weight: 600;
  font-size: 14.5px;
}

.toggle-row .s {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex: none;
  margin-left: auto;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.toggle-row.on .switch {
  background: var(--pink);
}

.toggle-row.on .switch::after {
  transform: translateX(18px);
}

.sheet .cover-wrap {
  position: relative;
}

.sheet .cover-wrap .chip {
  position: absolute;
  right: 10px;
  bottom: 24px;
  background: rgba(20, 23, 36, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
