/* Bough — minimal surface layer. Loaded after the theme so it stays quiet. */

:root {
  --bg: #f6f5f1;
  --bg-deep: #efeee8;
  --surface: #ffffff;
  --surface-2: #f2f1ec;
  --glass: #ffffff;
  --text: #1c241f;
  --text-2: #536159;
  --muted: #8a948d;
  --line: #e5e3dc;
  --primary: #3f6f58;
  --primary-soft: #edf2ee;
  --amber: #b8863e;
  --green: #4f8067;
  --pink: #a65d54;
  --cyan: #6f8b7b;
  --radius: 12px;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
}

html[data-theme="dark"] {
  --bg: #101613;
  --bg-deep: #0d1210;
  --surface: #161d19;
  --surface-2: #1b241f;
  --glass: #161d19;
  --text: #eef2ed;
  --text-2: #b7c1ba;
  --muted: #7f8c83;
  --line: #2a342d;
  --primary: #9bc0a8;
  --primary-soft: #1c2b23;
}

html, body { background: var(--bg); }
body { color: var(--text); }
body::before,
body::after,
.section-title,
.ws-accent { display: none !important; }

* { box-shadow: none; }
.n-button { border-radius: 8px !important; box-shadow: none !important; }
.n-input { --n-border-radius: 8px !important; }
.n-card, .n-modal, .n-drawer { border-radius: 12px; }
.n-spin-content { opacity: 1 !important; filter: none !important; }

/* ---------- top bar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.topbar-inner {
  width: min(1280px, 100%);
  min-height: 58px;
  padding: 0 24px;
  gap: 16px;
}
.brand { gap: 8px; }
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow: none;
}
.brand-word {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .06em;
}
.top-search { width: 280px; margin-left: auto; }
.top-search .n-input { background: var(--surface-2) !important; }
.top-actions { gap: 4px; }
.ai-top-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
}
.ai-top-btn span { display: none; }
.ai-top-btn:hover { background: var(--surface-2); color: var(--primary); }
.count-pill { display: none; }
.icon-ghost {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
.new-ws-btn {
  height: 34px !important;
  border-radius: 8px !important;
  padding: 0 12px !important;
  box-shadow: none !important;
}
.user-chip {
  border: 0;
  background: transparent;
  padding: 3px 4px;
  gap: 7px;
}
.user-copy b { font-size: 12px; }
.user-copy small { display: none; }
.mobile-search { padding: 8px 14px 10px; border-top: 1px solid var(--line); }
.mobile-search .n-input { background: var(--surface-2) !important; height: 38px !important; }

/* ---------- home ---------- */
.page {
  width: min(1280px, 100%);
  padding: 34px 24px 96px;
}
.hero {
  padding: 8px 0 30px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.hero-card {
  border-radius: 12px;
  background: var(--surface);
  transform: none;
}
.hero-card:hover { transform: none; }
.hero-cta { border-radius: 8px; box-shadow: none; }
.hero-copy .eyebrow { color: var(--muted); }
.hero-copy p { color: var(--muted); }
.hero-avatars span { display: none; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}
.page-head h1 {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0;
}
.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.workspace-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}
@media (max-width: 980px) {
  .workspace-list { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-mobile-brand { display: inline-flex; }
}
@media (min-width: 1200px) {
  .workspace-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.workspace-card {
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  animation: none;
}
.workspace-card:hover {
  transform: none;
  box-shadow: none;
  border-color: #cfd8d1;
}
.ws-head { gap: 10px; align-items: center; }
.ws-symbol {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--primary);
}
.ws-title h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.ws-tags { gap: 4px; margin-top: 3px; }
.ws-tags > * { display: none !important; }
.ws-tags .tag-admin {
  display: inline-flex !important;
  height: 17px !important;
  padding: 0 5px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 10px !important;
}
.ws-tags .n-tag .n-tag__content { padding: 0 !important; }
.ws-people { display: none !important; }
.ws-actions { gap: 0; }
.ws-actions .icon-ghost { width: 30px; height: 30px; }
.ws-meta {
  margin: 9px 0 12px;
  color: var(--muted);
  font-size: 11px;
  gap: 6px;
}
.ws-meta .n-icon { opacity: .65; }
.ws-member-names,
.ws-meta > span:last-child { display: none; }
.map-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.map-card {
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: var(--surface-2) !important;
  background-image: none !important;
  box-shadow: none !important;
}
.map-card:hover { transform: none; border-color: #cfd8d1 !important; }
.map-card::after { display: none !important; }
.map-top { align-items: center; }
.map-glyph {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--primary-soft) !important;
  color: var(--primary);
  box-shadow: none;
}
.map-glyph .n-icon { font-size: 15px; }
.map-access { display: none !important; }
.map-menu { width: 24px; height: 24px; }
.map-body { margin-top: 9px; }
.map-body h4 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0; }
.map-body p { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; }
.map-foot { display: none; }
.ws-empty { padding: 12px 0 2px; color: var(--muted); font-size: 12px; }

