:root {
  --bg: #f5f4f2;
  --panel: #ffffff;
  --panel-soft: #f1efe8;
  --ink: #1a1a1a;
  --muted: #5a5a5a;
  --line: rgba(31, 41, 51, 0.12);
  --line-strong: rgba(31, 41, 51, 0.2);
  --accent: #1d9e75;
  --accent-2: #ba7517;
  --accent-3: #185fa5;
  --accent-dark: #0f6e56;
  --accent-soft: #e1f5ee;
  --accent-mid: #9fe1cb;
  --warn: #ba7517;
  --warn-soft: #faeeda;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  padding: 7px 11px;
  cursor: pointer;
  transition: border-color 120ms, background 120ms, box-shadow 120ms, color 120ms;
}

button:hover {
  border-color: var(--accent-mid);
  background: #f8fbf9;
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.danger {
  border-color: #d6b4ab;
  color: #9a3e2d;
}

.danger:hover {
  background: #fff7f4;
  border-color: #c98c7e;
}

.ghost {
  background: transparent;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(260px, 680px) auto;
  gap: 16px;
  align-items: center;
  min-height: 54px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
  border: 0;
  padding-left: 0;
}

.mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.global-search {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 13px;
  background: var(--panel-soft);
  outline: none;
  transition: border-color 120ms, box-shadow 120ms, background 120ms;
}

.global-search:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.12);
  background: #fff;
}

.container {
  width: min(1200px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.band {
  margin: 0 0 28px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: 24px;
  font-weight: 650;
}

h2 {
  font-size: 18px;
  font-weight: 650;
}

h3 {
  font-size: 16px;
  font-weight: 650;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.library-card {
  min-height: 124px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  transition: border-color 120ms, box-shadow 120ms, transform 120ms;
}

.library-card:hover {
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.08);
  transform: translateY(-1px);
}

.library-card button {
  justify-self: start;
}

.lib-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
}

.stats-row,
.toolbar,
.inline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar {
  margin: 14px 0;
}

.toolbar input,
.toolbar select {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.topic-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(430px, 0.48fr);
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  display: grid;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  border: 1px solid var(--accent-mid);
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 2px 9px;
  font-size: 12px;
}

.pill-warn {
  border-color: #fac775;
  color: var(--warn);
  background: var(--warn-soft);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: min(500px, 92vw);
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--line-strong);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
  transform: translateX(-105%);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head,
.drawer-actions {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-actions {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.draft-paper {
  width: 100%;
  height: 100%;
  border: 0;
  resize: none;
  padding: 20px;
  line-height: 1.75;
  outline: none;
  background: repeating-linear-gradient(transparent, transparent 27px, #e8ede9 28px);
  background-color: #fff;
}

.draft-stream {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
}

.draft-compose {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #f8fbf9;
}

.draft-compose textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.65;
  outline: none;
  background: #fff;
}

.draft-entry-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.draft-entry {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.draft-entry-time {
  font-size: 12px;
  color: var(--muted);
}

.draft-entry-body {
  line-height: 1.7;
  white-space: normal;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(10, 20, 30, 0.3);
  display: none;
}

.overlay.open {
  display: block;
}

.editor {
  display: grid;
  gap: 10px;
}

.editor input,
.editor textarea,
.editor select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
}

.editor textarea {
  min-height: 170px;
  resize: vertical;
  line-height: 1.65;
}

.editor .body {
  min-height: 310px;
}

.rich-field {
  display: grid;
  gap: 0;
}

.rich-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #f8fbf9;
  padding: 7px;
}

.rich-toolbar button {
  min-height: 32px;
  padding: 5px 9px;
}

.rich-editor {
  min-height: 260px;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 0 0 8px 8px;
  padding: 12px 14px;
  background: #fff;
  outline: none;
  line-height: 1.7;
  overflow: auto;
}

.rich-editor:focus {
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.12);
}

.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.rich-hidden {
  display: none;
}

.rich-content {
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.rich-content p {
  margin: 0 0 8px;
}

.rich-content ul,
.rich-content ol,
.rich-editor ul,
.rich-editor ol {
  margin: 8px 0;
  padding-left: 24px;
}

.rich-content li,
.rich-editor li {
  margin: 4px 0;
}

.timeline {
  position: relative;
  display: grid;
  gap: 12px;
  padding-left: 18px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: #ccd8d2;
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 18px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  border: 2px solid #fff;
}

.entry-mindmap {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.entry-mindmap .mindmap-preview {
  min-height: 220px;
}

.entry-mindmap .node {
  max-width: 160px;
  font-size: 12px;
}

.suggestion {
  border-left: 4px solid var(--accent-3);
  background: #e6f1fb;
}

.mindmap {
  min-height: 380px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(216, 222, 216, 0.38) 1px, transparent 1px),
    linear-gradient(rgba(216, 222, 216, 0.38) 1px, transparent 1px);
  background-size: 28px 28px;
}

.mindmap-preview {
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 10px;
}

.mindmap-preview .node {
  max-width: 180px;
  font-size: 12px;
  padding: 7px 9px;
  cursor: default;
  pointer-events: none;
}

.mindmap-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(17, 24, 39, 0.42);
  backdrop-filter: blur(4px);
}

.mindmap-modal {
  position: fixed;
  inset: 24px;
  z-index: 90;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  padding: 16px;
}

.mindmap-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.mindmap-large {
  min-height: 0;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.mindmap-large .node {
  max-width: 260px;
  font-size: 14px;
}

.mindmap-modal-editor {
  margin-top: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.mindmap-modal-editor textarea {
  min-height: 84px;
  max-height: 140px;
}

.mindmap-history {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.mindmap-history .inline-row {
  max-height: 86px;
  overflow: auto;
}

.entry-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 82;
  background: rgba(17, 24, 39, 0.42);
  backdrop-filter: blur(4px);
}

.entry-modal {
  position: fixed;
  inset: 24px;
  z-index: 92;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  padding: 18px;
  overflow: hidden;
}

.entry-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.entry-modal-form {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.entry-modal-form .rich-editor {
  min-height: 46vh;
}

.entry-modal-history {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  max-height: 160px;
  overflow: auto;
}

.node {
  position: absolute;
  max-width: 210px;
  border: 1px solid var(--accent-mid);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.08);
  font-size: 13px;
  line-height: 1.35;
  cursor: grab;
  user-select: text;
  z-index: 2;
}

.node.center {
  border-color: var(--accent);
  color: var(--accent-dark);
  font-weight: 700;
}

.node.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.16), 0 8px 18px rgba(31, 41, 51, 0.08);
}

.node:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.18);
  cursor: text;
}

