:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --panel: #fffdfa;
  --text: #24211d;
  --muted: #746d63;
  --line: #e5ded2;
  --accent: #7f0b5d;
  --accent-dark: #5f0846;
  --accent-soft: #f3e1ee;
  --task: #3b82c4;
  --task-soft: #e8f2fb;
  --objective: #4f9d69;
  --objective-soft: #e9f5ed;
  --context: #d85c5c;
  --context-soft: #fbeaea;
  --criteria: #e99a3a;
  --criteria-soft: #fff1dd;
  --shadow: 0 18px 50px rgba(35, 31, 25, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2 { margin: 0; line-height: 1.08; }
h1 { font-size: clamp(2.2rem, 5vw, 4.4rem); letter-spacing: -0.055em; }
h2 { font-size: 1.2rem; letter-spacing: -0.025em; }

.subtitle {
  margin: 12px 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 1.05rem;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: rgba(255, 253, 250, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.input-panel { padding: 22px; }
.output-panel {
  padding: 22px;
  position: sticky;
  top: 20px;
}

label {
  display: block;
  margin-bottom: 16px;
}

label span {
  display: block;
  margin-bottom: 8px;
  font-weight: 720;
  letter-spacing: -0.015em;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 15px;
  background: #fff;
  color: var(--text);
  font: inherit;
  line-height: 1.45;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

textarea:focus {
  border-color: rgba(127, 11, 93, 0.6);
  box-shadow: 0 0 0 4px rgba(127, 11, 93, 0.11);
  background: #fffefc;
}

label span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

label span::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.tocc-task span { color: var(--task); }
.tocc-task span::before { background: var(--task); box-shadow: 0 0 0 4px var(--task-soft); }
.tocc-task textarea:focus { border-color: color-mix(in srgb, var(--task) 68%, white); box-shadow: 0 0 0 4px color-mix(in srgb, var(--task-soft) 82%, transparent); }

.tocc-objective span { color: var(--objective); }
.tocc-objective span::before { background: var(--objective); box-shadow: 0 0 0 4px var(--objective-soft); }
.tocc-objective textarea:focus { border-color: color-mix(in srgb, var(--objective) 68%, white); box-shadow: 0 0 0 4px color-mix(in srgb, var(--objective-soft) 82%, transparent); }

.tocc-context span { color: var(--context); }
.tocc-context span::before { background: var(--context); box-shadow: 0 0 0 4px var(--context-soft); }
.tocc-context textarea:focus { border-color: color-mix(in srgb, var(--context) 68%, white); box-shadow: 0 0 0 4px color-mix(in srgb, var(--context-soft) 82%, transparent); }

.tocc-criteria span { color: var(--criteria); }
.tocc-criteria span::before { background: var(--criteria); box-shadow: 0 0 0 4px var(--criteria-soft); }
.tocc-criteria textarea:focus { border-color: color-mix(in srgb, var(--criteria) 68%, white); box-shadow: 0 0 0 4px color-mix(in srgb, var(--criteria-soft) 82%, transparent); }

.divider {
  height: 1px;
  background: var(--line);
  margin: 8px 0 18px;
}

.output-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 16px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
  white-space: nowrap;
}

button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); }

.primary {
  color: #fff;
  background: var(--accent);
}
.primary:hover { background: var(--accent-dark); }

.ghost {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

pre {
  min-height: 560px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #11100e;
  color: #f7f1e8;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.55;
}

.status {
  min-height: 1.4em;
  margin: 12px 2px 0;
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 900px) {
  .hero { align-items: start; flex-direction: column; }
  .grid { grid-template-columns: 1fr; }
  .output-panel { position: static; }
  pre { min-height: 360px; max-height: none; }
}
