:root {
  color-scheme: light;
  --ink: #1e2724;
  --muted: #68736f;
  --line: #d9dfdc;
  --paper: #f7f8f4;
  --panel: #ffffff;
  --green: #2f7d5a;
  --blue: #3867b7;
  --gold: #b47b22;
  --rose: #b34d64;
  --teal: #14827b;
  --violet: #7460a8;
  --shadow: 0 18px 50px rgba(29, 37, 34, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    linear-gradient(rgba(247, 248, 244, 0.9), rgba(247, 248, 244, 0.9)),
    url("./paper-texture.svg");
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 22px;
  min-height: 100vh;
  padding: 24px;
}

.workspace,
.side-panel {
  min-width: 0;
}

.workspace,
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 0 4px;
  gap: 18px;
}

.kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.top-actions,
.cloud-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button,
.mini-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  font-size: 23px;
  box-shadow: 0 8px 18px rgba(29, 37, 34, 0.08);
}

.icon-button:hover,
.mini-button:hover,
.text-button:hover {
  border-color: #a9b4ae;
}

.danger {
  color: #983844;
}

.capture-panel,
.focus-card,
.cloud-card,
.summary-card,
.month-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.capture-panel,
.focus-card,
.cloud-card,
.summary-card,
.month-strip {
  padding: 18px;
}

.form-head,
.summary-head,
.month-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

label {
  display: block;
  font-size: 18px;
  font-weight: 800;
}

textarea,
input,
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfcf8;
  outline: none;
}

textarea {
  display: block;
  width: 100%;
  min-height: 150px;
  margin-top: 10px;
  resize: vertical;
  padding: 16px;
  line-height: 1.65;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 125, 90, 0.15);
}

.capture-controls {
  display: grid;
  grid-template-columns: minmax(142px, 1fr) minmax(118px, 0.8fr) auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.star-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: #fbfcf8;
  font-size: 14px;
  font-weight: 800;
}

.star-toggle input {
  min-height: 0;
  padding: 0;
}

.primary-button,
.text-button {
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  min-height: 42px;
  padding: 0 18px;
  color: white;
  background: var(--green);
}

.primary-button:hover {
  background: #256849;
}

.month-strip {
  flex-wrap: wrap;
}

.month-strip label {
  font-size: 14px;
}

.save-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0;
  border: 1px solid #cae2d1;
  border-radius: 8px;
  padding: 5px 10px;
  color: #266348;
  background: #eef8f1;
  font-size: 13px;
  font-weight: 800;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 12px;
  align-items: start;
}

.lane {
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.lane-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.lane-header h2 {
  font-size: 15px;
}

.lane-header output {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  background: #eef2ed;
  font-size: 12px;
  font-weight: 800;
}

.lane-mark {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.lane-mark.scene {
  background: var(--green);
}

.lane-mark.emotion {
  background: var(--rose);
}

.lane-mark.relationship {
  background: var(--violet);
}

.lane-mark.citywork {
  background: var(--blue);
}

.lane-mark.phrase {
  background: var(--gold);
}

.lane-mark.seed {
  background: var(--teal);
}

.lane-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.thought-card {
  position: relative;
  border: 1px solid #e1e6e0;
  border-radius: 8px;
  padding: 12px 12px 48px;
  background: var(--panel);
  line-height: 1.55;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mood-pill {
  border-radius: 999px;
  padding: 2px 7px;
  color: #743344;
  background: #f8eaf0;
}

.thought-card p {
  margin: 0;
  overflow-wrap: anywhere;
}

.card-actions {
  position: absolute;
  right: 9px;
  bottom: 9px;
  display: flex;
  gap: 6px;
}

.mini-button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--muted);
  background: #f7f8f4;
}

.star-button.active {
  color: #9c6a16;
  background: #fff5d8;
}

.focus-card ol {
  margin: 16px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.9;
}

.cloud-card {
  display: grid;
  gap: 10px;
}

.cloud-card input {
  width: 100%;
}

.cloud-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.summary-card {
  min-height: 0;
  flex: 1;
}

.text-button {
  min-height: 34px;
  padding: 7px 12px;
  color: var(--green);
  background: #eef6f1;
}

pre {
  min-height: 360px;
  max-height: calc(100vh - 520px);
  margin: 12px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcf8;
  color: #34403b;
  line-height: 1.6;
}

.empty-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  pre {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 16px;
  }

  .topbar,
  .form-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    align-self: stretch;
  }

  .icon-button {
    flex: 1;
  }

  .capture-controls {
    grid-template-columns: 1fr;
  }

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

  .primary-button {
    width: 100%;
  }
}
