:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --card: #fffefa;
  --ink: #25231f;
  --muted: #8a857b;
  --line: #e8e3d9;
  --accent: #d86b45;
  --accent-dark: #b94f2f;
  --tag: #f4e4d9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

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

button, textarea, input { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 72px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
}

h1 { margin: 0; font-size: 32px; letter-spacing: -.04em; }

.capture-badge {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 254, 250, .72);
  font-size: 12px;
}

.capture-badge.connected {
  border-color: #cfe0d1;
  color: #56745c;
  background: #f1f8f1;
}

.access-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -4px 0 18px;
  padding: 14px 16px;
  border: 1px solid #ecd6c8;
  border-radius: 12px;
  background: #fff4ed;
  color: #8b563f;
  font-size: 13px;
}

.access-panel strong { color: #6f3e2b; }
.access-panel p { margin: 4px 0 0; color: #a16e58; font-size: 12px; }
.access-form { display: flex; flex: 0 0 min(330px, 45%); gap: 8px; }
.access-form input {
  min-width: 0;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e6c8b7;
  border-radius: 8px;
  outline: 0;
  background: #fffefa;
}

.composer-panel {
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(51, 43, 30, .04);
}

.section-label {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

textarea {
  display: block;
  width: 100%;
  min-height: 118px;
  padding: 0;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  line-height: 1.75;
}

textarea::placeholder { color: #b2aca1; }

.composer-footer, .composer-actions, .timeline-heading, .timeline-tools {
  display: flex;
  align-items: center;
}

.composer-footer { justify-content: space-between; gap: 12px; }
.composer-actions { gap: 8px; }
.status { min-height: 20px; color: #6c8972; font-size: 13px; }
.status.error { color: #b94f4f; }

.button {
  padding: 9px 17px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 14px;
  transition: .15s ease;
}

.button-primary { background: var(--accent); color: white; }
.button-primary:hover { background: var(--accent-dark); }
.button-primary:disabled { opacity: .55; cursor: wait; }
.button-quiet { border-color: var(--line); background: transparent; color: var(--muted); }
.button-quiet:hover { color: var(--ink); }

.timeline-section { margin-top: 34px; }
.timeline-heading { justify-content: space-between; margin: 0 4px 12px; color: #615b51; font-size: 14px; font-weight: 650; }
.timeline-tools { gap: 10px; }
.note-count { color: var(--muted); font-weight: 400; }
.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font-size: 12px;
}
.text-button:hover { text-decoration: underline; }
.text-button:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }

.history-list { display: grid; gap: 10px; }
.history-item {
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
}
.history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
}
.history-content {
  margin: 0;
  color: var(--ink);
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.history-status {
  padding: 3px 7px;
  border-radius: 999px;
  background: #f4eee6;
  color: #8b7764;
  white-space: nowrap;
}
.history-status.processed { background: #eef6ee; color: #64806a; }

.empty-state {
  padding: 48px 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.capture-info { display: grid; gap: 8px; line-height: 1.7; }
.capture-info strong { color: #615b51; font-weight: 650; }
.hidden { display: none !important; }

@media (max-width: 600px) {
  .app-shell { width: min(100% - 22px, 760px); padding-top: 24px; }
  .topbar { align-items: flex-start; gap: 12px; }
  .access-panel { align-items: stretch; flex-direction: column; gap: 11px; }
  .access-form { flex-basis: auto; }
  .composer-panel { padding: 17px; }
  .capture-badge { margin-top: 4px; }
  .history-item { padding: 15px; }
}
