:root {
  --paper: #f1f0eb;
  --paper-deep: #e6e4dc;
  --sheet: #fbfaf6;
  --ink: #17201e;
  --muted: #68716d;
  --faint: #969d98;
  --line: #d6d8d1;
  --line-strong: #bec3bb;
  --accent: #d54b2a;
  --accent-deep: #a93419;
  --accent-soft: #f7ddd4;
  --green: #48735b;
  --green-soft: #dfeae2;
  --amber: #ad6d18;
  --amber-soft: #f4e5c9;
  --red: #a94035;
  --red-soft: #f2dbd7;
  --blue: #456780;
  --blue-soft: #dce7ed;
  --shadow: 0 18px 55px rgb(57 46 31 / 10%);
  --shadow-small: 0 8px 24px rgb(57 46 31 / 10%);
  --ui-type: "IBM Plex Mono", "JetBrains Mono", monospace;
  --source-type: "Iosevka Charon Mono", Iosevka, "IBM Plex Mono", "JetBrains Mono", monospace;
  --type: var(--ui-type);
  --serif: var(--type);
  --sans: var(--type);
  --mono: var(--type);
  --topbar-height: 64px;
  --sidebar-width: 276px;
  --editor-toolbar-top: calc(100dvh - 52px);
  color-scheme: light;
  font-family: var(--sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ui-icon {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  background: var(--sheet);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: color-mix(in srgb, var(--accent) 64%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-soft) 74%, transparent);
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.eyebrow--warning {
  color: var(--red);
}

kbd {
  display: inline-flex;
  min-width: 21px;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 4px;
  background: color-mix(in srgb, var(--sheet) 78%, var(--paper));
  box-shadow: 0 1px 0 var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1;
}

.button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--sheet);
  font-size: 13px;
  font-weight: 680;
  transition: transform 100ms ease, border-color 140ms ease, background 140ms ease;
}

a.button {
  text-decoration: none;
}

.button:hover:not(:disabled) {
  border-color: var(--muted);
}

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

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

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

.button--quiet {
  background: transparent;
}

.button--danger {
  border-color: color-mix(in srgb, var(--red) 50%, var(--line));
  background: var(--red-soft);
  color: var(--red);
}

.button--wide {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

.icon-button,
.mini-button,
.avatar-button,
.brand-lockup,
.view-tab,
.sync-chip,
.dialog-close,
.template-tab,
.mobile-nav button,
.mobile-editor-tools button,
.outline-node,
.file-item,
.conflict-link,
.agenda-card__title,
.todo-state {
  border: 0;
  background: transparent;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: 18px;
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--sheet);
  color: var(--ink);
}

.history-button {
  width: 42px;
  height: 42px;
}

.history-button .ui-icon {
  width: 25px;
  height: 25px;
  stroke-width: 2;
}

.mini-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 17px;
}

.mini-button:hover {
  border-color: var(--line-strong);
  background: var(--sheet);
  color: var(--ink);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.brand-star {
  display: inline-grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}

.login-view {
  display: grid;
  min-height: 100%;
  grid-template-columns: minmax(360px, 520px) 1fr;
  background: var(--paper);
}

.login-card {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 8vw, 110px);
  border-right: 1px solid var(--line);
  background: var(--sheet);
}

.brand-lockup--login {
  margin-bottom: clamp(55px, 11vh, 110px);
  font-size: 23px;
}

