:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #111827;
  --muted: #64748b;
  --line: #d8dee8;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #b91c1c;
  --shadow: 0 14px 42px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

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

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

.shell {
  width: min(760px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 18px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: 1.8rem;
}

h2 {
  font-size: 1rem;
}

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

.panel,
.command-box,
.list-panel {
  padding: 16px;
}

.stack {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

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

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

textarea {
  min-height: 126px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.command-actions {
  display: grid;
  grid-template-columns: minmax(112px, 160px) 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.primary,
.secondary,
.segmented,
.icon-button {
  border: 0;
  cursor: pointer;
}

.primary {
  min-height: 44px;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.primary:active {
  background: var(--primary-dark);
}

.secondary {
  min-height: 44px;
  border-radius: 7px;
  background: #e8edf3;
  color: #111827;
  font-weight: 800;
}

.account-panel {
  margin: 0 0 14px;
}

.password-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

@media (min-width: 560px) {
  .password-form {
    grid-template-columns: 1fr 160px;
    align-items: end;
  }
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 14px 0;
}

.view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 14px;
}

.tab-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-weight: 850;
}

.tab-button.active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.segmented {
  min-height: 38px;
  border-radius: 7px;
  background: #e8edf3;
  color: #334155;
  font-weight: 750;
}

.segmented.active {
  background: #111827;
  color: #fff;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 7px;
  background: #e8edf3;
  color: #111827;
  font-weight: 900;
}

.command-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.command-row {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.task-row {
  border-left: 4px solid var(--primary);
}

.command-row:active {
  border-color: var(--primary);
}

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

.message {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
}

.pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 2px 9px;
  background: #e8edf3;
  color: #334155;
  font-weight: 800;
}

.pill.completed {
  background: #dcfce7;
  color: #166534;
}

.pill.processing {
  background: #dbeafe;
  color: #1d4ed8;
}

.pill.queued {
  background: #fef3c7;
  color: #92400e;
}

.pill.failed {
  background: #fee2e2;
  color: var(--accent);
}

.status-line,
.empty {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.detail-panel {
  position: fixed;
  inset: 0;
  display: grid;
  align-items: end;
  background: rgba(15, 23, 42, 0.42);
  padding: 12px;
}

.detail-card {
  width: min(760px, 100%);
  max-height: 86vh;
  margin: 0 auto;
  overflow: auto;
  padding: 16px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.metrics div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
}

dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.brief {
  margin: 0;
  min-height: 140px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 12px;
  color: #1f2937;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
}

.approval-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 14px;
}

.approve,
.reject {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  font-weight: 850;
}

.approve {
  background: #15803d;
}

.reject {
  background: #b91c1c;
}

.hidden {
  display: none !important;
}

@media (min-width: 720px) {
  .shell {
    padding: 28px;
  }

  .detail-panel {
    align-items: center;
  }
}
