:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --line: #e6e8ec;
  --ink: #111827;
  --sub: #6b7280;
  --blue: #0d99ff;
  --blue-soft: rgba(13,153,255,0.12);
  --danger: #dc2626;
  --font-ui-en: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-ui-ja: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Noto Sans JP", sans-serif;
  --font-display-en: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display-ja: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Noto Sans JP", sans-serif;
  --font-ui: var(--font-ui-en), var(--font-ui-ja);
  --font-display: var(--font-display-en), var(--font-display-ja);
  --home-grid-cols: 24px 30px minmax(220px,1fr) minmax(170px,220px) minmax(210px,auto);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.55 var(--font-ui);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
html.home-auth-pending #app {
  visibility: hidden;
}
button,input,select,textarea { font: inherit; color: inherit; font-family: var(--font-ui); }
#app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; align-items: start; }
#app.guest-mode {
  grid-template-columns: 220px 1fr;
}
#side {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 14px 10px;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.brand-main {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand-version {
  font-size: 10px;
  color: #94a3b8;
  letter-spacing: 0.2px;
}
.brand-home {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 7px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}
.brand-actions { display:flex; align-items:center; gap:6px; }
.brand-auth {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 7px;
  height: 28px;
  min-width: 76px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  white-space: nowrap;
  line-height: 1;
  cursor: pointer;
}
.brand-settings {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 7px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}
.nav { display:flex; flex-direction:column; gap:4px; margin-bottom:12px; }
.nav-btn {
  border:1px solid transparent;
  border-radius:9px;
  background:transparent;
  color:var(--sub);
  text-align:left;
  padding:8px 10px;
  cursor:pointer;
}
.nav-btn.active { color: var(--blue); border-color:#cde7ff; background:var(--blue-soft); font-weight:700; }
.section-title {
  padding:8px 6px 6px;
  color:var(--sub);
  font-size:11px;
  font-weight:700;
  letter-spacing:0.4px;
  text-transform:uppercase;
}
.section-help { padding:0 6px 6px; color:#8b95a7; font-size:11px; }
#project-list {
  display:flex;
  flex-direction:column;
  gap:4px;
  padding-right:2px;
}
.project-tools {
  display: flex;
  padding: 0 0 8px;
}
#project-sort {
  width: 100%;
  min-width: 0;
}
.p-item {
  display:flex;
  align-items:center;
  gap:6px;
  width:100%;
  border:1px solid transparent;
  border-radius:8px;
  background:transparent;
  color:#374151;
  padding:4px;
}
.p-item:hover { background:#eef1f5; }
.p-item.active { background:#eaf4ff; border-color:#cae4ff; }
.p-item.dragging { opacity:0.5; }
.p-item.drop-before { box-shadow: inset 0 2px 0 #0d99ff; }
.p-item.drop-after { box-shadow: inset 0 -2px 0 #0d99ff; }
.p-main {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 3px 4px;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
}
.p-main:hover { background: rgba(255,255,255,0.4); }
.p-name { flex:1; text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.p-count {
  min-width: 22px;
  padding: 0 6px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid #dbe2ea;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.p-actions { display:flex; gap:4px; opacity:0; }
.p-item:hover .p-actions,
.p-item:focus-within .p-actions { opacity:1; }
.p-item.active .p-count {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.p-act {
  width:20px; height:20px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  color:#6b7280;
  font-size:11px;
  cursor:pointer;
}
.p-act:hover { color:#111827; border-color:#cfd5dd; background:#f8fafc; }
.p-grip {
  width: 20px;
  height: 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #9aa3b1;
  cursor: grab;
  user-select: none;
  text-align: center;
  line-height: 18px;
  padding: 0;
}
.p-grip:hover {
  border-color: #d6dce5;
  background: #fff;
  color: #475569;
}
.p-item .row-more summary {
  width: 20px;
  height: 20px;
  border-radius: 6px;
}
.p-item[data-project-sort="manual"] .p-grip {
  opacity: 1;
}
.p-item .row-more-menu {
  min-width: 128px;
}

#main { padding:14px; display:flex; flex-direction:column; gap:10px; }
#guest-home {
  display: none;
  min-height: calc(100vh - 28px);
  align-content: center;
}
.guest-home-card {
  width: min(1040px, 100%);
  margin: 0 auto;
  border: 1px solid #e2e8f0;
  border-radius: 32px;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  box-shadow: 0 30px 60px -15px rgba(15, 23, 42, 0.05), inset 0 1px 0 #ffffff;
  padding: 48px;
  display: grid;
  gap: 24px;
}
.guest-home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 32px;
  align-items: center;
}
.guest-home-copy {
  display: grid;
  gap: 20px;
}
.guest-home-invite-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
  margin-bottom: -4px;
}
.guest-home-invite-badge span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 0 2px #dbeafe;
  animation: pulseBlob 2s infinite;
}
@keyframes pulseBlob {
  0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}
.guest-home-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 40px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #0f172a;
  font-weight: 800;
  background: linear-gradient(90deg, #0f172a, #334155);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.guest-home-desc {
  font-size: 14px;
  line-height: 1.8;
  color: #475569;
  max-width: 56ch;
}
.guest-home-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.guest-home-point {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  padding: 16px;
  display: grid;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.guest-home-point:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  border-color: #cbd5e1;
}
.guest-home-point strong {
  font-size: 13px;
  color: #0f172a;
  font-weight: 700;
}
.guest-home-point span {
  font-size: 11px;
  line-height: 1.6;
  color: #64748b;
}
.guest-home-preview {
  min-height: 100%;
}
.guest-preview-panel {
  min-height: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 28px;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  padding: 28px 24px;
  display: grid;
  gap: 18px;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.5), 0 10px 30px rgba(15, 23, 42, 0.03);
}
.guest-preview-kicker {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3b82f6;
  font-weight: 800;
}
.guest-preview-title {
  font-size: 18px;
  line-height: 1.5;
  color: #0f172a;
  font-weight: 700;
}
.guest-preview-flow {
  display: grid;
  gap: 12px;
}
.guest-preview-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  padding: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.01);
}
.guest-preview-step-num {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #3b82f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}
.guest-preview-step-body {
  display: grid;
  gap: 4px;
}
.guest-preview-step-body strong {
  font-size: 13px;
  color: #0f172a;
  font-weight: 700;
}
.guest-preview-step-body span {
  font-size: 12px;
  line-height: 1.6;
  color: #64748b;
}
.guest-home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
}
.guest-home-btn {
  min-height: 48px;
  border-radius: 999px;
  padding: 0 24px;
  border: none;
  background: #0f172a;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 16px -4px rgba(15, 23, 42, 0.2);
  transition: all 0.2s ease;
}
.guest-home-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px -4px rgba(15, 23, 42, 0.3);
  background: #1e293b;
}
.guest-home-note {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.guest-home-copy > * {
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.guest-home-copy > *:nth-child(1) { animation-delay: 0.05s; }
.guest-home-copy > *:nth-child(2) { animation-delay: 0.1s; }
.guest-home-copy > *:nth-child(3) { animation-delay: 0.15s; }
.guest-home-copy > *:nth-child(4) { animation-delay: 0.2s; }
.guest-home-copy > *:nth-child(5) { animation-delay: 0.25s; }
.guest-home-copy > *:nth-child(6) { animation-delay: 0.3s; }
.guest-preview-panel {
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}
#top {
  display:grid;
  grid-template-columns: minmax(220px,1fr) 170px max-content auto auto;
  gap:8px;
  align-items:center;
}
.input,
.select,
#content-mode,
#btn-new-board {
  min-width: 0;
}
#content-mode {
  justify-self: start;
}
.input,.select,.btn {
  height:36px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel);
}
.input,.select { padding:0 10px; }
.btn { padding:0 12px; cursor:pointer; }
.btn.primary { background:var(--ink); border-color:var(--ink); color:#fff; }
.btn.danger:hover { color:var(--danger); border-color:#fecaca; background:#fef2f2; }
#scope-bar {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#scope-bar.is-visible {
  display: flex;
}
.scope-summary {
  color: var(--sub);
  font-size: 12px;
  font-weight: 600;
}
#mobile-controls {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  gap: 8px;
}
.mobile-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mobile-view-btn {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
}
.mobile-view-btn.active {
  border-color: #cde7ff;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}
#mobile-project-select {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  min-width: 160px;
}
.scope-pill {
  border: 1px solid #cfe4ff;
  background: #eef7ff;
  color: #1d4f8c;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
}
#content-mode {
  margin-left: auto;
  display: inline-flex;
  gap: 4px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
}
.mode-btn {
  height: 28px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #475569;
  padding: 0 10px;
  cursor: pointer;
  font-size: 12px;
}
.mode-btn.active {
  border-color: #bfdbfe;
  background: #eaf4ff;
  color: #0b63b6;
  font-weight: 700;
}
#toolbar {
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:12px;
  padding:8px;
  display:grid;
  gap:8px;
}
#toolbar .muted { color:var(--sub); font-size:12px; }
.toolbar-main {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.toolbar-summary {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
#home-sync-status[hidden] { display:none; }
#home-sync-status[data-tone="ok"] { color:#166534; }
#home-sync-status[data-tone="info"] { color:#1d4ed8; }
#home-sync-status[data-tone="warn"] { color:#b45309; }
#home-sync-status[data-tone="error"] { color:#b91c1c; }
.toolbar-trigger {
  margin-left:auto;
}
#toolbar-actions {
  display:none;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  padding-top:8px;
  border-top:1px solid var(--line);
}
#toolbar[data-open="1"] #toolbar-actions {
  display:flex;
}
#share-ops-card {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  gap: 10px;
}
.ops-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.ops-title-wrap {
  display: grid;
  gap: 2px;
}
.ops-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}
.ops-desc {
  font-size: 11px;
  color: #64748b;
}
.ops-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ops-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ops-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  background: #f8fafc;
  color: #475569;
}
.ops-badge.stage-internal {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.ops-badge.stage-limited {
  background: #effdf5;
  border-color: #bbf7d0;
  color: #166534;
}
.ops-badge.stage-general {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #6d28d9;
}
.ops-badge.level-ok {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}
.ops-badge.level-warn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}
.ops-badge.level-critical {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 8px;
}
.ops-stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}
.ops-k {
  font-size: 11px;
  color: #64748b;
}
.ops-v {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}
.ops-hint {
  margin-top: 3px;
  font-size: 11px;
  color: #94a3b8;
}
.ops-note {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
}
.ops-note.level-ok {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}
.ops-note.level-warn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}
.ops-note.level-critical {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.ops-alerts {
  font-size: 11px;
  color: #64748b;
}
.ops-error {
  color: #b91c1c;
}
#boards-home,
#pages-home {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
}
#boards-home-head,
#pages-home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  padding: 10px 10px 8px;
}
#pages-home-inventory {
  display: grid;
  gap: 8px;
  padding: 0 10px 8px;
}
.page-inventory-summary,
.page-inventory-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.page-inventory-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid #dbe4ee;
  border-radius: 999px;
  background: #f8fafc;
  padding: 0 10px;
  font-size: 11px;
  color: #475569;
}
.page-inventory-pill.review {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}
.page-kind-chip {
  height: 28px;
  border: 1px solid #dbe4ee;
  border-radius: 999px;
  background: #fff;
  padding: 0 10px;
  font-size: 11px;
  color: #475569;
}
.page-kind-chip:hover {
  border-color: #bfdcf7;
  background: #f0f7ff;
  color: #145ca8;
}
.page-kind-chip.active {
  border-color: #0f172a;
  background: #0f172a;
  color: #fff;
}
.page-kind-chip:disabled {
  opacity: 0.5;
  cursor: default;
}
#pages-home-search {
  width: calc(100% - 20px);
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 9px;
  margin: 0 10px 8px;
}
#boards-home-title,
#pages-home-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}
#boards-home-list,
#pages-home-list {
  display: block;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
}
.guest-sidebar-note {
  display: none;
  margin: 10px 6px 0;
  border: 1px solid #dbe4ee;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  font-size: 12px;
  line-height: 1.65;
  color: #64748b;
}
.guest-sidebar-note strong {
  display: block;
  margin-bottom: 4px;
  color: #0f172a;
}
#app.guest-mode #nav,
#app.guest-mode .section-title,
#app.guest-mode .section-help,
#app.guest-mode #project-list,
#app.guest-mode #btn-new-project,
#app.guest-mode #top,
#app.guest-mode #scope-bar,
#app.guest-mode #mobile-controls,
#app.guest-mode #toolbar,
#app.guest-mode #boards-home,
#app.guest-mode #pages-home {
  display: none;
}
#app.guest-mode #guest-home,
#app.guest-mode .guest-sidebar-note {
  display: grid;
}
.page-row:last-child { border-bottom: 0; }
.page-home-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) 150px auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff;
}
.page-home-main { min-width: 0; }
.page-home-title {
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-home-meta {
  font-size: 11px;
  color: var(--sub);
}
.page-home-open {
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0 9px;
  font-size: 11px;
  white-space: nowrap;
}
.page-home-open:hover {
  border-color: #bfdcf7;
  background: #f0f7ff;
  color: #145ca8;
}
.page-home-actions {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.page-home-move {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
}
.page-home-move:hover {
  border-color: #bfdcf7;
  color: #145ca8;
  background: #f0f7ff;
}
.page-home-row:focus-within {
  border-color: #8ec5ff;
  box-shadow: 0 0 0 2px rgba(13,153,255,.16);
}
#boards-home-list {
  overflow-x: auto;
  overflow-y: visible;
}
.board-row {
  display:grid;
  grid-template-columns: var(--home-grid-cols);
  gap:8px;
  align-items:center;
  padding:10px;
  border-bottom:1px solid var(--line);
  min-width:860px;
}
.board-row:last-child { border-bottom:0; }
.board-row:hover { background:#fafbfc; }
.board-row.sel { background:#eef6ff; }
.board-row.dragging { opacity: 0.5; }
.board-row.drop-before { box-shadow: inset 0 2px 0 #0d99ff; }
.board-row.drop-after { box-shadow: inset 0 -2px 0 #0d99ff; }
.board-head {
  background:#f8fafc;
  color:#6b7280;
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
}
.drag-handle { color:#9aa3b1; cursor:grab; text-align:center; user-select:none; }
.board-main { display:grid; gap:2px; min-width:0; }
.b-name { font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.page-row-statusline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #64748b;
}
.page-row-status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid #dbe4ee;
  border-radius: 999px;
  background: #f8fafc;
  padding: 0 8px;
  color: #475569;
}
.page-row-status.is-review {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}
.b-meta { color:var(--sub); font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.select-sm {
  height:30px;
  border:1px solid var(--line);
  border-radius:8px;
  padding:0 8px;
  background:#fff;
}
.page-project-static {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  white-space: nowrap;
}
.row-actions { display:flex; gap:6px; flex-wrap:wrap; }
.btn-xs {
  height:28px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  padding:0 9px;
  cursor:pointer;
  white-space:nowrap;
}
.btn-xs.on { color:var(--blue); border-color:#bdddff; background:#eef7ff; }
.row-more {
  position: relative;
}
.row-more[open] {
  z-index: 30;
}
.row-more summary {
  list-style: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #475569;
}
.row-more summary::-webkit-details-marker {
  display: none;
}
.row-more summary::marker {
  content: "";
}
.row-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  display: none;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  z-index: 20;
}
.row-more[open] .row-more-menu {
  display: grid;
}
.row-more[data-drop-up="1"] .row-more-menu {
  top: auto;
  bottom: calc(100% + 6px);
}
.row-more-menu .btn-xs {
  width: 100%;
  justify-content: flex-start;
}
#home-ctx {
  position: fixed;
  left: 0;
  top: 0;
  min-width: 196px;
  max-width: min(280px, calc(100vw - 16px));
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
  z-index: 1400;
}
#home-ctx-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1390;
  background: transparent;
}
#home-ctx-backdrop[hidden] {
  display: none;
}
#home-ctx[hidden] {
  display: none;
}
.home-ctx-label {
  padding: 6px 8px 4px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.home-ctx-btn {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #0f172a;
  padding: 0 10px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}
.home-ctx-btn:hover {
  background: #f8fafc;
}
.home-ctx-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.home-ctx-btn.tone-danger {
  color: #b91c1c;
}
.home-ctx-meta {
  color: #94a3b8;
  font-size: 11px;
}
.home-ctx-divider {
  height: 1px;
  margin: 3px 2px;
  background: #edf2f7;
}
.empty {
  border: 1px dashed #d5deeb;
  border-radius: 12px;
  padding: 18px 14px;
  color: var(--sub);
  background: #fff;
  text-align: center;
}
.empty-ill {
  display: grid;
  justify-items: center;
  gap: 8px;
}
.empty-ill-ico {
  width: 62px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #5f7ea3;
}
.empty-ill-ico svg {
  width: 62px;
  height: 48px;
}
.empty-ill-title {
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}
.empty-ill-desc {
  color: #64748b;
  font-size: 11px;
}
#auth-gate {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1000;
}
.auth-card {
  width: min(520px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  padding: 22px;
  display: grid;
  gap: 12px;
}
.auth-kicker {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}
.auth-title { font-size: 20px; font-weight: 700; line-height: 1.45; color: #0f172a; }
.auth-desc { color: var(--sub); line-height: 1.7; }
.auth-points {
  display: grid;
  gap: 8px;
}
.auth-point {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #475569;
}
.auth-actions { margin-top: 4px; display: flex; }
.auth-btn {
  height: 44px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  padding: 0 16px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
@media (max-width: 760px) {
  .guest-home-card {
    padding: 22px 18px;
    gap: 18px;
    border-radius: 24px;
  }
  .guest-home-hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .guest-home-title {
    font-size: clamp(28px, 8.4vw, 38px);
  }
  .guest-home-desc {
    font-size: 14px;
    line-height: 1.75;
  }
  .guest-home-points {
    grid-template-columns: 1fr;
  }
  .guest-preview-panel {
    padding: 18px 16px;
  }
  #auth-gate {
    align-items: flex-end;
    justify-content: stretch;
    padding: 14px 12px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(15,23,42,0.14), rgba(15,23,42,0.38));
    backdrop-filter: blur(1.5px);
  }
  .auth-card {
    width: 100%;
    max-width: none;
    border-radius: 22px;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
    box-shadow: 0 18px 40px rgba(15,23,42,0.16);
  }
  .auth-title { font-size: 18px; }
  .auth-desc {
    margin-top: 6px;
    line-height: 1.5;
  }
  .auth-point {
    font-size: 12.5px;
  }
  .auth-actions {
    margin-top: 14px;
  }
  .auth-btn {
    width: 100%;
    height: 44px;
    border-radius: 12px;
  }
  #onboarding-help-modal {
    align-items: flex-end;
    justify-content: stretch;
    padding: 14px 12px calc(12px + env(safe-area-inset-bottom));
  }
  .onboarding-help-card {
    width: 100%;
    max-width: none;
    border-radius: 22px;
    max-height: calc(100vh - 26px - env(safe-area-inset-bottom));
  }
  .onboarding-help-scroll {
    padding: 20px 16px 12px;
  }
  .onboarding-help-title {
    font-size: 20px;
  }
  .onboarding-help-actions {
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .onboarding-help-actions .btn {
    flex: 1 1 0;
  }
  #onboarding-sim-modal {
    align-items: flex-end;
    justify-content: stretch;
    padding: 14px 12px calc(12px + env(safe-area-inset-bottom));
  }
  .onboarding-sim-card {
    width: 100%;
    max-width: none;
    border-radius: 24px;
    max-height: calc(100vh - 26px - env(safe-area-inset-bottom));
  }
  .onboarding-sim-scroll {
    padding: 20px 16px 12px;
  }
  .onboarding-sim-title {
    font-size: 20px;
  }
  .onboarding-sim-shot-frame {
    height: min(42vh, 340px);
  }
  .onboarding-sim-canvas {
    min-height: 200px;
  }
  .onboarding-sim-node[data-kind="primary"] {
    inset: 18px auto auto 16px;
    width: 124px;
    height: 64px;
    font-size: 13px;
  }
  .onboarding-sim-node[data-kind="secondary"] {
    inset: 116px 16px auto auto;
    width: 140px;
    height: 70px;
    font-size: 13px;
  }
  .onboarding-sim-node[data-kind="summary"] {
    inset: 60px 50% auto auto;
    width: 160px;
    height: 82px;
    font-size: 13px;
  }
  .onboarding-sim-actions,
  .onboarding-sim-actions-main {
    width: 100%;
  }
  .onboarding-sim-actions {
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .onboarding-sim-actions .btn,
  .onboarding-sim-actions-main .btn {
    flex: 1 1 0;
  }
  .onboarding-sim-toolbar {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 8px;
  }
  .onboarding-sim-toolbar-title {
    max-width: 88px;
    font-size: 11px;
  }
  .onboarding-sim-toolbar-btn {
    min-height: 34px;
    padding: 0 10px;
    font-size: 11px;
  }
  .onboarding-sim-toolbar-menu {
    right: 10px;
    left: 10px;
    bottom: 66px;
    min-width: 0;
  }
}
#settings-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1100;
}
.settings-card {
  width: min(520px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  padding: 16px;
  display: grid;
  gap: 10px;
}
.settings-title { font-size: 16px; font-weight: 700; }
.settings-desc { color: var(--sub); }
.settings-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.settings-status {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: #374151;
}
.settings-section {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}
.settings-section-title { font-size: 13px; font-weight: 700; color: #111827; }
.settings-section-desc {
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.5;
}
.settings-meta-grid {
  display: grid;
  gap: 8px;
}
.settings-backup-status {
  margin-top: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px 12px;
  color: #475569;
  font-size: 12px;
  line-height: 1.6;
}
.settings-action-btn {
  min-height: 38px;
}
#onboarding-help-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1140;
  padding: 18px;
}
.onboarding-help-card {
  width: min(560px, calc(100vw - 24px));
  border: 1px solid #dbe7f3;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.2);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  max-height: calc(100vh - 36px);
  overflow: hidden;
}
.onboarding-help-scroll {
  min-height: 0;
  padding: 22px 20px 12px;
  display: grid;
  gap: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.onboarding-help-kicker {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}
.onboarding-help-title {
  font-size: 22px;
  line-height: 1.35;
  font-weight: 700;
  color: #0f172a;
}
.onboarding-help-desc {
  font-size: 13px;
  line-height: 1.7;
  color: #475569;
}
.onboarding-help-grid {
  display: grid;
  gap: 10px;
}
.onboarding-help-item {
  border: 1px solid #dbe7f3;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  padding: 12px;
  display: grid;
  gap: 4px;
}
.onboarding-help-item strong {
  font-size: 13px;
  color: #0f172a;
}
.onboarding-help-item span {
  font-size: 12px;
  line-height: 1.65;
  color: #64748b;
}
.onboarding-help-note {
  font-size: 12px;
  line-height: 1.65;
  color: #64748b;
}
.onboarding-help-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 12px 20px 20px;
  border-top: 1px solid rgba(219, 231, 243, 0.9);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.55) 0%, #f8fbff 100%);
}
#onboarding-sim-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.52);
  z-index: 1142;
  padding: 18px;
}
.onboarding-sim-card {
  width: min(860px, calc(100vw - 24px));
  border: 1px solid #dbe7f3;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
  box-shadow: 0 26px 64px rgba(15, 23, 42, 0.24);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  max-height: calc(100vh - 36px);
  overflow: hidden;
}
.onboarding-sim-scroll {
  min-height: 0;
  padding: 24px 22px 12px;
  display: grid;
  gap: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.onboarding-sim-head {
  display: grid;
  gap: 6px;
}
.onboarding-sim-kicker {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}
.onboarding-sim-title {
  font-size: 24px;
  line-height: 1.35;
  font-weight: 700;
  color: #0f172a;
}
.onboarding-sim-desc {
  font-size: 13px;
  line-height: 1.75;
  color: #475569;
}
.onboarding-sim-progress {
  display: flex;
  gap: 8px;
}
.onboarding-sim-progress-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.onboarding-sim-progress-text {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}
.onboarding-sim-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #dbe7f3;
}
.onboarding-sim-dot.active {
  background: #2563eb;
}
.onboarding-sim-stage {
  border: 1px solid #dbe7f3;
  border-radius: 22px;
  background: radial-gradient(circle at top, rgba(255,255,255,0.96), rgba(244,249,255,0.92));
  padding: 16px;
  display: grid;
  gap: 12px;
}
.onboarding-sim-shot-frame {
  border: 1px solid #dbe7f3;
  border-radius: 18px;
  overflow: hidden;
  background: var(--onboarding-shot-bg, #fff);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
  height: min(60vh, 560px);
}
.onboarding-sim-shot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: var(--onboarding-shot-fit, cover);
  object-position: var(--onboarding-shot-position, top center);
}
.onboarding-sim-shot-note {
  border: 1px solid #dbe7f3;
  border-radius: 16px;
  background: rgba(255,255,255,0.96);
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}
.onboarding-sim-shot-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}
.onboarding-sim-shot-body {
  font-size: 13px;
  line-height: 1.7;
  color: #334155;
}
.onboarding-sim-canvas {
  border: 1px solid #dbe7f3;
  border-radius: 18px;
  min-height: 228px;
  background:
    radial-gradient(circle at 1px 1px, rgba(148, 163, 184, 0.35) 1px, transparent 0) 0 0 / 18px 18px,
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  position: relative;
  overflow: hidden;
}
.onboarding-sim-node {
  position: absolute;
  border: 2px solid #94a3b8;
  border-radius: 18px;
  background: rgba(255,255,255,0.98);
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  font-size: 14px;
  line-height: 1.45;
  color: #0f172a;
  font-weight: 700;
}
.onboarding-sim-node[hidden] {
  display: none;
}
.onboarding-sim-node[data-kind="primary"] {
  inset: 24px auto auto 24px;
  width: 140px;
  height: 72px;
}
.onboarding-sim-node[data-kind="secondary"] {
  inset: 132px 24px auto auto;
  width: 164px;
  height: 78px;
}
.onboarding-sim-node[data-kind="summary"] {
  inset: 72px 50% auto auto;
  transform: translateX(50%);
  width: 188px;
  height: 92px;
}
.onboarding-sim-edge {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}
.onboarding-sim-edge.visible {
  opacity: 1;
}
.onboarding-sim-edge svg {
  width: 100%;
  height: 100%;
}
.onboarding-sim-edge path {
  stroke: #94a3b8;
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.onboarding-sim-toolbar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255,255,255,0.94);
  border: 1px solid #dbe7f3;
  box-shadow: 0 12px 26px rgba(15,23,42,0.12);
}
.onboarding-sim-toolbar-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.onboarding-sim-toolbar-title {
  min-width: 0;
  max-width: 120px;
  font-size: 12px;
  color: #334155;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.onboarding-sim-toolbar-btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #dbe7f3;
  background: rgba(255,255,255,0.98);
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.onboarding-sim-toolbar-btn.active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.onboarding-sim-toolbar-menu {
  position: absolute;
  right: 16px;
  bottom: 72px;
  display: none;
  min-width: 176px;
  border-radius: 16px;
  border: 1px solid #dbe7f3;
  background: rgba(255,255,255,0.97);
  box-shadow: 0 18px 36px rgba(15,23,42,0.18);
  padding: 10px;
  gap: 8px;
}
.onboarding-sim-toolbar-menu.visible {
  display: grid;
}
.onboarding-sim-toolbar-menu-note {
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
}
.onboarding-sim-toolbar-menu-item {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #dbe7f3;
  background: #fff;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
}
.onboarding-sim-toolbar-menu-item.active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.onboarding-sim-note-card,
.onboarding-sim-share-card {
  border: 1px solid #dbe7f3;
  border-radius: 16px;
  background: rgba(255,255,255,0.96);
  padding: 12px 14px;
  display: none;
  gap: 6px;
}
.onboarding-sim-note-card.visible,
.onboarding-sim-share-card.visible {
  display: grid;
}
.onboarding-sim-mini-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}
.onboarding-sim-mini-body {
  font-size: 13px;
  line-height: 1.7;
  color: #334155;
}
.onboarding-sim-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 22px 22px;
  border-top: 1px solid rgba(219, 231, 243, 0.9);
  background: linear-gradient(180deg, rgba(246, 250, 255, 0.5) 0%, #f6faff 100%);
}
.onboarding-sim-actions-main {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
#backup-intro-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1200;
}
#new-board-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1300;
}
.nb-grid {
  display: grid;
  gap: 8px;
}
.nb-row {
  display: grid;
  gap: 6px;
}
.nb-label {
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
}
.nb-input {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
}
.nb-input:focus {
  outline: none;
  border-color: #0d99ff;
  box-shadow: 0 0 0 3px rgba(13,153,255,0.12);
}
.nb-emoji {
  width: 64px;
  text-align: center;
  font-size: 18px;
}
.nb-error {
  display: none;
}
.emoji-grid { display:flex; flex-wrap:wrap; gap:6px; }
.emoji-chip {
  width:32px; height:32px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.emoji-chip.active { border-color:#0d99ff; background:#eef7ff; }
@media (max-width: 1120px) {
  #app { grid-template-columns: 1fr; }
  #app.guest-mode { grid-template-columns: 1fr; }
  #side { display:none; }
  #main { padding: 12px; }
  #top { grid-template-columns: minmax(0,1fr) minmax(140px,180px) 1fr; }
  #top #content-mode {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
  #top #btn-new-board {
    width: 100%;
  }
  .board-row { grid-template-columns: 24px 26px minmax(220px,1fr); min-width:0; }
  .board-row > .cell-aux { grid-column: 3; }
  #mobile-controls { display: grid; }
  .ops-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}
@media (max-width: 760px) {
  #main {
    padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
    gap: 14px;
    min-width: 0;
    overflow-x: hidden;
  }
  #app.guest-mode #main {
    padding: 0;
    gap: 0;
  }
  #app.guest-mode #guest-home {
    min-height: 100vh;
    padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
    align-content: start;
  }
  #top {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    min-width: 0;
  }
  #top #q,
  #top #sort,
  #top #content-mode {
    grid-column: 1 / -1;
  }
  #top > *,
  #toolbar,
  #boards-home,
  #pages-home,
  #scope-bar,
  #mobile-controls {
    min-width: 0;
    max-width: 100%;
  }
  .section-title {
    padding: 10px 6px 8px;
    font-size: 12.5px;
    letter-spacing: 0.03em;
  }
  .section-help {
    font-size: 12px;
    line-height: 1.55;
  }
  #top #btn-new-board {
    width: 100%;
  }
  #mobile-project-select {
    width: 100%;
    min-width: 0;
  }
  #content-mode {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 4px;
    border-radius: 14px;
  }
  .mode-btn {
    min-width: 0;
    min-height: 44px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }
  #boards-home-title,
  #pages-home-title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
  }
  .p-item {
    padding: 7px 6px;
    border-radius: 12px;
  }
  .p-main {
    align-items: flex-start;
    padding: 5px 6px;
  }
  .p-name {
    font-size: 15px;
    line-height: 1.4;
    white-space: normal;
    overflow: hidden;
    text-overflow: clip;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .p-count {
    align-self: flex-start;
    margin-top: 4px;
    font-size: 12.5px;
  }
  .input,
  .select,
  .btn {
    height: 44px;
    border-radius: 14px;
    font-size: 15px;
  }
  .btn {
    padding: 0 14px;
    font-weight: 600;
  }
  #mobile-controls {
    padding: 10px;
    gap: 10px;
    border-radius: 14px;
  }
  .mobile-row {
    gap: 8px;
  }
  .mobile-view-btn {
    height: 42px;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 600;
  }
  #mobile-project-select {
    height: 44px;
    border-radius: 12px;
    padding: 0 12px;
    font-size: 15px;
  }
  #toolbar-hint {
    display: none;
  }
  #home-ctx {
    max-width: calc(100vw - 20px);
    border-radius: 16px;
    padding: 10px;
    gap: 8px;
  }
  .row-more summary,
  .p-item .row-more summary {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }
  .board-row {
    min-width: 0;
    grid-template-columns: 18px 20px minmax(0, 1fr);
    gap: 8px 10px;
    align-items: start;
    padding: 12px;
  }
  #boards-home-list,
  #pages-home-list {
    max-width: 100%;
    overflow-x: visible;
    overflow-y: visible;
  }
  .board-head {
    display: none;
  }
  .drag-handle {
    padding-top: 6px;
  }
  .board-main {
    gap: 4px;
  }
  .board-row > .board-main {
    grid-column: 3;
    grid-row: 1;
  }
  .board-row > .cell-aux {
    grid-column: 3;
    min-width: 0;
  }
  .board-row .select-sm,
  .board-row .page-project-static {
    width: 100%;
    min-height: 40px;
    border-radius: 12px;
    padding-inline: 12px;
  }
  .board-row .row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }
  .board-row .btn-xs {
    min-height: 38px;
  }
  .b-name {
    font-size: 15px;
    line-height: 1.4;
    white-space: normal;
    overflow: hidden;
    text-overflow: clip;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .b-meta {
    font-size: 12.5px;
    line-height: 1.45;
  }
  .page-home-title {
    font-size: 15px;
    line-height: 1.4;
    white-space: normal;
    overflow: hidden;
    text-overflow: clip;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .page-home-meta,
  .page-row-statusline {
    font-size: 12.5px;
    line-height: 1.45;
  }
  .page-inventory-pill,
  .page-kind-chip {
    min-height: 30px;
    font-size: 12px;
  }
  .select-sm,
  .page-project-static {
    min-height: 34px;
    font-size: 13px;
  }
  .row-more-menu {
    padding: 8px;
    gap: 8px;
    border-radius: 14px;
  }
  .btn-xs,
  .row-more-menu .btn-xs {
    min-height: 40px;
    font-size: 15px;
    border-radius: 10px;
    padding: 0 12px;
  }
  .home-ctx-label {
    font-size: 12.5px;
  }
  .home-ctx-btn {
    min-height: 44px;
    border-radius: 12px;
    padding: 0 12px;
    font-size: 15px;
  }
  .ops-grid { grid-template-columns: 1fr; }
  .guest-home-card {
    width: 100%;
    max-width: none;
    min-height: calc(100vh - 34px - env(safe-area-inset-bottom));
    padding: 26px 20px 22px;
    border-radius: 24px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    gap: 14px;
  }
  .guest-home-hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .guest-home-title { font-size: clamp(30px, 9vw, 40px); }
  .guest-home-desc {
    font-size: 15px;
    line-height: 1.75;
    max-width: none;
  }
  .guest-preview-panel {
    padding: 18px 16px;
  }
  .guest-home-point strong {
    font-size: 13px;
  }
  .guest-home-point span {
    font-size: 13px;
  }
  .guest-home-note {
    font-size: 13px;
    line-height: 1.6;
  }
  .guest-home-points {
    grid-template-columns: 1fr;
  }
  .guest-home-btn {
    width: 100%;
    justify-content: center;
    font-size: 15px;
  }
}
