:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --panel-soft: #eef4f0;
  --ink: #20231f;
  --muted: #697069;
  --line: #dfe5dd;
  --accent: #256d5a;
  --accent-strong: #174c42;
  --warn: #8a5b16;
  --danger: #9a3f3f;
  --shadow: 0 12px 40px rgba(23, 38, 31, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
  padding: 0 16px;
}

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

button.secondary {
  width: 100%;
  background: #283533;
}

button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  min-height: 34px;
}

button.small {
  min-height: 32px;
  padding: 0 10px;
}

.shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #16211f;
  color: #f8fbf8;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #d7eee4;
  color: #10211c;
  font-weight: 900;
}

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

h1 {
  font-size: 22px;
  line-height: 1.15;
}

h2 {
  font-size: 17px;
}

#apiStatus {
  color: #b8c7c2;
  font-size: 13px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.82;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f9fbf8;
  color: var(--ink);
  outline: none;
  padding: 11px 12px;
}

textarea {
  min-height: 160px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #76aa9d;
  box-shadow: 0 0 0 3px rgba(118, 170, 157, 0.22);
}

.composer,
.search,
.mini-form {
  display: grid;
  gap: 12px;
}

.inline-fields {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
}

.workspace {
  padding: 24px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  min-width: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
}

.toolbar div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.toolbar span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.toolbar strong {
  font-size: 26px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  grid-auto-rows: minmax(240px, auto);
  gap: 18px;
  align-items: start;
}

.focus-panel {
  grid-column: 1 / -1;
}

.focus-message {
  display: grid;
  gap: 4px;
  padding: 16px;
  background: #eef4f0;
  border-bottom: 1px solid var(--line);
}

.focus-message strong {
  font-size: 20px;
}

.focus-message span {
  color: var(--muted);
  line-height: 1.45;
}

.focus-item.important {
  border-left: 5px solid var(--danger);
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.segmented button {
  min-height: 30px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
}

.segmented button.active {
  background: var(--accent);
  color: #fff;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}

.panel header {
  min-height: 56px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.timeline {
  grid-row: span 3;
}

.list {
  display: grid;
  gap: 0;
}

.empty,
.item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.empty {
  color: var(--muted);
}

.item:last-child,
.empty:last-child {
  border-bottom: 0;
}

.item p {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}

.compact .item {
  display: grid;
  gap: 10px;
}

.task-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.danger {
  background: var(--danger);
}

.danger:hover {
  background: #743030;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  background: #16211f;
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  padding: 12px 14px;
  transform: translateY(10px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .sidebar {
    min-height: auto;
  }

  .grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .timeline {
    grid-row: auto;
  }
}
