:root {
  --ink: #20211f;
  --ink-soft: #565952;
  --ink-muted: #8f918a;
  --paper: #fbfaf6;
  --canvas: #f3f1ea;
  --panel: #eeece5;
  --white: #fffefa;
  --line: #e5e2da;
  --line-strong: #d8d4ca;
  --coral: #e85b45;
  --coral-dark: #cc4735;
  --coral-soft: #fbe9e4;
  --sage: #5e806b;
  --sage-soft: #e7efe9;
  --amber: #b98035;
  --shadow: 0 18px 50px rgba(45, 43, 37, 0.08);
  --soft-shadow: 0 8px 25px rgba(45, 43, 37, 0.07);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
[contenteditable]:focus-visible {
  outline: 2px solid rgba(232, 91, 69, 0.44);
  outline-offset: 2px;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  display: grid;
  grid-template-columns: 82px 306px minmax(480px, 1fr) 326px;
  grid-template-rows: minmax(0, 1fr);
  height: 100vh;
  min-height: 640px;
  background: var(--canvas);
}

.app-shell.ai-collapsed {
  grid-template-columns: 82px 306px minmax(480px, 1fr);
}

.app-shell.ai-collapsed .ai-pane {
  display: none;
}

.rail {
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 12px 18px;
  color: #777a72;
  background: #ebe9e1;
  border-right: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 30px;
  padding: 0;
  color: white;
  background: var(--ink);
  border: 0;
  border-radius: 15px;
  box-shadow: 0 8px 18px rgba(25, 26, 23, 0.18);
}

.brand-bars {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 20px;
}

.brand-bars i {
  width: 3px;
  background: currentColor;
  border-radius: 99px;
}

.brand-bars i:nth-child(1) {
  height: 7px;
}

.brand-bars i:nth-child(2) {
  height: 17px;
}

.brand-bars i:nth-child(3) {
  height: 12px;
}

.brand-bars i:nth-child(4) {
  height: 5px;
}

.rail-nav,
.rail-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.rail-bottom {
  margin-top: auto;
}

.rail-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 58px;
  min-height: 56px;
  padding: 5px 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 13px;
  transition: 160ms ease;
}

.rail-button svg {
  width: 20px;
  height: 20px;
}

.rail-button span {
  font-size: 10px;
  letter-spacing: 0.03em;
}

.rail-button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}

.rail-button.is-active {
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 4px 15px rgba(45, 43, 37, 0.06);
}

.rail-button.is-active::before {
  position: absolute;
  left: -13px;
  width: 3px;
  height: 21px;
  background: var(--coral);
  border-radius: 0 4px 4px 0;
  content: "";
}

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: 17px;
  padding: 0;
  overflow: visible;
  color: #fff;
  background:
    radial-gradient(circle at 68% 25%, rgba(255, 255, 255, 0.24), transparent 24%),
    linear-gradient(145deg, #a9b7a8, #687a6b);
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 15px;
  box-shadow: 0 5px 12px rgba(40, 48, 40, 0.16);
}

.avatar i {
  position: absolute;
  right: -1px;
  bottom: 0;
  width: 9px;
  height: 9px;
  background: #68a270;
  border: 2px solid #ebe9e1;
  border-radius: 50%;
}

.library {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(251, 250, 246, 0.9);
  border-right: 1px solid var(--line);
}

.library-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 31px 22px 19px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.library-heading h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.09em;
  line-height: 1;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
}

.icon-button.soft {
  color: var(--ink-soft);
  background: #f1efe9;
  border: 1px solid var(--line);
}

.icon-button:hover {
  color: var(--ink);
  background: #e8e5dd;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 39px;
  margin: 0 18px 16px;
  padding: 0 11px;
  color: var(--ink-muted);
  background: #f1efe9;
  border: 1px solid transparent;
  border-radius: 11px;
  transition: 160ms ease;
}

.search-box:focus-within {
  color: var(--ink-soft);
  background: var(--white);
  border-color: var(--line-strong);
}

.search-box svg {
  width: 17px;
  height: 17px;
}

.search-box input {
  min-width: 0;
  flex: 1;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
}

.search-box input::placeholder {
  color: #a2a39c;
}

