:root {
  color-scheme: light;
  --canvas: #f4f7f1;
  --surface: #fbfcf8;
  --surface-strong: #ffffff;
  --muted: #ecf1e8;
  --accent: #5e7652;
  --accent-hover: #506947;
  --accent-soft: #e1ecd9;
  --accent-soft-strong: #d5e5cc;
  --text: #1e211d;
  --text-secondary: #697066;
  --text-tertiary: #91998e;
  --border: #dce3d8;
  --border-strong: #cbd6c7;
  --ai: #fff1c2;
  --ai-strong: #f4dda0;
  --ai-text: #6b561d;
  --danger-soft: #f5e8e6;
  --danger: #8f4e45;
  --shadow: 0 20px 46px -36px rgba(55, 76, 47, 0.42);
  --focus: 0 0 0 3px rgba(94, 118, 82, 0.25);
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --left-width: 280px;
  --right-width: 360px;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
  color: var(--text);
}

body {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: var(--focus);
}

button:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--left-width) minmax(560px, 1fr) var(--right-width);
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  background: var(--surface);
  overflow: hidden;
}

.sidebar,
.inspector {
  min-width: 0;
  background: var(--canvas);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100dvh;
  padding: 24px 20px 20px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 34px;
  margin-bottom: 20px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.primary-button,
.secondary-button,
.quiet-button,
.danger-button,
.icon-button,
.chip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 11px;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease,
    transform 120ms ease, opacity 180ms ease;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  font-weight: 650;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.primary-button:disabled {
  background: #cbd5c7;
  color: #f7f9f5;
  cursor: not-allowed;
}

.secondary-button {
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
}

.secondary-button:hover {
  border-color: var(--border-strong);
  background: var(--muted);
}

.quiet-button,
.chip-button {
  background: var(--muted);
  color: var(--text-secondary);
}

.quiet-button:hover,
.chip-button:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.danger-button {
  background: var(--danger-soft);
  color: var(--danger);
}

.danger-button:hover {
  background: #efd9d6;
}

.icon-button {
  width: 40px;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
}

.icon-button:hover {
  background: var(--muted);
  color: var(--text);
}

.new-note-button {
  width: 100%;
  min-height: 44px;
  margin-bottom: 16px;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.nav-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 180ms ease, transform 120ms ease;
}

.nav-item:hover {
  background: var(--muted);
}

.nav-item.is-active {
  background: var(--accent-soft);
  font-weight: 650;
}

.sidebar-divider {
  height: 1px;
  margin: 18px 0;
  background: var(--border);
}

.sidebar-label {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 550;
}

.note-list {
  display: grid;
  gap: 7px;
}

.note-row {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 180ms ease, border-color 180ms ease, transform 120ms ease;
}

.note-row:hover {
  background: var(--surface-strong);
  border-color: var(--border);
}

.note-row.is-active {
  background: var(--accent-soft);
}

.note-row-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.note-row-snippet {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.note-row-meta {
  margin-top: 5px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
}

.reset-button {
  width: 100%;
  justify-content: flex-start;
  color: var(--text-tertiary);
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  max-height: 100dvh;
  background: var(--surface);
  overflow: hidden;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(251, 252, 248, 0.94);
  backdrop-filter: blur(14px);
}

.header-left,
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.breadcrumb {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-text {
  color: var(--text-tertiary);
  font-size: 12px;
  white-space: nowrap;
}

.saved-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.saved-indicator .icon {
  width: 17px;
  height: 17px;
}

.back-button {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}

.back-button:hover {
  background: var(--accent-soft);
}

.workspace-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.content-column {
  width: min(760px, calc(100% - 64px));
  margin: 0 auto;
  padding: 46px 0 80px;
  animation: page-in 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.content-column.is-wide {
  width: min(820px, calc(100% - 64px));
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.page-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.page-description {
  max-width: 64ch;
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
}

.empty-home {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 150px);
  padding: 40px 24px 100px;
  text-align: center;
}

.empty-home-inner {
  max-width: 520px;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface-strong);
  color: var(--accent);
  box-shadow: var(--shadow);
}

.empty-home h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.025em;
}

.empty-home p {
  margin: 12px auto 24px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
}

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

.action-row.is-centered {
  justify-content: center;
}

.editor-title {
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.28;
}

.editor-title::placeholder,
.editor-body::placeholder {
  color: #aeb5aa;
}

.editor-meta,
.note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.editor-body {
  width: 100%;
  min-height: 320px;
  margin-top: 24px;
  padding: 0;
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.9;
}

.editor-title:focus,
.editor-body:focus {
  outline: none;
  box-shadow: none;
}

.editor-title:focus-visible,
.editor-body:focus-visible {
  border-radius: 7px;
  outline: 2px solid rgba(94, 118, 82, 0.42);
  outline-offset: 6px;
}

.demo-control {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.demo-control .demo-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-control strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.demo-control p {
  margin: 7px 0 12px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.65;
}

.demo-button {
  width: 100%;
}

.format-bar {
  display: inline-flex;
  gap: 2px;
  margin-top: 20px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--muted);
  color: var(--text-secondary);
}

.format-button {
  min-width: 30px;
  min-height: 28px;
  padding: 0 5px;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.format-button:hover {
  background: var(--surface-strong);
  color: var(--text);
}

.note-article {
  margin-top: 24px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.9;
  white-space: pre-line;
}

.relation-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 44px;
  padding: 10px 13px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 13px;
}

.search-wrap {
  position: relative;
  margin-top: 24px;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 46px;
  padding: 0 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--muted);
  color: var(--text);
  transition: background 180ms ease, border-color 180ms ease;
}

.search-input:focus {
  border-color: var(--accent);
  background: var(--surface-strong);
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transform: translateY(-50%);
}

.search-clear:hover {
  background: var(--surface-strong);
  color: var(--text);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 14px;
  padding: 4px;
  border-radius: 12px;
  background: var(--muted);
}

.segment {
  min-height: 36px;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.segment:hover {
  color: var(--text);
}

.segment.is-active {
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 650;
  box-shadow: 0 2px 8px rgba(55, 76, 47, 0.06);
}

.result-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.library-list,
.topic-note-list {
  display: grid;
}

.library-item,
.topic-note-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  width: 100%;
  padding: 20px 6px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 180ms ease, padding 180ms ease;
}

.library-item:hover,
.topic-note-item:hover {
  margin: 0 -10px;
  padding-right: 16px;
  padding-left: 16px;
  border-radius: 12px;
  background: var(--muted);
}

.library-item h3,
.topic-note-item h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 680;
  line-height: 1.5;
}

