/* cms-mcp dashboard
   One bold element: the dark "MCP 서버" panel holding what you copy into a
   client. Everything else is quiet lists on a light canvas. Green is reserved
   for "connected", amber for "needs action"; primary actions are ink. */

@font-face {
  font-family: "Pretendard Std";
  src: url("/static/fonts/PretendardStdVariable.woff2") format("woff2-variations");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1d2433;
  --ink-2: #4b5468;
  --ink-3: #8a93a6;
  --canvas: #f4f5f7;
  --surface: #ffffff;
  --line: #e4e7ec;
  --line-strong: #d3d8e0;
  --ok: #0e9f6e;
  --ok-bg: #e7f6ef;
  --warn: #b45309;
  --warn-bg: #fdf3e6;
  --focus: #3b6cf6;

  --panel: #1d2433;
  --panel-2: #262f42;
  --panel-text: #eef1f6;
  --panel-muted: #9aa4b8;
  --panel-line: rgba(255, 255, 255, 0.1);

  --font: "Pretendard Std", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --r-sm: 8px;
  --r-lg: 14px;
  --shell: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9ecf2;
    --ink-2: #b3bbca;
    --ink-3: #7c8598;
    --canvas: #0f131b;
    --surface: #161b25;
    --line: #252c39;
    --line-strong: #323a4a;
    --ok: #34d399;
    --ok-bg: rgba(52, 211, 153, 0.12);
    --warn: #f5b25a;
    --warn-bg: rgba(245, 178, 90, 0.12);
    --focus: #7d9cff;
    --panel: #1b2230;
    --panel-2: #232c3d;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 15px/1.6 var(--font);
  letter-spacing: -0.006em;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { margin: 0; letter-spacing: -0.022em; line-height: 1.3; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
p { margin: 0; }
a { color: inherit; }
code, pre { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 20px; }
.main { padding-top: 32px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 40px; }

/* Top bar */
.bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar-inner { height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mark { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; white-space: nowrap; font-weight: 700; font-size: 16px; letter-spacing: -0.03em; text-decoration: none; }
.logo { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.logo circle:last-child { stroke: var(--ok); }
.who { display: flex; align-items: center; gap: 14px; min-width: 0; font-size: 14px; color: var(--ink-2); }
.who-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who form { margin: 0; }

/* Buttons and links */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 600 14px/1 var(--font); letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 50px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.btn-on-dark { background: var(--panel-2); border-color: var(--panel-line); color: var(--panel-text); }
.btn-on-dark:hover { border-color: var(--panel-muted); }
.btn[data-copied] { border-color: var(--ok); color: var(--ok); }
.link {
  background: none; border: 0; padding: 4px 2px; cursor: pointer;
  font: 500 14px var(--font); color: var(--ink-3); text-decoration: none;
}
.link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.link-strong { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Notices */
.toast { padding: 12px 16px; border-radius: var(--r-sm); background: var(--ok-bg); color: var(--ok); font-weight: 600; font-size: 14px; }
.toast-warn { background: var(--warn-bg); color: var(--warn); }
.toast[data-hide] { opacity: 0; transition: opacity .4s; }

/* MCP server panel — the one dark element */
.connect { background: var(--panel); color: var(--panel-text); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.connect-head { display: flex; flex-direction: column; gap: 10px; }
.connect-head h2 { font-size: 13px; font-weight: 600; color: var(--panel-muted); letter-spacing: 0; }
.connect-head h1 { font-size: 20px; }
.connect-note { color: #f6c27a; font-size: 14px; }
.url-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.url-row code { flex: 1 1 260px; min-width: 0; font-size: 17px; font-weight: 500; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.url-row-key { padding: 14px 16px; border-radius: var(--r-sm); background: var(--panel-2); border: 1px dashed rgba(52, 211, 153, 0.5); }
.url-row-key code { font-size: 15px; }

.tabs { border-top: 1px solid var(--panel-line); padding-top: 16px; }
.tablist { display: flex; gap: 4px; margin-bottom: 12px; }
.tablist [role="tab"] {
  background: none; border: 0; border-radius: 6px; padding: 6px 10px; cursor: pointer;
  font: 500 13px var(--font); color: var(--panel-muted);
}
.tablist [role="tab"]:hover { color: var(--panel-text); }
.tablist [role="tab"][aria-selected="true"] { background: var(--panel-2); color: var(--panel-text); font-weight: 600; }
.tabpanel { position: relative; display: flex; flex-direction: column; gap: 10px; }
.tabpanel .btn { position: absolute; right: 10px; bottom: 10px; }
.tabpanel[hidden] { display: none; }
.tabpanel pre {
  align-self: stretch; margin: 0; padding: 14px 16px; border-radius: var(--r-sm);
  padding-right: 76px; min-height: 52px;
  background: rgba(0, 0, 0, 0.22); color: var(--panel-text); font-size: 13px; line-height: 1.65;
  white-space: pre-wrap; word-break: normal; overflow-wrap: anywhere;
}
.tab-hint { font-size: 13px; color: var(--panel-muted); }

/* Sections */
.block { display: flex; flex-direction: column; gap: 4px; }
.block-narrow { max-width: 520px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; }
.block-head form { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.item { display: flex; align-items: center; gap: 14px; padding: 16px 18px; flex-wrap: wrap; }
.item + .item { border-top: 1px solid var(--line); }
.item form { margin: 0; }
.item-side { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.item-main { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.item-title { font-weight: 600; overflow-wrap: anywhere; }
.item-code { font-size: 14px; }
.item-meta { font-size: 13px; color: var(--ink-3); }
.empty { padding: 22px 18px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--ink-3); font-size: 14px; }

.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--canvas); color: var(--ink-2); border: 1px solid var(--line); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-ok { color: var(--ok); }
.status-warn { color: var(--warn); }

.pairs { margin: 0; display: grid; gap: 2px; font-size: 13px; }
.pairs div { display: flex; gap: 10px; min-width: 0; }
.pairs dt { flex: 0 0 104px; color: var(--ink-3); }
.pairs dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }

/* Forms */
.alert { padding: 14px 16px; border-radius: var(--r-sm); background: var(--warn-bg); color: var(--warn); font-size: 14px; margin-bottom: 12px; }
.alert-title { font-weight: 600; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert .link-strong { color: var(--warn); }
.form { display: flex; flex-direction: column; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
select {
  width: 100%; height: 42px; padding: 0 36px 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 15px var(--font); appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.form-actions { display: flex; align-items: center; gap: 16px; padding-top: 4px; }
.page-actions { display: flex; justify-content: flex-end; }
.block-message { gap: 20px; align-items: flex-start; }
.block-message h1 { font-size: 19px; font-weight: 600; line-height: 1.5; }

/* Login */
.page-login .main { min-height: 100vh; justify-content: center; padding-top: 0; }
.login { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; max-width: 460px; }
.mark-lg { font-size: 18px; }
.mark-lg .logo { width: 24px; height: 24px; }
.login h1 { font-size: clamp(28px, 6vw, 36px); font-weight: 750; line-height: 1.25; letter-spacing: -0.035em; }
.login-note { font-size: 13px; color: var(--ink-3); margin-top: -12px; }
.g { width: 18px; height: 18px; background: #fff; border-radius: 50%; padding: 2px; }

@media (max-width: 560px) {
  .main { padding-top: 20px; gap: 32px; }
  .connect { padding: 18px; }
  .item { padding: 14px; }
  .pairs dt { flex-basis: 92px; }
  .who-email { max-width: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