.search-box kbd {
  padding: 3px 6px;
  color: #92948c;
  background: #fbfaf6;
  border: 1px solid #e1ded5;
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 9px;
}

.library-filters {
  display: flex;
  align-items: center;
  gap: 19px;
  height: 36px;
  margin: 0 21px;
  border-bottom: 1px solid var(--line);
}

.filter-tab {
  position: relative;
  height: 36px;
  padding: 0;
  color: var(--ink-muted);
  background: none;
  border: 0;
  font-size: 11px;
}

.filter-tab:hover,
.filter-tab.is-active {
  color: var(--ink);
}

.filter-tab.is-active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  content: "";
}

.note-list {
  flex: 1;
  min-height: 0;
  padding: 12px 11px 20px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #d9d5cb transparent;
}

.note-card {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 5px;
  padding: 15px 14px 14px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 13px;
  transition: 160ms ease;
}

.note-card:hover {
  background: rgba(255, 255, 255, 0.62);
}

.note-card.is-active {
  background: var(--white);
  border-color: #e7e3d9;
  box-shadow: 0 7px 20px rgba(45, 43, 37, 0.055);
}

.note-card.is-active::before {
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: -1px;
  width: 3px;
  background: var(--coral);
  border-radius: 0 4px 4px 0;
  content: "";
}

.note-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 7px;
}

.note-card-title {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-card-time {
  flex: none;
  color: #a5a69f;
  font-size: 9px;
}

.note-card-excerpt {
  display: -webkit-box;
  min-height: 33px;
  margin: 0 0 11px;
  overflow: hidden;
  color: #777a72;
  font-size: 10.5px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.note-card-bottom {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mini-tag {
  padding: 3px 7px;
  color: #726d62;
  background: #f1eee6;
  border-radius: 5px;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.audio-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #94958d;
  font-size: 8.5px;
}

.audio-badge svg {
  width: 11px;
  height: 11px;
}

.favorite-dot {
  width: 5px;
  height: 5px;
  margin-left: auto;
  background: var(--amber);
  border-radius: 50%;
}

.empty-notes {
  padding: 44px 18px;
  color: var(--ink-muted);
  text-align: center;
  font-size: 11px;
  line-height: 1.7;
}

.empty-notes svg {
  width: 28px;
  height: 28px;
  margin: 0 auto 14px;
  opacity: 0.6;
}

.library-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 20px;
  color: #9b9c94;
  border-top: 1px solid var(--line);
  font-size: 9px;
}

.library-footer span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.library-footer span i {
  width: 5px;
  height: 5px;
  background: #74a17c;
  border-radius: 50%;
}

.library-footer button {
  padding: 4px 0;
  color: #85877f;
  background: none;
  border: 0;
  font-size: 9px;
}

.workspace {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)),
    var(--canvas);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 66px;
  min-height: 66px;
  padding: 0 28px;
  background: rgba(243, 241, 234, 0.87);
  border-bottom: 1px solid rgba(225, 222, 213, 0.8);
  backdrop-filter: blur(14px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #979991;
  font-size: 10px;
}

.breadcrumb svg {
  width: 12px;
  height: 12px;
}

.breadcrumb strong {
  color: #666960;
  font-weight: 500;
}

.mobile-menu {
  display: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 3px;
  color: #93958d;
  font-size: 9px;
  white-space: nowrap;
}

.save-state i {
  width: 5px;
  height: 5px;
  background: #77a07b;
  border-radius: 50%;
}

.save-state.is-saving i {
  background: var(--amber);
  animation: savePulse 1s infinite;
}

.ai-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 9px;
  color: #7f5e54;
  background: #f3e7e1;
  border: 1px solid #ead8d0;
  border-radius: 9px;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.ai-toggle:hover {
  color: #68483f;
  background: #efddd5;
}

.ai-toggle svg {
  width: 14px;
  height: 14px;
}

.top-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #777a72;
  background: transparent;
  border: 0;
  border-radius: 9px;
}

.top-icon:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
}

.top-icon.is-favorite {
  color: var(--amber);
}

.top-icon.is-favorite svg {
  fill: currentColor;
}

.top-icon svg {
  width: 17px;
  height: 17px;
}

