:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #14171f;
  --muted: #657084;
  --line: #dce2ea;
  --accent: #1463ff;
  --accent-strong: #0f49bd;
  --green: #087f5b;
  --red: #b42318;
  --amber: #9a5b00;
  --shadow: 0 12px 28px rgba(30, 42, 62, 0.10);
}

* {
  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;
}

button,
select,
input {
  font: inherit;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: #fbfcfe;
}

.brand {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.1;
}

h2 {
  font-size: 16px;
  line-height: 1.2;
}

.brand p,
.panel-header p,
.pull-meta,
.empty-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.connection-form,
.control-block {
  display: grid;
  gap: 8px;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

select,
input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 8px 10px;
}

.control-row,
.artifact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

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

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

.button.secondary {
  background: #ffffff;
  border-color: var(--line);
  color: var(--text);
}

.status-panel {
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.status-panel[data-tone="ok"] {
  border-color: rgba(8, 127, 91, 0.28);
  color: var(--green);
}

.status-panel[data-tone="busy"] {
  border-color: rgba(154, 91, 0, 0.28);
  color: var(--amber);
}

.status-panel[data-tone="error"] {
  border-color: rgba(180, 35, 24, 0.28);
  color: var(--red);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.86fr) minmax(420px, 1.14fr);
  gap: 18px;
  padding: 18px;
  min-width: 0;
}

.pulls-panel,
.sim-panel {
  display: flex;
  min-width: 0;
  min-height: calc(100vh - 36px);
  flex-direction: column;
  gap: 14px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 2px;
}

.pull-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.pull-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(20, 23, 31, 0.04);
}

.pull-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.pull-title {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
}

.pull-title:hover {
  color: var(--accent);
}

.badge {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.ready {
  background: rgba(8, 127, 91, 0.10);
  color: var(--green);
}

.badge.empty {
  background: rgba(101, 112, 132, 0.12);
  color: var(--muted);
}

.sim-panel {
  min-height: 0;
}

#simFrame {
  width: 100%;
  flex: 1;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101318;
  box-shadow: var(--shadow);
}

@media (max-width: 1100px) {
  .app-shell,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pulls-panel,
  .sim-panel {
    min-height: auto;
  }

  #simFrame {
    min-height: 520px;
  }
}
