:root {
  /* SMoMo-inspired dark palette */
  --color-surface: #1f232b;
  --color-surface-2: #262b34;
  --color-canvas: #14161c;
  --color-canvas-2: #1a1d24;
  --color-accent: #c8ff3d;
  --color-on-accent: #14161c;
  /* Текст-акцент: на тёмном — лайм; на светлом — чёрный (не лайм на белом) */
  --color-accent-text: #c8ff3d;
  --color-accent-soft: rgba(200, 255, 61, 0.12);
  --color-accent-soft-mid: rgba(200, 255, 61, 0.18);
  --color-accent-soft-light: rgba(200, 255, 61, 0.08);
  --color-accent-muted: #a8d932;
  --color-accent-2: #e6e8ec;
  --color-on-accent-2: #14161c;
  --color-accent-2-soft: rgba(230, 232, 236, 0.12);
  --color-accent-2-soft-mid: rgba(230, 232, 236, 0.18);
  --color-accent-2-soft-light: rgba(230, 232, 236, 0.08);
  --color-accent-2-muted: #b4b9c2;
  --color-ink: #e6e8ec;
  --color-ink-muted: #8a909b;
  --color-ink-soft: #b4b9c2;
  --color-line: rgba(230, 232, 236, 0.1);
  --color-line-strong: rgba(230, 232, 236, 0.16);
  --color-success: #c8ff3d;
  --color-error: #ff6b7a;
  --color-warning: #ffe873;
  --dot-rgb: 200, 255, 61;
  --dot-alpha: 0.11;
  --dot-size: 20px;
  --press-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --press-duration: 0.24s;
  --press-in-duration: 0.1s;
  --nav-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-duration: 0.32s;
  --nav-hover-duration: 0.2s;
  --nav-active-bg: rgba(200, 255, 61, 0.12);
  --nav-active-ring: rgba(200, 255, 61, 0.28);
  --nav-active-glow: 0 2px 16px rgba(200, 255, 61, 0.18);
  --nav-hover-bg: rgba(230, 232, 236, 0.06);
  --focus-ring: rgba(200, 255, 61, 0.4);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

/* SMoMo light theme */
html[data-theme="light"] {
  --color-surface: #ffffff;
  --color-surface-2: #f6f7fa;
  --color-canvas: #f2f3f6;
  --color-canvas-2: #e8eaef;
  --color-accent: #c8ff3d;
  --color-on-accent: #14161c;
  --color-accent-text: #14161c;
  --color-accent-soft: rgba(200, 255, 61, 0.22);
  --color-accent-soft-mid: rgba(200, 255, 61, 0.3);
  --color-accent-soft-light: rgba(200, 255, 61, 0.14);
  --color-accent-muted: #5a8a0a;
  --color-accent-2: #14161c;
  --color-on-accent-2: #f2f3f6;
  --color-accent-2-soft: rgba(20, 22, 28, 0.08);
  --color-accent-2-soft-mid: rgba(20, 22, 28, 0.12);
  --color-accent-2-soft-light: rgba(20, 22, 28, 0.06);
  --color-accent-2-muted: #3d424c;
  --color-ink: #14161c;
  --color-ink-muted: #6d7380;
  --color-ink-soft: #3d424c;
  --color-line: rgba(20, 22, 28, 0.1);
  --color-line-strong: rgba(20, 22, 28, 0.16);
  --color-success: #5a8a0a;
  --color-error: #e11d48;
  --color-warning: #e6b800;
  --dot-rgb: 20, 22, 28;
  --dot-alpha: 0.12;
  --nav-active-bg: rgba(200, 255, 61, 0.22);
  --nav-active-ring: rgba(200, 255, 61, 0.4);
  --nav-active-glow: 0 2px 16px rgba(200, 255, 61, 0.22);
  --nav-hover-bg: rgba(20, 22, 28, 0.05);
  --focus-ring: rgba(200, 255, 61, 0.45);
  --shadow: 0 16px 40px rgba(20, 22, 28, 0.08);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background-color: var(--color-canvas);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-stolzl, system-ui, sans-serif);
  font-weight: 400;
  color: var(--color-ink);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Точки на отдельном fixed-слое — без background-attachment:fixed
   (тот режим заставляет Chromium/Electron репейнтить фон на каждом кадре анимации). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--color-canvas);
  background-image: radial-gradient(
    circle,
    rgba(var(--dot-rgb), var(--dot-alpha)) 1.15px,
    transparent 1.15px
  );
  background-size: var(--dot-size) var(--dot-size);
  transform: translateZ(0);
  contain: strict;
  backface-visibility: hidden;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.shell-main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 16px calc(16px + 49px + 24px);
}

.shell-main:has(.page) {
  max-width: 1100px;
  padding-bottom: 24px;
}

@media (min-width: 768px) {
  .shell-main {
    padding: 24px 24px calc(24px + 49px + 32px);
  }
  .shell-main:has(.page) {
    padding: 24px 32px 32px;
  }
}

/* ── Page shell ── */
.page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: calc(100dvh - 80px);
  padding: 20px;
  border-radius: 40px;
  background: transparent;
}

@media (min-width: 768px) {
  .page {
    gap: 32px;
    padding: 32px;
  }
}

/* ── Header ── */
.app-header {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}

.app-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  line-height: 0;
}

.app-logo-mark {
  display: block;
  flex-shrink: 0;
  border-radius: 999px;
  overflow: hidden;
  background: transparent;
}

.app-logo-mark-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-nav {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  justify-items: center;
  height: 49px;
  min-width: 0;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  padding: 0 8px;
  border-radius: 47px;
  background: var(--color-surface);
  overflow: visible;
  isolation: isolate;
  transform: translateZ(0);
  contain: layout style;
}

/* Верхнее меню: 3 основных + AI + домой */
.app-nav--top {
  grid-template-columns: repeat(5, 1fr);
  max-width: 520px;
}

.app-nav-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 47px;
  cursor: pointer;
  transition:
    transform var(--press-duration) var(--press-ease),
    opacity var(--nav-hover-duration) ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.app-nav-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.app-nav-indicator {
  position: absolute;
  inset: 0;
  border-radius: 47px;
  background: var(--color-accent);
  box-shadow: none;
  pointer-events: none;
  z-index: 0;
  /* Motion layoutId двигает через transform — держим свой compositor layer */
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Подложка активного пункта — только тёмная тема */
html[data-theme="dark"][data-nav-underlay="base"] .app-nav-indicator {
  background: color-mix(in srgb, var(--color-accent) 55%, #1f232b);
}

html[data-theme="dark"][data-nav-underlay="white"] .app-nav-indicator {
  background: #ffffff;
}

html[data-theme="dark"][data-nav-underlay="lime"] .app-nav-indicator {
  background: #c8ff3d;
}

html[data-theme="dark"][data-nav-underlay="black"] .app-nav-indicator {
  background: #0a0b0e;
  box-shadow: inset 0 0 0 1px rgba(230, 232, 236, 0.14);
}

/* На белой/лаймовой подложке — чёрные иконки; на чёрной — светлые */
html[data-theme="dark"][data-nav-underlay="white"] .app-nav-link--active .nav-icon,
html[data-theme="dark"][data-nav-underlay="lime"] .app-nav-link--active .nav-icon,
html[data-theme="dark"][data-nav-underlay="base"] .app-nav-link--active .nav-icon {
  filter: brightness(0) saturate(100%);
}

html[data-theme="dark"][data-nav-underlay="black"] .app-nav-link--active .nav-icon {
  filter: brightness(0) invert(1);
}

html[data-theme="dark"][data-nav-underlay="white"] .app-nav-link--active .nav-icon-slot,
html[data-theme="dark"][data-nav-underlay="lime"] .app-nav-link--active .nav-icon-slot,
html[data-theme="dark"][data-nav-underlay="base"] .app-nav-link--active .nav-icon-slot {
  color: #14161c;
}

html[data-theme="dark"][data-nav-underlay="black"] .app-nav-link--active .nav-icon-slot {
  color: #e6e8ec;
}

/* Кастомные иконки тёмной темы — без фильтра */
html[data-theme="dark"] .app-nav-link .nav-icon.nav-icon--preset-active {
  filter: none !important;
}

.app-nav-link .nav-icon,
.app-nav-link svg,
.app-nav-link .nav-icon-slot {
  position: relative;
  z-index: 1;
  transition:
    opacity var(--nav-hover-duration) var(--nav-ease),
    transform var(--nav-hover-duration) var(--nav-ease),
    color var(--nav-hover-duration) ease;
}

.app-nav-link:not(.app-nav-link--active) .nav-icon {
  opacity: 1;
  filter: brightness(0) invert(1);
}

.app-nav-link:not(.app-nav-link--active) svg,
.app-nav-link:not(.app-nav-link--active) .nav-icon-slot {
  opacity: 1;
  color: var(--color-ink);
}

/* Активная: чёрная иконка на лаймовой подложке (как в светлой теме) */
.app-nav-link--active .nav-icon {
  opacity: 1;
  filter: brightness(0) saturate(100%);
}

html[data-theme="light"] .app-nav-link:not(.app-nav-link--active) .nav-icon,
html[data-theme="light"] .app-nav-link--active .nav-icon {
  filter: brightness(0) saturate(100%);
}

html[data-theme="light"] .apps-tile-img {
  filter: brightness(0) saturate(100%);
}

.app-nav-link .nav-icon.nav-icon--preset-active {
  filter: none;
}

.app-nav-link--active svg,
.app-nav-link--active .nav-icon-slot {
  opacity: 1;
  color: #14161c;
}

.app-nav-link:hover:not(.app-nav-link--active) {
  background: var(--nav-hover-bg);
}

/* Тёмная тема: при наведении иконки остаются светлыми (не чёрные на чёрном) */
.app-nav-link:hover:not(.app-nav-link--active) .nav-icon {
  opacity: 1;
  filter: brightness(0) invert(1);
  transform: translateX(2px) scale(1.03);
}

.app-nav-link:hover:not(.app-nav-link--active) svg,
.app-nav-link:hover:not(.app-nav-link--active) .nav-icon-slot {
  opacity: 1;
  color: var(--color-ink);
  transform: translateX(2px) scale(1.03);
}

/* Светлая тема: чёрные иконки на светлом */
html[data-theme="light"] .app-nav-link:hover:not(.app-nav-link--active) .nav-icon {
  filter: brightness(0) saturate(100%);
  opacity: 1;
}

html[data-theme="light"] .app-nav-link:hover:not(.app-nav-link--active) svg,
html[data-theme="light"] .app-nav-link:hover:not(.app-nav-link--active) .nav-icon-slot {
  color: var(--color-ink);
  opacity: 1;
}

/* Полноцветные бейджи (apps) — без фильтра и на hover */
.app-nav-link:hover:not(.app-nav-link--active) .nav-icon.nav-icon--preset-active {
  filter: none;
}

.app-nav--side .app-nav-link:hover:not(.app-nav-link--active) .nav-icon {
  transform: translateY(2px) scale(1.03);
}

.app-nav--side .app-nav-link:hover:not(.app-nav-link--active) svg,
.app-nav--side .app-nav-link:hover:not(.app-nav-link--active) .nav-icon-slot {
  transform: translateY(2px) scale(1.03);
}

.nav-icon-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.app-nav-link:active {
  transform: scale(0.94);
  transition-duration: var(--press-in-duration);
}

.app-nav-link--active {
  background: transparent;
}

.app-nav--bottom {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 16px;
}

.app-settings {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-ink);
  transition: transform var(--press-duration) var(--press-ease), opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.app-settings:hover {
  opacity: 0.8;
}

.app-settings:active {
  transform: scale(0.9);
  transition-duration: var(--press-in-duration);
  opacity: 1;
}

.nav-icon {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* Мобилка: компактный хедер, меню из логотипа */
.app-logo--mobile,
.app-logo-nav {
  display: none;
}

.app-logo--desktop {
  display: flex;
}

@media (max-width: 767px) {
  .app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 40px;
  }

  .app-header-topnav {
    display: none;
  }

  .app-logo--desktop {
    display: none;
  }

  .app-logo-nav {
    display: block;
    position: relative;
    z-index: 40;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  .app-logo--mobile {
    display: flex;
    position: relative;
    z-index: 3;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .app-logo {
    width: 40px;
    height: 40px;
  }

  .app-logo-mark {
    width: 40px !important;
    height: 40px !important;
  }

  .app-settings {
    width: 40px;
    height: 40px;
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 41;
  }

  .app-settings svg {
    width: 18px;
    height: 18px;
  }

  .app-logo-menu {
    position: absolute;
    left: 0;
    top: -2px;
    height: 44px;
    /* не залезать на кнопку настроек справа */
    width: min(calc(100vw - 20px - 40px - 12px - 40px), 300px);
    max-width: calc(100vw - 72px);
    padding: 0 10px 0 48px;
    border-radius: 999px;
    background: var(--color-surface);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.32);
    display: flex;
    align-items: center;
    overflow: hidden;
  }

  .app-logo-menu-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 2px;
  }

  .app-logo-menu-link {
    width: 36px;
    height: 36px;
  }

  .bottom-nav--desktop {
    display: none !important;
  }

  .shell-main {
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .shell-main:has(.page) {
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .page {
    gap: 12px;
    padding: 0;
    min-height: 0;
    border-radius: 0;
  }
}

/* ── Apps launcher ── */
.coding-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  min-height: 0;
}

.coding-head {
  padding: 0 4px;
}

.coding-lead {
  margin: 8px 0 0;
  color: var(--color-ink-muted);
  font-size: 14px;
}

.coding-projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 760px;
}

.coding-error { margin: 0; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--color-error) 16%, transparent); color: var(--color-error); font-size: 13px; }
.coding-project-main { display: flex; align-items: center; gap: 14px; }
.coding-git-status { display: flex; gap: 8px; margin-top: 12px; color: #315d22; font-family: monospace; font-size: 10px; }
.coding-recent-sessions { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.coding-recent-sessions button { overflow: hidden; padding: 0; border: 0; background: none; color: var(--color-ink); cursor: pointer; font: inherit; font-size: 11px; text-align: left; text-decoration: underline; text-overflow: ellipsis; white-space: nowrap; }
.coding-project-card { flex-direction: column; align-items: stretch; }
.coding-project-actions { display: flex; gap: 8px; margin-top: auto; }
.coding-project-actions button, .coding-new, .coding-back { border: 0; border-radius: 999px; padding: 8px 12px; background: rgb(255 255 255 / 78%); color: var(--color-ink); cursor: pointer; font: inherit; font-size: 12px; }
.coding-project-actions button:disabled, .coding-new:disabled { opacity: .55; cursor: wait; }
.coding-project-actions .coding-continue { background: rgb(255 255 255 / 42%); }
.coding-ide { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: -10px; }
.coding-ide-toolbar { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 6px 10px; border-bottom: 1px solid var(--color-line); background: var(--color-surface); font-size: 13px; }
.coding-path { overflow: hidden; flex: 1; color: var(--color-ink-muted); font-family: monospace; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.coding-external { display: grid; place-items: center; color: var(--color-ink-muted); }
.coding-iframe { display: block; width: 100%; min-height: 0; flex: 1; border: 0; background: #0a0a0a; }

.coding-project-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 132px;
  padding: 22px;
  border: 1px solid var(--color-line);
  border-radius: 24px;
  color: var(--color-ink);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.coding-project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgb(0 0 0 / 10%);
}

.coding-project-card--purple { background: #c090ff; }
.coding-project-card--lime { background: #c8ff3d; }

.coding-project-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 18px;
  background: rgb(255 255 255 / 72%);
}

.coding-project-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.coding-project-name {
  font-size: 21px;
  font-weight: 600;
}

.coding-project-description {
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.7;
}

.coding-project-arrow {
  margin-left: auto;
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .coding-projects { grid-template-columns: 1fr; }
  .coding-project-card { min-height: 108px; }
  .coding-path { display: none; }
}

.apps-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.apps-head {
  padding: 0 4px;
}

.apps-category {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.apps-category-title {
  margin: 0;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.apps-empty {
  margin: 0;
  padding: 24px;
  border-radius: 24px;
  background: var(--color-surface);
  color: var(--color-ink-muted);
  font-size: 14px;
}

.apps-tile-img--custom {
  filter: none !important;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.settings-apps-err {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-error) 16%, transparent);
  color: var(--color-error);
  font-size: 13px;
}

.settings-apps-block {
  margin-top: 18px;
}

.settings-apps-subtitle {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-apps-cats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-apps-cat-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.settings-apps-folders {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-apps-folder {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 16px;
  background: var(--color-canvas);
  border: 1px solid var(--color-line);
}

.settings-apps-folder-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.settings-apps-folder-open:hover {
  background: var(--color-surface);
}

.settings-apps-folder-ico {
  flex-shrink: 0;
  color: var(--color-accent-text);
}

.settings-apps-folder-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-apps-folder-name {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-apps-folder-meta {
  font-size: 12px;
  color: var(--color-ink-muted);
}

.settings-apps-folder-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 4px;
  flex-shrink: 0;
}

.settings-apps-folder-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.settings-apps-back {
  align-self: flex-start;
  gap: 6px;
}

.settings-apps-folder-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-apps-folder-title-input {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  font-weight: 600;
}

.settings-apps-folder-hint {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.settings-apps-folder-empty {
  margin: 0;
  padding: 20px 12px;
  text-align: center;
  font-size: 14px;
  color: var(--color-ink-muted);
  border-radius: 16px;
  background: var(--color-canvas);
}

.settings-apps-app-order {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  padding-top: 4px;
}

.settings-apps-add-cat {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.settings-apps-add-cat .field-input {
  flex: 1;
  min-width: 160px;
}

.settings-apps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-apps-app {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: var(--color-canvas);
  border: 1px solid var(--color-line);
  flex-wrap: wrap;
}

.settings-apps-icons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.settings-apps-icon-pick {
  position: relative;
  width: 56px;
  height: auto;
  min-height: 52px;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px 6px;
  cursor: pointer;
  overflow: hidden;
}

.settings-apps-icon-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
  line-height: 1;
}

.settings-apps-icon-preview {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

html[data-theme="light"] .settings-apps-icon-preview {
  filter: brightness(0) saturate(100%);
}

.settings-apps-icon-preview--custom {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: none !important;
  border-radius: 8px;
}

.settings-apps-icon-empty {
  color: var(--color-ink-muted);
  display: grid;
  place-items: center;
}

.settings-apps-underlay {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.settings-apps-underlays {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.settings-apps-underlay-label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
  white-space: nowrap;
}

.settings-apps-app-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-apps-app-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.settings-apps-select {
  max-width: 220px;
}

.apps-theme {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 16px;
}

.apps-theme-head {
  padding: 0 2px;
}

.apps-theme-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-ink);
}

.apps-theme-desc {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.apps-theme .settings-theme-pick {
  margin-bottom: 0;
}

.settings-inline-link {
  color: var(--color-accent-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

html[data-theme="light"] .settings-inline-link {
  color: var(--color-accent-text);
}

.apps-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.apps-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 14px 16px;
  border-radius: 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  text-decoration: none;
  color: inherit;
  transition:
    transform var(--press-duration) var(--press-ease),
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.apps-tile:hover {
  border-color: color-mix(in srgb, var(--color-accent) 40%, var(--color-line));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.apps-tile:active {
  transform: scale(0.96);
  transition-duration: var(--press-in-duration);
}

.apps-tile-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--color-canvas);
  border: 1px solid var(--color-line);
  overflow: hidden;
  flex-shrink: 0;
}

.apps-tile-icon[data-underlay="white"],
.home-apps-icon[data-underlay="white"] {
  background: #ffffff;
}

.apps-tile-icon[data-underlay="lime"],
.home-apps-icon[data-underlay="lime"] {
  background: #c8ff3d;
}

.apps-tile-icon[data-underlay="black"],
.home-apps-icon[data-underlay="black"] {
  background: #0a0b0e;
  border-color: rgba(230, 232, 236, 0.14);
}

.apps-tile-icon[data-underlay="white"] .apps-tile-img:not(.apps-tile-img--custom),
.apps-tile-icon[data-underlay="lime"] .apps-tile-img:not(.apps-tile-img--custom),
.home-apps-icon[data-underlay="white"] .home-apps-img:not(.home-apps-img--custom),
.home-apps-icon[data-underlay="lime"] .home-apps-img:not(.home-apps-img--custom) {
  filter: brightness(0) saturate(100%);
}

.apps-tile-icon[data-underlay="black"] .apps-tile-img:not(.apps-tile-img--custom),
.home-apps-icon[data-underlay="black"] .home-apps-img:not(.home-apps-img--custom) {
  filter: brightness(0) invert(1);
}

.apps-tile-icon[data-underlay="white"] .apps-tile-fallback,
.apps-tile-icon[data-underlay="lime"] .apps-tile-fallback {
  color: #14161c;
}

.apps-tile-icon[data-underlay="black"] .apps-tile-fallback {
  color: #e6e8ec;
}

.home-apps-icon[data-underlay="white"],
.home-apps-icon[data-underlay="lime"] {
  color: #14161c;
}

.home-apps-icon[data-underlay="black"] {
  color: #e6e8ec;
}

.apps-tile-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.apps-tile-img--badge {
  width: 48px;
  height: 48px;
  filter: none;
}

.apps-tile-fallback {
  color: var(--color-accent-text);
}

.apps-tile-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  min-width: 0;
  width: 100%;
}

.apps-tile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink);
  line-height: 1.2;
}

.apps-tile-desc {
  font-size: 11px;
  color: var(--color-ink-muted);
  line-height: 1.3;
}

@media (min-width: 768px) {
  .apps-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

  .apps-tile {
    padding: 24px 16px 18px;
  }
}

/* ── Home bento ── */
.home-bento {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  grid-template-rows: 168px 130px 130px;
}

.home-tile {
  border-radius: 24px;
  background: var(--color-surface);
  min-height: 0;
}

.home-tile--a { grid-column: 1; grid-row: 1; }
.home-tile--b { grid-column: 2; grid-row: 1; }
.home-tile--c { grid-column: 1; grid-row: 2; }
.home-tile--d { grid-column: 1; grid-row: 3; }
.home-tile--e { grid-column: 2; grid-row: 2 / span 2; }

.home-tile-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-shrink: 0;
  padding: 0 2px;
}

.home-tile-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--color-ink);
  letter-spacing: -0.01em;
}

.home-tile-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.home-watch,
.home-apps {
  display: flex;
  flex-direction: column;
  padding: 14px 14px 12px;
  overflow: hidden;
  min-height: 0;
}

.home-watch-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.home-watch-row::-webkit-scrollbar {
  display: none;
}

.home-watch-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 64px;
  flex: 0 0 64px;
  min-width: 0;
  color: inherit;
}

.home-watch-poster {
  position: relative;
  width: 64px;
  height: 90px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-canvas);
  color: var(--color-accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-watch-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.home-watch-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 2px 6px;
  border-radius: 47px;
  font-size: 9px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

.home-watch-badge--watching {
  background: color-mix(in srgb, var(--color-accent) 85%, #000);
  color: var(--color-on-accent);
}

.home-watch-name {
  font-size: 11px;
  line-height: 1.2;
  color: var(--color-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-apps-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  flex: 1;
  align-content: center;
  min-height: 0;
}

.home-apps-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: inherit;
  text-align: center;
}

.home-apps-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--color-canvas);
  border: 1px solid var(--color-line);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.home-apps-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

html[data-theme="light"] .home-apps-img {
  filter: brightness(0) saturate(100%);
}

.home-apps-img--custom {
  filter: none !important;
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
}

.home-apps-name {
  font-size: 11px;
  line-height: 1.15;
  color: var(--color-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}

.home-today {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  overflow: hidden;
  min-height: 0;
}

.home-today-switch {
  margin-bottom: 12px;
  flex-shrink: 0;
}

.home-today-switch .seg-control-btn {
  font-size: 13px;
  padding: 8px 10px;
}

.home-today-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.home-today-title {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--color-ink);
  letter-spacing: -0.01em;
}

.home-today-link {
  font-size: 12px;
  color: var(--color-accent-text);
  flex-shrink: 0;
}

.home-today-link:hover {
  opacity: 0.75;
}

.home-today-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.home-today-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-today-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 12px;
  background: var(--color-canvas);
  min-width: 0;
}

.home-today-item--done {
  opacity: 0.5;
}

.home-today-item--done .home-today-text {
  text-decoration: line-through;
}

.home-today-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 6px;
  background: var(--color-surface);
  cursor: pointer;
  transition: transform var(--press-duration) var(--press-ease), background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.home-today-check:active {
  transform: scale(0.82);
  transition-duration: var(--press-in-duration);
}

.home-today-check--on {
  background: var(--color-accent);
  animation: tap-pop 0.38s var(--press-ease);
}

.home-today-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-today-time {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--color-ink-muted);
}

.page--work {
  min-height: calc(100dvh - 80px);
}

.work-layout {
  display: flex;
  gap: 16px;
  flex: 1;
  min-height: 0;
  align-items: flex-start;
}

.work-side-aside {
  flex-shrink: 0;
}

.work-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.work-layout--no-side .work-content {
  width: 100%;
}

.app-nav-link--expanded {
  z-index: 2;
}

/* Вертикальное зеркало верхнего pill-меню — слот 420/5 ≈ 84px на иконку */
.app-nav--side {
  --nav-slot-size: calc(420px / 5);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 49px;
  max-width: none;
  margin: 0;
  padding: 8px 0;
  overflow: hidden;
  box-sizing: border-box;
}

.app-nav-side-row {
  flex: 0 0 var(--nav-slot-size);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.app-nav--side-expanded {
  /* высота задаётся inline style + CSS transition */
}

.app-nav--side .app-nav-indicator {
  inset: 0;
}

@media (max-width: 520px) {
  .work-layout {
    gap: 12px;
  }

  .app-nav--side {
    --nav-slot-size: calc(380px / 5);
    width: 44px;
    padding: 6px 0;
  }

  .app-nav--side .app-nav-link {
    width: 36px;
    height: 36px;
  }
}

/* ── Work (stub) ── */
.work-stub {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.work-stub-head {
  padding: 0 4px;
}

.work-stub-title {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
}

.work-stub-note {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--color-ink-muted);
}

/* ── Settings (stub) ── */
.settings-stub {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-stub-head {
  padding: 0 4px;
}

.settings-stub-title {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
}

.settings-stub-note {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--color-ink-muted);
}

.settings-card {
  padding: 20px 22px 22px;
  border-radius: 24px;
  background: var(--color-surface);
}

.settings-card-head {
  margin-bottom: 16px;
}

.settings-card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.settings-card-desc {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--color-ink-muted);
}

.settings-theme-pick {
  display: none;
}

.theme-seg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--color-canvas);
  border: 1px solid var(--color-line);
  max-width: 100%;
}