.record-button {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 10px;
  color: white;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(32, 33, 31, 0.13);
  transition: 160ms ease;
}

.record-button:hover {
  background: #30322e;
  transform: translateY(-1px);
}

.record-button span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}

.record-button span i {
  width: 7px;
  height: 7px;
  background: var(--coral);
  border-radius: 50%;
}

.editor-scroll {
  flex: 1;
  min-height: 0;
  padding: 28px 24px 70px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #d8d4ca transparent;
}

.note-page {
  width: min(100%, 780px);
  min-height: 100%;
  margin: 0 auto;
  padding: 49px 68px 34px;
  background: var(--paper);
  border: 1px solid rgba(222, 218, 208, 0.84);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.note-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
  color: #9b9c94;
  font-size: 9.5px;
}

.note-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #777a72;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.note-type i {
  width: 13px;
  height: 1px;
  background: var(--coral);
}

.note-title {
  min-height: 42px;
  margin: 0 0 12px;
  color: #242521;
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
  outline: 0;
}

[contenteditable="true"][data-placeholder]:empty::before {
  color: #b7b4aa;
  content: attr(data-placeholder);
  pointer-events: none;
}

.note-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 25px;
  margin-bottom: 28px;
  color: #aaaba3;
  font-size: 9px;
}

.tag-picker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  color: #756a57;
  background: #f1ece1;
  border: 0;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 600;
}

.tag-picker svg {
  width: 11px;
  height: 11px;
}

.meta-divider {
  width: 1px;
  height: 9px;
  background: #dedbd2;
}

.audio-note {
  margin-bottom: 23px;
  padding: 16px 17px 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(251, 247, 239, 0.9)),
    #f7f3ec;
  border: 1px solid #e9e2d8;
  border-radius: 12px;
}

.audio-note.is-new {
  animation: newAudio 650ms ease both;
}

.audio-topline,
.audio-title {
  display: flex;
  align-items: center;
}

.audio-topline {
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 12px;
}

.audio-title {
  gap: 9px;
  min-width: 0;
}

.audio-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: none;
  color: var(--coral);
  background: var(--coral-soft);
  border-radius: 9px;
}

.audio-icon svg {
  width: 16px;
  height: 16px;
}

.audio-title > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.audio-title strong {
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-title small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #999a92;
  font-size: 8.5px;
}

.audio-title small i {
  width: 4px;
  height: 4px;
  background: #75a17a;
  border-radius: 50%;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 0;
  color: #8a8c84;
  background: none;
  border: 0;
  font-size: 8.5px;
  white-space: nowrap;
}

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

.text-button svg {
  width: 13px;
  height: 13px;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 11px;
}

.play-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  padding: 0;
  color: white;
  background: var(--ink);
  border: 0;
  border-radius: 50%;
}

.play-button:hover {
  background: #363832;
}

.play-button svg {
  width: 15px;
  height: 15px;
}

.play-button .play-icon {
  margin-left: 1px;
  fill: currentColor;
  stroke-width: 1;
}

.play-button .pause-icon {
  display: none;
  fill: currentColor;
  stroke-width: 2.6;
}

.audio-player.is-playing .play-icon {
  display: none;
}

.audio-player.is-playing .pause-icon {
  display: block;
}

.waveform-wrap {
  position: relative;
  height: 30px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 30px;
  color: #cbc6bc;
}

.waveform i {
  width: 2px;
  min-height: 2px;
  flex: 1;
  max-width: 3px;
  background: currentColor;
  border-radius: 4px;
}

.waveform-progress {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  overflow: hidden;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.waveform-progress .waveform {
  width: calc(var(--waveform-width, 500px));
  color: var(--coral);
}

.waveform-wrap input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.audio-time,
.speed-button {
  flex: none;
  color: #8d8f87;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.speed-button {
  padding: 4px 6px;
  background: transparent;
  border: 0;
  border-radius: 5px;
}

.speed-button:hover {
  background: #ece8df;
}

#audioElement {
  display: none;
}

.format-toolbar {
  position: sticky;
  top: -29px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 2px;
  width: max-content;
  margin: 0 0 18px -7px;
  padding: 4px;
  background: rgba(251, 250, 246, 0.9);
  border: 1px solid transparent;
  border-radius: 8px;
  opacity: 0.58;
  backdrop-filter: blur(8px);
  transition: 160ms ease;
}