.library-item p,
.topic-note-item p {
  display: -webkit-box;
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-tertiary);
  font-size: 12px;
  white-space: nowrap;
}

.relation-count {
  color: var(--accent);
  font-weight: 600;
}

.no-results {
  padding: 52px 20px;
  text-align: center;
}

.no-results h3 {
  margin: 0;
  font-size: 17px;
}

.no-results p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.topic-card {
  display: flex;
  min-height: 188px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-strong);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 200ms ease, border-color 200ms ease, transform 180ms ease,
    box-shadow 200ms ease;
}

.topic-card:hover {
  border-color: var(--border-strong);
  background: var(--muted);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.topic-card.is-featured {
  background: var(--accent-soft);
}

.topic-card-top,
.topic-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topic-card h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.count-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(251, 252, 248, 0.72);
  color: var(--text-secondary);
  font-size: 12px;
}

.topic-card > p {
  margin: 14px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
}

.representative-notes {
  margin: 13px 0 18px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.7;
}

.topic-card-footer {
  margin-top: auto;
  color: var(--text-tertiary);
  font-size: 11px;
}

.topic-explanation {
  margin: 28px 0 20px;
  padding: 17px 18px;
  border-radius: 14px;
  background: var(--accent-soft);
}

.topic-explanation strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.topic-explanation p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
}

.inspector {
  min-width: 0;
  min-height: 0;
  max-height: 100dvh;
  padding: 26px 24px;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.sidebar,
.workspace-scroll,
.inspector,
.modal {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.sidebar::-webkit-scrollbar,
.workspace-scroll::-webkit-scrollbar,
.inspector::-webkit-scrollbar,
.modal::-webkit-scrollbar {
  width: 9px;
}

.sidebar::-webkit-scrollbar-thumb,
.workspace-scroll::-webkit-scrollbar-thumb,
.inspector::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: var(--border-strong);
  background-clip: padding-box;
}

.inspector-title {
  margin: 0;
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.015em;
}

.inspector-description {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
}

.quiet-card,
.relation-card,
.candidate-card,
.manage-card,
.inspector-info {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-strong);
}

.quiet-card,
.inspector-info {
  padding: 18px;
}

.quiet-card strong,
.inspector-info strong {
  display: block;
  font-size: 14px;
}

.quiet-card p,
.inspector-info p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.7;
}