.theme-seg-btn {
  min-height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--color-ink-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform var(--press-duration) var(--press-ease);
  -webkit-tap-highlight-color: transparent;
}

.theme-seg-btn:hover {
  color: var(--color-ink);
}

.theme-seg-btn:active {
  transform: scale(0.96);
  transition-duration: var(--press-in-duration);
}

.theme-seg-btn--active {
  background: var(--color-accent);
  color: #14161c;
}

.settings-accent-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.settings-appearance-hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--color-ink-muted);
  line-height: 1.35;
}

.settings-nav-icons-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-nav-icons-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--color-canvas);
  border: 1px solid var(--color-line);
}

.settings-nav-icons-pair {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.settings-nav-icon-cell {
  position: relative;
}

.settings-nav-icon-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 44px;
  min-height: 44px;
  padding: 5px 3px 4px;
  border-radius: 11px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  cursor: pointer;
  overflow: hidden;
}

.settings-nav-icon-label {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
  line-height: 1;
}

.settings-nav-icon-preview {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

html[data-theme="light"] .settings-nav-icon-preview {
  filter: brightness(0) saturate(100%);
}

.settings-nav-icon-preview--custom {
  filter: none !important;
  border-radius: 5px;
}

.settings-nav-icon-empty {
  color: var(--color-ink-muted);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
}

.settings-nav-icon-reset {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--color-ink);
  color: var(--color-surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 1;
  line-height: 0;
}

.settings-nav-icon-reset:hover {
  background: var(--color-error);
  color: #fff;
}

.settings-nav-icons-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.settings-nav-slot-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink);
  line-height: 1.25;
}

.settings-nav-slot-path {
  margin: 0;
  font-size: 11px;
  color: var(--color-ink-muted);
  line-height: 1.25;
}

.settings-underlay-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.settings-underlay-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.settings-underlay-btn--active {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.settings-underlay-swatch {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  flex-shrink: 0;
  border: 1px solid var(--color-line-strong);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-ink) 8%, transparent);
}

.settings-accent-opt {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 45px;
  padding: 8px 18px 8px 10px;
  border: none;
  border-radius: 47px;
  background: var(--color-canvas);
  color: var(--color-ink);
  cursor: pointer;
  transition:
    box-shadow 0.15s ease,
    transform var(--press-duration) var(--press-ease);
  -webkit-tap-highlight-color: transparent;
}

.settings-accent-opt:active {
  transform: scale(0.96);
  transition-duration: var(--press-in-duration);
}

.settings-accent-opt--active {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.settings-accent-swatch {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--color-on-accent);
  flex-shrink: 0;
}

.settings-accent-label {
  font-size: 14px;
  font-weight: 500;
}

.settings-key-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
}

.settings-key-input {
  font-size: 14px;
}

.settings-key-save {
  align-self: flex-start;
}

.settings-key-status,
.settings-key-hint {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.settings-key-ok {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink);
}

.settings-key-error {
  margin: 0;
  font-size: 13px;
  color: var(--color-error);
}

.settings-bento {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(96px, 1fr);
  gap: 12px;
  min-height: 280px;
}

.settings-tile {
  display: flex;
  align-items: flex-end;
  padding: 16px 18px;
  border-radius: 24px;
  background: var(--color-surface);
}

.settings-tile-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink-muted);
  text-transform: lowercase;
}

@media (min-width: 768px) {
  .settings-bento {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    min-height: 360px;
  }
}

/* ── Work providers ── */
.work-providers {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.work-providers-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.work-providers-card {
  padding: 20px;
}

.work-providers-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.work-providers-card-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-ink);
}

.work-providers-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-canvas);
  color: var(--color-ink-muted);
  font-size: 12px;
}

.work-providers-empty {
  margin: 0;
  padding: 32px 12px;
  text-align: center;
  font-size: 14px;
  color: var(--color-ink-muted);
}

.work-providers-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.work-provider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--color-canvas);
}

.work-provider-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.work-provider-main {
  flex: 1;
  min-width: 0;
}

.work-provider-name {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
}

.work-provider-url {
  margin-top: 2px;
  font-size: 11px;
  color: var(--color-ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-provider-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.work-provider-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.work-provider-badge--usd {
  background: rgba(255, 232, 115, 0.25);
  color: #9a7a00;
}

.work-provider-badge--rub {
  background: rgba(133, 255, 115, 0.2);
  color: #2d8a22;
}

.work-provider-badge--muted {
  background: var(--color-surface);
  color: var(--color-ink-muted);
}

.work-provider-badge--active {
  background: rgba(133, 255, 115, 0.2);
  color: #2d8a22;
}

.work-provider-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.work-provider-modal {
  max-width: 440px;
}

.work-provider-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 16px;
}

.work-provider-toggle-title {
  font-size: 14px;
  font-weight: 500;
}

.work-provider-toggle-note {
  margin-top: 2px;
  font-size: 11px;
  color: var(--color-ink-muted);
}

.work-switch {
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  border: none;
  border-radius: 999px;
  background: var(--color-canvas);
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
}

.work-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease;
}

.work-switch--on {
  background: var(--color-accent);
}

.work-switch--on::after {
  transform: translateX(18px);
}

.work-provider-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.work-provider-color {
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease;
}

.work-provider-color--active {
  border-color: var(--color-ink);
  transform: scale(1.08);
}

@media (max-width: 720px) {
  .work-provider-row {
    flex-wrap: wrap;
  }

  .work-provider-meta {
    width: 100%;
    justify-content: flex-start;
    padding-left: 22px;
  }

  .work-provider-actions {
    margin-left: auto;
  }
}

/* ── Work services (supplier services) ── */
.work-services {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.work-services-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.work-services-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.work-services-file {
  display: none;
}

.work-services-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.work-services-search {
  position: relative;
  flex: 1;
  min-width: 160px;
}

.work-services-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-ink-muted);
  pointer-events: none;
}

.work-services-search .field-input {
  padding-left: 36px;
}

.work-catalog-searching {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-accent-text);
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}

.work-catalog-ai-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--color-accent-2);
  color: var(--color-on-accent-2);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  pointer-events: none;
}

.work-catalog-ai-badge--pending {
  opacity: 0.65;
  animation: work-catalog-ai-pulse 1s ease-in-out infinite;
}

@keyframes work-catalog-ai-pulse {
  50% { opacity: 0.35; }
}

.work-services-search:has(.work-catalog-ai-badge) .field-input {
  padding-right: 68px;
}

.work-services-search:has(.work-catalog-searching) .field-input {
  padding-right: 28px;
}

.work-services-select {
  width: auto;
  min-width: 130px;
  flex: 0 1 140px;
}

.work-services-card {
  padding: 20px;
}

.work-services-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.work-service-id {
  font-size: 11px;
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}

.work-services-search--wide {
  width: 100%;
}

.work-services-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.work-catalog-status {
  font-size: 12px;
  color: var(--color-ink-muted);
}

.work-catalog-status b {
  color: var(--color-ink);
  font-weight: 500;
}

.work-catalog-updated {
  margin-left: auto;
  font-size: 11px;
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}

.work-catalog-updated--stale {
  color: #b45309;
  font-weight: 600;
}

.work-catalog-stale-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #92400e;
  background: #fff8eb;
  box-shadow: inset 0 0 0 1px rgba(180, 83, 9, 0.25);
}

.work-catalog-stale-banner--sync {
  color: var(--color-ink-muted);
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-line);
}

.work-catalog-ai-status {
  font-size: 11px;
  color: var(--color-ink-muted);
  white-space: nowrap;
}

.work-catalog-ai-tag {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-accent-2-soft);
  color: var(--color-ink);
  font-size: 11px;
  font-weight: 500;
}

.work-catalog-ai-note {
  margin-top: 4px;
  font-size: 12px;
  color: var(--color-ink-muted);
  line-height: 1.35;
}

.work-catalog-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.work-catalog-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--color-canvas);
  border-radius: 47px;
  background: var(--color-canvas);
  color: var(--color-ink-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.work-catalog-chip--active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
}

.work-catalog-chip-count {
  opacity: 0.75;
  font-size: 11px;
}

.work-catalog-errors {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--color-ink-muted);
  line-height: 1.5;
  border: 1px solid rgba(255, 232, 115, 0.35);
}

.work-catalog-errors-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.work-catalog-errors-toggle svg:first-child {
  flex-shrink: 0;
  color: #9a7a00;
}

.work-catalog-errors-toggle svg:last-child {
  margin-left: auto;
  transition: transform 0.15s ease;
}

.work-catalog-errors-chevron--open {
  transform: rotate(180deg);
}

.work-catalog-errors-list {
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow: auto;
}

.work-catalog-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 16px;
  color: var(--color-ink-muted);
  font-size: 14px;
}

.work-catalog-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 16px;
  color: var(--color-ink-muted);
  font-size: 14px;
}

.work-catalog-empty .work-providers-empty {
  text-align: center;
  max-width: 320px;
}

.work-catalog-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--color-canvas);
  border-top-color: var(--color-accent);
  animation: work-spin-keyframes 1s linear infinite;
}

.work-spin {
  animation: work-spin-keyframes 1s linear infinite;
}

@keyframes work-spin-keyframes {
  to {
    transform: rotate(360deg);
  }
}

.work-catalog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.work-catalog-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--color-canvas);
}

.work-catalog-main {
  flex: 1;
  min-width: 0;
}