.note-page:focus-within .format-toolbar,
.format-toolbar:hover {
  border-color: var(--line);
  opacity: 1;
}

.format-toolbar button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 27px;
  padding: 0;
  color: #777970;
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-family: var(--serif);
  font-size: 10px;
}

.format-toolbar button:hover,
.format-toolbar button.is-active {
  color: var(--ink);
  background: #efede6;
}

.format-toolbar svg {
  width: 14px;
  height: 14px;
}

.format-toolbar > span {
  width: 1px;
  height: 14px;
  margin: 0 3px;
  background: var(--line);
}

.note-body {
  min-height: 320px;
  color: #3f413c;
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 2;
  outline: 0;
}

.note-body > :first-child {
  margin-top: 0;
}

.note-body p {
  margin: 0 0 13px;
}

.note-body h2 {
  margin: 27px 0 9px;
  color: #292a26;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.note-body ul,
.note-body ol {
  padding-left: 20px;
}

.note-body li {
  margin: 5px 0;
  padding-left: 3px;
}

.note-body blockquote {
  position: relative;
  margin: 24px 0;
  padding: 10px 18px;
  color: #5b5a52;
  background: #f5f1e8;
  border-left: 2px solid #c3a06c;
  font-style: italic;
}

.note-body strong {
  color: #282925;
}

.note-body em {
  color: #70736b;
}

.check-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 9px 0;
  line-height: 1.7;
}

.check-line > span:first-child {
  display: grid;
  width: 15px;
  height: 15px;
  flex: none;
  place-items: center;
  margin-top: 6px;
  color: transparent;
  border: 1px solid #c9c5bb;
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1;
}

.check-line.is-checked > span:first-child {
  color: white;
  background: var(--sage);
  border-color: var(--sage);
}

.check-line.is-checked {
  color: #9a9b94;
  text-decoration: line-through;
}

.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 38px;
  padding-top: 16px;
  color: #a2a39b;
  border-top: 1px solid #eeeae1;
  font-size: 8.5px;
}

.note-footer button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  color: #91938b;
  background: none;
  border: 0;
  font-size: 8.5px;
}

.note-footer button:hover {
  color: var(--ink);
}

.note-footer svg {
  width: 13px;
  height: 13px;
}

.ai-pane {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #efede7;
  border-left: 1px solid #dedad1;
}

.ai-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 0 19px;
  border-bottom: 1px solid rgba(215, 211, 202, 0.75);
}

.ai-orb {
  position: relative;
  display: grid;
  width: 33px;
  height: 33px;
  flex: none;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 33% 25%, rgba(255, 255, 255, 0.9), transparent 18%),
    linear-gradient(145deg, #deb6a3, #a6b8a3);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 11px;
  box-shadow: 0 6px 14px rgba(86, 93, 80, 0.12);
}

.ai-orb i {
  position: absolute;
  width: 15px;
  height: 1px;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 4px;
  transform: rotate(-35deg);
}

.ai-orb i:nth-child(1) {
  transform: rotate(-35deg) translateY(-5px);
}

.ai-orb i:nth-child(2) {
  transform: rotate(35deg);
}

.ai-orb i:nth-child(3) {
  transform: rotate(-35deg) translateY(5px);
}

.ai-heading > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.ai-heading p {
  margin: 0;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ai-heading span {
  color: #96978f;
  font-size: 8.5px;
}

.ai-heading .icon-button {
  width: 28px;
  height: 28px;
  background: transparent;
  border-color: transparent;
  transform: rotate(180deg);
}

.ai-content {
  flex: 1;
  min-height: 0;
  padding: 18px 17px 20px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #d4d0c6 transparent;
}

.ai-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  color: #989991;
  font-size: 8.5px;
}

.ai-notice svg {
  width: 13px;
  height: 13px;
  color: #7d8e7d;
}

.ai-summary-card {
  padding: 15px;
  background: rgba(255, 254, 250, 0.83);
  border: 1px solid #e3dfd5;
  border-radius: 12px;
  box-shadow: 0 6px 17px rgba(52, 50, 43, 0.045);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #43453f;
  font-size: 10px;
  font-weight: 600;
}