.login-card h1 {
  max-width: 380px;
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(43px, 5vw, 64px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.login-copy {
  max-width: 390px;
  margin: 0 0 32px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.65;
}

.login-form {
  display: grid;
  max-width: 380px;
  gap: 18px;
}

.login-form label,
.dialog-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.login-form input,
.dialog-card input,
.dialog-card select {
  width: 100%;
  height: 45px;
  padding: 0 12px;
}

.login-footnote {
  max-width: 380px;
  margin: 20px 0 0;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.5;
}

.form-error {
  min-height: 17px;
  margin: -5px 0 0;
  color: var(--red);
  font-size: 12px;
  line-height: 1.4;
}

.login-texture {
  position: relative;
  display: grid;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 23%, rgb(217 85 50 / 9%), transparent 29%),
    linear-gradient(90deg, transparent 0 49px, rgb(77 68 54 / 4%) 50px),
    linear-gradient(rgb(77 68 54 / 4%) 0 1px, transparent 1px);
  background-size: auto, 50px 50px, 50px 50px;
}

.login-texture::before {
  position: absolute;
  width: min(64vw, 800px);
  aspect-ratio: 1;
  border: 1px solid rgb(104 91 70 / 12%);
  border-radius: 50%;
  content: "";
}

.ghost-outline {
  position: relative;
  display: grid;
  width: min(64%, 650px);
  gap: clamp(20px, 3.5vh, 38px);
  transform: rotate(-3deg);
  color: rgb(57 51 43 / 34%);
  font-family: var(--mono);
  font-size: clamp(15px, 1.45vw, 22px);
  line-height: 1.3;
}

.ghost-outline span:nth-child(2),
.ghost-outline span:nth-child(3) {
  padding-left: 7%;
}

.ghost-outline span:nth-child(4) {
  padding-left: 14%;
}

.app {
  height: 100dvh;
  overflow: hidden;
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(16px);
}

.topbar__left,
.topbar__right {
  display: flex;
  align-items: center;
}

.topbar__left {
  gap: 30px;
}

.topbar__right {
  gap: 10px;
}

.view-tabs {
  display: flex;
  align-self: stretch;
  gap: 4px;
}

.view-tab {
  position: relative;
  display: flex;
  min-width: 76px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.view-tab::after {
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 2px;
  background: transparent;
  content: "";
}

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

.view-tab.is-active::after {
  background: var(--accent);
}

.count-badge {
  min-width: 19px;
  padding: 2px 5px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 9px;
}

.sync-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.sync-chip:hover {
  border-color: var(--line-strong);
  background: var(--sheet);
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}

.sync-chip.is-clean .sync-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.sync-chip.is-pending .sync-dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft);
}

.sync-chip.is-error .sync-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.sync-chip.is-syncing .sync-dot {
  animation: pulse 1s ease-in-out infinite;
  background: var(--blue);
}

@keyframes pulse {
  50% { opacity: 0.3; transform: scale(0.7); }
}

.button--capture {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 5px;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--sheet);
}

.avatar-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 750;
}

.workspace {
  position: relative;
  display: grid;
  height: calc(100dvh - var(--topbar-height));
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: relative;
  z-index: 12;
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 82%, var(--sheet));
}

.sidebar__top {
  padding: 20px 16px 12px;
}