.work-catalog-name {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 6px;
}

.work-catalog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.work-catalog-category {
  font-size: 11px;
  color: var(--color-ink-muted);
}

.work-catalog-desc {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--color-ink-muted);
  line-height: 1.45;
}

.work-catalog-price {
  flex-shrink: 0;
  text-align: right;
}

.work-catalog-price-primary {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.work-catalog-price-secondary {
  font-size: 11px;
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}

.work-catalog-price-note {
  margin-top: 4px;
  font-size: 10px;
  color: var(--color-ink-muted);
}

.work-catalog-price-range {
  margin-top: 3px;
  font-size: 10px;
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}

.work-catalog-more {
  width: 100%;
  margin-top: 12px;
  justify-content: center;
}

.work-service-modal {
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.work-service-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.work-service-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 80px;
  gap: 12px;
}

.work-service-block {
  margin-top: 12px;
  padding: 14px 16px;
}

.work-service-block-title {
  margin: 0 0 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent-text);
}

.work-service-block-title--mine {
  color: #2d8a22;
}

.work-service-textarea {
  min-height: 72px;
  resize: vertical;
}

.work-service-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.work-service-margin-x {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

.work-service-margin-label {
  font-size: 14px;
  color: var(--color-ink-muted);
}

.work-service-margin-x .field-input {
  width: 90px;
}

.work-service-qty-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.work-service-qty-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 999px;
  background: var(--color-canvas);
  color: var(--color-ink-muted);
  font-size: 11px;
  cursor: pointer;
}

.work-service-qty-btn--active {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.work-service-warn {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 232, 115, 0.2);
  color: #9a7a00;
  font-size: 12px;
}

.work-service-err {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 115, 115, 0.12);
  color: #c44;
  font-size: 12px;
}

@media (max-width: 720px) {
  .work-services-head {
    flex-direction: column;
  }

  .work-service-row {
    flex-wrap: wrap;
  }

  .work-service-prices {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    text-align: left;
    gap: 12px;
  }

  .work-service-grid-2,
  .work-service-grid-3 {
    grid-template-columns: 1fr;
  }
}

.work-bento {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  grid-template-rows: 160px 160px;
  min-height: 340px;
}

.work-tile {
  border-radius: 24px;
  background: var(--color-surface);
}

.work-tile--a { grid-column: 1; grid-row: 1; }
.work-tile--b { grid-column: 2; grid-row: 1; }
.work-tile--c { grid-column: 1; grid-row: 2; }
.work-tile--d { grid-column: 2; grid-row: 2; }

/* ── Work money (финансы) ── */
.work-money-page {
  width: 100%;
}

.work-money {
  --ink: var(--color-ink);
  --ink-soft: var(--color-ink-muted);
  --ink-mute: var(--color-ink-muted);
  --copper: var(--color-accent);
  --copper-soft: var(--color-accent-muted);
  --copper-deep: var(--color-accent-text);
  --teal: #5a9e8f;
  --teal-soft: #7ab8aa;
  --teal-deep: #3d7a6d;
  --inset: var(--color-canvas);
  --raised: var(--color-surface);
  --line: var(--color-line);
  --line-strong: var(--color-line-strong);
  --inset-1: inset 0 0 0 1px var(--color-line);
  --raise-1: 0 1px 3px rgba(0, 0, 0, 0.25);
  --r-sm: 12px;
  --r-md: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sh-dark-soft: rgba(0, 0, 0, 0.2);
  --font-display: var(--font-stolzl, system-ui, sans-serif);

  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  width: 100%;
}

.work-money-head {
  padding: 0 4px;
}

.work-money-tabs {
  max-width: 520px;
}

.work-money-body {
  min-width: 0;
}

.work-money .neo {
  background: var(--color-surface);
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px var(--color-line);
}

.work-money .neo-inset {
  background: var(--color-canvas);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--color-line);
}

.work-money .input {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 16px;
  background: var(--color-canvas);
  color: var(--color-ink);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.work-money .input:focus {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.work-money .overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.35);
}

.work-money .modal {
  width: 100%;
  max-width: 460px;
  padding: 24px;
  border-radius: 24px;
  background: var(--color-surface);
}

.work-money .sec-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-ink-muted);
  text-transform: lowercase;
}

.work-money .pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--color-canvas);
  color: var(--color-ink-muted);
  font-size: 12px;
  font-weight: 500;
}

.work-money .btn-primary {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.work-money .btn-accent-2 {
  background: var(--color-accent-2);
  color: var(--color-on-accent-2);
}

.work-money .btn-ghost {
  background: var(--color-canvas);
  color: var(--color-ink);
}

.work-money .btn-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
}

.work-money .btn-sm {
  gap: 6px;
  padding: 8px 14px;
  font-size: 14px;
}

.work-money .cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.work-money .cal-title {
  font-size: 16px;
  font-weight: 500;
}

.work-money .cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
  text-align: center;
  font-size: 10px;
  color: var(--color-ink-muted);
}

.work-money .neo.cal-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 24px 26px;
  border: none;
  color: var(--color-on-accent);
  background: var(--color-accent);
  box-shadow: none;
}

.work-money .cal-hero .stat-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(20, 22, 28, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.work-money .cal-hero .stat-num {
  font-size: 34px;
  font-weight: 800;
  color: var(--color-on-accent);
  letter-spacing: -0.02em;
}

.work-money .cal-hero .stat-sub {
  font-size: 13px;
  font-weight: 700;
  color: rgba(20, 22, 28, 0.75);
}

/* ── Money: debts ── */
.work-money .debts-bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.work-money .debts-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 22px 24px;
  border: none;
  color: var(--color-on-accent);
  background: linear-gradient(150deg, var(--color-accent-muted), var(--color-accent));
  border-radius: 24px;
}

.work-money .debts-hero .stat-label {
  color: color-mix(in srgb, var(--color-on-accent) 70%, transparent);
}

.work-money .debts-hero .stat-num {
  font-size: 28px;
  color: var(--color-on-accent);
  line-height: 1.05;
}

.work-money .debts-hero .stat-sub {
  color: color-mix(in srgb, var(--color-on-accent) 75%, transparent);
}

.work-money .debts-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 18px 20px;
  border-radius: 24px;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-line);
}

.work-money .stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.work-money .stat-num {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--color-ink);
}

.work-money .stat-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-muted);
}

.work-money .debts-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  grid-column: 1 / -1;
}

.work-money .debts-est {
  padding: 18px 20px;
  border-radius: 24px;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-line);
  min-width: 0;
}

.work-money .debts-est-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.work-money .debts-est-sub {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-ink);
}

.work-money .debts-est-sub b {
  font-weight: 800;
}

.work-money .debts-est-zero {
  color: var(--color-ink-muted);
  font-weight: 600;
}

.work-money .debts-est-usd {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-ink-muted);
}

.work-money .debts-est-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(340px, 42vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.work-money .debts-est-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 76px 46px 32px;
  gap: 6px;
  align-items: center;
}

.work-money .debts-est-row .input {
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 12px;
  min-height: 38px;
}

.work-money .debts-est-date {
  font-size: 13px;
}

.work-money .debts-est-amount {
  text-align: right;
}

.work-money .debts-est-cur {
  padding-left: 6px;
  padding-right: 2px;
}

.work-money .debts-est-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.work-money .debts-est-title {
  flex: 1;
  min-width: 0;
}

.work-money .debts-est-title.arrived {
  color: var(--color-ink-muted);
  text-decoration: line-through;
}

.work-money .debts-est-check {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--color-ink);
  background: var(--color-canvas);
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, color 0.15s ease;
}

.work-money .debts-est-check.on {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
}

.work-money .debts-est-del {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-ink-muted);
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.work-money .debts-est-del:hover {
  color: var(--color-error);
  background: var(--color-canvas);
}

.work-money .debts-est-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--color-ink-muted);
  font-size: 14px;
}

.work-money .debts-arrived {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.work-money .debts-arrived summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-muted);
  padding: 6px 2px 8px;
  list-style: none;
}

.work-money .debts-arrived summary::-webkit-details-marker {
  display: none;
}

.work-money .debts-arrived[open] summary {
  margin-bottom: 6px;
}

.work-money .btn-teal {
  background: var(--color-canvas);
  color: var(--teal-deep);
}

@media (max-width: 900px) {
  .work-money .debts-bento {
    grid-template-columns: 1fr;
  }

  .work-money .debts-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .work-money .debts-est-row {
    grid-template-columns: 1fr 72px 40px;
    grid-template-areas:
      "date date del"
      "title title del"
      "amount cur del";
    gap: 6px 8px;
    padding: 10px;
    border-radius: 14px;
    background: var(--color-canvas);
    box-shadow: inset 0 0 0 1px var(--color-line);
  }

  .work-money .debts-est-date { grid-area: date; }
  .work-money .debts-est-title-wrap { grid-area: title; }
  .work-money .debts-est-amount { grid-area: amount; text-align: left; }
  .work-money .debts-est-cur { grid-area: cur; }
  .work-money .debts-est-del { grid-area: del; align-self: start; }
}

.work-hours {
  width: fit-content;
  max-width: 100%;
}

.work-cal-wrap {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
}

.work-cal {
  flex: 0 0 auto;
  width: 500px;
  max-width: 100%;
  padding: 18px 18px 20px;
  box-sizing: border-box;
}

.work-cal-panel {
  flex: 0 0 280px;
  width: 280px;
  padding: 16px 14px 18px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.work-cal-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 12px;
}

.work-cal-panel-date {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-ink);
}

.work-cal-panel-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--press-duration) var(--press-ease);
  -webkit-tap-highlight-color: transparent;
}

.work-cal-panel-add:active {
  transform: scale(0.9);
}

.work-cal-panel-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.work-cal-booking-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.work-cal-booking-remove-mini {
  position: absolute;
  top: -2px;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--color-ink-muted);
  cursor: pointer;
  opacity: 0.6;
}

.work-cal-booking-remove-mini:hover {
  opacity: 1;
  background: var(--color-canvas);
}

.work-cal-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 47px;
  background: var(--color-canvas);
  box-shadow: inset 0 0 0 1px var(--color-line);
}

.work-cal-row--time {
  padding: 0 12px;
  gap: 6px;
}

.work-cal-assignee-mini {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.work-cal-assignee-mini-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-ink-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.work-cal-assignee-mini-btn--active {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.work-cal-row-select {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  padding-right: 18px;
}

.work-cal-row-time {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-size: 14px;
  outline: none;
  text-align: center;
}

.work-cal-row-time::-webkit-calendar-picker-indicator {
  opacity: 0.45;
  cursor: pointer;
}

.work-cal-row-sep {
  flex-shrink: 0;
  color: var(--color-ink-muted);
  font-size: 14px;
}

.work-cal .cal-nav {
  margin-bottom: 12px;
}

.work-cal .cal-title {
  font-size: 16px;
}

.work-cal-dow {
  gap: 4px;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.work-cal-grid {
  gap: 4px;
}

.work-cal-day {
  aspect-ratio: auto;
  min-height: 42px;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 4px 4px 3px;
  gap: 2px;
  border-radius: 8px;
}

.work-cal-day-num {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  align-self: flex-start;
}

.work-cal-day-chips {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  margin-top: auto;
}

.work-cal-chip {
  display: block;
  max-width: 100%;
  padding: 2px 5px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--color-accent-soft);
  color: var(--color-accent-text);
}

.work-cal-chip--artem {
  background: var(--color-accent-soft-mid);
}

.work-cal-chip--nika {
  background: var(--color-accent-soft-light);
  color: var(--color-accent-text);
}

.work-cal-chip--more {
  background: var(--color-canvas);
  color: var(--color-ink-muted);
}

.cal-day--selected .work-cal-chip {
  background: rgba(255, 255, 255, 0.22);
  color: var(--color-on-accent);
}

.cal-day--selected .work-cal-chip--more {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(233, 233, 233, 0.85);
}

.work-cal-day--filled:not(.cal-day--selected) {
  background: var(--color-canvas-2);
}

.work-cal-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.work-cal-editor-title {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
}

.work-hall-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.work-hall-pills .seg-control-btn {
  width: 100%;
  padding: 7px 8px;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 12px;
}

.work-assignee-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.work-assignee-btn {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 12px;
}

.work-cal-bookings {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.work-cal-booking {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: var(--color-canvas);
  flex-shrink: 0;
}

.work-cal-booking .seg-control-btn {
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-line);
}

.work-cal-booking .seg-control-btn--active {
  box-shadow: none;
}

.work-cal-booking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.work-cal-booking-num {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-ink-muted);
  text-transform: lowercase;
}

.work-cal-booking-remove {
  width: 36px;
  height: 36px;
}

.work-cal-booking-summary {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-muted);
}


.work-cal-editor-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}

.work-cal-editor-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.work-cal-editor-field .field-input {
  padding: 8px 10px;
  font-size: 14px;
  min-height: 38px;
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-line);
  color: var(--color-ink);
}

.work-cal-editor-field .field-input:focus {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.work-cal-editor-field .field-input::-webkit-calendar-picker-indicator {
  opacity: 0.55;
  cursor: pointer;
}

.work-cal-editor-summary {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--color-ink-muted);
}

@media (max-width: 720px) {
  .work-hours {
    width: 100%;
  }

  .work-cal-wrap {
    flex-direction: column;
    width: 100%;
  }

  .work-cal {
    width: 100%;
  }

  .work-cal-panel {
    width: 100%;
    flex: 0 0 auto;
  }
}

@media (max-width: 520px) {
  .work-cal-grid,
  .work-cal-dow {
    gap: 4px;
  }

  .work-cal-day {
    min-height: 48px;
    padding: 5px 3px 4px;
    border-radius: 8px;
  }

  .work-cal-day-num {
    font-size: 12px;
  }

  .work-cal-chip {
    font-size: 8px;
    padding: 1px 3px;
  }

  .work-cal-editor-times {
    grid-template-columns: 1fr;
  }

  .work-hall-pills .seg-control-btn {
    padding: 8px 10px;
    font-size: 13px;
  }
}

/* ── Reminders ── */
.reminders-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .reminders-grid {
    grid-template-columns: minmax(280px, 380px) 1fr;
    align-items: stretch;
  }
}

.tile {
  border-radius: 24px;
  background: var(--color-surface);
  padding: 24px;
}

.tile--cal,
.tile--tasks {
  display: flex;
  flex-direction: column;
}

.tile--tasks {
  min-height: 0;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cal-title {
  font-size: 18px;
  font-weight: 500;
}

.cal-year {
  color: var(--color-ink-muted);
}

.cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--color-ink-muted);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  background: var(--color-canvas);
  color: var(--color-ink);
  font-size: 14px;
  cursor: pointer;
  transition: transform var(--press-duration) var(--press-ease), background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.cal-day:active {
  transform: scale(0.9);
  transition-duration: var(--press-in-duration);
}

.cal-day:hover {
  background: var(--color-canvas-2);
}

.cal-day--today {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.cal-day--selected {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.cal-dot {
  position: absolute;
  bottom: 6px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--color-accent);
}

.cal-day--selected .cal-dot {
  background: var(--color-on-accent);
}

.cal-dot--done {
  background: var(--color-success);
}

.cal-day--empty {
  visibility: hidden;
  pointer-events: none;
  background: transparent;
}

.cal-day--empty:hover {
  background: transparent;
}

.tasks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.tasks-eyebrow {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.tasks-date {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 500;
}

.tasks-add {
  flex-shrink: 0;
}

.tasks-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ink-muted);
  font-size: 15px;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--color-canvas);
}

.task-item--done {
  opacity: 0.55;
}

.task-item--done .task-title {
  text-decoration: line-through;
}

.task-check {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 8px;
  background: var(--color-surface);
  cursor: pointer;
  transition: transform var(--press-duration) var(--press-ease), background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.task-check:active {
  transform: scale(0.82);
  transition-duration: var(--press-in-duration);
}

.task-check--on {
  background: var(--color-accent);
  box-shadow: inset 0 0 0 2px var(--color-surface);
  animation: tap-pop 0.38s var(--press-ease);
}

.task-body {
  flex: 1;
  min-width: 0;
}

.task-title {
  display: block;
  font-size: 15px;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--color-ink-muted);
}

.task-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: 11px;
}

/* ── Modal & forms ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.35);
}

.modal-card {
  width: 100%;
  max-width: 400px;
  padding: 24px;
  border-radius: 24px;
  background: var(--color-surface);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.modal-actions .btn {
  flex: 1;
  font-size: 16px;
}

.field-label {
  display: block;
  margin: 12px 0 6px;
  font-size: 12px;
  color: var(--color-ink-muted);
}

.field-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-line);
  border-radius: 16px;
  background: var(--color-canvas);
  color: var(--color-ink);
  outline: none;
}

.field-input:focus {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.seg-control {
  display: flex;
  gap: 8px;
}

.seg-control-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 47px;
  background: var(--color-canvas);
  color: var(--color-ink);
  font-size: 14px;
  cursor: pointer;
  transition: transform var(--press-duration) var(--press-ease), background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.seg-control-btn:active {
  transform: scale(0.94);
  transition-duration: var(--press-in-duration);
}

.seg-control-btn--active {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: var(--color-canvas);
  color: var(--color-ink);
  cursor: pointer;
  transition: transform var(--press-duration) var(--press-ease), opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.icon-btn:hover {
  opacity: 0.75;
}

.icon-btn:active {
  transform: scale(0.86);
  transition-duration: var(--press-in-duration);
  opacity: 1;
}

.icon-btn--muted {
  background: transparent;
  color: var(--color-ink-muted);
}

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: min(731px, calc(100vw - 40px));
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 21px;
  border: none;
  border-radius: 47px;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--press-duration) var(--press-ease), filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:active:not(:disabled) {
  transform: scale(0.94) translateY(1px);
  transition-duration: var(--press-in-duration);
  filter: brightness(0.96);
}

.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn--primary { background: var(--color-accent); color: var(--color-on-accent); }
.btn--accent-2 { background: var(--color-accent-2); color: var(--color-on-accent-2); }
.btn--secondary { background: var(--color-surface-2, var(--color-canvas)); color: var(--color-ink); }
.btn--icon { min-width: 68px; height: 45px; padding: 0 16px; }
.btn--sm {
  gap: 6px;
  padding: 8px 14px;
  font-size: 14px;
}

@keyframes tap-pop {
  0% { transform: scale(0.82); }
  55% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .icon-btn,
  .seg-control-btn,
  .app-nav-link,
  .app-nav-side-row,
  .bottom-nav,
  .app-settings,
  .task-check,
  .home-today-check,
  .cal-day {
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
    animation: none !important;
  }

  .btn:active:not(:disabled),
  .icon-btn:active,
  .seg-control-btn:active,
  .app-nav-link:active,
  .app-settings:active,
  .task-check:active,
  .home-today-check:active,
  .cal-day:active {
    transform: none;
  }

  .app-nav-link .nav-icon,
  .app-nav-link svg,
  .app-nav-link .nav-icon-slot {
    transition: opacity 0.15s ease, color 0.15s ease;
    transform: none !important;
    animation: none !important;
  }

  .app-nav-link:not(.app-nav-link--active) .nav-icon {
    filter: brightness(0) invert(1);
  }

  .app-nav-link--active .nav-icon {
    filter: brightness(0) saturate(100%);
  }

  html[data-theme="light"] .app-nav-link:not(.app-nav-link--active) .nav-icon,
  html[data-theme="light"] .app-nav-link--active .nav-icon {
    filter: brightness(0) saturate(100%);
  }

  .app-nav-link .nav-icon.nav-icon--preset-active {
    filter: none;
  }
}

/* ── Watch stand ── */
.watch-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  padding-bottom: 8px;
}

