:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --card: rgba(255, 255, 255, 0.92);
  --line: #d8dbe2;
  --text: #111827;
  --muted: #6b7280;
  --blue: #007aff;
  --blue-press: #0066d6;
  --red: #ff3b30;
  --green: #34c759;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  padding: 8px 2px 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 38px;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  margin-bottom: 18px;
}

.lead,
.hint {
  color: var(--muted);
  line-height: 1.7;
}

.lead {
  margin-top: 10px;
  font-size: 16px;
}

.server-pill {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  color: var(--muted);
  padding: 9px 14px;
  white-space: nowrap;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eceef2;
  margin-bottom: 18px;
}

.hidden {
  display: none !important;
}

.file-input {
  display: none;
}

.setup {
  margin-bottom: 18px;
}

.tab {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  padding: 9px 18px;
  font-size: 15px;
}

.tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.12);
}

.grid {
  display: none;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: 18px;
}

.grid.active {
  display: grid;
}

.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  padding: 22px;
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.08);
}

.wide {
  grid-column: 1 / -1;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin-bottom: 0;
}

.list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

.list-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.list-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  padding: 18px;
  background: #fff;
}

label {
  display: block;
  margin: 14px 0;
}

label span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 7px;
}

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

input {
  height: 46px;
  padding: 0 13px;
}

textarea {
  min-height: 170px;
  padding: 13px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  min-height: 42px;
  padding: 0 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

button.primary:active {
  background: var(--blue-press);
}

button.danger {
  border-color: rgba(255, 59, 48, 0.24);
  color: var(--red);
}

.notice {
  min-height: 44px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  color: var(--muted);
  background: #fff;
}

.notice.ok {
  border-color: rgba(52, 199, 89, 0.35);
  color: #1f7a3a;
}

.notice.err {
  border-color: rgba(255, 59, 48, 0.35);
  color: var(--red);
}

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

.metrics div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  background: #fff;
}

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

.metrics strong {
  font-size: 24px;
}

@media (max-width: 820px) {
  .app {
    width: min(100% - 24px, 1080px);
    padding: 20px 0;
  }

  .hero,
  .grid {
    display: block;
  }

  .grid {
    display: none;
  }

  .grid.active {
    display: block;
  }

  .card + .card {
    margin-top: 14px;
  }

  h1 {
    font-size: 30px;
  }

  .server-pill {
    display: inline-block;
    margin-top: 16px;
  }
}