:root {
  --bg: #f4f1ea;
  --panel: #ffffff;
  --ink: #1e1b18;
  --muted: #6f665d;
  --line: #ddd4c8;
  --accent: #7a1f1f;
  --accent-dark: #551313;
  --soft: #f8f5ef;
  --paper: #fffdf8;
  --shadow: 0 18px 50px rgba(62, 43, 25, .14);
}

.header-actions a.btn {
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.32);
  color: inherit;
}

.skills-page {
  padding: 18px 20px 28px;
}

.view-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 7px;
  border: 1px solid rgba(128, 87, 54, 0.18);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 12px 28px rgba(56, 35, 22, 0.07);
}

.view-tab {
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #6a5a52;
  cursor: pointer;
  font: 800 14px/1 Arial, sans-serif;
  letter-spacing: 0.02em;
  min-height: 38px;
  padding: 10px 16px;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.view-tab:hover {
  background: #fff5e7;
  color: #471314;
}

.view-tab.is-active {
  background: #7a191c;
  color: #fff7ed;
  box-shadow: 0 10px 22px rgba(122, 25, 28, 0.22);
}

.tab-panel[hidden] {
  display: none;
}

.tab-panel.is-active {
  animation: tabFade 0.16s ease;
}

@keyframes tabFade {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notion-shell {
  display: grid;
  grid-template-columns: minmax(310px, 0.36fr) minmax(520px, 0.64fr);
  gap: 14px;
  min-height: calc(100vh - 205px);
}

.notion-sidebar {
  overflow: hidden;
  padding: 0;
  background: #181818;
  border-color: #303030;
  color: #f1f1f1;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.22);
}

.notion-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid #303030;
}

.notion-sidebar-head .eyebrow,
.notion-sidebar .eyebrow {
  color: #a8a8a8;
}

.notion-sidebar-head h2 {
  margin: 8px 0 0;
  font-size: 24px;
  color: #f7f7f7;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #3d3d3d;
  border-radius: 9px;
  background: #242424;
  color: #f7f7f7;
  cursor: pointer;
  font: 800 22px/1 Arial, sans-serif;
}

.icon-btn:hover {
  background: #303030;
}

.skill-page-tree {
  padding: 0 0 8px;
}

.notion-tree-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 0;
  min-height: 38px;
  padding: 0 12px 0 calc(10px + (var(--level) * 22px));
  border-bottom: 1px solid #292929;
  color: #e9e9e9;
}

.notion-tree-item:hover {
  background: #202020;
}

.notion-tree-item.is-active {
  background: #2b2b2b;
}

.tree-disclosure,
.tree-mini-action,
.tree-page-button {
  border: 0;
  background: transparent;
  color: inherit;
}

.tree-disclosure {
  width: 26px;
  height: 30px;
  color: #d8d8d8;
  cursor: pointer;
  font-size: 14px;
}

.tree-disclosure:disabled {
  cursor: default;
  opacity: 0.35;
}

.tree-page-button {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
  width: 100%;
  height: 38px;
  cursor: pointer;
  text-align: left;
}

.notion-page-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  flex: 0 0 18px;
  opacity: 0.9;
  font-size: 15px;
}

.tree-page-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f3f3f3;
  font-size: 14px;
  font-weight: 700;
}

.tree-mini-action {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: #9f9f9f;
  cursor: pointer;
  font-size: 18px;
  opacity: 0;
}

.notion-tree-item:hover .tree-mini-action,
.notion-tree-item.is-active .tree-mini-action {
  opacity: 1;
}

.tree-mini-action:hover {
  background: #383838;
  color: #fff;
}

.hidden-pages-box {
  margin: 10px 12px 14px;
  border: 1px solid #303030;
  border-radius: 12px;
  background: #141414;
  color: #dfdfdf;
}

.hidden-pages-box summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  cursor: pointer;
  padding: 0 12px;
  color: #cfcfcf;
  font-size: 13px;
  font-weight: 800;
}

.hidden-pages-box summary span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  border-radius: 999px;
  background: #2d2d2d;
  color: #fff;
  font-size: 12px;
}

.hidden-skill-pages {
  border-top: 1px solid #303030;
  padding: 6px;
}

.hidden-page-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 13px;
}

.hidden-page-row:hover {
  background: #202020;
}

.hidden-page-row span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden-page-row small {
  color: #8f8f8f;
  font-size: 11px;
  text-transform: uppercase;
}

.hidden-page-row button {
  border: 1px solid #3d3d3d;
  border-radius: 7px;
  background: #242424;
  color: #f4f4f4;
  cursor: pointer;
  font-size: 12px;
  padding: 5px 7px;
}