.watch-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 4px;
}

.watch-lead {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--color-ink-muted);
  line-height: 1.35;
}

.watch-add {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.watch-add-input {
  flex: 1;
  min-width: 0;
}

.watch-add-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.watch-spin {
  animation: watch-spin 0.8s linear infinite;
}

@keyframes watch-spin {
  to { transform: rotate(360deg); }
}

.watch-err {
  margin: 0;
  font-size: 14px;
  color: var(--color-error, #ff7373);
}

.watch-empty {
  margin: 24px 0 0;
  text-align: center;
  font-size: 15px;
  color: var(--color-ink-muted);
}

.watch-filter {
  flex-wrap: wrap;
}

.watch-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (min-width: 640px) {
  .watch-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 960px) {
  .watch-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.watch-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.watch-card:active .watch-card-poster {
  transform: scale(0.97);
}

.watch-card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 18px;
  overflow: hidden;
  background: var(--color-surface);
  transition: transform var(--press-duration, 0.15s) var(--press-ease, ease);
}

.watch-card-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.watch-card-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent-text);
}

.watch-card-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 5px 10px;
  border-radius: 47px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  backdrop-filter: blur(6px);
}

.watch-card-badge--watching {
  background: color-mix(in srgb, var(--color-accent) 85%, #000);
}

.watch-card-badge--done {
  background: color-mix(in srgb, var(--color-success, #85ff73) 70%, #000);
  color: #111;
}

.watch-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px;
}

.watch-card-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--color-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.watch-card-sub {
  font-size: 12px;
  color: var(--color-ink-muted);
}

.watch-picker-q {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.watch-picker-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: min(60vh, 480px);
  overflow: auto;
}

.watch-picker-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.watch-picker-card:hover .watch-picker-card-poster,
.watch-picker-card:focus-visible .watch-picker-card-poster {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.watch-picker-card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-canvas);
  color: var(--color-accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.watch-picker-card-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.watch-picker-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 0 2px;
}

.watch-picker-card-title {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.watch-picker-card-sub {
  font-size: 11px;
  color: var(--color-ink-muted);
}

.watch-picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(60vh, 420px);
  overflow: auto;
}

.watch-picker-item {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 16px;
  background: var(--color-canvas, var(--color-bg));
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.watch-picker-item:hover {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.watch-picker-poster {
  position: relative;
  width: 48px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-surface);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent-text);
}

.watch-picker-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.watch-picker-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.watch-picker-title {
  font-size: 15px;
  font-weight: 500;
}

.watch-picker-sub {
  font-size: 12px;
  color: var(--color-ink-muted);
}

.watch-detail-poster-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  flex: 0 0 120px;
  width: 120px;
}

.watch-poster-change {
  appearance: none;
  border: none;
  padding: 8px 10px;
  border-radius: 47px;
  background: var(--color-canvas);
  color: var(--color-ink);
  font-size: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.watch-poster-change:disabled {
  opacity: 0.6;
  cursor: default;
}

.watch-detail-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.watch-detail.modal-card {
  max-width: 440px;
}

.watch-picker.modal-card {
  max-width: 520px;
}

.watch-detail-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  align-self: flex-start;
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-canvas);
  color: var(--color-accent-text);
}

.watch-detail-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.watch-detail-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.watch-detail-sub,
.watch-detail-genres {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.watch-detail-overview {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-ink);
}

.watch-status-seg {
  margin: 0 0 4px;
  width: 100%;
  min-width: 0;
}

.watch-status-seg .seg-control-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 8px;
  font-size: 13px;
}

.watch-rating {
  margin: 10px 0 0;
}

.watch-rating-label {
  margin-top: 0;
}

.watch-rating-row {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}

.watch-rating-btn {
  appearance: none;
  border: none;
  padding: 8px 0;
  border-radius: 12px;
  background: var(--color-canvas);
  color: var(--color-ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--press-duration, 0.15s) var(--press-ease, ease),
    background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.watch-rating-btn:active {
  transform: scale(0.94);
}

.watch-rating-btn--active {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.watch-note {
  resize: vertical;
  min-height: 64px;
}

@media (max-width: 520px) {
  .watch-add {
    flex-direction: column;
  }

  .watch-detail-body {
    flex-direction: column;
    align-items: center;
  }

  .watch-detail-poster-col {
    width: 140px;
    flex-basis: 140px;
  }

  .watch-detail-info {
    width: 100%;
  }

  .watch-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .watch-rating-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* ── AI app ── */
.ai-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.ai-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ai-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-tabs {
  min-width: min(240px, 100%);
}

.ai-chat-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
  position: relative;
}

.ai-chats-panel {
  flex: 0 0 240px;
  width: 240px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--color-surface);
  border-radius: 24px;
  padding: 12px;
}

.ai-chats-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-new-chat {
  flex: 1;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 14px;
}

.ai-chats-close,
.ai-chats-toggle,
.ai-chats-backdrop {
  display: none;
}

.ai-chats-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  flex: 1;
}

.ai-chats-empty {
  padding: 18px 8px;
  text-align: center;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.ai-chat-item {
  position: relative;
  display: flex;
  align-items: stretch;
  border-radius: 14px;
}

.ai-chat-item-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 36px 10px 12px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.ai-chat-item-btn:hover {
  background: var(--color-canvas);
}

.ai-chat-item--active .ai-chat-item-btn {
  background: color-mix(in srgb, var(--color-accent) 22%, var(--color-canvas));
}

.ai-chats-owner {
  margin: 0;
  padding: 0 4px 2px;
  font-size: 12px;
  color: var(--color-ink-muted);
}

.ai-chats-owner strong {
  color: var(--color-ink);
  font-weight: 600;
}

.ai-chat-item-title {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-chat-shared-mark {
  flex-shrink: 0;
  color: var(--color-accent-text);
}

.ai-chat-item-actions {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: flex;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.ai-chat-item:hover .ai-chat-item-actions,
.ai-chat-item:focus-within .ai-chat-item-actions {
  opacity: 1;
  pointer-events: auto;
}

.ai-chat-item-del,
.ai-chat-item-share {
  position: static;
  transform: none;
  width: 30px;
  height: 30px;
  opacity: 1;
  pointer-events: auto;
}

.ai-chat-item-share--on {
  color: var(--color-accent-text);
}

.ai-chat-item-btn {
  padding-right: 68px;
}

.ai-chat-rename {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  font-size: 13px;
}

.ai-identify {
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
}

.ai-identify-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-ink);
}

.ai-identify-desc {
  margin: 4px 0 12px;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.ai-identify-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-usage-shared-note {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.ai-chat-item-meta {
  font-size: 11px;
  color: var(--color-ink-muted);
}

.ai-chat {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-surface);
  border-radius: 24px;
  padding: 16px;
}

.ai-chat-log {
  flex: 1;
  min-height: 280px;
  max-height: min(58vh, 640px);
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.ai-chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  color: var(--color-ink-muted);
  padding: 32px 16px;
}

.ai-chat-empty p {
  margin: 0;
  max-width: 280px;
  font-size: 14px;
  line-height: 1.4;
}

.ai-msg-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-msg {
  display: flex;
}

.ai-msg--user {
  justify-content: flex-end;
}

.ai-msg--assistant {
  justify-content: flex-start;
}

.ai-bubble {
  position: relative;
  max-width: min(92%, 560px);
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--color-canvas);
  color: var(--color-ink);
}

.ai-msg--user .ai-bubble {
  background: var(--color-accent);
  color: var(--color-on-accent);
  border-bottom-right-radius: 6px;
}

.ai-msg--assistant .ai-bubble {
  border-bottom-left-radius: 6px;
  padding-bottom: 28px;
  padding-top: 18px;
}

.ai-bubble--pending {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-ink-muted);
  padding-bottom: 12px;
}

.ai-bubble-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.45;
}

.ai-bubble-meta {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.ai-model-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-ink-muted);
  background: color-mix(in srgb, var(--color-surface) 80%, transparent);
  padding: 2px 7px;
  border-radius: 999px;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-model-tag--user {
  display: inline-block;
  margin-top: 8px;
  color: color-mix(in srgb, var(--color-on-accent) 80%, transparent);
  background: color-mix(in srgb, var(--color-on-accent) 14%, transparent);
}

.ai-bubble--pending .ai-model-tag {
  margin-left: 2px;
}

.ai-cost {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-ink-muted);
  background: color-mix(in srgb, var(--color-surface) 80%, transparent);
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: auto;
  flex-shrink: 0;
}

.ai-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.ai-mode {
  flex-shrink: 0;
}

.ai-model-pick {
  flex: 1;
  min-width: 140px;
}

.ai-model-select {
  width: 100%;
  min-height: 40px;
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 13px;
}

.ai-model-now {
  flex: 1 1 100%;
  margin: 0;
  font-size: 12px;
  color: var(--color-ink-muted);
}

.ai-model-now strong {
  color: var(--color-ink);
  font-weight: 600;
}

.ai-bubble-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.ai-img-wrap {
  position: relative;
  display: inline-block;
}

.ai-img-btn {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 12px;
  overflow: hidden;
}

.ai-img {
  display: block;
  max-width: min(240px, 70vw);
  max-height: 220px;
  width: auto;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
}

.ai-msg--user .ai-img {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-on-accent) 25%, transparent);
}

.ai-img-dl {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
  color: var(--color-ink);
}

.ai-pending {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-pending-item {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-canvas);
}

.ai-pending-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ai-pending-rm {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  background: color-mix(in srgb, var(--color-surface) 90%, transparent);
}

.ai-attach {
  flex-shrink: 0;
  margin-bottom: 4px;
}

.ai-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
}

.ai-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: color-mix(in srgb, #000 55%, transparent);
  cursor: pointer;
}

.ai-lightbox-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: min(96vw, 920px);
  max-height: 92vh;
}

.ai-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 64px);
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 16px;
  background: var(--color-surface);
  object-fit: contain;
}

.ai-lightbox-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.ai-input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  max-height: 140px;
  resize: none;
}

.ai-send {
  width: 48px;
  height: 48px;
  padding: 0;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ai-clear {
  flex-shrink: 0;
  margin-bottom: 4px;
}

.ai-err {
  margin: 0;
  font-size: 13px;
  color: var(--color-error);
}

.ai-spin {
  animation: ai-spin 0.8s linear infinite;
}

@keyframes ai-spin {
  to { transform: rotate(360deg); }
}

.ai-usage {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-usage-hero {
  padding: 22px 24px;
  border-radius: 24px;
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.ai-usage-hero-label {
  margin: 0 0 6px;
  font-size: 13px;
  opacity: 0.75;
}

.ai-usage-hero-sum {
  margin: 0;
  font-size: 36px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.ai-usage-hero-meta {
  margin: 10px 0 0;
  font-size: 13px;
  opacity: 0.75;
}

.ai-usage-block {
  padding: 16px 18px;
  border-radius: 24px;
  background: var(--color-surface);
}

.ai-usage-subtitle {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-ink-muted);
}

.ai-usage-sources,
.ai-usage-recent {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-usage-source,
.ai-usage-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--color-canvas);
}

.ai-usage-source-name,
.ai-usage-recent-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink);
}

.ai-usage-source-meta,
.ai-usage-recent-meta {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--color-ink-muted);
}

.ai-usage-source-cost,
.ai-usage-recent-cost {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-accent-text);
}

.ai-tile-empty {
  margin: 0;
  padding: 18px 8px;
  text-align: center;
  font-size: 14px;
  color: var(--color-ink-muted);
}

@media (max-width: 860px) {
  .ai-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .ai-head {
    gap: 10px;
    align-items: center;
  }

  .ai-head > :first-child {
    min-width: 0;
    flex-shrink: 0;
  }

  .ai-head-actions {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
    gap: 8px;
  }

  .ai-tabs {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 200px;
  }

  .ai-tabs .seg-control-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 10px;
    font-size: 13px;
  }

  .ai-chat-shell {
    overflow: hidden;
    width: 100%;
    max-width: 100%;
  }

  .ai-chat {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 12px;
    border-radius: 20px;
  }

  .ai-msg-list,
  .ai-msg {
    max-width: 100%;
    min-width: 0;
  }

  .ai-bubble {
    max-width: min(100%, 560px);
    box-sizing: border-box;
  }

  .ai-bubble-text {
    overflow-wrap: anywhere;
  }

  .ai-composer {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .ai-chats-toggle {
    display: grid;
    flex-shrink: 0;
  }

  .ai-chats-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 2;
    border: none;
    background: rgba(20, 22, 28, 0.35);
    border-radius: 24px;
    cursor: pointer;
  }

  .ai-chats-panel {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    flex: none;
    transform: translateX(-110%);
    transition: transform 0.22s ease;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  }

  .ai-chats-panel--open {
    transform: translateX(0);
  }

  .ai-chats-close {
    display: grid;
  }

  .ai-chat-item-actions {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 520px) {
  .ai-chat-log {
    max-height: min(52vh, 520px);
  }

  .ai-head {
    flex-wrap: nowrap;
  }

  .ai-tabs {
    max-width: none;
  }

  .work-stub-title {
    font-size: 28px;
  }
}

/* ── Login / PWA gate ── */
.gate-page {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 24px 16px 48px;
}

.gate-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 22px 24px;
  border-radius: 28px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
}

.gate-card--loading {
  text-align: center;
  color: var(--color-ink-muted);
  font-size: 14px;
}

.gate-title {
  margin: 4px 0 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-ink);
}

.gate-sub {
  margin: 0 0 8px;
  font-size: 13px;
  text-align: center;
  color: var(--color-ink-muted);
  line-height: 1.35;
}

.gate-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.gate-submit {
  width: 100%;
  margin-top: 8px;
  justify-content: center;
}

.gate-err {
  margin: 0;
  width: 100%;
  font-size: 13px;
  color: var(--color-error);
  text-align: center;
}

/* ── Studio (fullscreen infinite canvas) ── */
.shell-main:has(.page--studio) {
  max-width: none;
  width: 100%;
  height: 100dvh;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.page--studio {
  position: fixed;
  inset: 0;
  z-index: 80;
  gap: 0;
  padding: 0;
  margin: 0;
  min-height: 100dvh;
  height: 100dvh;
  border-radius: 0;
  background: var(--color-canvas);
}

.studio-app {
  position: absolute;
  inset: 0;
  display: block;
  min-height: 0;
}

.studio-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  border-radius: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.studio-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.studio-origin {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0.35;
}

.studio-origin-x,
.studio-origin-y {
  position: absolute;
  background: color-mix(in srgb, var(--color-ink) 35%, transparent);
}

.studio-origin-x {
  left: -40px;
  top: 0;
  width: 80px;
  height: 1px;
}

.studio-origin-y {
  left: 0;
  top: -40px;
  width: 1px;
  height: 80px;
}

.studio-chrome {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.studio-toolbar {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: calc(100vw - 24px);
  padding: 8px 10px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  border: 1px solid var(--color-line);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--color-ink) 10%, transparent);
}

.studio-tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 8px;
  border-right: 1px solid var(--color-line);
}

.studio-tool-group:last-of-type {
  border-right: none;
  padding-right: 0;
}

.studio-tool {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.studio-tool:hover:not(:disabled) {
  background: var(--color-canvas);
}

.studio-tool:disabled {
  opacity: 0.35;
  cursor: default;
}

.studio-tool--active {
  background: var(--color-accent);
  color: var(--color-on-accent, #e9e9e9);
}

.studio-tool--danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-error) 18%, transparent);
  color: var(--color-error);
}

.studio-zoom-label {
  min-width: 44px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}

.studio-side {
  position: absolute;
  top: max(72px, calc(env(safe-area-inset-top) + 64px));
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(280px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  pointer-events: auto;
}

@media (max-width: 720px) {
  .studio-side {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
    max-height: 38dvh;
    flex-direction: row;
    align-items: stretch;
  }

  .studio-side .studio-panel {
    flex: 1;
    min-width: 0;
    overflow: auto;
  }
}

.studio-panel {
  padding: 12px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--color-surface) 94%, transparent);
  border: 1px solid var(--color-line);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--color-ink) 8%, transparent);
}

.studio-panel-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.studio-panel-empty {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.studio-layers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow: auto;
}

.studio-layer-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--color-ink-muted);
}

.studio-layer-search .field-input {
  flex: 1;
  min-width: 0;
  padding-right: 32px;
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}

.studio-layer-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-ink-muted);
  cursor: pointer;
}

.studio-layer-search-clear:hover {
  background: var(--color-canvas);
  color: var(--color-ink);
}