.section-heading,
.git-card__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-heading {
  margin: 0 3px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-field {
  position: relative;
  display: flex;
  height: 38px;
  align-items: center;
}

.search-field > span[aria-hidden] {
  position: absolute;
  left: 11px;
  z-index: 1;
  color: var(--faint);
  font-size: 18px;
}

.search-field input {
  width: 100%;
  height: 100%;
  padding: 0 43px 0 34px;
  background: color-mix(in srgb, var(--sheet) 60%, transparent);
  font-size: 12px;
}

.search-field kbd {
  position: absolute;
  right: 8px;
}

.file-list {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 9px 14px;
  scrollbar-width: thin;
}

.file-group-label {
  padding: 15px 9px 6px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.file-item {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 9px 9px;
  border-radius: 7px;
  color: var(--muted);
  text-align: left;
}

.file-item:hover {
  background: color-mix(in srgb, var(--sheet) 68%, transparent);
  color: var(--ink);
}

.file-item.is-active {
  background: var(--sheet);
  box-shadow: inset 2px 0 var(--accent), 0 1px 6px rgb(57 46 31 / 5%);
  color: var(--ink);
}

.file-copy {
  min-width: 0;
}

.file-title {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-path {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-age {
  color: var(--faint);
  font-size: 9px;
}

.sidebar-empty {
  margin: auto 24px;
  color: var(--muted);
  text-align: center;
}

.sidebar-empty .empty-mark {
  display: block;
  color: var(--accent);
  font-family: var(--serif);
  margin-bottom: 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.sidebar-empty strong {
  font-family: var(--serif);
  font-size: 17px;
}

.sidebar-empty p {
  margin: 7px 0;
  font-size: 11px;
  line-height: 1.5;
}

.git-card {
  margin: 8px 10px 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--sheet) 62%, transparent);
}

.git-card strong {
  display: block;
  max-width: 165px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-button--sync {
  font-size: 15px;
}

.mini-button--sync.is-syncing {
  animation: rotate 1s linear infinite;
}

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

.git-summary {
  min-height: 30px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.git-summary.is-error {
  color: var(--red);
}

.conflict-link {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 0 9px;
  border-radius: 5px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
}

.main {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.view-panel {
  display: none;
  height: 100%;
}

.view-panel.is-active {
  display: block;
}

.editor-view {
  background: var(--paper);
}

.welcome-state {
  display: flex;
  width: min(610px, calc(100% - 80px));
  height: 100%;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  margin: auto;
}

.welcome-state h1 {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: clamp(48px, 6vw, 82px);
  font-weight: 450;
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.welcome-state > p:not(.eyebrow) {
  max-width: 470px;
  margin: 0 0 28px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.65;
}

.document {
  display: grid;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.document-bar {
  display: flex;
  min-height: 79px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 22px 12px 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 91%, transparent);
}

.document-identity {
  min-width: 0;
}

.focus-chip {
  display: flex;
  min-width: 0;
  max-width: min(34vw, 360px);
  height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 650;
}

.focus-chip .ui-icon {
  width: 16px;
  height: 16px;
}

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

.document-path {
  overflow: hidden;
  margin: 0 0 4px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-identity h1 {
  overflow: hidden;
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 550;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
}

.save-state {
  margin-right: 4px;
  color: var(--muted);
  font-size: 10px;
}

.save-state.is-dirty {
  color: var(--amber);
}

.save-state.is-error {
  color: var(--red);
}

.editor-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 245px;
  background: var(--sheet);
}

.editor-layout.outline-hidden {
  grid-template-columns: minmax(0, 1fr) 0;
}

.source-pane {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 31px minmax(0, 1fr);
}

.source-ruler {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.editor-mode-tabs {
  display: flex;
  height: 23px;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
}

.editor-mode-tabs button {
  min-height: 17px;
  padding: 0 8px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.editor-mode-tabs button.is-active {
  background: var(--sheet);
  box-shadow: 0 1px 3px rgb(29 39 36 / 10%);
  color: var(--ink);
}

.source-editor-stack {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 0 51px, color-mix(in srgb, var(--accent) 9%, transparent) 52px, transparent 53px),
    var(--sheet);
}

.source-editor-stack > * {
  grid-area: 1 / 1;
}

.org-highlight,
.org-editor {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 25px clamp(22px, 4.5vw, 70px) 80px;
  border: 0;
  border-radius: 0;
  font-family: var(--source-type);
  font-size: 14px;
  font-variant-ligatures: none;
  line-height: 1.75;
  overflow-wrap: break-word;
  tab-size: 2;
  white-space: pre-wrap;
}

.org-highlight {
  z-index: 0;
  overflow: auto;
  background: transparent;
  color: var(--ink);
  pointer-events: none;
  scrollbar-width: none;
}

.org-highlight::-webkit-scrollbar {
  display: none;
}

.org-editor {
  position: relative;
  z-index: 1;
  resize: none;
  overflow: auto;
  background: transparent;
  caret-color: var(--accent);
  color: transparent;
  -webkit-text-fill-color: transparent;
  outline: none;
}

.org-editor::selection {
  background: color-mix(in srgb, var(--blue-soft) 82%, transparent);
}

.org-editor:focus {
  border: 0;
  box-shadow: none;
}

.org-syntax-stars,
.org-syntax-list,
.org-syntax-directive {
  color: var(--accent);
}

.org-syntax-heading {
  color: var(--ink);
}

.org-syntax-todo,
.org-syntax-priority {
  color: var(--amber);
}

.org-syntax-tags,
.org-syntax-property,
.org-syntax-comment,
.org-syntax-fold {
  color: var(--faint);
}

.org-syntax-link,
.org-syntax-timestamp {
  color: var(--blue);
}

.org-syntax-code,
.org-syntax-block,
.org-syntax-table {
  color: var(--green);
}

.org-syntax-emphasis {
  color: var(--accent-deep);
}

.org-reading {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: clamp(34px, 6vw, 78px) clamp(22px, 9vw, 130px) 110px;
  background: var(--sheet);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.8;
}

.org-reading > * {
  max-width: 820px;
  margin-right: auto;
  margin-left: auto;
}

.org-reading h1,
.org-reading h2,
.org-reading h3,
.org-reading h4,
.org-reading h5,
.org-reading h6 {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 2em;
  margin-bottom: 0.65em;
  color: var(--ink);
  font-weight: 720;
  letter-spacing: -0.025em;
  line-height: 1.25;
  scroll-margin-top: 24px;
}

.org-reading h1:first-child,
.org-reading h2:first-child {
  margin-top: 0;
}

.org-reading .org-document-title {
  padding-bottom: 0.55em;
  border-bottom: 1px solid var(--line);
  font-size: clamp(30px, 5vw, 52px);
}

.org-reading h2 { font-size: 27px; }
.org-reading h3 { font-size: 21px; }
.org-reading h4 { font-size: 17px; }
.org-reading h5,
.org-reading h6 { font-size: 15px; }

.org-reading [data-source-line] {
  cursor: pointer;
}

.org-reading [data-source-line]:hover > span:not(.org-render-tags),
.org-reading [data-source-line]:focus-visible > span:not(.org-render-tags) {
  color: var(--accent-deep);
}

.org-reading p {
  margin-top: 0;
  margin-bottom: 1.15em;
}

.org-reading a {
  color: var(--blue);
  text-decoration-color: color-mix(in srgb, var(--blue) 40%, transparent);
  text-underline-offset: 3px;
}

.org-reading code,
.org-reading time {
  padding: 0.12em 0.32em;
  border-radius: 3px;
  background: var(--paper);
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.9em;
}

.org-reading .org-block {
  padding: 18px 20px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  line-height: 1.6;
}

.org-reading .org-block code {
  padding: 0;
  background: transparent;
}

.org-reading blockquote {
  padding: 2px 0 2px 20px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.org-reading ul,
.org-reading ol {
  padding-left: 1.7em;
}

.org-checkbox {
  margin-right: 0.55em;
  color: var(--accent);
}

.org-render-todo,
.org-render-priority,
.org-render-tags span {
  flex: none;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.org-render-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}

.org-render-tags span {
  background: var(--blue-soft);
  color: var(--blue);
}

.org-table-wrap {
  overflow-x: auto;
}

.org-reading table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.org-reading th,
.org-reading td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
}

.org-reading th {
  background: var(--paper);
}

.org-reading hr {
  margin-top: 2.4em;
  margin-bottom: 2.4em;
  border: 0;
  border-top: 1px solid var(--line-strong);
}

.org-reading-empty,
.org-unsafe-link {
  color: var(--faint);
}

.document.is-reading .mobile-editor-tools {
  display: none;
}

.outline-pane {
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 62%, var(--sheet));
  transition: opacity 160ms ease;
}

.editor-layout.outline-hidden .outline-pane {
  opacity: 0;
  pointer-events: none;
}

.outline-heading {
  display: flex;
  height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.outline-heading__title {
  display: flex;
  align-items: center;
  gap: 5px;
}

.outline-focus {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
}

.outline-focus:hover:not(:disabled),
.outline-focus.is-active {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.outline-focus .ui-icon {
  width: 17px;
  height: 17px;
}

.outline-heading span:last-child {
  color: var(--faint);
  font-size: 8px;
  font-weight: 550;
  letter-spacing: 0;
  text-transform: none;
}

.outline-tree {
  height: calc(100% - 44px);
  overflow: auto;
  padding: 10px 8px 40px;
  scrollbar-gutter: stable;
}

.outline-node-wrap {
  --depth: 1;
  position: relative;
  width: max(100%, calc(150px + var(--depth) * 14px));
}

.outline-depth-2 { --depth: 2; }
.outline-depth-3 { --depth: 3; }
.outline-depth-4 { --depth: 4; }
.outline-depth-5 { --depth: 5; }
.outline-depth-6 { --depth: 6; }
.outline-depth-7 { --depth: 7; }
.outline-depth-8 { --depth: 8; }
.outline-depth-9 { --depth: 9; }
.outline-depth-10 { --depth: 10; }
.outline-depth-11 { --depth: 11; }
.outline-depth-12 { --depth: 12; }
.outline-depth-13 { --depth: 13; }
.outline-depth-14 { --depth: 14; }
.outline-depth-15 { --depth: 15; }
.outline-depth-16 { --depth: 16; }
.outline-depth-17 { --depth: 17; }
.outline-depth-18 { --depth: 18; }
.outline-depth-19 { --depth: 19; }
.outline-depth-20 { --depth: 20; }
.outline-depth-21 { --depth: 21; }
.outline-depth-22 { --depth: 22; }
.outline-depth-23 { --depth: 23; }
.outline-depth-24 { --depth: 24; }
.outline-depth-25 { --depth: 25; }
.outline-depth-26 { --depth: 26; }
.outline-depth-27 { --depth: 27; }
.outline-depth-28 { --depth: 28; }
.outline-depth-29 { --depth: 29; }
.outline-depth-30 { --depth: 30; }
.outline-depth-31 { --depth: 31; }
.outline-depth-32 { --depth: 32; }

.outline-node-wrap::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(10px + (var(--depth) - 1) * 14px);
  width: 1px;
  background: color-mix(in srgb, var(--line) 65%, transparent);
  content: "";
}

.outline-node {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 31px;
  grid-template-columns: 13px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  padding: 3px 6px 3px calc(5px + (var(--depth) - 1) * 14px);
  border-radius: 5px;
  color: var(--muted);
  text-align: left;
}

.outline-node:hover,
.outline-node.is-current {
  background: var(--sheet);
  color: var(--ink);
}

.outline-bullet {
  position: relative;
  z-index: 1;
  display: grid;
  width: 12px;
  height: 12px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--paper) 60%, var(--sheet));
  color: var(--accent);
  font-size: 11px;
}

.outline-label {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outline-label .outline-todo {
  margin-right: 4px;
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 8px;
}

.outline-empty {
  margin: 22px 15px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.5;
}

.outline-empty code {
  color: var(--accent);
  font-family: var(--mono);
}

.editor-footer {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 20px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--faint);
  font-size: 9px;
}

.editor-footer > div {
  display: flex;
  gap: 14px;
}

.editor-footer kbd {
  min-width: 17px;
  min-height: 16px;
  padding: 0 3px;
  font-size: 8px;
}

.mobile-editor-tools {
  display: none;
}

.agenda-view {
  overflow-y: auto;
  padding: clamp(28px, 5vw, 64px) clamp(24px, 7vw, 100px) 80px;
  background: var(--paper);
}

.agenda-header {
  display: flex;
  max-width: 1120px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto 28px;
}

.agenda-header h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(43px, 5vw, 68px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.agenda-range {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  color: var(--faint);
}

.agenda-range label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  text-transform: uppercase;
}

.agenda-range input {
  height: 36px;
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 10px;
}

.agenda-stats {
  display: grid;
  max-width: 1120px;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0 auto 28px;
}

.agenda-stat {
  min-height: 71px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--sheet) 60%, transparent);
}

.agenda-stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 550;
}

.agenda-stat span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.agenda-stat--overdue strong {
  color: var(--red);
}

.agenda-groups {
  display: grid;
  max-width: 1120px;
  gap: 28px;
  margin: auto;
}

.agenda-group {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
}

.agenda-group__label {
  padding-top: 13px;
}

.agenda-group__label strong {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 550;
}

.agenda-group__label span {
  color: var(--faint);
  font-size: 10px;
}

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

.agenda-card {
  display: grid;
  min-height: 67px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sheet);
  box-shadow: 0 2px 10px rgb(57 46 31 / 3%);
}

.agenda-card:hover {
  border-color: var(--line-strong);
}

.todo-state {
  min-width: 49px;
  padding: 5px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
}

.agenda-card__copy {
  min-width: 0;
}

.agenda-card__title {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-meta {
  display: flex;
  overflow: hidden;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  color: var(--faint);
  font-size: 9px;
  white-space: nowrap;
}

.agenda-kind {
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--paper);
  color: var(--muted);
  font-weight: 650;
  text-transform: capitalize;
}

.agenda-kind--deadline {
  background: var(--red-soft);
  color: var(--red);
}

.agenda-time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.agenda-empty,
.loading-state {
  padding: 70px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 17px;
  text-align: center;
}

.mobile-nav {
  display: none;
}

.mobile-only {
  display: none;
}

.dialog {
  width: min(680px, calc(100vw - 30px));
  max-height: min(850px, calc(100dvh - 30px));
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
}

.dialog--wide {
  width: min(1080px, calc(100vw - 30px));
}

.dialog::backdrop {
  background: rgb(28 26 22 / 56%);
  backdrop-filter: blur(3px);
}

.dialog-card {
  max-height: min(850px, calc(100dvh - 30px));
  padding: 25px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--sheet);
  box-shadow: var(--shadow);
}

.dialog-card--small {
  max-width: 520px;
  margin: auto;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.dialog-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 550;
  letter-spacing: -0.035em;
}

.dialog-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  font-size: 25px;
  line-height: 1;
}