.ai-fab {
  width: 44px;
  height: 44px;
  right: 20px;
  bottom: 20px;
  border-radius: 50%;
  box-shadow: none;
}
.ai-fab span { display: none; }

/* ---------- auth ---------- */
.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  min-height: 100vh;
  background: transparent;
}
.auth-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}
.auth-card {
  width: min(360px, 100%);
  animation: none;
}
.auth-mobile-brand {
  display: none;
  margin-bottom: 30px;
  gap: 9px;
  font-size: 17px;
}
.auth-mobile-brand .brand-mark { width: 32px; height: 32px; border-radius: 8px; }
.auth-heading h2 {
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0;
}
.auth-heading p { margin: 7px 0 22px; font-size: 12px; }
.auth-switch {
  display: flex;
  gap: 20px;
  width: fit-content;
  margin-bottom: 22px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.auth-switch button {
  position: relative;
  height: 32px;
  padding: 0 1px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.auth-switch button.active {
  background: transparent;
  color: var(--primary);
  box-shadow: none;
}
.auth-switch button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--primary);
}
.field-label { margin: 10px 2px 6px; color: var(--muted); font-size: 11px; font-weight: 500; }
.auth-form { gap: 6px; }
.auth-form .n-input { background: var(--surface) !important; }
.auth-submit { margin-top: 14px; height: 42px !important; border-radius: 8px !important; font-weight: 500; }
.auth-error { padding: 8px 0 0; background: transparent; color: var(--pink); font-size: 11px; }
.auth-legal { position: fixed; left: 0; right: 0; bottom: 16px; z-index: 2; text-align: center; font-size: 10px; }
.theme-fab {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: none;
}

/* ---------- editor ---------- */
#view-editor { background: var(--bg); }
.map-stage { background-color: var(--bg) !important; background-image: none !important; }
.editor-bar {
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  padding: 0 12px;
  gap: 5px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
  backdrop-filter: none;
}
.title-input {
  height: 32px;
  padding: 0 4px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}
.title-input:hover, .title-input:focus { background: var(--surface-2); box-shadow: none; }
.save-status { font-size: 11px; }
.save-status i { width: 5px; height: 5px; }
.follow-pill {
  height: 26px;
  max-width: 150px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--primary);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.follow-pill:hover { border-color: var(--primary); }
.map-stage .tags span {
  border: 0 !important;
  background: var(--surface-2) !important;
  color: var(--text-2) !important;
  font-size: 10px !important;
  line-height: 16px !important;
}
.bar-action { padding: 0 8px; border-radius: 6px; }
.toolrail {
  left: 12px;
  padding: 4px;
  gap: 1px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: none;
  backdrop-filter: none;
}
.toolrail button { width: 34px; height: 34px; border-radius: 6px; }
.rail-sep { margin: 4px 6px; }
.statusbar {
  bottom: 12px;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--surface);
  box-shadow: none;
  backdrop-filter: none;
  font-size: 10.5px;
}
.node-panel {
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
}
.node-tooltip {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: none;
  font-size: 12px;
}
.ai-welcome-mark,
.ai-mark,
.ai-editor-mark,
.ai-editor-welcome .ai-editor-welcome-mark {
  border-radius: 10px !important;
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
  box-shadow: none !important;
}
.ai-welcome-mark { width: 40px !important; height: 40px !important; }
.ai-mark { width: 28px !important; height: 28px !important; }
.ai-welcome h3 { font-size: 20px !important; font-weight: 600 !important; }
.ai-suggestions button {
  border: 1px solid var(--line) !important;
  border-radius: 7px !important;
  background: var(--surface) !important;
  box-shadow: none !important;
  font-size: 12px !important;
}
.ai-editor-mark { width: 30px !important; height: 30px !important; }
.ai-editor-welcome .ai-editor-welcome-mark { width: 40px !important; height: 40px !important; }
.ai-editor-input { border-radius: 8px !important; }
.ai-editor-send { border-radius: 8px !important; box-shadow: none !important; }
.ai-editor-panel { box-shadow: none !important; }
.drawer {
  background: var(--surface);
  box-shadow: none;
  border-left: 1px solid var(--line);
}
.drawer-head { padding: 18px 18px 10px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 15px; }
.drawer-tabs { margin: 10px 14px 0; gap: 0; padding: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.drawer-tab { height: 34px; border-radius: 0; background: transparent; box-shadow: none !important; }
.drawer-tab.active { color: var(--primary); border-bottom: 2px solid var(--primary); background: transparent; box-shadow: none; }
.map-stage .me-tpc { border-radius: 8px !important; box-shadow: none !important; }
.map-stage .me-root > .me-tpc { border-radius: 9px !important; box-shadow: none !important; }
#editor-ai {
  border-radius: 50%;
  box-shadow: none;
  z-index: 35;
}
.ai-editor-panel { border-left: 1px solid var(--line); box-shadow: none; }
.ai-editor-head { min-height: 54px; border-bottom: 1px solid var(--line); }
.ai-editor-panel .ai-editor-mark { width: 30px; height: 30px; border-radius: 8px; box-shadow: none; }

