:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #657184;
  --line: #d7e0e8;
  --paper: #ffffff;
  --soft: #f2f6f8;
  --brand: #1d4f68;
  --brand-2: #277c7f;
  --ok: #176b4d;
  --warn: #8a5a13;
  --error: #9b2c2c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #edf3f7;
  color: var(--ink);
  font-family: "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 0 16px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

a.button {
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  padding: 0 16px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

button.secondary {
  background: #dfe8ee;
  color: var(--ink);
}

button.danger {
  background: #9b2c2c;
}

input,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.fixed-persona {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
}

.fixed-persona span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

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

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 42px);
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--brand-2);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-form {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  gap: 8px;
  align-items: end;
}

.admin-form label {
  grid-column: 1 / -1;
  margin-bottom: -2px;
}

.notice {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid #c8e4d7;
  border-radius: 8px;
  background: #e8f4ef;
  color: var(--ok);
  font-weight: 800;
  margin-bottom: 16px;
}

.notice.warn {
  background: #fff8e9;
  border-color: #f0d9a8;
  color: var(--warn);
}

.notice.error {
  background: #fff0f0;
  border-color: #efcaca;
  color: var(--error);
}

.grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.4fr);
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.panel-head {
  margin-bottom: 18px;
}

.split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.stack {
  display: grid;
  gap: 11px;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.result {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #c8e4d7;
  border-radius: 8px;
  background: #e8f4ef;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.bot-list {
  display: grid;
  gap: 10px;
}

.bot-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfe;
  display: grid;
  gap: 12px;
}

.bot-main {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.bot-title {
  display: grid;
  gap: 2px;
}

.bot-title strong {
  font-size: 18px;
}

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

.meta div {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: #fff;
  overflow-wrap: anywhere;
}

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

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

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

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e9eef4;
  color: var(--muted);
  font-weight: 900;
}

.badge.active {
  background: #e8f4ef;
  color: var(--ok);
}

.badge.pending_pairing {
  background: #fff8e9;
  color: var(--warn);
}

.badge.suspended,
.badge.disabled {
  background: #fff0f0;
  color: var(--error);
}

@media (max-width: 880px) {
  .topbar,
  .grid,
  .two,
  .meta,
  .copy-row,
  .admin-form {
    grid-template-columns: 1fr;
  }

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