.spark-icon,
.plain-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #a46052;
  background: #f6e6e0;
  border-radius: 6px;
}

.plain-icon {
  color: #786f60;
  background: #eee9df;
}

.plain-icon.accent-green {
  color: var(--sage);
  background: var(--sage-soft);
}

.spark-icon svg,
.plain-icon svg {
  width: 13px;
  height: 13px;
}

.tiny-icon {
  display: grid;
  width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0;
  place-items: center;
  color: #a3a49c;
  background: none;
  border: 0;
  border-radius: 5px;
}

.tiny-icon:hover {
  color: var(--ink);
  background: #f1eee7;
}

.tiny-icon svg {
  width: 13px;
  height: 13px;
}

.ai-summary-card > p {
  margin: 12px 0 11px;
  color: #565851;
  font-family: var(--serif);
  font-size: 11.5px;
  line-height: 1.85;
}

.ai-confidence {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #a1a29a;
  font-size: 8px;
}

.ai-confidence i {
  width: 4px;
  height: 4px;
  background: #7fa085;
  border-radius: 50%;
}

.insight-section {
  margin-top: 21px;
}

.count-pill {
  display: grid;
  width: 17px;
  height: 17px;
  margin-left: auto;
  place-items: center;
  color: #9c675a;
  background: #f3e3de;
  border-radius: 99px;
  font-size: 8px;
}

.count-pill.green {
  color: #67806d;
  background: #e1ebe3;
}

.key-points {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: points;
}

.key-points li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  align-items: start;
  margin-bottom: 10px;
  color: #5e6059;
  font-size: 9.5px;
  line-height: 1.65;
  counter-increment: points;
}

.key-points li::before {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  margin-top: 1px;
  color: #817b70;
  background: #e8e3d9;
  border-radius: 5px;
  content: counter(points, decimal-leading-zero);
  font-size: 7px;
  font-weight: 600;
}

.key-points strong {
  color: #373934;
  font-weight: 600;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}

.todo-item {
  display: grid;
  grid-template-columns: 17px 1fr auto;
  gap: 7px;
  align-items: start;
  padding: 9px 9px 9px 10px;
  color: #585a53;
  background: rgba(255, 254, 250, 0.62);
  border: 1px solid #e4e0d7;
  border-radius: 8px;
  font-size: 9px;
  line-height: 1.45;
  cursor: pointer;
}

.todo-item:hover {
  background: var(--white);
}

.todo-check {
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  margin-top: 0;
  color: transparent;
  border: 1px solid #c7c5bd;
  border-radius: 4px;
  font-size: 9px;
}

.todo-item.is-done .todo-check {
  color: #fff;
  background: var(--sage);
  border-color: var(--sage);
}

.todo-item.is-done .todo-text {
  color: #9a9b94;
  text-decoration: line-through;
}

.todo-owner {
  align-self: center;
  padding: 2px 5px;
  color: #9a8270;
  background: #f1eae1;
  border-radius: 4px;
  font-size: 7px;
  white-space: nowrap;
}

.ai-quote {
  position: relative;
  margin: 23px 0 0;
  padding: 14px 15px 12px 31px;
  color: #62645d;
  background: linear-gradient(135deg, #eae5db, #eeeae2);
  border: 0;
  border-radius: 9px;
  font-family: var(--serif);
  font-size: 10.5px;
  font-style: italic;
  line-height: 1.7;
}

.ai-quote::before {
  position: absolute;
  top: 4px;
  left: 13px;
  color: #b5a48e;
  content: "“";
  font-size: 27px;
  font-style: normal;
}

.ai-quote cite {
  display: block;
  margin-top: 6px;
  color: #979991;
  font-family: var(--sans);
  font-size: 7.5px;
  font-style: normal;
}

.ai-bottom {
  padding: 12px 17px 16px;
  background: #efede7;
  border-top: 1px solid rgba(215, 211, 202, 0.8);
}

.ai-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  color: #9a9b93;
  font-size: 8px;
}

.ai-mode span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ai-mode span i {
  width: 4px;
  height: 4px;
  background: #80a189;
  border-radius: 50%;
}