/* ---------- drawers / modals ---------- */
.n-drawer-content { background: var(--surface) !important; }
.n-drawer-header { border-bottom: 1px solid var(--line); }
.n-drawer-body-content-wrapper { padding: 16px 18px; }
.drawer-title span { font-size: 15px; font-weight: 600; }
.drawer-title small { font-size: 10.5px; }
.drawer-body { padding-bottom: 24px; }
.n-modal .n-card { border: 1px solid var(--line); }
.n-tabs .n-tabs-nav { --n-tab-border-color: var(--line); }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .topbar-inner { min-height: 54px; padding: 0 14px; gap: 8px; }
  .brand-word { display: none; }
  .brand-mark { width: 30px; height: 30px; }
  .top-search { display: none; }
  .ai-top-btn { width: 34px; padding: 0; justify-content: center; }
  .ai-top-btn span { display: none; }
  .new-ws-btn { width: 34px; padding: 0 !important; }
  .new-ws-btn .btn-label { display: none; }
  .user-copy, .user-chevron { display: none; }
  .user-chip { padding: 2px; }
  .page { padding: 22px 14px 84px; }
  .page-head { margin-bottom: 12px; }
  .page-head h1 { font-size: 15px; }
  .page-head p { font-size: 11px; }
  .workspace-list { gap: 8px; }
  .workspace-card { padding: 13px 14px; border-radius: 10px; }
  .ws-head { flex-wrap: wrap; gap: 8px; }
  .ws-people { display: none; }
  .ws-actions { margin-left: auto; }
  .ws-meta { margin: 7px 0 10px; }
  .map-grid { grid-template-columns: 1fr; gap: 6px; }
  .map-card { min-height: 78px; padding: 9px 10px; }
  .map-body { margin-top: 7px; }
  .map-body h4 { font-size: 12.5px; }
  .map-body p { margin-top: 3px; }
  .map-access { display: none; }
  .ai-fab { right: 14px; bottom: 14px; width: 42px; height: 42px; }
  .auth-panel { padding: 24px 20px; align-items: center; }
  .auth-card { padding-top: 0; }
  .auth-heading h2 { font-size: 23px; }
  .auth-legal { bottom: 12px; }
  .editor-bar { height: 50px; padding: 0 8px; gap: 2px; }
  #collapse-top, #collapse-left, #collapse-bottom { display: none; }
  .title-input { max-width: 150px; font-size: 13px; }
  .presence { display: none; }
  .follow-pill { display: none !important; }
  .save-status span { display: none; }
  .bar-action { padding: 0 6px; }
  .bar-action .btn-label { display: none; }
  .toolrail {
    left: 50%;
    transform: translateX(-50%);
    bottom: 50px;
    padding: 4px;
    border-radius: 10px;
    gap: 0;
  }
  .toolrail button { width: 36px; height: 36px; }
  .rail-sep { margin: 0 3px; }
  .statusbar { bottom: 8px; height: 28px; padding: 0 8px; }
  .statusbar .tips { display: none; }
  .node-panel { left: 8px; right: 8px; bottom: 102px; border-radius: 12px; }
  .node-panel.expanded { max-height: 58vh; }
  .drawer { border-left: 0; }
  .ai-editor-panel { width: 100%; }
  .drawer { width: 100% !important; max-width: none !important; }
  .drawer-head { padding-left: 16px; padding-right: 16px; }
  .appearance-body { padding-left: 16px; padding-right: 16px; }
  .ai-editor-head { min-height: 54px; }
  .n-drawer { width: 100% !important; max-width: 100%; }
  .n-drawer-content { border-radius: 0; }
}

@media (max-width: 390px) {
  .page { padding-left: 12px; padding-right: 12px; }
  .workspace-card { padding-left: 12px; padding-right: 12px; }
  .title-input { max-width: 108px; }
}

/* Auth layout is declared after the shared breakpoint above, so the mobile
   override has to stay after the desktop grid as well. */
@media (max-width: 980px) {
  .auth-page { grid-template-columns: minmax(0, 1fr); }
  .auth-visual { display: none; }
  .auth-mobile-brand { display: inline-flex !important; }
}

.auth-page,
.auth-panel { min-height: 100dvh; }

.auth-page {
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  grid-template-rows: minmax(0, 1fr);
}
.auth-visual {
  height: 100%;
  min-height: 0;
}
.auth-panel {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}