.hint-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding: 17px 16px;
  border: 1px solid rgba(107, 86, 29, 0.08);
  border-radius: 16px;
  background: var(--ai);
  color: var(--ai-text);
  animation: hint-in 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes hint-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hint-card strong {
  display: block;
  font-size: 13px;
}

.hint-card span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.82;
}

.hint-action {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--ai-text);
  cursor: pointer;
  font-weight: 650;
}

.candidate-card {
  padding: 16px;
  border-color: rgba(107, 86, 29, 0.1);
  background: var(--ai);
  color: var(--ai-text);
}

.candidate-label {
  color: rgba(107, 86, 29, 0.74);
  font-size: 11px;
}

.candidate-card h3 {
  margin: 7px 0 0;
  color: #3e351c;
  font-size: 16px;
  line-height: 1.45;
}

.candidate-reason {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.65;
}

.evidence-stack {
  display: grid;
  gap: 9px;
  margin-top: 15px;
}

.evidence {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
}

.evidence-label {
  color: var(--text-tertiary);
  font-size: 10px;
}

.evidence p {
  display: -webkit-box;
  overflow: hidden;
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.candidate-link {
  min-height: 34px;
  margin-top: 10px;
  padding: 0;
  background: transparent;
  color: var(--ai-text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.decision-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.decision-actions .primary-button,
.decision-actions .quiet-button {
  min-width: 0;
  padding: 0 10px;
}

.decision-help {
  margin-top: 12px;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.55;
}

.decision-result {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-strong);
}

.decision-result-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 13px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.decision-result h3 {
  margin: 0;
  font-size: 15px;
}

.decision-result p {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.65;
}

.relation-card {
  padding: 16px;
}

.relation-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.relation-card h3,
.manage-card h3 {
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 1.45;
}

.relation-type {
  color: var(--text-tertiary);
  font-size: 11px;
}

.relation-card p {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.65;
}

.relation-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 13px;
}

.relation-card-actions button {
  min-height: 34px;
  padding: 0 10px;
}

.manage-section-title {
  margin: 22px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
}

.manage-card {
  padding: 13px;
}

.manage-card .action-row {
  margin-top: 10px;
}

.manage-search {
  margin-top: 12px;
}

.manage-search .search-input {
  height: 42px;
  font-size: 13px;
}

.manual-results {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.manual-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-strong);
}

.manual-result strong {
  display: block;
  font-size: 12px;
}

.manual-result span {
  display: block;
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.manual-result button {
  min-height: 34px;
  padding: 0 10px;
}

.manual-result button:disabled {
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--accent-hover);
  cursor: default;
  opacity: 1;
}

.toast-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: #293126;
  color: #f8faf6;
  box-shadow: 0 18px 42px -22px rgba(29, 40, 26, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: auto;
  animation: toast-in 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast span {
  flex: 1;
  font-size: 13px;
}

.toast button {
  min-height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  font-weight: 650;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(35, 43, 32, 0.34);
  backdrop-filter: blur(6px);
  animation: fade-in 180ms ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: min(640px, 100%);
  max-height: min(720px, calc(100dvh - 48px));
  overflow-y: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 20px;
  background: var(--surface-strong);
  box-shadow: 0 32px 80px -40px rgba(26, 38, 22, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  animation: modal-in 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-meta {
  margin-top: 7px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.modal-body {
  margin-top: 22px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.85;
  white-space: pre-line;
}

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

@media (max-width: 1360px) {
  :root {
    --left-width: 248px;
    --right-width: 332px;
  }

  .sidebar {
    padding-right: 16px;
    padding-left: 16px;
  }

  .inspector {
    padding-right: 18px;
    padding-left: 18px;
  }

  .workspace-header {
    padding-right: 24px;
    padding-left: 24px;
  }

  .content-column,
  .content-column.is-wide {
    width: calc(100% - 48px);
  }
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .app-shell {
    min-width: 1120px;
  }
}

@media (max-width: 799px) {
  body.is-fit-preview {
    width: 100vw;
    height: auto;
    min-width: 0;
    overflow: auto;
    background: var(--canvas);
  }

  body.is-fit-preview #app {
    width: 1280px;
    transform: scale(var(--prototype-fit-scale, 1));
    transform-origin: left top;
  }

  body.is-fit-preview .app-shell {
    grid-template-columns: 248px 700px 332px;
    width: 1280px;
    min-width: 1280px;
    min-height: 800px;
    max-height: 800px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