.ai-mode button {
  width: 15px;
  height: 15px;
  padding: 0;
  color: #8c8e86;
  background: transparent;
  border: 1px solid #c9c7c0;
  border-radius: 50%;
  font-size: 8px;
}

.organize-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 37px;
  color: #f8f7f2;
  background: #45473f;
  border: 0;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(52, 54, 48, 0.12);
}

.organize-button:hover {
  background: #34362f;
}

.organize-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.organize-button svg {
  width: 14px;
  height: 14px;
}

.organize-button.is-busy svg {
  animation: spin 1.4s linear infinite;
}

.record-overlay {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  transition: 220ms ease;
}

.record-overlay.is-open {
  visibility: visible;
  opacity: 1;
}

.record-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 36, 32, 0.38);
  backdrop-filter: blur(7px);
}

.record-sheet {
  position: relative;
  width: min(580px, calc(100vw - 34px));
  padding: 28px 31px 23px;
  background: #fcfbf7;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(30, 31, 28, 0.25);
  transform: translateY(13px) scale(0.985);
  transition: 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.record-overlay.is-open .record-sheet {
  transform: translateY(0) scale(1);
}

.record-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.recording-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: var(--coral);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.recording-label > i {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(232, 91, 69, 0.35);
  animation: recordPulse 1.8s infinite;
}

.record-sheet h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.recording-timer {
  margin-top: 21px;
  color: #292b27;
  font-family: "Avenir Next", var(--sans);
  font-size: 43px;
  font-weight: 300;
  letter-spacing: 0.06em;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.recording-hint {
  margin: 7px 0 10px;
  color: #a1a29a;
  font-size: 9px;
  text-align: center;
}

.live-viz {
  position: relative;
  height: 86px;
  margin: 0 -2px 15px;
  overflow: hidden;
}

#liveCanvas {
  width: 100%;
  height: 100%;
}

.live-caption {
  position: absolute;
  right: 0;
  bottom: 1px;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #aaaba3;
  font-size: 8px;
}

.live-caption i {
  width: 4px;
  height: 4px;
  background: #7ea083;
  border-radius: 50%;
}

.live-transcript {
  min-height: 96px;
  padding: 13px 15px;
  background: #f3f1eb;
  border: 1px solid #e6e2d9;
  border-radius: 11px;
}

.live-transcript-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #777a72;
  font-size: 8.5px;
  font-weight: 600;
}

.language-pill {
  padding: 3px 6px;
  color: #93958d;
  background: #ebe8e1;
  border-radius: 4px;
  font-size: 7px;
  font-weight: 400;
}

.live-transcript-text {
  color: #4c4e48;
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.7;
}

.transcript-placeholder {
  color: #a7a8a0;
}

.interim-text {
  color: #95968e;
}

.record-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 31px;
  margin-top: 16px;
}

.record-secondary,
.record-main {
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
}

.record-secondary {
  width: 41px;
  height: 41px;
  color: #777a72;
  background: #f1efe9;
  border: 1px solid #dedbd2;
}

.record-secondary:hover {
  color: var(--ink);
  background: #e9e6de;
}

.record-secondary svg {
  width: 17px;
  height: 17px;
}

.record-main {
  width: 51px;
  height: 51px;
  background: var(--coral);
  border: 5px solid #f8dbd4;
  box-shadow: 0 0 0 1px #edb3a6;
}

.record-main:hover {
  background: var(--coral-dark);
}

.record-main span {
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 3px;
}

.resume-control {
  display: none;
}

#pauseRecording.is-paused .pause-control {
  display: none;
}

#pauseRecording.is-paused .resume-control {
  display: block;
}

.record-control-labels {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 6px;
  color: #a1a29a;
  font-size: 7.5px;
}

.popover {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 146px;
  padding: 7px;
  visibility: hidden;
  background: #fffefa;
  border: 1px solid #e2ded5;
  border-radius: 10px;
  box-shadow: 0 13px 40px rgba(44, 42, 36, 0.15);
  opacity: 0;
  transform: translateY(-4px);
  transition: 120ms ease;
}

.popover.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.popover > p {
  margin: 3px 7px 5px;
  color: #9a9b93;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.popover > button {
  padding: 7px 8px;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 6px;
  font-size: 9.5px;
}

