/* ── Home-page variables ─────────────────────────────── */
:root {
  --card:   #242424;
  --card-h: #2a2a2a;
}

/* ── Base layout ─────────────────────────────────────── */
html {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow: hidden;
  background: var(--bg);
}

/* React mount: column flex so .content can shrink and scroll */
#root {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Full-bleed centered panels (loading, needs-folder) — avoid 100vh + chrome overflow */
.home-viewport-fill {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
}
.home-viewport-fill--stack {
  flex-direction: column;
  gap: 12px;
}

.home-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 10px 24px;
  padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--bg);
  z-index: 10;
}

/* ── Header ──────────────────────────────────────────── */
.header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  height: 48px;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-mark {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--accent);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px; padding: 4px;
}
.logo-mark span { background: var(--bg); border-radius: 1px; display: block; }
.logo-name { font-size: 13px; font-weight: 600; color: var(--text-d); }

.search-wrap {
  position: relative;
  flex: 1; max-width: 320px;
}
.search-wrap svg {
  position: absolute; left: 9px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px 6px 30px;
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: rgba(59,142,243,0.5); }
.search-input::placeholder { color: var(--muted); }

.h-spacer { flex: 1; }

/* Header: desktop shows full toolbar; narrow screens use .header-mobile-actions + menu */
.header-desktop-extras {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 0;
}
.header-mobile-actions {
  display: none;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(0, 0, 0, 0.45);
  -webkit-tap-highlight-color: transparent;
}
.header-menu-panel {
  display: none;
  position: fixed;
  z-index: 2110;
  left: 12px;
  right: 12px;
  max-height: min(72vh, 520px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card-h);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}
.header-menu-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-d);
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.12s;
}
.header-menu-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.header-menu-item.header-menu-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
a.header-menu-item.header-menu-link {
  text-decoration: none;
  color: var(--text-d);
}
.header-menu-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 10px 14px 4px;
}
.header-menu-meta {
  font-size: 12px;
  color: var(--text-d);
  padding: 0 14px 8px;
  line-height: 1.45;
  word-break: break-word;
}
.header-menu-row {
  display: flex;
  gap: 8px;
  padding: 0 14px 12px;
  flex-wrap: wrap;
}
.header-menu-inline-btn {
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

.btn-icon {
  background: none; border: 1px solid var(--border);
  color: var(--text-d); border-radius: 5px;
  font-size: 14px; width: 28px; height: 28px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.btn-icon:hover { background: rgba(255,255,255,0.06); color: var(--text); }

.btn-new {
  display: flex; align-items: center; gap: 5px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 5px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  padding: 6px 13px; cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-new:hover { background: #5ba3f5; }

.btn-secondary {
  background: none; border: 1px solid var(--border);
  color: var(--text-d); border-radius: 5px;
  font-size: 11px; height: 28px; padding: 0 11px;
  cursor: pointer; font-family: inherit; font-weight: 500;
  white-space: nowrap; flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.06); color: var(--text); }

/* ── Folder tabs ─────────────────────────────────────── */
.tab-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 24px;
  flex-shrink: 0;
  overflow-x: auto;
  min-height: 0;
}
.tab-bar::-webkit-scrollbar { height: 0; }

.tab {
  position: relative;
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px;
  font-size: 12px; font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  border: none; background: none;
  font-family: inherit;
  transition: color 0.12s;
  flex-shrink: 0;
}
.tab::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.15s;
  border-radius: 2px 2px 0 0;
}
.tab:hover { color: var(--text-d); }
.tab.active { color: var(--text); }
.tab.active::after { transform: scaleX(1); }

.tab-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.tab-count {
  font-size: 10px; color: var(--muted);
  background: rgba(255,255,255,0.07);
  border-radius: 8px; padding: 1px 5px;
}
.tab-div { width: 1px; height: 14px; background: var(--border); margin: 0 2px; flex-shrink: 0; }

/* ── Content area ────────────────────────────────────── */
.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  padding: 24px 24px 60px;
  background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}

.section-label {
  font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 12px;
}