.studio-layer-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--color-ink-muted);
}

.studio-layer-item {
  position: relative;
  border-radius: 12px;
}

.studio-layer-item--dragging {
  opacity: 0.45;
}

.studio-layer-item--drop-before::before,
.studio-layer-item--drop-after::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--color-accent);
  z-index: 2;
  pointer-events: none;
}

.studio-layer-item--drop-before::before {
  top: -1px;
}

.studio-layer-item--drop-after::after {
  bottom: -1px;
}

.studio-layer-item--drop-inside .studio-layer {
  box-shadow: inset 0 0 0 2px var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 16%, transparent);
}

.studio-layer {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
  text-align: left;
}

.studio-layer:hover {
  background: var(--color-canvas);
}

.studio-layer--active {
  background: color-mix(in srgb, var(--color-accent) 22%, transparent);
}

.studio-layer-grip {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-left: -2px;
  color: var(--color-ink-muted);
  cursor: grab;
  opacity: 0.55;
}

.studio-layer-item:hover .studio-layer-grip,
.studio-layer--active .studio-layer-grip {
  opacity: 1;
}

.studio-layers--dragging .studio-layer-grip {
  cursor: grabbing;
}

.studio-layer-type {
  width: 18px;
  text-align: center;
  opacity: 0.7;
  font-size: 13px;
  flex-shrink: 0;
}

.studio-layer-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
}

.studio-props {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.studio-props-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.studio-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.studio-field .field-input {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  font-size: 14px;
}

.studio-textarea {
  resize: vertical;
  min-height: 64px;
}

.studio-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.studio-swatch {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
}

.studio-swatch--active {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.studio-swatches input[type="color"] {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.studio-node {
  position: absolute;
  box-sizing: border-box;
  overflow: visible;
  pointer-events: none;
}

.studio-node--frame {
  background: #fff;
}

.studio-frame-label {
  position: absolute;
  left: 0;
  top: -18px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: color-mix(in srgb, var(--color-ink) 55%, transparent);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.studio-frame-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.studio-node--text {
  display: flex;
  align-items: flex-start;
  padding: 4px 6px;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.25;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
}

.studio-node-text {
  pointer-events: none;
}

.studio-selection {
  position: absolute;
  box-sizing: border-box;
  outline: 2px solid var(--color-accent);
  outline-offset: 0;
  pointer-events: none;
  z-index: 20;
}

.studio-handle {
  pointer-events: auto;
  position: absolute;
  width: calc(10px * var(--studio-inv-zoom, 1));
  height: calc(10px * var(--studio-inv-zoom, 1));
  border-radius: 2px;
  background: var(--color-surface);
  border: calc(2px * var(--studio-inv-zoom, 1)) solid var(--color-accent);
  z-index: 2;
  box-sizing: border-box;
}

.studio-rotate-handle {
  pointer-events: auto;
  position: absolute;
  left: 50%;
  top: calc(-28px * var(--studio-inv-zoom, 1));
  width: calc(12px * var(--studio-inv-zoom, 1));
  height: calc(12px * var(--studio-inv-zoom, 1));
  margin-left: calc(-6px * var(--studio-inv-zoom, 1));
  border-radius: 999px;
  background: var(--color-surface);
  border: calc(2px * var(--studio-inv-zoom, 1)) solid var(--color-accent);
  cursor: grab;
  z-index: 3;
}

.studio-rotate-handle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: calc(1px * var(--studio-inv-zoom, 1));
  height: calc(10px * var(--studio-inv-zoom, 1));
  background: var(--color-accent);
  transform: translateX(-50%);
}

.studio-hover {
  position: absolute;
  box-sizing: border-box;
  outline: 1.5px solid color-mix(in srgb, var(--color-accent) 55%, transparent);
  outline-offset: 0;
  pointer-events: none;
  z-index: 18;
}

.studio-dim-hud {
  position: absolute;
  z-index: 32;
  pointer-events: none;
  transform-origin: center top;
  padding: 3px 8px;
  border-radius: 6px;
  background: #14161c;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.studio-measure {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 31;
}

.studio-measure-line {
  position: absolute;
  background: #ff4dd8;
}

.studio-measure-label {
  position: absolute;
  z-index: 2;
  transform-origin: center center;
  padding: 2px 6px;
  border-radius: 4px;
  background: #ff4dd8;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.studio-empty-hint {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  width: max-content;
  margin-left: -80px;
  margin-top: -28px;
  text-align: center;
  pointer-events: none;
  color: color-mix(in srgb, var(--color-ink) 40%, transparent);
  font-size: 13px;
  line-height: 1.45;
}

.studio-empty-hint p {
  margin: 0;
}

.studio-statusbar {
  position: absolute;
  left: max(12px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  border: 1px solid var(--color-line);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-muted);
  pointer-events: none;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--color-ink) 8%, transparent);
}

.studio-statusbar-hint {
  color: color-mix(in srgb, var(--color-ink-muted) 80%, transparent);
  font-weight: 500;
}

@media (max-width: 720px) {
  .studio-statusbar {
    display: none;
  }
}

.studio-tool--wide {
  width: auto;
  min-width: 40px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 160px;
}

.studio-tool-label {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.studio-projects-card {
  width: min(440px, 100%);
}

.studio-file-current {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--color-canvas);
  border: 1px solid var(--color-line);
  flex-shrink: 0;
}

.studio-file-current-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.studio-file-current-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink);
  word-break: break-word;
}

.studio-file-warn {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-warning, #ffe873) 35%, var(--color-surface));
  font-size: 13px;
  line-height: 1.35;
  color: var(--color-ink);
  flex-shrink: 0;
}

.studio-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.studio-file-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.studio-file-hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-ink-muted);
  flex-shrink: 0;
}

.studio-projects-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.studio-projects-usage {
  font-size: 12px;
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}

.studio-projects-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  min-height: 0;
  max-height: min(48dvh, 420px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.studio-projects-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--color-line);
  background: var(--color-canvas);
}

.studio-projects-item--active {
  border-color: color-mix(in srgb, var(--color-accent) 55%, var(--color-line));
  background: color-mix(in srgb, var(--color-accent) 12%, var(--color-surface));
}

.studio-projects-open {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.studio-projects-open:hover {
  background: color-mix(in srgb, var(--color-surface) 70%, transparent);
}

.studio-projects-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.studio-projects-date {
  font-size: 11px;
  color: var(--color-ink-muted);
}

.studio-projects-item-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 4px;
}

.studio-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, #14161c 35%, transparent);
  backdrop-filter: blur(6px);
  pointer-events: auto;
  overflow: auto;
}

.studio-help-card {
  width: min(520px, 100%);
  max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 16px 16px 10px;
  border-radius: 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  box-shadow: 0 20px 50px color-mix(in srgb, var(--color-ink) 18%, transparent);
}

.studio-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.studio-help-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--color-ink);
}

.studio-help-lead {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-ink-muted);
  flex-shrink: 0;
}

.studio-help-body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.studio-help-section-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.studio-help-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.studio-help-row {
  display: grid;
  grid-template-columns: minmax(110px, 34%) 1fr;
  gap: 10px;
  align-items: start;
}

.studio-help-keys {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  background: #14161c;
  border: 1px solid #14161c;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: #c8ff3d;
  text-align: center;
}

.studio-help-text {
  font-size: 13px;
  line-height: 1.35;
  color: var(--color-ink);
  padding-top: 4px;
}

@media (max-width: 520px) {
  .studio-help-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .studio-help-keys {
    width: fit-content;
  }
}

.studio-guide {
  position: absolute;
  pointer-events: none;
  z-index: 30;
  background: #ff4dd8;
}

.studio-guide--v {
  width: 1px;
}

.studio-guide--h {
  height: 1px;
}

.studio-node--image {
  overflow: hidden;
  background: color-mix(in srgb, var(--color-ink) 6%, transparent);
}

.studio-node-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

.studio-node-image-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--color-ink-muted);
  pointer-events: none;
}

.studio-layer-rename {
  flex: 1;
  min-width: 0;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 2px 6px !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

.studio-zoom-label {
  cursor: pointer;
}
.studio-handle--nw {
  left: calc(-5px * var(--studio-inv-zoom, 1));
  top: calc(-5px * var(--studio-inv-zoom, 1));
  cursor: nwse-resize;
}
.studio-handle--ne {
  right: calc(-5px * var(--studio-inv-zoom, 1));
  top: calc(-5px * var(--studio-inv-zoom, 1));
  cursor: nesw-resize;
}
.studio-handle--sw {
  left: calc(-5px * var(--studio-inv-zoom, 1));
  bottom: calc(-5px * var(--studio-inv-zoom, 1));
  cursor: nesw-resize;
}
.studio-handle--se {
  right: calc(-5px * var(--studio-inv-zoom, 1));
  bottom: calc(-5px * var(--studio-inv-zoom, 1));
  cursor: nwse-resize;
}
.studio-handle--n {
  left: 50%;
  top: calc(-5px * var(--studio-inv-zoom, 1));
  transform: translateX(-50%);
  cursor: ns-resize;
}
.studio-handle--s {
  left: 50%;
  bottom: calc(-5px * var(--studio-inv-zoom, 1));
  transform: translateX(-50%);
  cursor: ns-resize;
}
.studio-handle--e {
  right: calc(-5px * var(--studio-inv-zoom, 1));
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}
.studio-handle--w {
  left: calc(-5px * var(--studio-inv-zoom, 1));
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.studio-selection--multi {
  outline-width: 1px;
  outline-style: dashed;
  opacity: 0.85;
  z-index: 19;
}

.studio-selection--group {
  outline-style: solid;
}

.studio-marquee {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 16%, transparent);
  pointer-events: none;
  z-index: 25;
}

.studio-node--line {
  overflow: visible;
  background: transparent !important;
  border: none !important;
}

.studio-line-svg {
  display: block;
  overflow: visible;
  pointer-events: none;
}

.studio-group-children {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.studio-node-text-edit {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 4px 6px;
  border: none;
  outline: 2px solid var(--color-accent);
  background: color-mix(in srgb, var(--color-surface) 90%, transparent);
  color: inherit;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.25;
  resize: none;
  pointer-events: auto;
}

.studio-align-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.studio-align-row .studio-tool {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--color-canvas);
}

.studio-layer-icon-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-ink-muted);
  cursor: pointer;
  opacity: 0;
}

.studio-layer:hover .studio-layer-icon-btn,
.studio-layer--active .studio-layer-icon-btn {
  opacity: 1;
}

.studio-layer-icon-btn:hover {
  background: var(--color-canvas);
  color: var(--color-ink);
}

.studio-field--row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.studio-field--row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
}


/* ── Download (TikTok / Reels) ── */
.dl-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  max-width: 560px;
}

.dl-head {
  padding: 0 4px;
}

.dl-card {
  padding: 20px;
  border-radius: 24px;
  background: var(--color-surface);
}

.dl-row {
  position: relative;
  display: flex;
  align-items: center;
}

.dl-input {
  padding-right: 48px;
}

.dl-icon-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--color-ink-muted);
  cursor: pointer;
}

.dl-icon-btn:hover:not(:disabled) {
  background: var(--color-canvas);
  color: var(--color-ink);
}

.dl-icon-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.dl-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

.dl-err {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-error) 16%, transparent);
  color: var(--color-error);
  font-size: 13px;
}

.dl-ok {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-success) 18%, transparent);
  color: var(--color-ink);
  font-size: 13px;
}

.dl-hint {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-ink-muted);
}

.dl-spin {
  animation: dl-spin 0.8s linear infinite;
}

@keyframes dl-spin {
  to { transform: rotate(360deg); }
}

/* ── Notes ── */
.page--notes {
  min-height: 0;
}

.notes-app {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr;
  gap: 12px;
  position: relative;
}

.notes-identify {
  grid-column: 1 / -1;
}

.notes-sidebar,
.notes-editor {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-radius: 24px;
  overflow: hidden;
}

.notes-side-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 12px 8px;
}

.notes-side-title {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.15;
}

.notes-new-btn {
  min-width: 40px;
  padding-left: 10px;
  padding-right: 10px;
}

.notes-owner {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--color-ink-muted);
}

.notes-search {
  position: relative;
  padding: 0 10px 8px;
}

.notes-search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-ink-muted);
  pointer-events: none;
}

.notes-search-input {
  padding: 9px 32px 9px 34px;
  border-radius: 12px;
  font-size: 13px;
}

.notes-search-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--color-ink-muted);
  cursor: pointer;
}

.notes-folders {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 10px 10px;
}

.notes-folder {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 0;
  border-radius: 999px;
  background: var(--color-canvas);
  color: var(--color-ink-muted);
  font-size: 11px;
  cursor: pointer;
}

.notes-folder--on {
  background: color-mix(in srgb, var(--color-accent) 22%, var(--color-canvas));
  color: var(--color-ink);
}

.notes-folder--add {
  color: var(--color-accent);
}

.notes-folder-count {
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.notes-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.notes-empty {
  margin: 24px 8px;
  text-align: center;
  color: var(--color-ink-muted);
  font-size: 14px;
}

.notes-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 11px;
  border: 0;
  border-radius: 14px;
  background: var(--color-canvas);
  color: var(--color-ink);
  cursor: pointer;
}

.notes-item--on {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.notes-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.notes-item-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-item-pin,
.notes-item-share {
  flex-shrink: 0;
  color: var(--color-accent);
}

.notes-item-when {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--color-ink-muted);
}

.notes-item-preview {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--color-ink-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notes-item-from {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--color-accent);
}

.notes-editor-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-line);
}

.notes-back {
  display: none;
}

.notes-editor-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-ink-muted);
}

.notes-saving {
  color: var(--color-accent);
}

.notes-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent) 18%, transparent);
  color: var(--color-ink);
  font-size: 11px;
}

.notes-badge--private {
  background: var(--color-canvas);
  color: var(--color-ink-muted);
}

.notes-editor-folder {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-editor-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.notes-folder-select {
  max-width: 120px;
  padding: 6px 8px;
  border: 1px solid var(--color-line);
  border-radius: 12px;
  background: var(--color-canvas);
  color: var(--color-ink);
  font-size: 12px;
}

.icon-btn--accent {
  color: var(--color-accent);
}

.notes-compose {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.notes-title-input {
  width: 100%;
  padding: 16px 20px 8px;
  border: 0;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.25;
  outline: none;
}

.notes-title-input::placeholder {
  color: var(--color-ink-muted);
  font-weight: 400;
}

.notes-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 14px 10px;
  border-bottom: 1px solid var(--color-line);
}

.notes-tool {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--color-ink-muted);
  cursor: pointer;
}

.notes-tool:hover {
  background: var(--color-canvas);
  color: var(--color-ink);
}

.notes-tool--on {
  background: color-mix(in srgb, var(--color-accent) 22%, var(--color-canvas));
  color: var(--color-ink);
}

.notes-tool-sep {
  width: 1px;
  height: 22px;
  margin: 6px 4px;
  background: var(--color-line);
}

.notes-editor-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.notes-editor-content .tiptap,
.notes-prose {
  min-height: 100%;
  padding: 16px 20px 32px;
  outline: none;
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-ink);
}

.notes-prose p {
  margin: 0 0 0.7em;
}

.notes-prose h2 {
  margin: 0.9em 0 0.4em;
  font-size: 1.35em;
  font-weight: 600;
}

.notes-prose h3 {
  margin: 0.8em 0 0.35em;
  font-size: 1.15em;
  font-weight: 600;
}

.notes-prose ul,
.notes-prose ol {
  margin: 0 0 0.8em;
  padding-left: 1.35em;
}

.notes-prose blockquote {
  margin: 0 0 0.8em;
  padding: 0.2em 0 0.2em 0.9em;
  border-left: 3px solid var(--color-accent);
  color: var(--color-ink-muted);
}

.notes-prose p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
  color: var(--color-ink-muted);
}

.notes-editor-loading {
  padding: 24px;
  color: var(--color-ink-muted);
}

.notes-editor-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  color: var(--color-ink-muted);
  text-align: center;
}

.notes-hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-ink-muted);
}

@media (max-width: 860px) {
  .notes-app {
    grid-template-columns: 1fr;
  }

  .notes-back {
    display: grid;
  }

  .notes-app:not(.notes-app--editing) .notes-editor {
    display: none;
  }

  .notes-app--editing .notes-sidebar {
    display: none;
  }

  .notes-app--editing .notes-editor {
    display: flex;
    min-height: calc(100dvh - 160px);
  }

  .notes-folder-select {
    max-width: 88px;
  }
}

/* Заметки: компактнее на телефоне */
@media (max-width: 767px) {
  .page--notes {
    gap: 10px;
  }

  .notes-sidebar,
  .notes-editor {
    border-radius: 20px;
  }

  .notes-app--editing .notes-editor {
    min-height: calc(
      100dvh - 40px - 12px - 24px - env(safe-area-inset-bottom, 0px)
    );
  }

  .notes-editor-bar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 10px 8px;
  }

  .notes-editor-meta {
    flex: 1 1 auto;
    min-width: 0;
    gap: 6px;
    font-size: 11px;
  }

  .notes-editor-meta .notes-badge,
  .notes-editor-folder {
    display: none;
  }

  .notes-editor-actions {
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .notes-colors {
    order: 0;
    margin: 0;
    flex: 1;
    justify-content: flex-start;
  }

  .notes-folder-select {
    max-width: 96px;
    flex-shrink: 0;
  }

  .notes-title-input {
    padding: 12px 14px 6px;
    font-size: 22px;
  }

  .notes-toolbar {
    padding: 0 10px 8px;
    gap: 2px;
  }

  .notes-tool {
    width: 32px;
    height: 32px;
  }

  .notes-prose {
    padding: 10px 14px 24px;
  }

  .notes-side-head {
    padding: 12px 10px 6px;
  }

  .notes-side-title {
    font-size: 18px;
  }
}

/* Notes: color marks, tasks, links, images, home capture */
.notes-item[data-color] {
  box-shadow: inset 3px 0 0 var(--note-color, transparent);
}

.notes-item--on[data-color] {
  box-shadow: inset 3px 0 0 var(--note-color, transparent), inset 0 0 0 2px var(--color-accent);
}