.dialog-close:hover {
  background: var(--paper);
  color: var(--ink);
}

.dialog-card > label {
  margin: 16px 0;
}

.dialog-card label small {
  color: var(--faint);
  font-size: 10px;
  font-weight: 450;
}

.dialog-card label span em {
  color: var(--faint);
  font-size: 10px;
  font-style: normal;
  font-weight: 450;
}

.dialog-card textarea {
  width: 100%;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
}

.dialog-actions > div {
  display: flex;
  gap: 8px;
}

.dialog-actions--wrap {
  flex-wrap: wrap;
}

.dialog-copy {
  margin: -8px 0 18px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.55;
}

.template-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 7px;
  margin-bottom: 20px;
}

.template-tab {
  display: grid;
  min-height: 54px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-align: left;
}

.template-tab__key {
  display: inline-grid;
  min-width: 28px;
  height: 25px;
  place-items: center;
  padding: 0 6px;
  border: 1px solid currentcolor;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 9px;
  opacity: 0.72;
}

.template-tab__copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.template-tab__copy strong,
.template-tab__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-tab__copy strong {
  font-size: 11px;
}

.template-tab__copy small {
  color: var(--faint);
  font-size: 8px;
  font-weight: 550;
  text-transform: uppercase;
}

.capture-template-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--faint);
  font-family: var(--serif);
  text-align: center;
}

