:root {
  color-scheme: light;
  --ink: #15191e;
  --muted: #68717c;
  --line: #dce1e6;
  --line-strong: #c6cdd5;
  --paper: #f4f6f7;
  --panel: #ffffff;
  --blue: #1769e0;
  --blue-soft: #edf4ff;
  --green: #16835f;
  --green-soft: #e9f7f1;
  --red: #c03245;
  --red-soft: #fff0f2;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  letter-spacing: 0;
}

button, input { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(1040px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--panel);
  border-inline: 1px solid var(--line);
}

.app-shell.mindmap-shell {
  width: 100%;
  max-width: none;
  border-inline: 0;
}

.app-header {
  min-height: 62px;
  display: grid;
  grid-template-columns: auto minmax(300px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,255,255,.96);
}

.logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
  border: 0;
  background: transparent;
  padding: 0;
}

.brand-logo {
  display: block;
  width: 132px;
  height: 34px;
  object-fit: contain;
  object-position: left center;
}

.itemmap-brand-mark {
  width: 34px;
  height: 34px;
  display: block;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  object-fit: contain;
  padding: 5px;
}

.itemmap-brand-word {
  color: var(--ink);
  font-size: 19px;
  font-weight: 850;
  line-height: 1;
}

.app-menu {
  position: relative;
  min-width: 0;
}

.app-brand-control {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.app-version-pill {
  min-width: 0;
  min-height: 22px;
  border: 0;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  padding: 2px 7px;
  font-size: 10px;
  line-height: 1;
  font-weight: 850;
}
.app-version-pill:hover { background: #d9f1e7; }
.app-version-pill:disabled { opacity: .65; cursor: wait; }

.app-home-trigger {
  cursor: pointer;
}

.app-home-trigger:hover {
  opacity: .88;
}

.app-switcher-trigger {
  width: 26px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.app-switcher-trigger svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--muted);
}

.app-switcher-trigger:hover {
  background: #f6f8fa;
  color: var(--ink);
}

.app-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(24,32,42,.14);
  overflow: hidden;
}

.app-dropdown-item {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-weight: 800;
}

.app-dropdown-item:last-child { border-bottom: 0; }
.app-dropdown-item:hover { background: #f6f8fa; }
.app-dropdown-item.active { background: var(--blue-soft); }
.app-dropdown-item .brand-logo { width: 120px; height: 30px; }
.app-dropdown-item .itemmap-brand-word,
.app-dropdown-item .sidenote-brand-word {
  color: var(--ink);
  font-size: 19px;
  font-weight: 850;
}

.sidenote-brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  gap: 3px;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  flex: 0 0 auto;
}
.sidenote-brand-mark span {
  display: block;
  border-radius: 3px;
  background: var(--green);
}
.sidenote-brand-mark span:last-child {
  width: 68%;
  background: var(--blue);
}
.sidenote-brand-word { line-height: 1; }