.notes-colors {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
}

.notes-color {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid var(--color-line);
  background: var(--color-canvas);
  padding: 0;
  cursor: pointer;
}

.notes-color--on {
  outline: 2px solid var(--color-ink);
  outline-offset: 1px;
}

.notes-link {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.notes-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  margin: 0.6em 0;
}

.notes-prose ul[data-type="taskList"] {
  list-style: none;
  padding-left: 0;
  margin: 0 0 0.8em;
}

.notes-prose ul[data-type="taskList"] li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0.25em 0;
}

.notes-prose ul[data-type="taskList"] li > label {
  flex-shrink: 0;
  margin-top: 0.2em;
}

.notes-prose ul[data-type="taskList"] li > label input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.notes-prose ul[data-type="taskList"] li > div {
  flex: 1;
  min-width: 0;
}

.notes-prose ul[data-type="taskList"] li[data-checked="true"] > div {
  text-decoration: line-through;
  color: var(--color-ink-muted);
}

.home-note-capture {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  background: var(--color-surface);
  transition: transform 0.15s ease;
}

.home-note-capture:active {
  transform: scale(0.97);
}

.home-note-capture-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--color-accent);
  color: var(--color-on-accent, #14161c);
}

.home-note-capture-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-note-capture-title {
  font-size: 18px;
  font-weight: 500;
}

.home-note-capture-sub {
  font-size: 12px;
  color: var(--color-ink-muted);
}

@media (min-width: 768px) and (max-width: 860px) {
  .notes-colors {
    order: 5;
    width: 100%;
    margin: 4px 0 0;
  }

  .notes-editor-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* ── Hidden /x (characters) ── */
.page--x {
  gap: 14px;
}

.x-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 100%;
}

.x-page--boot {
  align-items: center;
  justify-content: center;
  min-height: 40vh;
}

.x-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.x-warn {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--color-warning) 28%, var(--color-surface));
  color: var(--color-ink);
  font-size: 13px;
}

.x-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.x-section-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.x-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.x-card-wrap {
  position: relative;
}

.x-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 18px;
  background: var(--color-surface);
  color: var(--color-ink);
  text-align: left;
  cursor: pointer;
}

.x-card:active {
  transform: scale(0.98);
}

.x-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 600;
  color: #14161c;
  flex-shrink: 0;
}

.x-avatar--sm {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 13px;
}

.x-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.x-card-name {
  font-size: 15px;
  font-weight: 500;
}

.x-card-tag {
  font-size: 12px;
  color: var(--color-ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.x-card-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  opacity: 0.7;
}

.x-empty {
  margin: 0;
  padding: 16px;
  color: var(--color-ink-muted);
  font-size: 14px;
}

.x-create {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-surface);
  border-radius: 20px;
  padding: 14px;
}

.x-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--color-ink-muted);
}

.x-textarea {
  resize: vertical;
  min-height: 72px;
}

.x-chat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--color-surface);
  border-radius: 20px;
  padding: 12px;
}

.x-chat-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.x-chat-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.x-chat-title {
  font-size: 15px;
  font-weight: 500;
}

.x-chat-sub {
  font-size: 11px;
  color: var(--color-ink-muted);
}

.x-chat-log {
  flex: 1;
  min-height: 240px;
  max-height: min(58vh, 640px);
  overflow: auto;
}

.x-bubble--user {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.x-composer {
  margin-top: auto;
}

@media (max-width: 767px) {
  .x-chat-log {
    max-height: none;
    flex: 1;
  }

  .x-page--chat .x-chat {
    min-height: calc(100dvh - 40px - 24px - env(safe-area-inset-bottom, 0px));
  }
}

.x-threads {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-surface);
  border-radius: 20px;
  padding: 12px;
}

.x-thread-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.x-thread-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.x-thread-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px;
  border: 0;
  border-radius: 14px;
  background: var(--color-canvas);
  color: var(--color-ink);
  text-align: left;
  cursor: pointer;
}

.x-thread-title {
  font-size: 14px;
  font-weight: 500;
}

.x-thread-preview {
  font-size: 12px;
  color: var(--color-ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.x-hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-ink-muted);
  line-height: 1.4;
}

.x-hint code {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--color-canvas);
}

.x-empty-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 12px;
}

.x-regen {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-ink) 8%, transparent);
  color: var(--color-ink-muted);
  font-size: 11px;
  cursor: pointer;
}

.x-regen:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.x-hint--tight {
  margin-top: 6px;
}

.x-heat {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.x-heat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: 0;
  border-radius: 14px;
  background: var(--color-canvas);
  color: var(--color-ink-muted);
  cursor: pointer;
  font: inherit;
}

.x-heat-btn strong {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-ink);
}

.x-heat-btn em {
  font-style: normal;
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
}

.x-heat-btn.is-on {
  background: color-mix(in srgb, var(--color-accent) 28%, var(--color-surface));
  color: var(--color-accent);
}

.x-heat-btn.is-on strong {
  color: var(--color-accent);
}

.x-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.x-chip {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--color-canvas);
  color: var(--color-ink-muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.x-chip.is-on {
  background: color-mix(in srgb, var(--color-accent) 32%, var(--color-surface));
  color: var(--color-accent);
}

.x-fetish-add {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.x-fetish-add .field-input {
  flex: 1;
}

.x-fetish-add .btn {
  min-width: 44px;
  padding-inline: 14px;
}

.x-cost {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--color-ink-muted);
  opacity: 0.55;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}


/* —— Skirmish v2: journal / book —— */
.page--skirmish {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 12px 100px;
  /* lighter than book outline so black frame reads */
  background:
    radial-gradient(ellipse at 50% 30%, #2a2622 0%, transparent 55%),
    #3a3530;
}

.sk-app {
  color: #3a2a1c;
  font-family: "Stolzl", "Segoe UI", system-ui, sans-serif;
}

.sk-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sk-brand {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sk-brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #c45c26;
  color: #fff7e8;
  font-weight: 700;
}

.sk-brand strong {
  display: block;
  color: var(--color-ink);
  font-size: 18px;
}

.sk-brand p {
  margin: 0;
  color: var(--color-ink-muted);
  font-size: 12px;
}

.sk-currency {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--color-ink-muted);
}

.sk-currency input {
  background: #fff7e8;
  border: 1px solid #d2b48c;
  border-radius: 10px;
  padding: 8px 10px;
  color: #3a2a1c;
  font: inherit;
  min-width: 120px;
}

.sk-currency--gold {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe9a8, #f0c14b);
  color: #5a3d10;
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  border: 1px solid #d4a017;
}

.sk-coin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff2b0, #c8880a);
  box-shadow: inset 0 0 0 2px rgba(90, 61, 16, 0.25);
}

.sk-banner {
  background: #fff1d6;
  border: 1px dashed #c45c26;
  color: #5a3d10;
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
}

.sk-err { color: #c0392b; font-size: 13px; margin: 0 0 8px; }
.sk-ok { color: #2f7d32; font-size: 13px; }
.sk-muted { color: #7a6550; font-size: 13px; }


.sk-stage {
  position: relative;
  width: min(100%, 920px);
  margin: 0 auto;
  padding-right: 72px;
}

.sk-book {
  position: relative;
  width: 100%;
  aspect-ratio: 881 / 555;
  isolation: isolate;
}

.sk-book__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  filter: drop-shadow(0 0 0 1px rgba(255, 220, 180, 0.08)) drop-shadow(0 14px 24px rgba(0, 0, 0, 0.55));
}

.sk-page {
  position: absolute;
  z-index: 3;
  overflow: auto;
  color: #2a2420;
  scrollbar-width: thin;
  font-size: 12px;
  line-height: 1.35;
}

/* Inside parchment only — leave polaroid free on left bottom */
.sk-page--left {
  left: 8%;
  top: 11%;
  width: 37%;
  height: 76%;
  padding: 6px 8px;
}

.sk-page--right {
  left: 54.5%;
  top: 11%;
  width: 36%;
  height: 76%;
  padding: 6px 8px;
}

.sk-page h2 {
  margin: 0 0 6px;
  color: #2a2420;
  font-size: 16px;
}

.sk-page h3,
.sk-page h4 {
  margin: 8px 0 4px;
  color: #2a2420;
  font-size: 13px;
}


.sk-book { overflow: visible; }

/* Hand-drawn side tabs — SVG ink style matching book */
.sk-tabs {
  position: absolute;
  right: -62px;
  top: 8%;
  bottom: 8%;
  width: 74px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  z-index: 4;
  pointer-events: none;
}

.sk-tab {
  pointer-events: auto;
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  border: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center;
  cursor: pointer;
  padding: 0;
  color: #f0e6d4;
  font: inherit;
  overflow: visible;
  transform: translateX(-12px);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), filter 0.15s ease;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.55));
}

.sk-tab--blood { background-image: url("/skirmish/tab-hero.svg"); }
.sk-tab--rust  { background-image: url("/skirmish/tab-shop.svg"); }
.sk-tab--olive { background-image: url("/skirmish/tab-deck.svg"); }
.sk-tab--steel { background-image: url("/skirmish/tab-match.svg"); }
.sk-tab--bone  { background-image: url("/skirmish/tab-codex.svg"); color: #1a1610; }

.sk-tab__rivet { display: none; }

.sk-tab__label {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 100%;
  width: 100%;
  padding: 10px 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  color: #fff8e8;
  -webkit-text-stroke: 0.55px #1a1008;
  paint-order: stroke fill;
  text-shadow:
    0 0 2px #000,
    0 1px 0 #000,
    1px 0 0 #000,
    -1px 0 0 #000,
    0 -1px 0 #000;
  overflow: visible;
}

.sk-tab--bone .sk-tab__label {
  color: #1a1208;
  -webkit-text-stroke: 0.5px #f5ecd8;
  text-shadow:
    0 0 2px rgba(255, 248, 232, 0.7),
    0 1px 0 rgba(255, 248, 232, 0.5);
}

.sk-tab:hover:not(:disabled) {
  transform: translateX(0);
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.55)) brightness(1.08);
}

.sk-tab.is-on {
  transform: translateX(8px);
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.65)) brightness(1.12);
  z-index: 2;
}

.sk-tab:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: translateX(-12px);
}

.sk-tab:focus-visible {
  outline: 2px solid #c8ff3d;
  outline-offset: 2px;
}

.sk-polaroid {
  transform: none !important;
  margin-bottom: 6px !important;
  padding: 6px !important;
}
.sk-polaroid__art { height: 64px !important; margin-bottom: 4px !important; background: rgba(90,70,50,0.25) !important; }
.sk-polaroid strong { font-size: 14px !important; }
.sk-mech ul { margin: 4px 0 0; padding-left: 14px; font-size: 11px; line-height: 1.3; }
.sk-mech p { font-size: 12px; }
.sk-subtabs { gap: 4px; margin-bottom: 6px; }
.sk-subtabs button { padding: 5px 8px; font-size: 11px; }
.sk-cardgrid {
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)) !important;
  gap: 8px !important;
}
.sk-sts { min-height: 220px; }
.sk-buy--lg { padding: 8px !important; margin-top: 4px !important; font-size: 12px; }

.sk-herohead {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 12px;
}

.sk-lv {
  background: #c45c26;
  color: #fff7e8;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.sk-title { color: #7a6550; font-size: 13px; }

.sk-equip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  align-items: center;
  margin-bottom: 8px;
}

.sk-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sk-slot {
  border: 1px solid #8a6a42;
  background: rgba(230, 222, 201, 0.4);
  border-radius: 8px;
  padding: 4px 5px;
  text-align: left;
  cursor: pointer;
  color: #2a2420;
  font: inherit;
  min-height: 36px;
}

