:root {
  color-scheme: light;
  --bg: #f5f4ef;
  --panel: #ffffff;
  --panel-soft: #f0eee7;
  --text: #202426;
  --muted: #687076;
  --line: #d9d6cc;
  --accent: #126b62;
  --accent-strong: #0a4f49;
  --warn: #b64b1f;
  --shadow: 0 18px 55px rgba(29, 35, 38, 0.12);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

button:hover {
  border-color: #a8a397;
}

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

button.primary:hover {
  background: var(--accent-strong);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 107, 98, 0.12);
}

.app-shell {
  min-height: 100vh;
}

.focus-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 244, 239, 0.94);
  backdrop-filter: blur(12px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 58vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.18rem;
}

h2 {
  font-size: 1rem;
}

.focus-actions,
.toolbar-actions,
.dialog-actions,
.inline-field,
.section-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  padding: 18px clamp(16px, 3vw, 34px) 28px;
}

.task-pane,
.inspector,
.capture-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.task-pane {
  height: calc(100vh - 132px);
  min-height: 560px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pane-toolbar,
.inspector-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.task-list {
  flex: 1;
  padding: 8px;
  overflow: auto;
}

.task-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto 18px;
  align-items: start;
  gap: 8px;
  min-height: 38px;
  border-radius: 8px;
  padding: 4px 8px;
  border: 1px solid transparent;
  text-align: left;
}

.task-row.dragging {
  opacity: 0.45;
}

.task-row:hover {
  background: #f7f6f1;
}

.task-row.selected {
  border-color: rgba(18, 107, 98, 0.32);
  background: #eaf3ef;
}

.task-row.done .task-text {
  color: var(--muted);
  padding-left: 18px;
}

.task-row.focused {
  box-shadow: inset 3px 0 0 var(--accent);
}

.task-check {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #fff;
  margin-top: 6px;
  cursor: pointer;
}

.task-row.done .task-check {
  background: var(--accent);
  border-color: var(--accent);
}

.task-text-input {
  min-width: 0;
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  padding: 4px 6px;
  background: transparent;
  box-shadow: none;
  resize: none;
  line-height: 1.45;
  overflow: hidden;
}

.task-text-input:focus {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(18, 107, 98, 0.16);
}

.task-row.done .task-text-input {
  color: var(--muted);
  padding-left: 18px;
}

.drag-handle {
  color: var(--muted);
  cursor: grab;
  padding-top: 4px;
  user-select: none;
}

.task-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  padding-top: 4px;
}

.badge {
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--panel-soft);
  color: var(--muted);
}

.badge.warn {
  background: #fff0e8;
  color: var(--warn);
}

.capture-card {
  margin: 8px;
  padding: 14px;
  box-shadow: none;
  flex: 0 0 auto;
}

.capture-card label,
.field-label,
.field-group label {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.capture-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.parse-chips,
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.parse-chip,
.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 0.83rem;
}

.parse-chip button,
.link-chip button {
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
}

.inspector {
  position: sticky;
  top: 86px;
  align-self: start;
  max-height: calc(100vh - 104px);
  overflow: auto;
}

.field-group {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.inline-field {
  align-items: stretch;
}

.meta-box {
  min-height: 36px;
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--panel-soft);
}

.muted,
.hint {
  color: var(--muted);
}

.hint {
  margin: 0;
  font-size: 0.86rem;
}

dialog {
  width: min(560px, calc(100vw - 28px));
  border: 0;
  border-radius: 10px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(22, 25, 26, 0.28);
}

.dialog-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.dialog-card.wide {
  width: min(760px, calc(100vw - 28px));
}

.dialog-actions {
  justify-content: flex-end;
}

.review-list {
  display: grid;
  gap: 10px;
}

.review-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.review-item button {
  margin-top: 10px;
}

.review-item strong {
  display: block;
  margin-bottom: 4px;
}

@media (max-width: 900px) {
  .focus-bar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .focus-bar {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    max-width: 100%;
  }

  .workspace {
    display: flex;
    flex-direction: column;
  }

  .inspector {
    position: static;
    max-height: none;
  }

  .focus-actions,
  .toolbar-actions {
    flex-wrap: wrap;
  }
}
