/* Planner styles. */

.planner-head {
  margin-bottom: 16px;
}
.save-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.save-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}
.save-state.saving i {
  background: var(--yellow);
}
.planner-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  height: calc(100vh - 150px);
  min-height: 560px;
}
.editor-panel,
.preview-panel {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.planner-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--surface2);
}
.planner-toolbar button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-width: 32px;
  height: 30px;
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.planner-toolbar button:hover {
  background: var(--surface);
  color: var(--green);
}
.planner-toolbar > span {
  flex: 1;
}
.planner-toolbar .template-btn {
  color: var(--green);
  width: auto;
  padding: 0 10px;
  background: var(--green-soft);
}
#planEditor {
  flex: 1;
  resize: none;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  padding: 24px;
  font:
    14px/1.8 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  color: var(--text);
  outline: none;
}
.editor-foot,
.preview-head {
  height: 46px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.preview-head {
  border-top: 0;
  border-bottom: 1px solid var(--line);
  height: 53px;
}
.preview-head span {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}
.preview-head small {
  letter-spacing: 0.12em;
}
.markdown-body {
  padding: 26px 30px;
  overflow: auto;
  line-height: 1.75;
  font-size: 14px;
}
.markdown-body h1 {
  font-size: 27px;
  margin: 0 0 22px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}
.markdown-body h2 {
  font-size: 19px;
  margin: 28px 0 12px;
}
.markdown-body h3 {
  font-size: 16px;
  margin: 22px 0 10px;
}
.markdown-body p {
  margin: 10px 0;
}
.markdown-body ul {
  padding-left: 22px;
}
.markdown-body li {
  margin: 7px 0;
}
.markdown-body blockquote {
  margin: 16px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--green);
  background: var(--green-soft);
  color: var(--muted);
  border-radius: 0 8px 8px 0;
}
.markdown-body code {
  background: var(--surface2);
  padding: 2px 5px;
  border-radius: 5px;
}
.markdown-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
.markdown-body input {
  accent-color: var(--green);
  margin-right: 8px;
}
.markdown-empty {
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}
.markdown-empty span {
  font-size: 30px;
  display: block;
  margin-bottom: 10px;
}
@media (max-width: 720px) {
  .sidebar nav {
    grid-template-columns: repeat(6, 1fr);
  }
  .planner-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .editor-panel,
  .preview-panel {
    height: 520px;
  }
  .planner-toolbar .template-btn {
    font-size: 10px;
  }
  .markdown-body {
    padding: 22px;
  }
  .planner-head p {
    max-width: 180px;
  }
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  min-width: 380px;
}
.markdown-body th,
.markdown-body td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.markdown-body th {
  background: var(--surface2);
  font-weight: 600;
  color: var(--text);
}
.markdown-body tbody tr:last-child td {
  border-bottom: 0;
}
.markdown-body tbody tr:hover {
  background: var(--green-soft);
}
.notebook-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - 150px);
  min-height: 560px;
}
.notebook-layout .planner-layout {
  height: 100%;
  min-height: 0;
}
.notes-sidebar {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.notes-head {
  height: 53px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.notes-head button {
  width: 29px;
  height: 29px;
  border: 0;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.notes-list {
  padding: 8px;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 4px;
}
.note-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 11px 8px 11px 11px;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.note-item:hover,
.note-item.active {
  background: var(--green-soft);
}
.note-item > span {
  min-width: 0;
  flex: 1;
}
.note-item b,
.note-item small {
  display: block;
}
.note-item b {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-item small {
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}
.note-item i {
  font-style: normal;
  color: var(--muted);
  opacity: 0;
  padding: 3px 5px;
  font-size: 16px;
}
.note-item:hover i {
  opacity: 1;
}
.notes-empty {
  padding: 28px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.notebook-layout .planner-layout {
  grid-template-columns: minmax(0, 1fr);
}
.format-tools {
  display: flex;
  gap: 5px;
}
.mode-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 2px;
  margin-left: 5px;
}
.planner-toolbar .mode-toggle button {
  height: 26px;
  width: auto;
  padding: 0 11px;
  border-radius: 6px;
}
.planner-toolbar .mode-toggle button.active {
  background: var(--green);
  color: #fff;
}
.note-preview {
  display: none;
  flex: 1;
  min-height: 0;
}
.note-workspace.preview-mode #planEditor {
  display: none;
}
.note-workspace.preview-mode .note-preview {
  display: block;
}
.note-workspace.preview-mode .format-tools,
.note-workspace.preview-mode .template-btn {
  display: none;
}

.note-calc {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface2);
  overflow: hidden;
}
.calc-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.calc-row:first-child,
.calc-note:first-child {
  border-top: 0;
}
.calc-row > span {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
}
.calc-row > span > i {
  font-style: normal;
  opacity: 0.75;
}
.calc-row > b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.calc-row.error > b {
  color: var(--orange);
  font-weight: 500;
  font-size: 12px;
}
.calc-note {
  padding: 10px 14px 2px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.note-block-error {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 12px;
}
.note-chart {
  margin: 16px 0;
  padding: 16px 16px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface2);
}
.note-chart > figcaption {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}
.note-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--muted);
}
.note-chart-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}
.note-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.nc-grid {
  stroke: var(--line);
  stroke-width: 1;
}
.nc-axis-line {
  stroke: var(--muted);
  stroke-width: 1;
  opacity: 0.5;
}
.nc-axis {
  fill: var(--muted);
  font-size: 11px;
  font-family: inherit;
}
.nc-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.nc-dot {
  stroke: var(--surface2);
  stroke-width: 2;
}
.nc-bar {
  stroke: var(--surface2);
  stroke-width: 1;
}
.nc-dot:hover,
.nc-bar:hover {
  opacity: 0.78;
}
.note-chart-data {
  margin-top: 8px;
  font-size: 12px;
}
.note-chart-data > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  padding: 4px 0;
}
.note-chart-data table {
  font-size: 12px;
}
.planner-toolbar [data-md-block] {
  font-size: 13px;
}