.popover > button:hover {
  background: #f3f0e9;
}

.more-popover {
  width: 180px;
}

.more-popover button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.more-popover button svg {
  width: 15px;
  height: 15px;
}

.more-popover button.danger {
  color: #b55444;
}

.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  visibility: hidden;
  place-items: center;
  background: rgba(35, 36, 32, 0.32);
  opacity: 0;
  backdrop-filter: blur(5px);
  transition: 180ms ease;
}

.modal-backdrop.is-open {
  visibility: visible;
  opacity: 1;
}

.info-modal {
  width: min(610px, calc(100vw - 34px));
  max-height: calc(100vh - 50px);
  padding: 28px 30px;
  overflow: auto;
  background: #fcfbf7;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 17px;
  box-shadow: 0 28px 80px rgba(30, 31, 28, 0.22);
}

.modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.modal-top h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.transcript-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 8px;
  padding: 9px 12px;
  color: #8d8f87;
  background: #f2f0e9;
  border-radius: 8px;
  font-size: 8.5px;
}

.transcript-toolbar span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.transcript-toolbar i {
  width: 5px;
  height: 5px;
  background: #76a17b;
  border-radius: 50%;
}

.transcript-toolbar button {
  color: #777970;
  background: none;
  border: 0;
  font-size: 8.5px;
}

.transcript-body {
  max-height: min(450px, calc(100vh - 260px));
  overflow: auto;
}

.transcript-line {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 13px;
  padding: 13px 4px;
  border-bottom: 1px solid #ece8df;
}

.transcript-speaker {
  color: #9a7969;
  font-size: 8.5px;
  font-weight: 600;
}

.transcript-time {
  display: block;
  margin-top: 3px;
  color: #b1b1aa;
  font-size: 7px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.transcript-line p {
  margin: 0;
  color: #4e504a;
  font-family: var(--serif);
  font-size: 11.5px;
  line-height: 1.8;
}

.modal-footnote {
  margin: 15px 0 0;
  color: #a4a59d;
  font-size: 8px;
}

.compact-modal {
  width: min(450px, calc(100vw - 34px));
}

.info-copy {
  margin: 20px 0;
  color: #60625b;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.9;
}

.feature-list {
  display: grid;
  gap: 7px;
  margin-bottom: 22px;
}

.feature-list span {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #686a63;
  background: #f2f0e9;
  border-radius: 8px;
  font-size: 9.5px;
}

.feature-list i {
  color: #ad7e70;
  font-size: 7px;
  font-style: normal;
  font-weight: 600;
}

.modal-primary {
  width: 100%;
  height: 37px;
  color: white;
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  font-size: 10px;
}

.toast {
  position: fixed;
  z-index: 100;
  bottom: 25px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 145px;
  padding: 10px 15px 10px 10px;
  color: #f8f7f3;
  background: #33352f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 12px 35px rgba(38, 39, 35, 0.2);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-icon {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  color: #9ac1a0;
  background: rgba(113, 159, 121, 0.2);
  border-radius: 50%;
}

.toast-icon svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
}

.is-organizing .ai-summary-card > p,
.is-organizing .key-points li,
.is-organizing .todo-item {
  position: relative;
  color: transparent;
  border-radius: 4px;
}

.is-organizing .ai-summary-card > p {
  background: linear-gradient(90deg, #ebe7df 25%, #f6f3ed 40%, #ebe7df 55%);
  background-size: 300% 100%;
  animation: shimmer 1.2s infinite;
}

.is-organizing .key-points li::after,
.is-organizing .todo-item::after {
  position: absolute;
  top: 4px;
  right: 0;
  left: 28px;
  height: 10px;
  background: linear-gradient(90deg, #e9e5dd 25%, #f5f2ec 40%, #e9e5dd 55%);
  background-size: 300% 100%;
  border-radius: 4px;
  content: "";
  animation: shimmer 1.2s infinite;
}

.is-organizing .todo-item::after {
  left: 31px;
}

@keyframes recordPulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 91, 69, 0.35); }
  65% { box-shadow: 0 0 0 8px rgba(232, 91, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 91, 69, 0); }
}