.template-tab:hover,
.template-tab.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.capture-title-field input {
  height: 51px;
  font-family: var(--serif);
  font-size: 18px;
}

.capture-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.capture-dynamic-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin: 16px 0;
}

.capture-dynamic-field {
  min-width: 0;
}

.capture-dynamic-field:first-child:nth-last-child(odd) {
  grid-column: 1 / -1;
}

.capture-dynamic-field__control {
  min-width: 0;
}

.template-description {
  min-height: 17px;
  margin: 9px 0 0;
  color: var(--faint);
  font-size: 10px;
}

.keyboard-note {
  color: var(--faint);
  font-size: 10px;
}

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

.merge-columns textarea,
.merge-result {
  min-height: 210px;
  font-family: var(--mono);
  font-size: 11px;
  white-space: pre;
}

.merge-result {
  min-height: 260px;
}

.conflict-file-list {
  display: grid;
  gap: 7px;
  margin: 8px 0 18px;
}

.conflict-file-button {
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
}

.conflict-file-button:hover,
.conflict-file-button.is-active {
  border-color: var(--red);
}

.resolution-file {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 18px 0 4px;
  color: var(--muted);
  font-size: 10px;
}

.resolution-file strong {
  color: var(--ink);
  font-family: var(--mono);
}

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