.line {
  position: absolute;
  height: 2px;
  background: #aac0b8;
  transform-origin: left center;
  z-index: 1;
  pointer-events: none;
}

.mindmap-editor {
  margin-top: 12px;
}

.mindmap-editor textarea {
  min-height: 150px;
  font-family: inherit;
}

.quadrants {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quadrant {
  min-height: 280px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.todo-add {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  padding: 10px;
}

.todo-add input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  outline: none;
}

.todo-add-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto;
  gap: 8px;
  align-items: center;
}

.todo-item {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.todo-item.done {
  opacity: 0.66;
}

.trash-list {
  display: grid;
  gap: 8px;
}

.trash-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  background: #fbfcfb;
}

.trash-item strong {
  font-size: 14px;
  line-height: 1.35;
}

.trash-item .inline-row {
  gap: 6px;
}

.trash-item button {
  padding: 6px 9px;
  font-size: 13px;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day,
.weekday {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.weekday {
  min-height: auto;
  color: var(--muted);
  background: transparent;
  border: 0;
  text-align: center;
  font-size: 12px;
}

.day.has {
  border-color: var(--accent-mid);
  background: var(--accent-soft);
}

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

.kbd {
  font-family: Consolas, monospace;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

/* Compatibility with the attached visual theme naming. */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.page-title {
  font-size: 20px;
  font-weight: 650;
}

.page-sub,
.sec-label,
.sec-link {
  color: var(--muted);
  font-size: 12px;
}

.stat-card,
.panel,
.lib-card,
.thought-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-ghost,
.btn-icon {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

/* Taste Skill inspired redesign pass: quieter workbench, stronger hierarchy. */
:root {
  --bg: #f6f7f8;
  --panel: #ffffff;
  --panel-soft: #f3f6f5;
  --ink: #121826;
  --muted: #667085;
  --line: rgba(18, 24, 38, 0.1);
  --line-strong: rgba(18, 24, 38, 0.18);
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --accent-soft: #e8f5f2;
  --accent-mid: #8fd8cb;
  --accent-3: #2563eb;
  --shadow: 0 1px 2px rgba(18, 24, 38, 0.04), 0 8px 24px rgba(18, 24, 38, 0.04);
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 247, 248, 0) 220px),
    var(--bg);
  color: var(--ink);
}

button {
  min-height: 36px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(18, 24, 38, 0.02);
}

button:hover {
  background: #f9fbfa;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08);
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.18);
}

.topbar {
  min-height: 64px;
  grid-template-columns: auto minmax(280px, 760px) auto;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 0 rgba(18, 24, 38, 0.04);
}

.brand {
  color: var(--ink);
}

.mark {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.1);
}

