:root {
  color-scheme: light;
  --bg: #f5f2ed;
  --ink: #1f2933;
  --muted: #69717d;
  --line: #d8d1c6;
  --panel: #ffffff;
  --accent: #176b5b;
  --accent-strong: #0f4f44;
  --danger: #a33a2b;
  --shadow: 0 18px 45px rgba(31, 41, 51, 0.12);
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.topbar,
.section-head,
.section-actions,
.session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  min-height: 88px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

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

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

.status {
  min-width: 118px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.56);
}

.top-status {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
  align-items: start;
}

.panel,
.list-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.form {
  display: grid;
  gap: 14px;
}

.form + .form,
.session {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

select {
  min-height: 44px;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input:focus {
  outline: 3px solid rgba(23, 107, 91, 0.18);
  border-color: var(--accent);
}

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

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

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

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

button:disabled,
.is-disabled button {
  cursor: not-allowed;
  opacity: 0.45;
}

.ghost {
  color: var(--accent);
  border: 1px solid var(--line);
  background: transparent;
}

.ghost:hover {
  color: #fff;
}

.dev-code {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef7f4;
  color: var(--accent-strong);
  direction: ltr;
  text-align: center;
  font-weight: 700;
}

.list-section {
  margin-top: 18px;
  padding: 20px;
}

.org-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.org-item {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.metric {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric span {
  color: var(--muted);
}

.metric strong {
  overflow-wrap: anywhere;
}

.org-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.org-meta {
  color: var(--muted);
  font-size: 13px;
}

.empty {
  min-height: 86px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.message {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--muted);
}

.message.is-error {
  color: var(--danger);
}

.is-hidden {
  display: none;
}

.is-disabled {
  opacity: 0.58;
  pointer-events: none;
}

@media (max-width: 900px) {
  .shell {
    width: min(100% - 22px, 1120px);
    padding-top: 18px;
  }

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

  .workspace,
  .grid,
  .org-list,
  .section-actions {
    grid-template-columns: 1fr;
  }

  .section-head,
  .section-actions {
    align-items: stretch;
    flex-direction: column;
  }

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