:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --panel: #ffffff;
  --ink: #171916;
  --muted: #667064;
  --line: #d8ddd4;
  --accent: #176f65;
  --accent-ink: #ffffff;
  --soft: #e9f2ef;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  padding: 0 16px;
}

button.secondary,
.tabs button {
  background: var(--soft);
  color: var(--accent);
}

.shell {
  min-height: 100dvh;
}

.auth-view {
  display: grid;
  min-height: 100dvh;
  padding: 24px;
  place-items: center;
}

.auth-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.auth-panel h1,
.topbar h1 {
  margin: 0;
  letter-spacing: 0;
}

label,
.path-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 12px;
}

textarea {
  line-height: 1.55;
  resize: vertical;
}

.message {
  min-height: 22px;
  color: #a33a2a;
}

#appView {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 16px;
}

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

.advanced-link {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.quick-capture,
.tools,
.tabs,
.workspace {
  margin-top: 14px;
}

.quick-capture {
  display: grid;
  gap: 10px;
}

.tools {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  white-space: nowrap;
}

.tabs button.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 14px;
}

.note-list,
.editor {
  min-width: 0;
}

#noteList {
  display: grid;
  gap: 8px;
}

.note-item {
  width: 100%;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.note-item.active {
  border-color: var(--accent);
  background: var(--soft);
}

.note-title {
  display: block;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.note-meta,
.note-preview {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

.editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#saveState {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  #appView {
    padding: 12px;
  }

  .topbar {
    align-items: flex-end;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .note-list {
    max-height: 36dvh;
    overflow: auto;
  }

  #noteContent {
    min-height: 42dvh;
  }
}