.global-search {
  min-height: 42px;
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(18, 24, 38, 0.04);
}

.container {
  width: min(1280px, calc(100vw - 48px));
}

.section-head {
  align-items: flex-start;
}

h1 {
  font-size: 26px;
  letter-spacing: 0;
}

h2 {
  font-size: 17px;
}

.card,
.list-item,
.library-card,
.draft-entry,
.entry-mindmap,
.todo-item,
.trash-item,
.day {
  border-radius: 8px;
  border-color: rgba(18, 24, 38, 0.11);
  box-shadow: var(--shadow);
}

.card,
.list-item {
  padding: 16px;
}

.library-card {
  min-height: 132px;
  align-content: space-between;
}

.lib-icon {
  border-radius: 8px;
  background: #eef7f4;
}

.topic-workspace,
.split {
  gap: 18px;
}

.toolbar input,
.toolbar select,
.editor input,
.editor textarea,
.editor select,
.todo-add input,
.draft-compose textarea {
  border-radius: 8px;
  background: #fff;
}

.timeline {
  gap: 14px;
  padding-left: 20px;
}

.timeline::before {
  left: 6px;
  background: linear-gradient(var(--accent-mid), rgba(143, 216, 203, 0.2));
}

.timeline-item {
  border-left: 3px solid transparent;
}

.timeline-item::before {
  left: -21px;
  top: 20px;
  width: 10px;
  height: 10px;
  background: var(--accent);
  box-shadow: 0 0 0 5px #fff;
}

.timeline-item.suggestion {
  border-left-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08), var(--shadow);
}

.timeline-item > .rich-content {
  max-width: 78ch;
  color: #1f2937;
}

.entry-mindmap {
  background: #fbfcfc;
}

.rich-toolbar {
  background: #f6f8f8;
  border-radius: 8px 8px 0 0;
}

.rich-toolbar button {
  min-height: 30px;
  border-radius: 7px;
  padding: 4px 8px;
}

.rich-editor {
  min-height: 300px;
  border-radius: 0 0 8px 8px;
  font-size: 15px;
  line-height: 1.75;
}

.rich-content {
  font-size: 15px;
}

.entry-modal,
.mindmap-modal {
  inset: 20px;
  border-radius: 10px;
  border-color: rgba(18, 24, 38, 0.16);
  box-shadow: 0 28px 90px rgba(18, 24, 38, 0.28);
}

.entry-modal-head,
.mindmap-modal-head {
  align-items: flex-start;
  background: linear-gradient(180deg, #fff, #fbfcfc);
  margin: -18px -18px 0;
  padding: 16px 18px 14px;
  border-radius: 10px 10px 0 0;
}

.entry-modal-form .rich-editor {
  min-height: 50vh;
}

.tag {
  border-radius: 999px;
  background: #eef7f4;
}

.suggestion {
  background: #eef5ff;
  border-left-color: var(--accent-3);
}

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .split,
  .topic-workspace,
  .quadrants {
    grid-template-columns: 1fr;
  }

  .todo-add-options {
    grid-template-columns: 1fr;
  }

  .mindmap-modal {
    inset: 8px;
    padding: 10px;
  }

  .entry-modal {
    inset: 8px;
    padding: 10px;
  }

  .entry-modal-head {
    display: grid;
  }

  .mindmap-modal-head {
    display: grid;
  }

  .mindmap-large .node {
    max-width: 200px;
    font-size: 12px;
  }
}