.empty-tree,
.empty-hidden {
  margin: 0;
  padding: 12px;
  color: #8f8f8f;
  font-size: 13px;
}

.notion-page {
  background: #fbfaf7;
  border-color: rgba(128, 87, 54, 0.2);
}

.notion-page-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.notion-page-toolbar h2 {
  margin: 3px 0 0;
  color: #1f1f1f;
  font-size: 28px;
  line-height: 1.1;
}

.skill-page-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.skill-page-form label {
  display: grid;
  gap: 7px;
  color: #6b5b52;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.skill-page-form label:first-child,
.skill-page-form label:nth-child(3),
.skill-page-form label:nth-child(4),
.skill-page-form label:nth-child(9) {
  grid-column: 1 / -1;
}

.skill-page-form input,
.skill-page-form textarea {
  width: 100%;
  border: 1px solid rgba(128, 87, 54, 0.22);
  border-radius: 13px;
  background: #fffdf8;
  color: #211714;
  padding: 12px 13px;
  font: 14px/1.45 Arial, sans-serif;
  box-shadow: inset 0 1px 2px rgba(62, 36, 22, 0.05);
}

.skill-page-form input:focus,
.skill-page-form textarea:focus {
  outline: 3px solid rgba(122, 25, 28, 0.14);
  border-color: rgba(122, 25, 28, 0.42);
}

.skill-page-form input:disabled,
.skill-page-form textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* High-contrast Notion-like skill map overrides */
.notion-shell .notion-sidebar.panel {
  background: #171717;
  border-color: #2f2f2f;
  color: #f2f2f2;
}

.notion-shell .notion-page.panel {
  background: #fffdf8;
  color: #201714;
}

.notion-sidebar-head {
  background: #171717;
}

.notion-sidebar-head .eyebrow {
  color: #b8b8b8;
}

.notion-sidebar-head h2 {
  color: #ffffff;
  opacity: 1;
}

.notion-tree-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px 30px;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 0 14px 0 44px;
  border-bottom: 1px solid #303030;
  background: #111;
  color: #a7a7a7;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notion-tree-item {
  grid-template-columns: 28px minmax(0, 1fr) 118px 30px;
  background: #171717;
  border-bottom-color: #303030;
  color: #f4f4f4;
}

.notion-tree-item:hover {
  background: #242424;
}

.notion-tree-item.is-active {
  background: #303030;
  box-shadow: inset 3px 0 0 #f5d29e;
}

.tree-disclosure {
  color: #f4f4f4;
}

.tree-page-title {
  color: #f7f7f7;
  opacity: 1;
}

.tree-page-button {
  color: #f7f7f7;
}

.status-pill {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  max-width: 112px;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.status-pill.is-updated {
  background: #168246;
}

.status-pill.is-trained {
  background: #2563eb;
}

.status-pill.is-draft {
  background: #9a6517;
}

.status-pill.is-untrained {
  background: #8a1d22;
}

.tree-mini-action {
  color: #f7f7f7;
}

.hidden-pages-box {
  background: #101010;
  border-color: #383838;
}

.hidden-pages-box summary {
  color: #ffffff;
}

.hidden-page-row {
  color: #f2f2f2;
}

.skill-page-form.is-single-text {
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: start;
}

.skill-page-form.is-single-text .field-name {
  grid-column: 1;
}

.skill-page-form.is-single-text .field-status {
  grid-column: 2;
}

.skill-page-form.is-single-text .field-content {
  grid-column: 1 / -1;
}

.skill-page-form select {
  width: 100%;
  border: 1px solid rgba(128, 87, 54, 0.22);
  border-radius: 13px;
  background: #fffdf8;
  color: #211714;
  padding: 12px 13px;
  font: 14px/1.45 Arial, sans-serif;
}

.skill-page-form.is-single-text textarea#skillContentInput {
  min-height: 520px;
  resize: vertical;
}

@media (max-width: 900px) {
  .notion-tree-header,
  .notion-tree-item {
    grid-template-columns: 28px minmax(0, 1fr) 94px 28px;
  }

  .status-pill {
    max-width: 92px;
    font-size: 10px;
  }

  .skill-page-form.is-single-text {
    grid-template-columns: 1fr;
  }

  .skill-page-form.is-single-text .field-name,
  .skill-page-form.is-single-text .field-status {
    grid-column: 1;
  }
}

/* Keep skill names readable in the Notion-style tree */
.notion-shell .notion-tree-header {
  grid-template-columns: minmax(0, 1fr) 82px 24px;
  padding-left: 36px;
}