/* ── Board grid ──────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  flex: 1;
  align-content: start;
}

/* ── Board card ──────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.card:hover { border-color: var(--border-m); background: var(--card-h); }
.card:hover .card-menu-btn { opacity: 1; }

.card-thumb { height: 180px; position: relative; overflow: hidden; }

.card-badge {
  position: absolute;
  bottom: 7px; left: 7px;
  background: rgba(0,0,0,0.65);
  color: rgba(255,255,255,0.8);
  font-size: 9px; font-weight: 500;
  padding: 2px 6px; border-radius: 4px;
  backdrop-filter: blur(4px);
}

.card-storage-icon {
  margin-left: auto;
  display: flex; align-items: center;
  flex-shrink: 0;
}
.card-storage-icon.local { color: #34c776; }
.card-storage-icon.cloud { color: #3b8ef3; }

.card-local  { border-left: 2px solid rgba(52,199,118,0.35); }
.card-cloud  { border-left: 2px solid rgba(59,142,243,0.2); }

.card-menu-btn {
  position: absolute;
  top: 7px; right: 7px;
  width: 24px; height: 24px;
  border-radius: 5px;
  background: rgba(0,0,0,0.6);
  border: none; color: #fff;
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.12s, background 0.12s;
  backdrop-filter: blur(4px);
}
.card-menu-btn:hover { background: rgba(0,0,0,0.85); }

.card-body { padding: 12px 14px; border-top: 1px solid var(--border); }
.card-name {
  font-size: 13px; font-weight: 500;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.card-meta { display: flex; align-items: center; gap: 6px; }
.card-folder-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.card-date { font-size: 10px; color: var(--muted); }

/* ── Empty state ─────────────────────────────────────── */
.empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; padding: 40px 20px 60px;
  text-align: center;
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
}
.empty-icon {
  width: 56px; height: 56px; border-radius: 14px;
  border: 1px dashed rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--muted);
  margin-bottom: 4px;
}
.empty-title { font-size: 14px; font-weight: 600; color: var(--text-d); }
.empty-sub { font-size: 12px; color: var(--muted); line-height: 1.6; max-width: 240px; }

/* ── Welcome screen ──────────────────────────────────── */
.welcome-logo-mark {
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--accent);
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: 4px; padding: 10px; margin-bottom: 24px;
}
.welcome-logo-mark span { background: rgba(255,255,255,0.85); border-radius: 2px; display: block; }
.welcome-title { font-size: 28px; font-weight: 700; color: var(--text-d); letter-spacing: -0.02em; margin-bottom: 10px; }
.welcome-sub { font-size: 14px; color: var(--muted); max-width: 380px; line-height: 1.7; margin-bottom: 28px; }
.welcome-cta {
  display: flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 11px 24px; cursor: pointer; transition: opacity 0.15s; margin-bottom: 40px;
}
.welcome-cta:hover { opacity: 0.85; }
.welcome-steps {
  display: flex; gap: 12px; margin-bottom: 40px; flex-wrap: wrap; justify-content: center;
}
.welcome-step {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 14px 16px; width: 148px; text-align: left;
  display: flex; flex-direction: column; gap: 7px;
}
.step-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(59,142,243,0.15); color: var(--accent);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step-label { font-size: 11px; font-weight: 600; color: var(--text-d); }
.step-desc { font-size: 11px; color: var(--muted); line-height: 1.5; }
.welcome-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.welcome-link {
  font-size: 11px; color: var(--muted); text-decoration: none;
  display: flex; align-items: center; gap: 4px;
  transition: color 0.12s; border: none; background: none;
  font-family: inherit; cursor: pointer; padding: 0;
}
.welcome-link:hover { color: var(--text-d); }

