:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --text: #111827;
  --muted: #5f6b7a;
  --border: #d8dee6;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --danger: #b42318;
  --ok: #16803c;
  --shadow: 0 16px 40px rgba(17, 24, 39, 0.08);
}

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

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

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.02;
  font-weight: 760;
}

.hero p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(22, 128, 60, 0.22);
  border-radius: 8px;
  background: rgba(22, 128, 60, 0.08);
  color: var(--ok);
  font-size: 13px;
  font-weight: 650;
}

.status-dot.muted {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--muted);
}

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

.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 730;
}

.meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
  word-break: break-all;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field span,
.check-row span {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  outline: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 86px;
  padding: 11px 12px;
  resize: vertical;
}

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

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

.check-row,
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row {
  margin: 4px 0 14px;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.check-row.strong {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.toggle-row {
  flex-wrap: wrap;
}

.model-panel {
  display: flex;
  flex-direction: column;
}

.model-list {
  display: grid;
  gap: 8px;
}

.model-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfd;
}

.model-id {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 650;
}

.model-owner {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0 0;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  padding: 0 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 720;
  cursor: pointer;
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.save-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 620;
}

.save-status.error {
  color: var(--danger);
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 24px, 720px);
    padding-top: 22px;
  }

  .hero,
  .layout,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .hero {
    display: grid;
    align-items: start;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .panel {
    padding: 18px;
  }
}