.notion-shell .notion-tree-item {
  grid-template-columns: 20px minmax(0, 1fr) 82px 24px;
  column-gap: 6px;
}

.notion-shell .tree-page-button {
  gap: 7px;
  min-width: 0;
}

.notion-shell .notion-page-icon {
  width: 16px;
  flex-basis: 16px;
  font-size: 14px;
}

.notion-shell .tree-page-title {
  min-width: 0;
  font-size: 13px;
  line-height: 1.2;
}

.notion-shell .status-pill {
  max-width: 80px;
  min-height: 22px;
  padding: 3px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
}

.notion-shell .tree-mini-action {
  width: 24px;
  height: 24px;
}

@media (max-width: 900px) {
  .notion-shell .notion-tree-header,
  .notion-shell .notion-tree-item {
    grid-template-columns: 20px minmax(0, 1fr) 72px 22px;
  }

  .notion-shell .status-pill {
    max-width: 70px;
    font-size: 9px;
  }
}

.skills-board {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(380px, 1.05fr);
  gap: 14px;
  align-items: stretch;
}

.skills-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.skills-panel-head h2 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.1;
}

.skills-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.skills-actions .btn {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}

.skills-editor-panel,
.skills-preview-panel {
  min-height: calc(100vh - 205px);
}

.skills-textarea {
  width: 100%;
  min-height: calc(100vh - 315px);
  resize: vertical;
  border: 1px solid rgba(128, 87, 54, 0.26);
  border-radius: 16px;
  background: #fffdf8;
  color: #211714;
  padding: 16px;
  font: 14px/1.55 Arial, sans-serif;
  box-shadow: inset 0 1px 2px rgba(62, 36, 22, 0.06);
}

.skills-textarea:focus {
  outline: 3px solid rgba(122, 25, 28, 0.16);
  border-color: rgba(122, 25, 28, 0.45);
}

.skills-status,
.muted {
  color: #77675f;
  font-size: 13px;
}

.markdown-preview {
  min-height: calc(100vh - 315px);
  max-height: calc(100vh - 245px);
  overflow: auto;
  border-radius: 16px;
  background: #fffdf8;
  border: 1px solid rgba(128, 87, 54, 0.18);
  padding: 22px 24px;
  color: #211714;
  font-family: Arial, sans-serif;
}

.markdown-preview h1 {
  margin: 0 0 14px;
  font-size: 25px;
  line-height: 1.15;
}

.markdown-preview h2 {
  margin: 24px 0 8px;
  color: #6f1519;
  font-size: 20px;
}

.markdown-preview h3 {
  margin: 18px 0 8px;
  font-size: 17px;
}

.markdown-preview p,
.markdown-preview li {
  font-size: 15px;
  line-height: 1.55;
}

.markdown-preview blockquote {
  margin: 14px 0;
  border-left: 5px solid #8a1d22;
  background: #fff5e7;
  padding: 10px 14px;
  border-radius: 0 12px 12px 0;
}

.markdown-preview code {
  background: #f3e6d3;
  border-radius: 6px;
  padding: 1px 5px;
}

.skills-map-panel {
  margin-top: 14px;
}

.mindmap-canvas {
  --mindmap-width: 980px;
  --mindmap-height: 680px;
  position: relative;
  width: 100%;
  height: min(72vh, 720px);
  min-height: 560px;
  overflow: auto;
  border: 1px solid rgba(128, 87, 54, 0.18);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 50%, rgba(122, 25, 28, 0.08), transparent 30%),
    linear-gradient(rgba(122, 25, 28, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 25, 28, 0.045) 1px, transparent 1px),
    #fffdf8;
  background-size: auto, 32px 32px, 32px 32px, auto;
  box-shadow: inset 0 1px 3px rgba(56, 35, 22, 0.06);
}

.mindmap-canvas::before {
  content: "";
  display: block;
  width: var(--mindmap-width);
  height: var(--mindmap-height);
}

.mindmap-svg,
.mindmap-nodes {
  position: absolute;
  inset: 0 auto auto 0;
  width: var(--mindmap-width);
  height: var(--mindmap-height);
}

.mindmap-svg {
  pointer-events: none;
  overflow: visible;
}

.mindmap-svg path {
  fill: none;
  stroke: rgba(122, 25, 28, 0.34);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 2px 2px rgba(84, 43, 27, 0.08));
}