.sk-slot.has { border-color: #4a6fa5; box-shadow: inset 0 0 0 1px #4a6fa5; }
.sk-slot em { display: block; font-size: 10px; color: #7a6550; font-style: normal; }
.sk-slot span { font-size: 12px; font-weight: 600; }

.sk-figure {
  aspect-ratio: 3/4;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--hero-accent, #c45c26) 35%, #fff7e8), transparent 55%),
    #e8d2a8;
  border: 2px solid #b08958;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  padding: 10px;
}

.sk-figure__body {
  width: 56%;
  height: 62%;
  border-radius: 40% 40% 18% 18%;
  background: linear-gradient(180deg, #fff7e8, color-mix(in srgb, var(--hero-accent, #c45c26) 55%, #3a2a1c));
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
  margin-bottom: 8px;
}

.sk-figure__glow {
  position: absolute;
  inset: 10% 15% auto;
  height: 40%;
  background: radial-gradient(circle, rgba(255,255,255,0.55), transparent 70%);
  pointer-events: none;
}

.sk-figure p {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #5a3d10;
}

.sk-bars { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; }
.sk-bar { display: grid; grid-template-columns: 28px 1fr 56px; gap: 8px; align-items: center; font-size: 12px; }
.sk-bar div { height: 12px; border-radius: 999px; background: #d9c3a0; overflow: hidden; }
.sk-bar i { display: block; height: 100%; border-radius: inherit; }
.sk-bar--hp i { background: linear-gradient(90deg, #e85d5d, #ff8f8f); }
.sk-bar--en i { background: linear-gradient(90deg, #4a6fa5, #7aa2d4); }
.sk-bar em { font-style: normal; font-variant-numeric: tabular-nums; }

.sk-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.sk-stats div {
  background: #fff7e8;
  border: 1px solid #d2b48c;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
}

.sk-stats em { font-style: normal; color: #7a6550; font-size: 12px; }

.sk-mech {
  background: rgba(230, 222, 201, 0.28);
  border: 1px solid rgba(90, 61, 16, 0.3);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 8px;
  font-size: 11px;
}

.sk-mech ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.4; }
.sk-mech p { margin: 0; font-size: 14px; line-height: 1.4; }

.sk-subtabs, .sk-tabs-inline, .sk-chiprow, .sk-actions, .sk-lobby {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.sk-subtabs button, .sk-chip, .sk-tabs-inline span {
  border: 1px solid #b08958;
  background: #fff7e8;
  color: #5a3d10;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.sk-subtabs button.is-on,
.sk-chip.is-on,
.sk-tabs-inline span.is-on {
  background: #c45c26;
  border-color: #c45c26;
  color: #fff7e8;
}

.sk-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.sk-tile {
  background: rgba(230, 222, 201, 0.35);
  border: 1px solid rgba(90, 61, 16, 0.35);
  border-radius: 10px;
  padding: 6px 8px;
  text-align: left;
  color: #2a2420;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}

.sk-tile.is-on { outline: 2px solid #c45c26; }
.sk-tile span, .sk-tile em { font-size: 12px; color: #7a6550; font-style: normal; }
.sk-tile p { margin: 0; font-size: 12px; line-height: 1.3; }

.sk-buy {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: #c45c26;
  color: #fff7e8;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.sk-buy:disabled { opacity: 0.45; cursor: not-allowed; }
.sk-buy--lg { width: 100%; padding: 12px; font-weight: 700; margin-top: 8px; }

.sk-cardgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 12px;
}

.sk-cardgrid--sm { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

/* Fantasy Craft structure × character art palette */
.sk-sts {
  --sk-ink: #1a1a1a;
  --sk-cyan: #3de0e8;
  --sk-teal: #4a6e6a;
  --sk-bone: #f4f1ea;
  --sk-bar: #6e6c69;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 240px;
  padding: 8px 9px 8px;
  border: 2.5px solid var(--sk-ink);
  border-radius: 12px;
  background: var(--sk-bone);
  color: var(--sk-ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 3px 0 #0d0d0d;
  overflow: hidden;
}

.sk-sts--item { cursor: default; }
.sk-sts.attack { border-color: #5c221c; }
.sk-sts.skill { border-color: #2a4050; }
.sk-sts.power { border-color: #3a5a50; }
.sk-sts.is-on {
  outline: 2px solid var(--sk-cyan);
  outline-offset: 2px;
}
.sk-sts:disabled { cursor: default; }

.sk-sts__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-bottom: 3px;
  border-bottom: 1.5px solid var(--sk-ink);
}

.sk-sts__brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #3a3a3a;
}

.sk-sts__mark {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--sk-ink);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--sk-cyan), var(--sk-teal));
  flex: 0 0 auto;
}

.sk-sts__mark--item {
  border-radius: 3px;
  background: linear-gradient(145deg, #c4a45a, #6a5030);
}

.sk-sts__num {
  font-size: 10px;
  font-weight: 600;
  color: #3a3a3a;
  text-transform: lowercase;
}

.sk-sts__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.sk-sts__name {
  flex: 1;
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--sk-ink);
}

.sk-sts__cost {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  padding-top: 2px;
}

.sk-sts__cost--pts {
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
}
.sk-sts__cost--pts em {
  font-style: normal;
}

.sk-sts__orb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--sk-ink);
  background: radial-gradient(circle at 35% 30%, #b8fff8, var(--sk-cyan) 45%, #1a4a48);
  box-shadow: 0 0 4px rgba(61, 224, 232, 0.55);
  flex: 0 0 auto;
}

.sk-sts__orb--coin {
  background: radial-gradient(circle at 35% 30%, #ffe8a0, #c4a45a 50%, #5a4018);
  box-shadow: none;
}

.sk-sts__art {
  position: relative;
  flex: 1 1 auto;
  min-height: 88px;
  margin-top: 2px;
  border: 2.5px solid var(--sk-ink);
  border-radius: 8px;
  background: linear-gradient(180deg, #c8d0cc, #8a9690);
  overflow: hidden;
}

.sk-sts__art--item {
  background: linear-gradient(180deg, #cfc4b0, #8a7e6a);
}

.sk-sts__seal {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--sk-ink);
  background:
    radial-gradient(circle at 50% 45%, #1a1a1a 0 28%, transparent 29%),
    radial-gradient(circle at 40% 35%, #6a5030, #3a2810);
  box-shadow: 0 1px 0 #0d0d0d;
}

.sk-sts__seal--item {
  border-radius: 5px;
  background:
    linear-gradient(145deg, #c4a45a, #5a4018);
  box-shadow: inset 0 0 0 4px rgba(26, 26, 26, 0.25);
}

.sk-sts.attack .sk-sts__seal {
  background:
    radial-gradient(circle at 50% 45%, #1a1a1a 0 28%, transparent 29%),
    radial-gradient(circle at 40% 35%, #c45c40, #5c221c);
}
.sk-sts.skill .sk-sts__seal {
  background:
    radial-gradient(circle at 50% 45%, #1a1a1a 0 28%, transparent 29%),
    radial-gradient(circle at 40% 35%, #5a7a90, #2a4050);
}
.sk-sts.power .sk-sts__seal {
  background:
    radial-gradient(circle at 50% 45%, var(--sk-cyan) 0 28%, transparent 29%),
    radial-gradient(circle at 40% 35%, #4a6e6a, #1a3030);
}

.sk-sts__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--sk-bar);
  color: #f4f1ea;
}

.sk-sts__text {
  margin: 0;
  flex: 1;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 700;
  text-transform: lowercase;
  color: #f4f1ea;
}

.sk-sts__hint {
  font-weight: 500;
  opacity: 0.75;
}

.sk-sts__fx {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1.5px solid #1a1a1a;
  border-radius: 3px;
  background:
    linear-gradient(180deg, #7ec8e8, #3a6a90);
  clip-path: polygon(50% 0, 100% 18%, 100% 70%, 50% 100%, 0 70%, 0 18%);
}

.sk-sts__fx--shield {
  background: linear-gradient(180deg, #a8c0a0, #4a6e6a);
}

.sk-sts__act {
  flex: 0 0 auto;
  padding: 3px 7px;
  font-size: 10px;
  border-color: #f4f1ea;
  color: #f4f1ea;
  background: transparent;
}

.sk-polaroid {
  background: #fff7e8;
  border: 1px solid #d2b48c;
  border-radius: 8px;
  padding: 10px 10px 14px;
  margin-bottom: 12px;
  box-shadow: 3px 4px 0 rgba(90, 61, 16, 0.12);
  transform: rotate(-1deg);
}

.sk-polaroid__art {
  height: 140px;
  border-radius: 4px;
  margin-bottom: 8px;
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--hero-accent, #c45c26) 40%, #fff), transparent 60%),
    #d9c3a0;
}

.sk-polaroid strong { display: block; font-size: 18px; }
.sk-polaroid span { color: #7a6550; font-size: 12px; }

.sk-note, .sk-note-input {
  background: rgba(230, 222, 201, 0.28);
  border: 1px solid rgba(90, 61, 16, 0.3);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 8px;
}

.sk-note-input {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.sk-note-input input,
.sk-lobby input,
.sk-lobby select {
  background: #fff;
  border: 1px solid #d2b48c;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  color: #3a2a1c;
}

.sk-lobby label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #7a6550;
}

.sk-list { margin: 0; padding-left: 18px; line-height: 1.45; font-size: 14px; }
.sk-refs { display: grid; gap: 8px; margin-top: 10px; }
.sk-refs img { width: 100%; border-radius: 10px; border: 1px solid #d2b48c; }

.sk-seats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.sk-seat {
  background: #fff7e8;
  border: 1px solid #d2b48c;
  border-radius: 12px;
  padding: 8px;
  font-size: 12px;
}

.sk-seat ul { list-style: none; margin: 6px 0 0; padding: 0; }
.sk-seat li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.sk-seat button {
  border: 0;
  border-radius: 999px;
  padding: 4px 8px;
  background: #4a6fa5;
  color: #fff;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.sk-handcard { display: flex; flex-direction: column; gap: 6px; }

.sk-log {
  max-height: 220px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.sk-log p {
  margin: 0;
  background: #fff7e8;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.3;
}

.sk-log em { color: #7a6550; font-style: normal; margin-right: 4px; }

@media (max-width: 860px) {
  .sk-stage {
    width: min(100%, 560px);
    padding-right: 0;
    padding-bottom: 72px;
  }
  .sk-tabs {
    right: 2%;
    left: 2%;
    top: auto;
    bottom: -2px;
    width: auto;
    height: 48px;
    flex-direction: row;
    gap: 6px;
  }
  .sk-tab {
    flex: 1;
    min-height: 44px;
    transform: translateY(6px);
  }
  .sk-tab__label {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 10px;
    letter-spacing: 0.04em;
  }
  .sk-tab:hover:not(:disabled),
  .sk-tab.is-on {
    transform: translateY(0);
  }
  .sk-tab:disabled { transform: translateY(6px); }
  .sk-page--left { height: 70%; font-size: 11px; }
  .sk-page--right { font-size: 11px; }
  .sk-equip { grid-template-columns: 1fr; }
  .sk-slots { flex-direction: row; flex-wrap: wrap; }
  .sk-slot { flex: 1 1 40%; }
  .sk-seats { grid-template-columns: 1fr; }
}

/* ── Temporary balance ── */
.page--balance {
  min-height: 0;
}

.tb-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 8px;
}

.tb-head {
  padding: 0 4px;
}

.tb-hero {
  padding: 28px 22px 24px;
  border-radius: 28px;
  background: var(--color-surface);
  text-align: center;
}

.tb-loading {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-ink-muted);
  font-size: 15px;
}

.tb-usd {
  margin: 0;
  font-size: clamp(40px, 12vw, 56px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
}

.tb-alts {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tb-alt {
  font-size: clamp(16px, 4.5vw, 20px);
  font-weight: 400;
  color: var(--color-ink-soft);
  font-variant-numeric: tabular-nums;
}

.tb-alt-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-ink-muted);
  opacity: 0.55;
}

.tb-rates-hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--color-ink-muted);
}

.tb-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tb-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 88px;
  padding: 16px 12px;
  border: 0;
  border-radius: 24px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  transition: transform var(--press-in-duration) var(--press-ease),
    background var(--press-duration) var(--press-ease);
  -webkit-tap-highlight-color: transparent;
}

.tb-action:active:not(:disabled) {
  transform: scale(0.97);
}

.tb-action:disabled {
  opacity: 0.45;
  cursor: default;
}

.tb-action--add {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.tb-action--sub {
  background: var(--color-surface);
  color: var(--color-ink);
  border: 1px solid var(--color-line);
}

.tb-history {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 0;
}

.tb-history-title {
  margin: 0;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--color-ink-muted);
}

.tb-empty {
  margin: 0;
  padding: 20px 16px;
  border-radius: 20px;
  background: var(--color-surface);
  color: var(--color-ink-muted);
  font-size: 14px;
  text-align: center;
}

.tb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px 14px 16px;
  border-radius: 20px;
  background: var(--color-surface);
}

.tb-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tb-item-amt {
  font-size: 17px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.tb-item-amt--plus {
  color: var(--color-success);
}

.tb-item-amt--minus {
  color: var(--color-error);
}

.tb-item-comment {
  font-size: 14px;
  color: var(--color-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-item-comment--muted {
  color: var(--color-ink-muted);
}

.tb-item-when {
  font-size: 12px;
  color: var(--color-ink-muted);
}

.tb-item-del {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--color-ink-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tb-item-del:hover:not(:disabled),
.tb-item-del:active:not(:disabled) {
  background: color-mix(in srgb, var(--color-error) 14%, transparent);
  color: var(--color-error);
}

.tb-item-del:disabled {
  opacity: 0.5;
  cursor: default;
}

.tb-sheet-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.tb-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.tb-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  border-radius: 28px 28px 0 0;
  background: var(--color-surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: tb-sheet-up 0.28s var(--press-ease);
}

@keyframes tb-sheet-up {
  from {
    transform: translateY(24px);
    opacity: 0.85;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.tb-sheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.tb-sheet-title {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.tb-sheet-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: var(--color-canvas);
  color: var(--color-ink);
  cursor: pointer;
}

.tb-cur-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.tb-chip {
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--color-line);
  border-radius: 47px;
  background: var(--color-canvas);
  color: var(--color-ink-muted);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tb-chip--on {
  background: var(--color-accent);
  border-color: transparent;
  color: var(--color-on-accent);
}

.tb-chip:disabled {
  opacity: 0.35;
  cursor: default;
}

.tb-amount {
  font-size: 28px !important;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  min-height: 56px;
}

.tb-err {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-error) 16%, transparent);
  color: var(--color-error);
  font-size: 13px;
}

.tb-submit {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 24px;
  border: 0;
  border-radius: 47px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tb-submit--sub {
  background: color-mix(in srgb, var(--color-error) 88%, #14161c);
  color: #fff;
}

.tb-submit:disabled {
  opacity: 0.55;
  cursor: default;
}

.tb-spin {
  animation: tb-spin 0.8s linear infinite;
}

@keyframes tb-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 720px) {
  .tb-sheet {
    border-radius: 28px;
    margin-bottom: 24px;
  }

  .tb-sheet-root {
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
}

/* ── Mail app ── */
.page--mail {
  padding-bottom: 24px;
}

.mail-app {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: calc(100dvh - 88px);
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 0 12px 20px;
  color: var(--color-ink, #14161c);
}

.mail-app--loading {
  padding: 40px 16px;
  color: var(--color-ink-muted, #6d7380);
}

.mail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mail-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-ink, #14161c);
}

.mail-title {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  color: var(--color-ink, #14161c);
}

.mail-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mail-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 47px;
  background: var(--color-surface, #fff);
  color: var(--color-ink, #14161c);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--color-line, rgba(20, 22, 28, 0.1));
}

.mail-icon-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.mail-icon-btn--danger {
  color: var(--color-error, #e11d48);
}

.mail-spin {
  animation: mail-spin 0.8s linear infinite;
}

@keyframes mail-spin {
  to { transform: rotate(360deg); }
}

.mail-error {
  background: color-mix(in srgb, var(--color-error, #e11d48) 14%, var(--color-surface, #fff));
  color: var(--color-error, #e11d48);
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 14px;
}

.mail-empty-setup {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  background: var(--color-surface, #fff);
  border-radius: 24px;
  padding: 48px 24px;
  color: var(--color-ink, #14161c);
  min-height: 320px;
}

.mail-hint {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-muted, #6d7380);
  line-height: 1.4;
}

.mail-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.mail-side,
.mail-read {
  background: var(--color-surface, #fff);
  border-radius: 24px;
  min-height: 0;
}

.mail-side {
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 10px;
  max-height: calc(100dvh - 180px);
}

.mail-read {
  display: none;
  flex-direction: column;
  padding: 12px;
  max-height: calc(100dvh - 180px);
}

.mail-body--read .mail-side {
  display: none;
}

.mail-body--read .mail-read {
  display: flex;
}

.mail-views {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mail-views-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.mail-views-row::-webkit-scrollbar {
  display: none;
}

.mail-view {
  border: none;
  background: var(--color-canvas, #f2f3f6);
  color: var(--color-ink, #14161c);
  border-radius: 47px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.mail-view--on {
  background: var(--color-accent, #c8ff3d);
  color: var(--color-on-accent, #14161c);
}

.mail-accounts-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mail-acc-chip {
  border: none;
  background: transparent;
  color: var(--color-ink-muted, #6d7380);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 47px;
  cursor: pointer;
}

.mail-acc-chip--on {
  background: var(--color-accent-soft-mid, rgba(200, 255, 61, 0.3));
  color: var(--color-ink, #14161c);
}

.mail-search {
  position: relative;
  display: flex;
  align-items: center;
}

.mail-search-icon {
  position: absolute;
  left: 12px;
  color: var(--color-ink-muted, #6d7380);
  pointer-events: none;
}

.mail-search-input {
  width: 100%;
  border: none;
  background: var(--color-canvas, #f2f3f6);
  border-radius: 47px;
  padding: 10px 36px 10px 36px;
  font: inherit;
  font-size: 14px;
  color: var(--color-ink, #14161c);
  outline: none;
}

.mail-search-input::placeholder {
  color: var(--color-ink-muted, #6d7380);
}

.mail-search-clear {
  position: absolute;
  right: 8px;
  border: none;
  background: transparent;
  color: var(--color-ink-muted, #6d7380);
  cursor: pointer;
  display: inline-flex;
  padding: 4px;
}

.mail-list {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  -webkit-overflow-scrolling: touch;
}

.mail-list-empty {
  padding: 32px 12px;
  text-align: center;
  color: var(--color-ink-muted, #6d7380);
  font-size: 14px;
}

.mail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 16px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  color: var(--color-ink, #14161c);
}

.mail-item--on {
  background: var(--color-accent-soft, rgba(200, 255, 61, 0.22));
}

.mail-item--unread .mail-item-from,
.mail-item--unread .mail-item-subj {
  font-weight: 600;
}

.mail-item-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.mail-item-from {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-item-when {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--color-ink-muted, #6d7380);
}

.mail-item-subj {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-item-snip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--color-ink-muted, #6d7380);
  overflow: hidden;
}

.mail-item-snip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-read-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.mail-read-actions {
  display: flex;
  gap: 4px;
}

.mail-read-head h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--color-ink, #14161c);
}

.mail-read-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--color-ink-muted, #6d7380);
  margin-bottom: 12px;
}

.mail-read-body {
  flex: 1;
  min-height: 200px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--color-canvas, #f2f3f6);
}

.mail-iframe {
  width: 100%;
  height: 100%;
  min-height: 360px;
  border: none;
  background: #fff;
  border-radius: 16px;
}

.mail-plain {
  margin: 0;
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-ink, #14161c);
}

.mail-read-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 240px;
  color: var(--color-ink-muted, #6d7380);
}

.mail-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 22, 28, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

.mail-modal-card {
  width: min(520px, 100%);
  max-height: min(90dvh, 720px);
  overflow: auto;
  background: var(--color-surface, #fff);
  border-radius: 28px;
  padding: 18px;
  color: var(--color-ink, #14161c);
}

.mail-modal-card--compose {
  width: min(640px, 100%);
}

.mail-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.mail-modal-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.mail-acc-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mail-acc-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  background: var(--color-canvas, #f2f3f6);
  border-radius: 16px;
  padding: 12px;
}

.mail-acc-list strong {
  display: block;
  font-size: 14px;
  color: var(--color-ink, #14161c);
}

.mail-acc-list span {
  display: block;
  font-size: 12px;
  color: var(--color-ink-muted, #6d7380);
  margin-top: 2px;
}

.mail-link-danger {
  border: none;
  background: transparent;
  color: var(--color-error, #e11d48);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.mail-bl-block {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-line, rgba(20, 22, 28, 0.1));
}

.mail-bl-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-ink, #14161c);
}

.mail-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mail-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--color-ink-muted, #6d7380);
}

.mail-form input,
.mail-form select,
.mail-form textarea {
  border: none;
  background: var(--color-canvas, #f2f3f6);
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--color-ink, #14161c);
  outline: none;
  resize: vertical;
}

@media (min-width: 900px) {
  .mail-body {
    grid-template-columns: minmax(280px, 380px) 1fr;
  }

  .mail-side,
  .mail-read {
    display: flex !important;
    max-height: calc(100dvh - 140px);
  }

  .mail-back {
    display: none;
  }

  .mail-modal {
    align-items: center;
  }
}

/* ── Pokémon cards ── */
.poke-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  padding-bottom: 8px;
}

.poke-head {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 0 4px;
}

.poke-back {
  flex-shrink: 0;
  margin-top: 2px;
}

.poke-lead {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--color-ink-muted);
  line-height: 1.35;
}

/* ── Collection hub ── */
.collection-hub {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  padding-bottom: 8px;
}

.collection-hub-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 4px;
}

.collection-hub-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .collection-hub-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.collection-hub-tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 24px;
  background: var(--color-surface, #fff);
  color: inherit;
  text-decoration: none;
  min-height: 96px;
  transition: transform 0.15s ease;
}

.collection-hub-tile:active {
  transform: scale(0.98);
}

.collection-hub-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--color-bg, #e9e9e9);
  color: var(--color-accent, #c090ff);
}

.collection-hub-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.collection-hub-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.collection-hub-name {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.15;
}

.collection-hub-desc {
  font-size: 14px;
  color: var(--color-ink-muted);
  line-height: 1.3;
}

.collection-hub-stats {
  margin-top: 4px;
}

.collection-hub-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 24px;
  background: var(--color-surface, #fff);
}

.collection-share {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.collection-share-bar {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--color-bg, #e9e9e9);
  gap: 2px;
}

.collection-share-bar--empty {
  opacity: 0.55;
}

.collection-share-seg {
  min-width: 0;
  height: 100%;
}

.collection-share-seg--poke {
  background: #5b8def;
}

.collection-share-seg--mtg {
  background: #2f9e6b;
}

.collection-share-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 14px;
  color: var(--color-ink-muted);
}

.collection-share-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.collection-share-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.collection-share-dot--poke {
  background: #5b8def;
}

.collection-share-dot--mtg {
  background: #2f9e6b;
}

.coll-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.coll-chart--empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--color-bg, #e9e9e9);
  padding: 20px;
}

.coll-chart-empty {
  margin: 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-ink-muted);
  max-width: 28ch;
}

.coll-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.coll-chart-tick {
  fill: var(--color-ink-muted, #8a8a8a);
  font-size: 10px;
  font-family: inherit;
}

.coll-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.coll-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.coll-chart-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mtg-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  padding-bottom: 8px;
}

.mtg-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0 4px;
}

.mtg-stub {
  padding: 24px 20px;
  border-radius: 24px;
  background: var(--color-surface, #fff);
  font-size: 15px;
  line-height: 1.45;
  color: var(--color-ink-muted);
}

.mtg-stub p {
  margin: 0;
}

.poke-chrome {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.poke-scan-trigger {
  flex: 0 0 auto;
  width: 48px;
  min-width: 48px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.poke-chrome-search {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.poke-chrome-input {
  flex: 1;
  min-width: 0;
}

.poke-chrome-go {
  flex: 0 0 auto;
  width: 48px;
  min-width: 48px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.poke-scan-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.poke-scan-bar-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.poke-add {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.poke-add-input {
  flex: 1;
  min-width: 0;
}

.poke-add-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.poke-spin {
  animation: poke-spin 0.8s linear infinite;
}

@keyframes poke-spin {
  to { transform: rotate(360deg); }
}

.poke-err {
  margin: 0;
  font-size: 14px;
  color: var(--color-error, #ff7373);
}

.poke-stats {
  margin: 0;
  padding: 0 4px;
  font-size: 14px;
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}

.poke-empty {
  margin: 24px 0 0;
  text-align: center;
  font-size: 15px;
  color: var(--color-ink-muted);
}

.poke-filter {
  flex-wrap: wrap;
}

.poke-tools {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.poke-bag-input {
  flex: 1;
  min-width: 0;
}

.poke-set-select {
  flex: 0 1 180px;
  min-width: 120px;
}

.poke-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 640px) {
  .poke-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 960px) {
  .poke-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.poke-tile {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--press-duration, 0.16s) var(--press-ease, ease);
}

.poke-tile:active {
  transform: scale(0.96);
}

.poke-tile-art {
  display: block;
  width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-canvas);
  box-shadow: 0 6px 16px rgba(20, 22, 28, 0.12);
}

.poke-tile-art img,
.poke-picker-art img,
.poke-detail-art img,
.poke-top-art img,
.poke-scan-queue-art img,
.poke-scan-shot img,
.poke-scan-match img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.poke-card-fallback {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--color-canvas);
}

.poke-tile-qty,
.poke-tile-wish {
  position: absolute;
  z-index: 1;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-on-accent, #e9e9e9);
  background: var(--color-accent);
}

.poke-tile-qty {
  top: 6px;
  right: 6px;
}

.poke-tile-wish {
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-warning, #ffe873);
  color: #3a3208;
}

.poke-tile-finish {
  position: absolute;
  z-index: 1;
  left: 6px;
  bottom: 6px;
  max-width: calc(100% - 12px);
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  color: #2a2a2a;
  background: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poke-tile--wish .poke-tile-finish {
  bottom: 28px;
}

.poke-siblings {
  margin: 0 0 14px;
}

.poke-sibling-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.poke-sibling-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  border-radius: 14px;
  background: var(--color-bg, #e9e9e9);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.poke-sibling-art {
  width: 36px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #ddd;
}

.poke-sibling-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.poke-tile--wish .poke-tile-art {
  opacity: 0.78;
}

.poke-picker.modal-card {
  max-width: 560px;
  max-height: min(85dvh, 760px);
  overflow: auto;
}

.poke-picker-q {
  margin: -8px 0 16px;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.poke-picker-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 640px) {
  .poke-picker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.poke-picker-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.poke-picker-art {
  display: block;
  width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-canvas);
  box-shadow: 0 4px 12px rgba(20, 22, 28, 0.1);
  transition: transform 0.16s ease;
}

.poke-picker-card:hover .poke-picker-art,
.poke-picker-card:focus-visible .poke-picker-art {
  transform: translateY(-2px);
}

.poke-picker-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.poke-picker-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poke-picker-sub,
.poke-picker-have {
  font-size: 12px;
  color: var(--color-ink-muted);
  line-height: 1.3;
}

.poke-picker-have {
  color: var(--color-accent-text, var(--color-accent));
}

.poke-detail.modal-card {
  max-width: 480px;
  max-height: min(88dvh, 820px);
  overflow: auto;
}

.poke-detail-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.poke-detail-art-col {
  flex: 0 0 132px;
  width: 132px;
}

.poke-detail-art {
  display: block;
  width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-canvas);
  box-shadow: 0 8px 20px rgba(20, 22, 28, 0.14);
}

.poke-detail-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.poke-detail-sub {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-muted);
  line-height: 1.35;
}

.poke-list-seg .seg-control-btn {
  font-size: 13px;
}

.poke-qty {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.poke-qty-label {
  margin: 4px 0 0;
}

.poke-qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.poke-qty-n {
  min-width: 1.6em;
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.poke-note {
  resize: vertical;
  min-height: 64px;
}

.poke-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

/* Подвкладки языка сетов (中文 / 日本語 / English) */
.poke-lang-tabs {
  flex-wrap: nowrap;
  margin-bottom: 12px;
}

.poke-tabs::-webkit-scrollbar {
  display: none;
}

.poke-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  flex: 1 0 auto;
  min-width: 4.5rem;
}

.poke-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 720px) {
  .poke-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.poke-stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--color-surface);
}

.poke-stat-card--accent {
  background: var(--color-accent-soft);
}

.poke-stat-label {
  font-size: 12px;
  color: var(--color-ink-muted);
}

.poke-stat-value {
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.poke-portfolio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.poke-portfolio-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.poke-section-title {
  margin: 20px 0 10px;
  font-size: 15px;
  font-weight: 500;
}

.poke-top-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.poke-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 16px;
  background: var(--color-surface);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.poke-top-art {
  flex: 0 0 44px;
  width: 44px;
  aspect-ratio: 63 / 88;
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-canvas);
  display: block;
  align-self: center;
}

.poke-top-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.poke-top-name {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poke-top-sub {
  font-size: 12px;
  color: var(--color-ink-muted);
}

.poke-top-price {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.poke-sets,
.poke-binder,
.poke-bag,
.poke-search,
.poke-scan,
.poke-portfolio {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.poke-set-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.poke-set-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 18px;
  background: var(--color-surface);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.poke-set-logo {
  flex: 0 0 56px;
  width: 56px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Вертикальный бустер-пак CN-сета (public/pokemon-sets/*.webp) */
.poke-set-logo--pack {
  flex-basis: 42px;
  width: 42px;
  height: 56px;
}

.poke-set-logo--pack img {
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.poke-set-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.poke-set-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.poke-set-name {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poke-set-sub {
  font-size: 12px;
  color: var(--color-ink-muted);
}

.poke-progress {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--color-canvas);
  overflow: hidden;
}

.poke-progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-accent);
}

.poke-set-pct {
  flex-shrink: 0;
  min-width: 2.4em;
  text-align: right;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--color-ink-muted);
}

.poke-binder-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.poke-binder-titles {
  min-width: 0;
}

.poke-binder-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
}

.poke-binder-sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.poke-binder-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.poke-binder-art-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}

.poke-binder-tile--missing .poke-tile-art {
  opacity: 0.42;
  filter: grayscale(0.35);
}

.poke-binder-tile--wish .poke-tile-art {
  opacity: 0.72;
}

.poke-tile-miss {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 500;
  color: var(--color-accent-text);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.poke-binder-actions {
  display: flex;
  gap: 4px;
}

.poke-mini-btn {
  flex: 1;
  appearance: none;
  border: none;
  padding: 6px 4px;
  border-radius: 999px;
  background: var(--color-canvas);
  color: var(--color-ink);
  font-size: 11px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.poke-mini-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.poke-mini-btn--danger {
  flex: 0 0 28px;
  color: var(--color-error);
}

.poke-scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.poke-scan-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.poke-scan-cam {
  flex: 1;
  min-width: 140px;
  justify-content: center;
}

.poke-scan-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.poke-scan-queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.poke-scan-queue-item {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  background: var(--color-surface);
}

.poke-scan-queue-item--error {
  outline: 1px solid color-mix(in srgb, var(--color-error) 35%, transparent);
}

.poke-scan-queue-item--review {
  outline: 1px solid color-mix(in srgb, var(--color-warning, #ffe873) 55%, transparent);
}

.poke-scan-review-hint {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--color-warning, #ffe873) 35%, var(--color-surface));
  color: var(--color-ink);
  font-size: 13px;
  line-height: 1.35;
}

.poke-tag--warn {
  background: color-mix(in srgb, var(--color-warning, #ffe873) 55%, var(--color-accent-soft));
  color: var(--color-ink);
}

.poke-scan-queue-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.poke-scan-queue-main:disabled {
  cursor: default;
}

.poke-scan-queue-art-wrap {
  position: relative;
  flex: 0 0 52px;
  width: 52px;
  aspect-ratio: 63 / 88;
}

.poke-scan-queue-art {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-canvas);
}

.poke-scan-queue-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.poke-scan-queue-spin,
.poke-scan-queue-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  pointer-events: none;
}

.poke-scan-queue-spin {
  background: color-mix(in srgb, #000 35%, transparent);
  color: #fff;
}

.poke-scan-queue-check {
  top: auto;
  left: auto;
  right: -4px;
  bottom: -4px;
  inset: auto;
  width: 22px;
  height: 22px;
  background: var(--color-accent);
  color: var(--color-bg);
}

.poke-scan-queue-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.poke-scan-queue-name {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poke-scan-queue-sub {
  font-size: 12px;
  color: var(--color-ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poke-scan-queue-item .poke-scan-tags {
  margin: 2px 0 0;
}

.poke-scan-batch {
  position: sticky;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  padding-top: 4px;
}

.poke-scan-batch-btn {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.poke-scan-busy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  background: var(--color-surface);
  color: var(--color-ink-muted);
  font-size: 14px;
}

.poke-scan-busy-art {
  width: min(180px, 50vw);
  aspect-ratio: 63 / 88;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-canvas);
}

.poke-scan-busy-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poke-scan-preview-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.poke-scan-shot,
.poke-scan-match {
  display: block;
  width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-canvas);
}

.poke-scan-shot img,
.poke-scan-match img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.poke-scan-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}

.poke-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent-text);
  font-size: 12px;
  font-weight: 500;
}

.poke-scan-confirm .poke-poster-change,
.poke-poster-change {
  appearance: none;
  border: none;
  align-self: flex-start;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 47px;
  background: var(--color-canvas);
  color: var(--color-ink);
  font-size: 12px;
  cursor: pointer;
}

.poke-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

@media (max-width: 480px) {
  .poke-add {
    flex-direction: column;
  }

  .poke-detail-art-col {
    flex-basis: 108px;
    width: 108px;
  }

  .poke-tools {
    flex-direction: column;
  }

  .poke-set-select {
    flex-basis: auto;
    width: 100%;
  }

  .poke-tab-btn {
    font-size: 12px;
    padding: 10px 8px;
  }
}

/* ── China / отправки ── */
.page--china {
  min-height: 0;
}

.ch-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  max-width: 560px;
  width: 100%;
}

.ch-head {
  padding: 0 4px;
}

.ch-banner,
.ch-err,
.ch-empty {
  margin: 0;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.4;
}

.ch-banner {
  background: color-mix(in srgb, var(--color-warning) 22%, transparent);
  color: var(--color-ink);
}

.ch-err {
  margin-top: 12px;
  background: color-mix(in srgb, var(--color-error) 16%, transparent);
  color: var(--color-error);
}

.ch-empty {
  background: var(--color-surface);
  color: var(--color-ink-muted);
  text-align: center;
}

.ch-card {
  padding: 20px;
  border-radius: 24px;
  background: var(--color-surface);
}

.ch-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--color-ink-muted);
}

.ch-field-err {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--color-error);
}

.ch-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ch-value {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--color-ink-muted);
}

.ch-value strong {
  color: var(--color-ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.ch-stores {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ch-stores .seg-control-btn {
  flex: 1 1 calc(50% - 8px);
  min-height: 44px;
}

.ch-actions {
  margin-top: 18px;
  display: flex;
}

.ch-actions .btn {
  width: 100%;
}

.ch-spin {
  animation: dl-spin 0.8s linear infinite;
}

.ch-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ch-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.ch-list-title {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--color-ink-muted);
}

.ch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ch-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: 20px;
  background: var(--color-surface);
}

.ch-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ch-item-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.ch-status {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.ch-status--wait {
  background: color-mix(in srgb, var(--color-warning) 28%, transparent);
  color: var(--color-ink);
}

.ch-status--ok {
  background: color-mix(in srgb, var(--color-success) 22%, transparent);
  color: var(--color-ink);
}

.ch-status--err {
  background: color-mix(in srgb, var(--color-error) 18%, transparent);
  color: var(--color-error);
}

.ch-item-meta {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-muted);
}

.ch-item-link {
  font-size: 12px;
  color: var(--color-accent-text);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.ch-item-link:hover {
  text-decoration: underline;
}

.ch-item-err {
  margin: 0;
  font-size: 12px;
  color: var(--color-error);
}

.ch-track-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  align-items: center;
}

.ch-track-row .field-input {
  flex: 1;
  min-width: 0;
}

.ch-retry {
  align-self: flex-start;
  margin-top: 4px;
}

@media (max-width: 480px) {
  .ch-track-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ch-track-row .btn {
    min-height: 44px;
  }
}

/* ── Collection card face (Figma 1011:60 proportions) ── */
.poke-grid--rich {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

@media (min-width: 640px) {
  .poke-grid--rich {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 960px) {
  .poke-grid--rich {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.poke-grid--rich > li {
  min-width: 0;
}

/*
  Figma outer: 768×1232.
  stage (lime+art): ~87% высоты, footer: ~13%.
*/
.ccard {
  --ccard-lime: #cafb40;
  display: flex;
  flex-direction: column;
  width: 100%;
  aspect-ratio: 768 / 1232;
  border-radius: clamp(16px, 7%, 28px);
  overflow: hidden;
  background: #fff;
  color: #111;
  box-shadow: 0 8px 22px rgba(20, 22, 28, 0.1);
  text-align: left;
}

.ccard--missing {
  filter: grayscale(0.12);
}

.ccard--missing .ccard-media img {
  filter: brightness(0.58) saturate(0.78);
}

.ccard--wish {
  box-shadow:
    0 0 0 2px rgba(255, 232, 115, 0.85),
    0 8px 22px rgba(20, 22, 28, 0.1);
}

/* лаймовый блок с артом + полоска номера */
.ccard-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 2.1% 2.1% 0;
  border-radius: clamp(14px, 5.2%, 22px);
  background: var(--ccard-lime);
  overflow: hidden;
}

.ccard-media {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #111;
  overflow: hidden;
  /* Figma: верх 40, низ 80 при ширине 736 */
  border-radius: clamp(14px, 5.2%, 22px) clamp(14px, 5.2%, 22px) clamp(22px, 10%, 40px)
    clamp(22px, 10%, 40px);
}

.ccard-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.ccard-fallback {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #1a1a1a, #333);
}

/* foil shimmer */
.ccard-foil {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      115deg,
      transparent 0%,
      rgba(255, 120, 200, 0.2) 16%,
      rgba(120, 220, 255, 0.3) 34%,
      rgba(255, 230, 120, 0.32) 50%,
      rgba(180, 120, 255, 0.24) 66%,
      transparent 86%
    ),
    repeating-linear-gradient(
      -18deg,
      rgba(255, 255, 255, 0.05) 0 2px,
      transparent 2px 7px
    );
  background-size: 220% 220%, 14px 14px;
  mix-blend-mode: color-dodge;
  opacity: 0.88;
  animation: ccard-foil-shift 4.8s ease-in-out infinite;
}

.ccard-foil::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.32) 48%,
    transparent 62%
  );
  animation: ccard-foil-sheen 3.6s ease-in-out infinite;
  mix-blend-mode: soft-light;
}

.ccard-foil--etched {
  background:
    linear-gradient(
      125deg,
      transparent 10%,
      rgba(200, 210, 220, 0.38) 30%,
      rgba(160, 175, 190, 0.48) 48%,
      rgba(230, 235, 240, 0.32) 62%,
      transparent 85%
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.07) 0 1px,
      transparent 1px 4px
    );
  mix-blend-mode: soft-light;
  opacity: 0.95;
}

.ccard-foil--etched::after {
  opacity: 0.5;
}

.ccard-foil--holo {
  mix-blend-mode: overlay;
  opacity: 0.92;
}

@keyframes ccard-foil-shift {
  0%,
  100% {
    background-position: 0% 40%, 0 0;
  }
  50% {
    background-position: 100% 60%, 0 0;
  }
}

@keyframes ccard-foil-sheen {
  0%,
  100% {
    transform: translateX(-30%) rotate(8deg);
    opacity: 0.18;
  }
  50% {
    transform: translateX(30%) rotate(8deg);
    opacity: 0.8;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ccard-foil,
  .ccard-foil::after {
    animation: none;
  }
}

/* stamped DATE oval — как в макете */
.ccard-stamp {
  pointer-events: none;
  position: absolute;
  z-index: 2;
  left: 8%;
  bottom: 10%;
  width: 32%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2px dashed rgba(180, 180, 180, 0.85);
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  transform: rotate(-8deg);
}

.ccard-stamp::before {
  content: "DATE";
  font-size: clamp(7px, 2.8vw, 11px);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(200, 200, 200, 0.9);
}

.ccard-qty,
.ccard-wish {
  position: absolute;
  z-index: 3;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
}

.ccard-qty {
  top: 6px;
  right: 6px;
  color: #111;
  background: var(--ccard-lime);
}

.ccard-wish {
  top: 6px;
  left: 6px;
  background: #ffe873;
  color: #3a3208;
}

/* полоска номера — тонкая, внутри лайма */
.ccard-banner {
  flex: 0 0 auto;
  height: clamp(18px, 3.4%, 26px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(10px, 2.6vw, 13px);
  font-weight: 700;
  line-height: 1;
  color: #111;
  background: var(--ccard-lime);
}

/* белый низ: имя+теги | цена */
.ccard-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 13%;
  min-height: 56px;
  max-height: 72px;
  padding: 8px 10px 10px;
  box-sizing: border-box;
  background: #fff;
}

.ccard-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.ccard-name {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
}

.ccard-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.ccard-tag {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ccard-lime);
  color: #111;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.15;
  white-space: nowrap;
}

.ccard-side {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  padding-left: 8px;
  border-left: 2.5px solid #111;
  min-width: 46px;
  max-width: 40%;
}

.ccard-price {
  font-size: clamp(15px, 4.2vw, 22px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
  color: #111;
}

.poke-tile--rich,
.poke-binder-art-btn--rich {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: clamp(16px, 7%, 28px);
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--press-duration, 0.16s) var(--press-ease, ease);
}

.poke-tile--rich:active,
.poke-binder-art-btn--rich:active {
  transform: scale(0.98);
}

.poke-binder-tile--rich {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.poke-binder-tile--rich .poke-binder-actions {
  display: flex;
  gap: 4px;
}

.ccard-miss {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  font-size: clamp(36px, 14vw, 56px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.22);
  pointer-events: none;
}