/* ── Context menu ────────────────────────────────────── */
.ctx-menu {
  position: fixed;
  background: #2a2a2a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px; padding: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  z-index: 2000; min-width: 148px;
}
.ctx-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; border-radius: 4px;
  font-size: 12px; color: var(--text-d);
  cursor: pointer; border: none; background: none;
  width: 100%; font-family: inherit; text-align: left;
  transition: background 0.1s, color 0.1s;
}
.ctx-item:hover { background: rgba(59,142,243,0.15); color: var(--text); }
.ctx-item.danger { color: #ff6b6b; }
.ctx-item.danger:hover { background: rgba(255,69,58,0.12); }
.ctx-div { height: 1px; background: rgba(255,255,255,0.07); margin: 3px 0; }

/* ── Modals ──────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: #222; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9px; padding: 20px 22px;
  width: 290px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}
.modal-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 14px; }
.modal-sub { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.modal-input {
  width: 100%; background: #111;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px; color: var(--text);
  font-family: inherit; font-size: 12px;
  padding: 8px 10px; outline: none; margin-bottom: 14px;
  transition: border-color 0.15s;
}
.modal-input:focus { border-color: rgba(59,142,243,0.6); }
.modal-row { display: flex; gap: 8px; }
.modal-btn {
  flex: 1; padding: 8px; border-radius: 5px;
  font-family: inherit; font-size: 12px;
  font-weight: 500; cursor: pointer; border: none;
}
.modal-btn.cancel { background: rgba(255,255,255,0.06); color: var(--muted); }
.modal-btn.cancel:hover { background: rgba(255,255,255,0.1); }
.modal-btn.confirm { background: var(--accent); color: #fff; }
.modal-btn.confirm:hover { background: #5ba3f5; }
.modal-btn.del { background: rgba(255,69,58,0.15); color: #ff6b6b; }
.modal-btn.del:hover { background: rgba(255,69,58,0.25); }

/* ── First-visit intro (large Adobe-style welcome) ─────── */
.home-intro-overlay {
  position: fixed; inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 28px);
  padding-bottom: max(clamp(12px, 3vw, 28px), env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(59, 142, 243, 0.22), transparent 55%),
    rgba(6, 8, 12, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: home-intro-fade 0.35s ease;
}
@keyframes home-intro-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.home-intro-panel {
  position: relative;
  width: min(100%, 960px);
  min-height: min(88vh, 820px);
  min-height: min(88dvh, 820px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, var(--card-h) 0%, var(--card) 45%, #1a1a1a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: clamp(16px, 2vw, 24px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 32px 120px rgba(0, 0, 0, 0.65),
    0 12px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.home-intro-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, #2d6fd4, var(--accent), #5ad4a8, #e6a23a);
  opacity: 0.95;
  pointer-events: none;
}
.home-intro-skip {
  position: absolute;
  top: clamp(16px, 2.5vw, 28px);
  right: clamp(16px, 2.5vw, 28px);
  z-index: 2;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-d);
  font-family: inherit;
  font-size: clamp(13px, 1.2vw, 15px);
  font-weight: 600;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.home-intro-skip:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}
.home-intro-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: clamp(48px, 7vw, 88px) clamp(20px, 4vw, 56px) clamp(28px, 4vw, 44px);
}
.home-intro-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  max-width: 42rem;
  margin: 0 auto;
  width: 100%;
}
.home-intro-footer {
  flex-shrink: 0;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding-top: clamp(20px, 3vw, 40px);
}
.home-intro-mark {
  width: clamp(72px, 12vw, 104px);
  height: clamp(72px, 12vw, 104px);
  border-radius: clamp(16px, 2vw, 22px);
  background: linear-gradient(145deg, #5ba3f5, var(--accent));
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: clamp(4px, 0.8vw, 8px);
  padding: clamp(12px, 2vw, 18px);
  margin: 0 0 clamp(24px, 4vw, 40px);
  box-shadow: 0 16px 48px rgba(59, 142, 243, 0.35);
}
.home-intro-mark span {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 3px;
  display: block;
}
.home-intro-slide-title {
  font-size: clamp(1.75rem, 4vw + 1rem, 3.25rem);
  font-weight: 700;
  color: var(--text-d);
  letter-spacing: -0.035em;
  margin: 0 0 clamp(16px, 2.5vw, 28px);
  line-height: 1.08;
  max-width: 100%;
}
.home-intro-slide-body {
  font-size: clamp(1.05rem, 1.5vw + 0.65rem, 1.35rem);
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
  max-width: 38rem;
  min-height: 5.5em;
}
.home-intro-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: clamp(20px, 3vw, 28px);
}
.home-intro-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.home-intro-dot:hover { background: rgba(255, 255, 255, 0.28); }
.home-intro-dot.active {
  background: var(--accent);
  transform: scale(1.2);
  box-shadow: 0 0 0 3px rgba(59, 142, 243, 0.35);
}
.home-intro-nav {
  display: flex;
  gap: 12px;
}
.home-intro-nav button {
  flex: 1;
  font-family: inherit;
  font-size: clamp(14px, 1.25vw, 17px);
  font-weight: 600;
  padding: clamp(14px, 1.8vw, 18px) clamp(20px, 2vw, 28px);
  border-radius: 10px;
  cursor: pointer;
  border: none;
  transition: opacity 0.12s, background 0.15s, transform 0.12s;
}
.home-intro-nav button:active { transform: scale(0.98); }
.home-intro-back {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-d);
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}
.home-intro-back:hover:not(:disabled) { background: rgba(255, 255, 255, 0.11); }
.home-intro-back:disabled {
  opacity: 0.35;
  cursor: default;
}
.home-intro-next {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 28px rgba(59, 142, 243, 0.45);
}
.home-intro-next:hover { background: #5ba3f5; }
.home-intro-counter {
  text-align: center;
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 600;
  color: var(--muted);
  margin-top: clamp(16px, 2vw, 22px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .header {
    padding: 0 12px;
    gap: 8px;
    min-height: 52px;
    height: auto;
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    padding-bottom: 8px;
    flex-wrap: nowrap;
    align-items: center;
  }
  .logo-name { display: none; }
  .header-root-chip { display: none !important; }
  .search-wrap { max-width: none; flex: 1; min-width: 0; }
  .header-desktop-extras { display: none !important; }
  .header-mobile-actions {
    display: flex;
  }
  .header-menu-backdrop,
  .header-menu-panel {
    display: block;
  }
  .header-menu-panel {
    top: calc(72px + env(safe-area-inset-top, 0px));
  }
  .header .header-mobile-actions .btn-icon,
  .header .header-menu-toggle {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .header .header-mobile-actions .btn-new {
    height: 40px;
    font-size: 12px;
    padding: 0 14px;
  }
  .card-menu-btn {
    opacity: 1;
    width: 28px;
    height: 28px;
  }

  .tab-bar { padding: 0 14px; }
  .tab { padding: 10px 10px; font-size: 11px; }

  .content { padding: 12px 14px calc(72px + env(safe-area-inset-bottom, 0px)); }

  .empty {
    padding: 16px 12px 24px;
    justify-content: flex-start;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }
  .card-thumb { height: 130px; }

  .welcome-title { font-size: 22px; }
  .welcome-sub { font-size: 13px; }
  .welcome-steps { flex-direction: column; align-items: center; }
  .welcome-step { width: 90%; max-width: 280px; }

  .modal { width: calc(100vw - 32px); }

  .home-intro-panel {
    min-height: min(92vh, 640px);
    min-height: min(92dvh, 640px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
  }
  .home-intro-body {
    padding: 44px 18px 24px;
  }
  .home-intro-slide-title {
    font-size: clamp(1.5rem, 6.5vw, 2.25rem);
  }
  .home-intro-slide-body {
    font-size: clamp(0.95rem, 3.8vw, 1.1rem);
    min-height: 0;
  }
  .home-intro-skip {
    font-size: 12px;
    padding: 8px 14px;
  }
}

/* ── Touch / coarse-pointer accessibility ─────────────── */
@media (pointer: coarse) {
  .btn-new,
  .btn-secondary,
  .btn-icon,
  .header-menu-toggle {
    min-height: 40px;
    min-width: 40px;
    padding: 8px 14px;
    font-size: 13px !important;
  }
  .ctx-item { padding: 12px 14px !important; font-size: 14px !important; }
  .header-menu-item { padding: 14px 16px; font-size: 14px; }
  .card { min-height: 220px; }
  .folder-tab { padding: 10px 14px !important; font-size: 13px !important; }
}