.mindmap-node {
  position: absolute;
  z-index: 2;
  width: 270px;
  min-height: 104px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  border: 1px solid rgba(128, 87, 54, 0.24);
  border-radius: 20px;
  background: linear-gradient(145deg, #fffdf9, #fff4e4);
  padding: 14px;
  box-shadow: 0 16px 35px rgba(56, 35, 22, 0.14);
  transition: box-shadow 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.mindmap-node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.node-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(122, 25, 28, 0.28);
  border-radius: 12px;
  background: #fffaf2;
  color: #7a191c;
  cursor: pointer;
  font: 900 23px/1 Arial, sans-serif;
  box-shadow: 0 8px 18px rgba(56, 35, 22, 0.08);
}

.node-toggle:hover {
  background: #ffe8c8;
  border-color: rgba(122, 25, 28, 0.52);
}

.mindmap-node.is-root .node-toggle {
  background: rgba(255, 248, 239, 0.96);
  border-color: rgba(255, 248, 239, 0.38);
  color: #4b1113;
}

.mindmap-node:hover {
  border-color: rgba(122, 25, 28, 0.42);
  box-shadow: 0 20px 44px rgba(56, 35, 22, 0.18);
}

.mindmap-node.is-dragging {
  z-index: 5;
  cursor: grabbing;
  transform: scale(1.025);
  border-color: rgba(122, 25, 28, 0.72);
  box-shadow: 0 26px 60px rgba(56, 35, 22, 0.26);
}

.mindmap-node.is-root {
  background: linear-gradient(145deg, #7a191c, #4b1113);
  color: #fff8ef;
  border-color: rgba(255, 238, 214, 0.34);
}

.mindmap-node.is-root .skill-badge {
  background: #f5d29e;
  color: #4b1113;
}

.mindmap-node h3 {
  margin: 8px 0 8px;
  font-size: 17px;
  line-height: 1.22;
}

.mindmap-node p {
  margin: 0 0 8px;
  color: #66554d;
  font-size: 13px;
  line-height: 1.35;
}

.mindmap-node.is-root p {
  color: rgba(255, 248, 239, 0.82);
}

.node-details {
  max-height: 240px;
  overflow: auto;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(128, 87, 54, 0.18);
}

.mindmap-node.is-root .node-details {
  border-top-color: rgba(255, 248, 239, 0.22);
}

.node-hint {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 4px;
  border-radius: 999px;
  background: #f5e8d4;
  color: #7a191c !important;
  padding: 3px 9px;
  font-size: 11px !important;
  font-weight: 800;
}

.mindmap-node.is-root .node-hint {
  background: rgba(255, 248, 239, 0.17);
  color: #f5d29e !important;
}

.mindmap-node.is-collapsed {
  min-height: 118px;
}

.mindmap-node.is-expanded {
  min-height: 170px;
}

.mindmap-node ul {
  margin: 0;
  padding-left: 18px;
}

.mindmap-node li {
  margin: 4px 0;
  color: #574943;
  font-size: 12px;
  line-height: 1.35;
}

.mindmap-node.is-root li {
  color: rgba(255, 248, 239, 0.86);
}

.mindmap-empty {
  position: absolute;
  left: 24px;
  top: 24px;
}

.skill-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 12px;
}

.skill-card {
  border: 1px solid rgba(128, 87, 54, 0.2);
  border-radius: 18px;
  background: linear-gradient(145deg, #fffdf9, #fff7ea);
  padding: 16px;
  box-shadow: 0 12px 28px rgba(56, 35, 22, 0.07);
}

.skill-card h3 {
  margin: 8px 0 10px;
  color: #241613;
  font-size: 17px;
  line-height: 1.25;
}

.skill-card ul {
  margin: 0;
  padding-left: 18px;
}

.skill-card li {
  margin: 6px 0;
  color: #574943;
  font-size: 13px;
  line-height: 1.4;
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #7a191c;
  color: #fff7ed;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .notion-shell {
    grid-template-columns: 1fr;
  }

  .skill-page-form {
    grid-template-columns: 1fr;
  }

  .skills-board {
    grid-template-columns: 1fr;
  }

  .skills-editor-panel,
  .skills-preview-panel,
  .skills-textarea,
  .markdown-preview {
    min-height: 420px;
  }

  .mindmap-canvas {
    min-height: 520px;
  }
}

@media (max-width: 640px) {
  .skills-page {
    padding: 12px;
  }

  .skills-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .skills-actions {
    justify-content: flex-start;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 18px 28px;
  background: linear-gradient(135deg, #2a1713, #6d211f);
  color: white;
}

.app-header h1,
.toolbar h2,
.panel h2 {
  margin: 0;
}

.app-header h1 {
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 10px;
  font-weight: 800;
  color: #d7b78c;
}

.subtitle {
  margin: 6px 0 0;
  color: #f1e7dc;
  max-width: 720px;
  font-size: 16px;
  line-height: 1.35;
}

.header-actions,
.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  font-size: 14px;
  line-height: 1.2;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: #f5d7a5;
  color: #2a1713;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
}

.btn-secondary {
  background: white;
  color: var(--accent-dark);
  border-color: var(--line);
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  min-height: calc(100vh - 92px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(62, 43, 25, .06);
}

.panel-grow {
  flex: 1;
  min-height: 260px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  font-size: 12px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  background: var(--soft);
  color: var(--ink);
  min-height: 40px;
}

.snippet-list {
  overflow: auto;
  padding-right: 2px;
  display: grid;
  gap: 8px;
}

.snippet-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px 12px;
  margin: 0;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.snippet-card.active {
  border-color: var(--accent);
  background: #fff8ed;
  box-shadow: inset 3px 0 0 var(--accent);
}

.snippet-card h3 {
  margin: 0 0 5px;
  font-size: 14px;
  line-height: 1.25;
}

.snippet-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.small-note {
  font-size: 12px;
  color: var(--muted);
}

.small-note ul {
  padding-left: 18px;
  margin: 8px 0 0;
}

.workspace {
  min-width: 0;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  box-shadow: 0 6px 18px rgba(62, 43, 25, .06);
}

.toolbar .eyebrow {
  margin: 0 0 2px;
  font-size: 8px;
  letter-spacing: .1em;
}

.toolbar h2 {
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
  max-width: 58ch;
}

.meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.toolbar-actions {
  flex-shrink: 0;
}

.toolbar .btn {
  padding: 7px 10px;
  font-size: 13px;
}

.page-wrap {
  overflow: auto;
  padding: 14px;
  border-radius: 8px;
  background: #e7ded1;
  box-shadow: inset 0 0 0 1px rgba(80, 58, 37, .08);
}

.word-page {
  width: 21cm;
  min-height: 29.7cm;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.word-content {
  min-height: 29.7cm;
  padding: .8cm 2cm 1.83cm 2cm;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12pt;
  line-height: 1.5;
  color: #111;
}

.word-content p,
.word-content li {
  text-align: justify;
  margin: 12pt 0;
}

.word-content h1,
.word-content h2,
.word-content h3,
.word-content h4 {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  line-height: 1.5;
  color: #111;
}

.word-content h1 {
  text-transform: uppercase;
  font-size: 12pt;
  margin: 18pt 0;
}

.word-content h2 {
  text-transform: uppercase;
  font-size: 12pt;
  margin: 24pt 0;
}

.word-content h3 {
  font-size: 12pt;
  margin: 18pt 0;
}

.word-content h4 {
  font-size: 12pt;
  margin: 14pt 0 8pt;
}

.word-content blockquote {
  margin: 10pt 0 10pt 1cm;
  padding: 8pt 10pt;
  border-left: 3px solid #777;
  background: #f5f5f5;
}

.word-content blockquote p {
  margin: 0;
}

.word-content strong {
  font-weight: 700;
}

.word-content code {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12pt;
  background: #f3f3f3;
  padding: 0 3px;
}

.word-content hr {
  border: 0;
  border-top: 1px solid #bdbdbd;
  margin: 18pt 0;
}

.placeholder {
  color: #666;
}

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-header {
    padding: 14px 18px;
  }
  .app-header h1 {
    font-size: 28px;
  }
  .header-actions {
    flex-direction: row;
    align-items: center;
  }
  .sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
  }
  .panel-grow {
    grid-column: 1 / -1;
    min-height: 220px;
  }
  .snippet-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .word-page { transform-origin: top left; }
  .sidebar { min-height: auto; }
}

@media (max-width: 700px) {
  .app-header,
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .sidebar,
  .snippet-list {
    grid-template-columns: 1fr;
  }
  .toolbar h2 {
    font-size: 20px;
  }
}

@media print {
  body { background: white; }
  .app-header,
  .sidebar,
  .toolbar { display: none; }
  .app-shell { display: block; padding: 0; }
  .page-wrap { padding: 0; background: white; overflow: visible; }
  .word-page { width: auto; min-height: auto; box-shadow: none; }
  .word-content { padding: .8cm 2cm 1.83cm 2cm; }
}
#preview h3 {
  margin: 1.6rem 0 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  color: #0f172a;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}

#preview blockquote {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border-left: 4px solid #2563eb;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(255, 255, 255, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

#preview ul {
  margin: 0.35rem 0 1.2rem;
  padding-left: 1.15rem;
}

#preview li {
  margin-bottom: 0.55rem;
  line-height: 1.65;
}

#preview p {
  margin: 0 0 1rem;
  text-align: justify;
}