.toast-region {
  position: fixed;
  z-index: 100;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  width: min(340px, calc(100vw - 36px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  box-shadow: var(--shadow-small);
  color: var(--sheet);
  font-size: 11px;
  line-height: 1.45;
  animation: toast-in 180ms ease both;
}

.toast--error {
  background: var(--red);
}

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

@media (max-width: 960px) {
  :root {
    --sidebar-width: 245px;
  }

  .editor-layout {
    grid-template-columns: minmax(0, 1fr) 210px;
  }

  .agenda-view {
    padding-right: 35px;
    padding-left: 35px;
  }

  .agenda-group {
    grid-template-columns: 120px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-height: 56px;
  }

  body {
    overflow: hidden;
  }

  .login-view {
    display: block;
    overflow-y: auto;
  }

  .login-card {
    min-height: 100dvh;
    padding: max(32px, env(safe-area-inset-top)) 25px max(32px, env(safe-area-inset-bottom));
    border-right: 0;
  }

  .brand-lockup--login {
    margin-bottom: clamp(50px, 13vh, 100px);
  }

  .login-card h1 {
    font-size: 47px;
  }

  .login-texture {
    display: none;
  }

  .topbar {
    padding: 0 10px;
  }

  .topbar__left,
  .topbar__right {
    gap: 8px;
  }

  .topbar .brand-lockup > span:last-child,
  .view-tabs,
  .sync-chip > span:last-child,
  .button--capture span:last-child {
    display: none;
  }

  .button--capture {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .mobile-only {
    display: inline-grid;
  }

  .workspace {
    height: calc(100dvh - var(--topbar-height) - 61px - env(safe-area-inset-bottom));
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    top: var(--topbar-height);
    bottom: calc(61px + env(safe-area-inset-bottom));
    left: 0;
    width: min(86vw, 330px);
    border-right: 1px solid var(--line-strong);
    box-shadow: var(--shadow);
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 45;
    inset: var(--topbar-height) 0 calc(61px + env(safe-area-inset-bottom));
    background: rgb(28 26 22 / 38%);
  }

  .main {
    grid-column: 1;
  }

  .mobile-nav {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: calc(61px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(4, 1fr);
    padding: 4px 8px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--paper) 96%, transparent);
    backdrop-filter: blur(16px);
  }

  .mobile-nav button {
    display: flex;
    min-height: 52px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 9px;
  }

  .mobile-nav button span:first-child {
    font-size: 18px;
  }

  .mobile-nav button.is-active {
    color: var(--accent);
  }

  .document-bar {
    min-height: 67px;
    padding: 9px 12px 9px 16px;
  }

  .document-identity h1 {
    font-size: 19px;
  }

  .focus-chip {
    max-width: 38vw;
    padding: 0 8px;
  }

  .button--quiet#save-button {
    display: none;
  }

  .save-state {
    max-width: 76px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .editor-layout,
  .editor-layout.outline-hidden {
    display: block;
    position: relative;
  }

  .source-pane {
    height: 100%;
    grid-template-rows: 29px minmax(0, 1fr) auto;
  }

  .source-editor-stack {
    background: var(--sheet);
  }

  .org-highlight,
  .org-editor {
    padding: 18px 16px 100px;
    font-size: 16px;
    line-height: 1.72;
  }

  .org-editor {
    background: transparent;
  }

  .org-reading {
    padding: 30px 19px 90px;
    font-size: 14px;
  }

  .org-reading h2 { font-size: 23px; }
  .org-reading h3 { font-size: 19px; }

  .mobile-editor-tools {
    display: flex;
    min-height: 52px;
    max-width: 100vw;
    align-items: center;
    gap: 3px;
    padding: 5px 8px;
    overflow-x: auto;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    box-shadow: 0 -5px 18px rgb(23 32 30 / 6%);
    backdrop-filter: blur(16px);
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    touch-action: manipulation;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-editor-tools::-webkit-scrollbar {
    display: none;
  }

  .mobile-editor-tools button {
    display: grid;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    flex: none;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    transition: transform 80ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease;
  }

  .mobile-editor-tools button:not(:disabled):active,
  .mobile-editor-tools button.is-active {
    border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
    background: var(--accent-soft);
    color: var(--accent-deep);
    transform: scale(0.94);
  }

  .mobile-editor-tools .ui-icon {
    width: 22px;
    height: 22px;
    stroke-width: 1.9;
  }

  .mobile-editor-tools .tool-divider {
    width: 1px;
    height: 25px;
    flex: none;
    margin: 0 3px;
    background: var(--line);
  }

  .editor-keyboard-active .mobile-editor-tools {
    position: fixed;
    z-index: 70;
    top: var(--editor-toolbar-top);
    right: 0;
    left: 0;
    height: 52px;
    padding-right: max(8px, env(safe-area-inset-right));
    padding-left: max(8px, env(safe-area-inset-left));
    border-bottom: 0;
  }

  .editor-keyboard-active .mobile-nav {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
  }

  .outline-pane {
    position: absolute;
    z-index: 10;
    inset: 0;
    border-left: 0;
    background: var(--paper);
    opacity: 1;
    transform: translateX(0);
    transition: transform 180ms ease;
  }

  .editor-layout.outline-hidden .outline-pane {
    opacity: 1;
    transform: translateX(102%);
  }

  .outline-heading {
    height: 45px;
  }

  .outline-node {
    min-height: 43px;
    font-size: 12px;
  }

  .outline-label {
    font-size: 12px;
  }

  .editor-footer {
    display: none;
  }

  .welcome-state {
    width: calc(100% - 42px);
  }

  .welcome-state h1 {
    font-size: 52px;
  }

  .agenda-view {
    padding: 28px 16px 60px;
  }

  .agenda-header {
    display: block;
    margin-bottom: 19px;
  }

  .agenda-header h1 {
    font-size: 49px;
  }

  .agenda-range {
    margin-top: 21px;
    justify-content: space-between;
  }

  .agenda-range label {
    flex: 1;
  }

  .agenda-range input {
    width: 100%;
    min-width: 0;
    height: 42px;
  }

  .agenda-stats {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 24px;
  }

  .agenda-group {
    display: block;
  }

  .agenda-group__label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 0 2px 8px;
  }

  .agenda-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .agenda-time {
    grid-column: 2;
  }

  .dialog {
    width: 100vw;
    max-width: none;
    max-height: calc(100dvh - 12px);
    margin: auto 0 0;
  }

  .dialog-card {
    max-height: calc(100dvh - 12px);
    padding: 20px 17px max(18px, env(safe-area-inset-bottom));
    border-radius: 13px 13px 0 0;
  }

  .login-form input,
  .dialog-card input,
  .dialog-card textarea,
  .dialog-card select,
  .agenda-range input,
  .search-field input {
    font-size: 16px;
  }

  .dialog-heading h2 {
    font-size: 26px;
  }

  .capture-fields,
  .capture-dynamic-fields,
  .merge-columns {
    grid-template-columns: 1fr;
  }

  .capture-dynamic-field:first-child:nth-last-child(odd) {
    grid-column: auto;
  }

  .merge-columns textarea,
  .merge-result {
    min-height: 180px;
  }

  .keyboard-note {
    display: none;
  }

  .dialog-actions {
    align-items: stretch;
  }

  .dialog-actions > div {
    flex: 1;
  }

  .dialog-actions > div .button {
    flex: 1;
  }

  .toast-region {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

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

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1c1a;
    --paper-deep: #24231f;
    --sheet: #252522;
    --ink: #ece8de;
    --muted: #aaa499;
    --faint: #777269;
    --line: #3c3933;
    --line-strong: #514d45;
    --accent: #e26946;
    --accent-deep: #f08a68;
    --accent-soft: #482d26;
    --green: #78ad89;
    --green-soft: #293a2e;
    --amber: #d79a45;
    --amber-soft: #463823;
    --red: #e27769;
    --red-soft: #452c29;
    --blue: #7faac4;
    --blue-soft: #293944;
    --shadow: 0 18px 55px rgb(0 0 0 / 25%);
    --shadow-small: 0 8px 24px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }

  .button--primary {
    color: #1c1c1a;
  }

  .button--capture {
    background: var(--ink);
    color: var(--paper);
  }
}