@keyframes savePulse {
  50% { opacity: 0.3; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@keyframes newAudio {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 72px 280px minmax(440px, 1fr) 300px;
  }

  .app-shell.ai-collapsed {
    grid-template-columns: 72px 280px minmax(440px, 1fr);
  }

  .note-page {
    padding-right: 48px;
    padding-left: 48px;
  }

  .rail {
    padding-right: 8px;
    padding-left: 8px;
  }

  .rail-button.is-active::before {
    left: -9px;
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 72px 275px minmax(0, 1fr);
  }

  .app-shell.ai-collapsed {
    grid-template-columns: 72px 275px minmax(0, 1fr);
  }

  .ai-toggle {
    display: inline-flex;
  }

  .ai-pane {
    position: fixed;
    z-index: 25;
    top: 0;
    right: 0;
    bottom: 0;
    width: 318px;
    box-shadow: -16px 0 40px rgba(43, 42, 37, 0.12);
    transform: translateX(102%);
    transition: 220ms ease;
  }

  .app-shell.ai-open .ai-pane {
    transform: translateX(0);
  }

  .app-shell.ai-collapsed .ai-pane {
    display: flex;
  }
}

@media (max-width: 780px) {
  body {
    overflow: hidden;
  }

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

  .rail {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    height: 62px;
    flex-direction: row;
    padding: 5px 12px;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .brand-mark,
  .rail-bottom {
    display: none;
  }

  .rail-nav {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
  }

  .rail-button {
    width: 58px;
    min-height: 50px;
  }

  .rail-button.is-active::before {
    top: -6px;
    right: 16px;
    bottom: auto;
    left: 16px;
    width: auto;
    height: 2px;
    border-radius: 0 0 4px 4px;
  }

  .library {
    position: fixed;
    z-index: 30;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 330px);
    background: var(--paper);
    box-shadow: 15px 0 40px rgba(34, 35, 31, 0.18);
    transform: translateX(-102%);
    transition: 220ms ease;
  }

  .app-shell.library-open .library {
    transform: translateX(0);
  }

  .library::after {
    position: fixed;
    z-index: -1;
    inset: 0 0 0 100%;
    width: 100vw;
    visibility: hidden;
    background: rgba(28, 29, 26, 0.25);
    content: "";
    opacity: 0;
    transition: 220ms ease;
  }

  .app-shell.library-open .library::after {
    visibility: visible;
    opacity: 1;
  }

  .workspace {
    height: calc(100vh - 62px);
  }

  .topbar {
    height: 59px;
    min-height: 59px;
    padding: 0 15px;
  }

  .mobile-menu {
    display: grid;
    width: 30px;
    height: 30px;
    margin-left: -7px;
    padding: 0;
    place-items: center;
    color: var(--ink-soft);
    background: none;
    border: 0;
  }

  .mobile-menu svg {
    width: 19px;
    height: 19px;
  }

  .breadcrumb > span,
  .breadcrumb > svg {
    display: none;
  }

  .save-state,
  .top-icon,
  .ai-toggle span {
    display: none;
  }

  .ai-toggle {
    display: grid;
    width: 32px;
    height: 32px;
    padding: 0;
    place-items: center;
  }

  .record-button {
    width: 35px;
    height: 35px;
    padding: 0;
    justify-content: center;
    overflow: hidden;
    font-size: 0;
  }

  .editor-scroll {
    padding: 0 0 62px;
  }

  .note-page {
    min-height: calc(100% + 20px);
    padding: 30px 21px 26px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .note-title {
    font-size: 30px;
  }

  .audio-note {
    padding: 14px 13px 12px;
  }

  .format-toolbar {
    top: -30px;
  }

  .note-body {
    font-size: 14px;
    line-height: 1.95;
  }

  .record-sheet {
    width: calc(100vw - 18px);
    padding: 23px 19px 20px;
    border-radius: 18px;
  }

  .recording-timer {
    font-size: 38px;
  }

  .record-controls {
    gap: 34px;
  }

  .record-control-labels {
    gap: 49px;
  }

  .ai-pane {
    bottom: 62px;
    width: min(90vw, 340px);
  }

  .toast {
    bottom: 76px;
  }
}

@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;
  }
}