.global-command {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.global-search-field {
  position: relative;
  flex: 1;
  min-width: 110px;
}
.global-search-field input {
  width: 100%;
  padding-right: 36px;
}
.global-search-field input::-webkit-search-cancel-button { appearance: none; }
.global-command .header-search-clear {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 28px;
  height: 28px;
  min-height: 0;
  display: inline-grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  opacity: 0;
  pointer-events: none;
}
.global-command .header-search-clear.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.global-command .header-search-clear:hover { background: #eef1f4; color: var(--ink); }
.global-command .header-search-clear svg { width: 16px; height: 16px; }
.header-search-history {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 55;
  display: none;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(24,32,42,.14);
  padding: 4px 0;
}
.header-search-history.is-visible { display: block; }
.global-command .header-search-history-item {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  padding: 6px 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.global-command .header-search-history-item:hover,
.global-command .header-search-history-item:focus { background: #f3f6f8; outline: none; }
.header-search-history-item svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--muted); }
.header-search-history-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-command button { white-space: nowrap; padding-inline: 11px; }

.account-menu {
  position: relative;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.account-menu span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.account-button {
  min-width: 0;
  max-width: 190px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 6px 9px 6px 12px;
  font-weight: 750;
}
.account-button span { min-width: 0; }
.account-button svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--muted); }
.account-button:hover { background: #f6f8fa; }

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 170px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(24,32,42,.14);
  overflow: hidden;
}
.account-dropdown button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 13px;
  text-align: left;
  font-weight: 700;
}
.account-dropdown button:last-child { border-bottom: 0; color: var(--red); }
.account-dropdown button:hover { background: #f6f8fa; }

.workspace { padding: 28px 28px 60px; }

.workspace.mindmap-workspace-shell {
  height: calc(100vh - 62px);
  padding: 0;
  overflow: hidden;
}
.proxy-mode .workspace.mindmap-workspace-shell {
  height: calc(100vh - 92px);
}

.plan-pill {
  min-height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.plan-pill.pro {
  border-color: rgba(22,131,95,.35);
  background: var(--green-soft);
  color: var(--green);
}

.billing-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}
.billing-strip.pro {
  border-color: rgba(22,131,95,.24);
  background: var(--green-soft);
}
.billing-strip div {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.billing-strip strong {
  font-size: 16px;
}
.billing-strip span:last-child {
  color: var(--muted);
  font-size: 13px;
}
.billing-strip button {
  flex: 0 0 auto;
}

.account-info-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.account-info-panel dl {
  margin: 0;
}
.account-info-panel dl div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.account-info-panel dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.account-info-panel dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}
.account-info-actions {
  padding: 14px 16px;
  background: #fbfcfd;
}

.proxy-banner {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid rgba(22,131,95,.24);
  border-width: 0 0 1px;
  border-radius: 0;
  background: var(--green-soft);
}
.proxy-banner div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.proxy-banner strong {
  color: var(--green);
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
}
.proxy-banner span {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.proxy-banner button {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 0 8px;
  font-size: 11px;
}

.admin-panel {
  display: grid;
  gap: 12px;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.admin-stat-card {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}
.admin-stat-card strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}
.admin-stat-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}
.admin-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.admin-search-form input {
  min-width: 0;
}
.admin-generated {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.admin-user-list {
  display: grid;
  gap: 8px;
}
.admin-user-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.admin-user-result {
  width: 100%;
  color: var(--ink);
  text-align: left;
}
.admin-user-result:hover {
  background: #fbfcfd;
}
.admin-user-result.selected {
  border-color: rgba(22,131,95,.28);
  background: var(--green-soft);
}
.admin-user-open {
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}
.admin-user-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.admin-user-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.admin-user-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.admin-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(23,105,224,.18);
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 800;
}
.admin-user-id {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.admin-subscription-mini {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.admin-user-editor {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(22,131,95,.24);
  border-radius: 8px;
  background: var(--green-soft);
}
.admin-user-editor-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.admin-user-editor-head h2 {
  margin: 1px 0 2px;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.admin-user-editor-head span:last-child {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.admin-subscription-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.admin-subscription-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.admin-subscription-card strong,
.admin-subscription-card span {
  display: block;
}
.admin-subscription-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.admin-subscription-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-inline-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-inline-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.profile-inline-control select {
  height: 34px;
  min-width: 112px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 9px;
  font: inherit;
  font-weight: 750;
}

.mindmap-page {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  margin: 0;
  background: #f8fafb;
}

.mindmap-sidebar {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: #f8fafb;
}

.mindmap-new-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px 34px;
  gap: 6px;
  align-items: center;
}

.mindmap-new-form input {
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.mindmap-new-form .icon-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.mindmap-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 0;
  overflow: auto;
  padding: 11px;
  border: 1px solid rgba(17,24,39,.07);
  border-radius: 10px;
  background: #fff;
}

.mindmap-list-section {
  margin: 10px 0 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
}

.mindmap-list-section:first-child { margin-top: 0; }

.mindmap-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 3px;
  border: 1px solid rgba(17,24,39,.09);
  border-top: 0;
  border-bottom: 1px solid rgba(17,24,39,.07);
  background: #fff;
  padding: 4px 7px;
}

.mindmap-list-section + .mindmap-list-row {
  border-top: 1px solid rgba(17,24,39,.09);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.mindmap-list-row:has(+ .mindmap-list-section),
.mindmap-list-row:last-child {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.mindmap-list-row.active { background: var(--green-soft); }
.mindmap-list-row[draggable="true"] { cursor: grab; }
.mindmap-list-row.dragging {
  opacity: .52;
  background: rgba(22,131,95,.08);
}

.mindmap-list mark,
.mindmap-node mark {
  border-radius: 4px;
  background: #fff2a8;
  color: inherit;
  padding: 0 2px;
}

.mindmap-load-more {
  padding: 9px 0 3px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.mindmap-entry-link {
  min-width: 0;
  display: grid;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  font-size: 12px;
  font-weight: 450;
  line-height: 1.15;
}

.mindmap-entry-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mindmap-entry-link small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.mindmap-row-pin,
.mindmap-row-delete {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.mindmap-row-pin { color: #9aa3ad; }

.mindmap-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.mindmap-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.8);
}

.mindmap-dates {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.mindmap-dates strong {
  color: var(--ink);
  font-weight: 850;
}

.mindmap-canvas {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(#e2e8ed 1px, transparent 1px),
    linear-gradient(90deg, #e2e8ed 1px, transparent 1px),
    #f8fafb;
  background-size: 28px 28px;
  outline: none;
  cursor: default;
  touch-action: none;
}

.public-mindmap-page {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: #f8fafb;
}

.public-category-page {
  min-height: 100vh;
  background: #f8fafb;
}

.public-mindmap-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.92);
}

.public-mindmap-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.public-install-note {
  margin: 12px 16px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(22,131,95,.18);
  border-radius: 8px;
  background: #f1faf6;
  color: var(--green);
  font-size: 13px;
  box-shadow: 0 10px 26px rgba(22,131,95,.08);
}

.public-install-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(22,131,95,.16);
  border-radius: 9px;
  background: #fff;
}

.public-install-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.public-install-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  flex: 1;
}

.public-install-note span {
  color: var(--ink);
}

.public-install-button {
  min-height: 34px;
  white-space: nowrap;
}

.public-category-hero,
.public-category-list {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
}

.public-category-hero {
  padding: 18px 0 10px;
  display: grid;
  gap: 4px;
}

.public-category-hero h1 {
  margin: 0;
  color: var(--blue);
  font-size: clamp(28px, 7vw, 44px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.public-category-list {
  padding-bottom: 42px;
}

.public-item-name {
  color: var(--green);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.public-description {
  max-width: 520px;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.public-mindmap-workspace {
  min-height: 0;
}

.public-mindmap-canvas {
  height: 100%;
  min-height: 0;
  cursor: grab;
}

.public-mindmap-gesture-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 8;
  transform: translateX(-50%);
  padding: 6px 10px;
  border: 1px solid rgba(22,131,95,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  color: var(--muted);
  box-shadow: 0 10px 26px rgba(25,37,48,.08);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  pointer-events: none;
}

.mindmap-canvas.space-panning { cursor: grab; }
.mindmap-canvas.panning { cursor: grabbing; }

.mindmap-stage {
  position: absolute;
  inset: 0;
  width: 2400px;
  height: 1600px;
  transform-origin: 0 0;
}

.mindmap-selection-box {
  position: absolute;
  z-index: 6;
  border: 1px solid rgba(28,118,214,.55);
  border-radius: 6px;
  background: rgba(28,118,214,.10);
  pointer-events: none;
}

.mindmap-lines {
  position: absolute;
  inset: 0;
  width: 2400px;
  height: 1600px;
  overflow: visible;
  pointer-events: none;
}

.mindmap-lines path {
  fill: none;
  stroke: rgba(22,131,95,.42);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
}

.mindmap-node {
  position: absolute;
  width: 132px;
  min-height: 32px;
  border: 1px solid rgba(22,131,95,.32);
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  color: var(--green);
  box-shadow: 0 10px 22px rgba(25,37,48,.08);
  cursor: default;
  user-select: none;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease, background .12s ease;
}

.mindmap-node.hovered,
.mindmap-node:hover {
  border-color: rgba(22,131,95,.55);
  box-shadow: 0 12px 28px rgba(25,37,48,.12);
}

.mindmap-node.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22,131,95,.14), 0 12px 26px rgba(25,37,48,.10);
}

.mindmap-node.search-hit {
  border-color: #d6a100;
  background: #fffdf2;
  box-shadow: 0 0 0 4px rgba(214,161,0,.14), 0 12px 28px rgba(25,37,48,.10);
}

.mindmap-node.dragging {
  opacity: .9;
  transform: scale(1.015);
  box-shadow: 0 18px 38px rgba(25,37,48,.18);
}

.mindmap-node.drop-target {
  border-color: var(--blue);
  background: #f0f7ff;
  box-shadow: 0 0 0 4px rgba(28,118,214,.14), 0 16px 34px rgba(25,37,48,.14);
}

.mindmap-node.linked-map-node {
  border-color: rgba(28,118,214,.34);
  color: var(--blue);
  background: linear-gradient(180deg, #fff, #f7fbff);
}

.mindmap-linked-open,
.mindmap-linked-expand {
  position: absolute;
  right: -10px;
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(25,37,48,.12);
}

.mindmap-linked-expand { top: 50%; transform: translateY(-50%); }
.mindmap-linked-open { bottom: -10px; }

.mindmap-node-search {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(22,131,95,.24);
  border-radius: 999px;
  background: #fff;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.9);
  box-shadow: 0 8px 18px rgba(25,37,48,.12);
  transition: opacity .12s ease, transform .12s ease, border-color .12s ease, background .12s ease;
  z-index: 3;
}

.mindmap-node:hover .mindmap-node-search,
.mindmap-node:focus-within .mindmap-node-search,
.mindmap-node.hovered .mindmap-node-search {
  opacity: 1;
  transform: scale(1);
}

.mindmap-node-search:hover {
  border-color: rgba(22,131,95,.48);
  background: #f3fbf7;
}

.mindmap-linked-open svg,
.mindmap-linked-expand svg,
.mindmap-node-search svg {
  width: 13px;
  height: 13px;
}

.mindmap-node-text {
  min-height: 22px;
  padding: 4px 8px;
  outline: none;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mindmap-node-text:empty::before {
  content: "";
  display: inline-block;
  width: 1px;
}

.mindmap-node-text[contenteditable] {
  user-select: text;
  cursor: text;
}

.mindmap-node.linked-map-node .mindmap-node-text {
  cursor: pointer;
}

.mindmap-node.linked-map-node .mindmap-node-text[contenteditable] {
  cursor: text;
}

.mindmap-context-menu {
  position: fixed;
  z-index: 120;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(25,37,48,.16);
}

.mindmap-context-menu button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 700;
  padding: 6px 10px;
}

.mindmap-context-menu button:hover { background: #f4f7f6; }
.mindmap-context-menu button:disabled {
  opacity: .4;
  pointer-events: none;
}

.mindmap-hintbar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 12;
  min-height: 34px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(198,205,213,.82);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 14px 34px rgba(24,32,42,.08);
}

.mindmap-hintbar kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  min-height: 20px;
  margin: 0 2px;
  padding: 1px 6px;
  border: 1px solid rgba(192,50,69,.28);
  border-radius: 5px;
  background: var(--red-soft);
  color: var(--red);
  font: inherit;
  font-weight: 850;
}

.mindmap-hintbar kbd svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
}

.mindmap-hintbar [data-state="Saved"] { color: var(--green); font-weight: 850; }
.mindmap-hintbar [data-state="Save failed"] { color: var(--red); font-weight: 850; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}
.page-head h1 { margin: 1px 0 0; font-size: 26px; line-height: 1.15; }
.page-head h2 { margin: 0; font-size: 20px; line-height: 1.18; }
.compact-head {
  margin: 12px 0 4px;
  align-items: center;
}
.search-results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.mindmap-node-result-link { min-width: 0; }
.mindmap-node-result-link > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.mindmap-node-result-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  border-radius: 4px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
}
.mindmap-node-search-table table { table-layout: fixed; }
.mindmap-node-search-table th:first-child { width: 52%; }
.mindmap-node-search-table th:nth-child(2) { width: 33%; }
.mindmap-node-search-table th:last-child { width: 15%; }
.mindmap-node-search-table td { vertical-align: middle; }
.mindmap-node-search-table td { overflow-wrap: anywhere; }
.mindmap-node-detail-head { align-items: center; }
.mindmap-node-title-area { min-width: 0; }
.mindmap-node-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.mindmap-node-title-row h1 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}
.mindmap-node-title-row .icon-actions { flex: 0 0 auto; }
.mindmap-node-open-map { display: inline-grid; }
.mindmap-node-title-edit-form {
  display: grid;
  grid-template-columns: minmax(180px, 420px) auto auto;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}
.mindmap-node-title-edit-form input { width: 100%; }
.mindmap-node-title-edit-form .icon-button { width: 40px; height: 40px; }
.node-detail-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}
.node-detail-head-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.node-detail-head-actions svg { width: 16px; height: 16px; }
.mindmap-node-path-panel {
  margin: 8px 0 12px;
  padding: 4px 0;
}
.mindmap-node-path {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.mindmap-node-path button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 3px 2px;
  font-weight: 700;
}
.mindmap-node-path button[aria-current="page"] { color: var(--ink); }
.mindmap-node-path svg { flex: 0 0 14px; width: 14px; height: 14px; color: var(--muted); }
.mindmap-node-children-panel { margin-top: 4px; }
.mindmap-node-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 8px;
}
.mindmap-node-add-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.mindmap-node-add-form svg { width: 16px; height: 16px; }
.mindmap-node-children-table table { table-layout: fixed; }
.mindmap-node-children-table th:last-child { width: 112px; }
.mindmap-node-children-table tbody td { border-bottom: 1px solid var(--line); }
.mindmap-node-children-table tbody tr:last-child td { border-bottom: 0; }
.mindmap-node-children-table td:first-child { overflow-wrap: anywhere; }
.mindmap-node-children-table .icon-actions { flex-wrap: nowrap; }
.mindmap-child-edit-form { width: 100%; }
.mindmap-child-edit-form input { width: 100%; height: 34px; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.count { color: var(--muted); font-size: 13px; }

.command-bar,
.relation-fields {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

input {
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
  outline: none;
}
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,224,.12); }
.command-bar input { flex: 1; }

.primary,
.secondary,
.provider-button,
.google-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 0 14px;
  font-weight: 750;
}
.primary { background: var(--green); color: #fff; }
.secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.primary:hover { background: #106d4e; }
.secondary:hover { background: #f6f8fa; }

.table-wrap {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: auto;
}
.list-load-sentinel {
  padding: 16px 0 2px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #f5f7f8; color: var(--muted); font-size: 11px; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfd; }

.actions-cell { text-align: right; white-space: nowrap; }
.muted-cell { color: var(--muted); }

.record-link,
.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  font-weight: 700;
}
.record-link { display: inline-flex; align-items: center; gap: 8px; text-align: left; }
.text-button + .text-button { margin-left: 10px; }
.text-button:hover, .record-link:hover { text-decoration: underline; }
.danger-text { color: var(--red); }

.record-id {
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 4px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
}
.item-id { background: var(--green-soft); color: var(--green); }

.detail-title { display: flex; align-items: center; gap: 12px; }
.detail-title,
.detail-title > div { min-width: 0; }
.detail-title > .record-id { width: 36px; height: 36px; font-size: 14px; }
.detail-name-row,
.inline-name-form,
.detail-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-name-row h1 { margin: 3px 0 0; }
.detail-name-row h1 { overflow-wrap: anywhere; }
.inline-name-form input { width: min(360px, 54vw); }
.detail-head-actions { justify-content: flex-end; flex-wrap: wrap; }
.category-detail-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 6px;
}
.opp-detail-link { font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; }
.detail-grid-single { grid-template-columns: minmax(0, 1fr); }
.detail-head { padding-bottom: 8px; border-bottom: 0; }
.opp-category-section {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 4px;
  border-top: 0;
}
.opp-category-section > .secondary { justify-self: start; }
.opp-category-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.picker-intro { margin: 0; color: var(--muted); font-size: 13px; }
.opp-picker-table { margin-top: 14px; }

.relation-command { padding-bottom: 8px; border-bottom: 0; }
.relation-command h2 { margin: 0 0 10px; font-size: 14px; }
.relation-fields .suggestion-field { flex: 1.15; }
.relation-fields > input { flex: 1; }

.suggestion-field { position: relative; min-width: 0; }
.suggestion-field > input { width: 100%; }
.suggestions {
  display: none;
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  z-index: 25;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(25,35,45,.12);
  overflow: hidden;
}
.suggestions.visible { display: grid; }
.suggestions button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}
.suggestions button:hover { background: var(--blue-soft); }
.suggestions small { color: var(--muted); white-space: nowrap; }

.relation-table { margin-top: 10px; }
.description-button {
  max-width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}
.description-button:hover { color: var(--blue); text-decoration: underline; }
.description-button.empty { color: var(--muted); font-style: italic; }
.empty-description { color: var(--muted); font-style: italic; }

.description-editor {
  display: grid;
  gap: 10px;
}
.description-editor label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.description-editor textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 12px;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  outline: none;
}
.description-editor textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,224,.12); }
.editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.editor-foot span {
  color: var(--muted);
  font-size: 13px;
}
.editor-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.icon-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.icon-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--blue);
}
.icon-button:hover { background: var(--blue-soft); }
.icon-button svg { width: 16px; height: 16px; }
.danger-icon { color: var(--red); }
.danger-icon:hover { background: var(--red-soft); }

.category-map-page-head {
  align-items: center;
}
.category-map-page-head p {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.category-map-toolbar {
  position: relative;
  width: min(520px, 100%);
  margin: 16px 0;
}
.category-map-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
}
.category-map-search-field {
  position: relative;
}
.category-map-search-field > svg {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}
.category-map-search-field input {
  width: 100%;
  padding-left: 35px;
  padding-right: 38px;
}
.category-map-clear {
  position: absolute;
  right: 5px;
  top: 4px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
}
.category-map-clear:hover { background: #f1f4f6; color: var(--ink); }
.category-map-clear svg { width: 15px; height: 15px; }
.category-map-add-button { width: 40px; height: 40px; color: var(--green); }
.category-map-add-button:disabled { cursor: default; opacity: .42; }
.category-map-suggestions {
  position: absolute;
  z-index: 12;
  top: calc(100% + 5px);
  left: 0;
  right: 48px;
  max-height: 244px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(24,32,42,.14);
}
.category-map-suggestions button {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 7px 10px;
  color: var(--ink);
  text-align: left;
}
.category-map-suggestions button:last-child { border-bottom: 0; }
.category-map-suggestions button:hover { background: #f7f9fa; }
.category-map-suggestions button > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.category-map-suggestions small { color: var(--muted); white-space: nowrap; }
.category-map-suggestions svg { width: 15px; height: 15px; color: var(--green); }
.category-map-recent {
  margin: 2px 0 14px;
}
.category-map-recent > .eyebrow {
  display: block;
  margin-bottom: 6px;
}
.category-map-recent-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 1px 7px;
  scrollbar-width: thin;
}
.category-map-recent-list button {
  flex: 0 0 min(260px, 76vw);
  min-width: 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.category-map-recent-list button:hover {
  border-color: #a9c9bd;
  background: #f6fbf9;
}
.category-map-recent-list button > span:nth-child(2) {
  overflow: hidden;
  color: var(--blue);
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.category-map-recent-list small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.category-map-recent-list svg {
  width: 15px;
  height: 15px;
  color: var(--green);
}
.category-map-undo {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 8px 11px;
  border: 1px solid #b8dfd0;
  border-radius: 6px;
  background: var(--green-soft);
  color: #0f664b;
  font-size: 13px;
}
.category-map-undo button {
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 800;
}
.category-map-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
}
.category-map-box {
  height: 100%;
  min-width: 0;
  min-height: 286px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.category-map-box.source { border-top: 3px solid var(--blue); }
.category-map-box.drop-target {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 0 0 3px rgba(22,131,95,.16);
}
.category-map-box > header {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px 7px 11px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fa;
}
.category-map-box > header > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.category-map-box > header strong {
  overflow-wrap: anywhere;
  color: var(--blue);
  font-size: 14px;
}
.category-map-box-count {
  min-width: 24px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.category-map-items {
  min-height: 236px;
  max-height: none;
  overflow: visible;
  padding: 8px;
}
.category-map-item {
  width: 100%;
  min-height: 39px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--green);
  text-align: left;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.category-map-item,
.category-map-item * {
  -webkit-touch-callout: none !important;
  -webkit-user-drag: none;
  -webkit-user-select: none !important;
  user-select: none !important;
}
.category-map-item:last-child { margin-bottom: 0; }
.category-map-item:hover { border-color: #a9c9bd; background: #f6fbf9; }
.category-map-item:active { cursor: grabbing; }
.category-map-item > svg { width: 15px; height: 15px; color: #99a2ab; }
.category-map-item > span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.category-map-item.dragging { opacity: .25; }
.category-map-drag-ghost {
  position: fixed;
  z-index: 1000;
  margin: 0;
  pointer-events: none;
  opacity: .94;
  transform: rotate(1.5deg) scale(1.02);
  box-shadow: 0 12px 28px rgba(24,32,42,.24);
}
.category-map-dragging,
.category-map-dragging * { cursor: grabbing !important; }
.category-map-dragging { user-select: none; }
.category-map-touch-dragging {
  position: fixed;
  inset-inline: 0;
  width: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
}
.category-map-empty {
  min-height: 190px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 20px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.category-map-new-box {
  min-height: 286px;
  display: grid;
  place-content: center;
  gap: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: #fbfcfd;
  color: var(--muted);
}
.category-map-new-box:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.category-map-new-box svg { width: 22px; height: 22px; margin: 0 auto; }


.alert {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: 5px;
  font-size: 13px;
}
.alert.error { color: var(--red); border-color: #efbdc5; background: var(--red-soft); }
.alert.success { color: var(--green); border-color: #b8dfd0; background: var(--green-soft); }

.empty-state {
  margin-top: 20px;
  padding: 38px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
}

.auth-page {
  min-height: 100vh;
  min-height: 100svh;
  padding: max(30px, env(safe-area-inset-top)) 24px max(48px, env(safe-area-inset-bottom));
  background: #fff;
}
.auth-panel {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 10px 0 56px;
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.auth-brand .itemmap-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}
.auth-brand .itemmap-brand-word {
  font-size: 25px;
}
.auth-language {
  margin: 32px 0 70px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.auth-intro {
  margin-bottom: 34px;
  text-align: center;
}
.auth-panel h1 {
  max-width: 500px;
  margin: 0 auto 12px;
  font-size: 38px;
  line-height: 1.18;
}
.auth-panel p {
  max-width: 470px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}
.email-auth-form {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}
.email-auth-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.email-auth-form input {
  width: 100%;
  height: 54px;
  border-radius: 8px;
  padding-inline: 18px;
  font-size: 16px;
}
.email-auth-form .primary {
  width: 100%;
  min-height: 54px;
  border-radius: 8px;
  justify-content: center;
  font-size: 16px;
}
.auth-reset {
  justify-self: center;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 22px;
  color: var(--muted);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.auth-actions {
  display: grid;
  gap: 12px;
}
.provider-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
  min-height: 52px;
  border-radius: 8px;
  font-size: 15px;
}
.provider-button:hover { background: #f6f8fa; }
.qr-login-button svg {
  width: 18px;
  height: 18px;
  color: var(--green);
}
.apple-button {
  border-color: #111;
  background: #111;
  color: #fff;
}
.apple-button:hover { background: #272727; }
.apple-symbol {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 20px;
  line-height: 1;
}
.google-g { color: var(--blue); font-weight: 900; }

.qr-login-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(22,131,95,.22);
  border-radius: 7px;
  background: var(--green-soft);
  text-align: center;
}
.qr-login-panel strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 15px;
}
.qr-login-panel p {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.4;
}
.qr-login-image {
  width: 188px;
  height: 188px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
}
.qr-manual-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.qr-manual-code span,
.qr-login-status {
  color: var(--muted);
  font-size: 12px;
}
.qr-manual-code strong {
  margin: 0;
  color: var(--green);
  font-size: 18px;
  letter-spacing: .08em;
}
.qr-login-status {
  max-width: 100%;
  display: none;
  overflow-wrap: anywhere;
}
.qr-image-failed .qr-login-status {
  display: block;
}

.pc-login-guide {
  display: grid;
  gap: 14px;
  max-width: 560px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.pc-login-guide p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.pc-login-guide label,
.qr-manual-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.pc-login-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pc-login-actions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.pc-login-actions svg {
  width: 17px;
  height: 17px;
}
.qr-manual-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}
.qr-scan-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}
.qr-scan-box video {
  width: 100%;
  max-height: 360px;
  border-radius: 6px;
  background: #101820;
  object-fit: cover;
}
.account-dropdown .mobile-only-menu-item {
  display: none;
}

@media (max-width: 760px) {
  .app-shell { border: 0; }
  .app-header {
    min-height: 0;
    grid-template-columns: 1fr auto;
    gap: 8px 10px;
    padding: 6px 14px 8px;
  }
  .global-command {
    order: 3;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(88px, 1fr) auto auto;
    padding: 2px 0 0;
    border-top: 0;
  }
  .global-search-field { width: 100%; min-width: 0; }
  .global-search-field input { width: 100%; min-width: 0; height: 36px; }
  .global-command button { min-height: 36px; padding-inline: 7px; font-size: 12px; }
  .global-command .header-search-clear { width: 28px; height: 28px; min-height: 0; padding: 0; }
  .global-command .header-search-history-item { min-height: 36px; padding: 7px 10px; font-size: 13px; }
  .global-command .mindmap-search-command {
    display: none;
  }
  .account-menu {
    max-width: 48vw;
  }
  .account-button { max-width: 46vw; }
  .account-dropdown {
    right: 0;
    min-width: 190px;
    max-width: min(220px, calc(100vw - 28px));
  }
  .account-dropdown button {
    min-height: 38px;
    padding-inline: 12px;
    font-size: 13px;
  }
  .plan-pill {
    min-height: 26px;
    padding-inline: 8px;
  }
  .account-menu span {
    display: block;
    max-width: 32vw;
    font-size: 12px;
  }
  .account-dropdown .mobile-only-menu-item {
    display: flex;
  }
  .account-dropdown .pc-only-menu-item {
    display: none;
  }
  .qr-manual-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace { padding: 10px 14px 50px; }
  .workspace.mindmap-workspace-shell {
    height: calc(100vh - 104px);
    padding: 0;
  }
  .proxy-mode .workspace.mindmap-workspace-shell {
    height: calc(100vh - 134px);
  }
  .mindmap-page {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .public-mindmap-header {
    min-height: 52px;
    padding: 6px 10px;
    gap: 8px;
  }
  .public-mindmap-header .brand-logo {
    width: 132px;
  }
  .public-mindmap-actions .secondary {
    min-height: 34px;
    padding-inline: 9px;
    font-size: 12px;
  }
  .public-install-note {
    margin: 8px 10px;
    padding: 8px;
    align-items: center;
    gap: 8px;
    font-size: 12px;
  }
  .public-install-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }
  .public-install-icon img {
    width: 25px;
    height: 25px;
  }
  .public-install-copy {
    gap: 1px;
  }
  .public-install-copy span {
    line-height: 1.3;
  }
  .public-install-button {
    min-height: 32px;
    padding-inline: 10px;
    font-size: 12px;
  }
  .public-category-hero,
  .public-category-list {
    width: calc(100% - 20px);
  }
  .public-category-hero {
    padding-top: 12px;
  }
  .public-category-list th,
  .public-category-list td {
    padding: 8px 7px;
    font-size: 12px;
  }
  .public-category-list th:first-child,
  .public-category-list td:first-child {
    width: 34px;
  }
  .public-mindmap-workspace .mindmap-toolbar {
    min-height: 38px;
    padding: 0 10px;
  }
  .public-mindmap-workspace .mindmap-dates {
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11px;
  }
  .public-mindmap-gesture-hint {
    bottom: 8px;
    max-width: calc(100vw - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
  }
  .billing-strip {
    align-items: stretch;
    flex-direction: column;
  }
  .billing-strip button {
    width: 100%;
  }
  .proxy-banner {
    align-items: center;
    flex-direction: row;
    min-height: 30px;
    padding: 3px 8px;
  }
  .proxy-banner div {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  .proxy-banner span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .proxy-banner button {
    min-height: 23px;
    padding-inline: 7px;
    white-space: nowrap;
  }
  .admin-search-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .admin-user-card {
    align-items: stretch;
    grid-template-columns: 1fr;
  }
  .admin-user-editor-head,
  .admin-subscription-grid {
    grid-template-columns: 1fr;
  }
  .account-info-panel dl div {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 13px 14px;
  }
  .command-bar { flex-wrap: wrap; }
  .command-bar input { flex: 1 1 100%; }
  .relation-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  .relation-fields .suggestion-field,
  .relation-fields > input {
    width: 100%;
    min-width: 0;
  }
  .relation-fields > button {
    white-space: nowrap;
  }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-head { align-items: flex-start; }
  .detail-head-actions { justify-content: flex-start; }
  .category-detail-actions { justify-content: flex-end; }
  .inline-name-form input { width: min(250px, 54vw); }
  th, td { padding: 8px 7px; }
  .actions-cell .text-button { display: block; margin: 4px 0; }
  .relation-table {
    overflow: hidden;
  }
  .relation-table table {
    table-layout: fixed;
  }
  .relation-table th,
  .relation-table td {
    padding: 8px 5px;
    vertical-align: middle;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .relation-table th:nth-child(1),
  .relation-table td:nth-child(1) {
    width: 28px;
  }
  .relation-table th:nth-child(2),
  .relation-table td:nth-child(2) {
    width: 34%;
  }
  .relation-table th:nth-child(3),
  .relation-table td:nth-child(3) {
    width: 24%;
  }
  .relation-table th:nth-child(4),
  .relation-table td:nth-child(4) {
    width: 96px;
  }
  .relation-table .record-link {
    display: inline;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .relation-table .actions-cell {
    white-space: normal;
  }
  .relation-table .icon-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 4px;
    white-space: normal;
  }
  .relation-table .icon-button {
    width: 28px;
    height: 28px;
  }
  .relation-table .icon-button svg {
    width: 14px;
    height: 14px;
  }
  .category-map-page-head {
    align-items: flex-start;
  }
  .category-map-page-head > button {
    flex: 0 0 auto;
    min-height: 36px;
    padding-inline: 10px;
    font-size: 12px;
  }
  .category-map-page-head p {
    font-size: 12px;
  }
  .category-map-toolbar {
    margin: 12px 0;
  }
  .category-map-suggestions {
    right: 0;
  }
  .category-map-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .category-map-box > header {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 4px;
    padding: 6px;
  }
  .category-map-box > header > div { gap: 4px; }
  .category-map-box > header .record-id { display: none; }
  .category-map-box > header strong { font-size: 12px; }
  .category-map-box-count { min-width: 18px; font-size: 11px; }
  .category-map-box > header .icon-button { width: 26px; height: 26px; }
  .category-map-item {
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 3px;
    padding: 6px 5px;
    font-size: 12px;
  }
  .category-map-item > svg { width: 12px; height: 12px; }
  .category-map-box,
  .category-map-new-box {
    min-height: 236px;
  }
  .category-map-items {
    min-height: 186px;
    max-height: none;
    overflow: visible;
  }
  .category-map-empty {
    min-height: 145px;
  }
  .category-map-new-box {
    min-height: 84px;
  }
  .page-head h1 { font-size: 23px; }
  .mindmap-node-detail-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .node-detail-head-actions { justify-content: flex-start; }
  .node-detail-head-actions button { min-height: 36px; padding-inline: 9px; font-size: 12px; }
  .mindmap-node-title-area { width: 100%; }
  .mindmap-node-open-map { display: none; }
  .mindmap-node-title-edit-form { grid-template-columns: minmax(0, 1fr) auto auto; }
  .mindmap-node-add-form { gap: 6px; }
  .mindmap-node-add-form button { padding-inline: 9px; font-size: 12px; }
  .mindmap-node-children-table th:last-child { width: 112px; }
  .mindmap-node-children-table .icon-button { width: 28px; height: 28px; }
  .mindmap-node-path-panel { margin-top: 4px; }
}
