:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f1b2d;
  --muted: #4b5b71;
  --brand: #0d8194;
  --brand-2: #11A2B8;
  --danger: #b91c1c;
  --success: #22a06b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15,27,45,.05), 0 8px 24px rgba(15,27,45,.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); min-height: 100%; }
body { line-height: 1.5; display: flex; flex-direction: column; min-height: 100vh; }

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #0f1b2d0d; padding: 0 6px; border-radius: 4px; font-size: 92%; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 700; letter-spacing: -0.01em; }
.brand-tag { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.topnav { display: flex; align-items: center; gap: 12px; }
.chip {
  padding: 4px 10px; border-radius: 999px; background: #d5f0f5;
  color: var(--brand); font-size: 13px; font-weight: 600;
}

main { flex: 1; max-width: 960px; width: 100%; margin: 0 auto; padding: 40px 24px 60px; }
main > .card { max-width: 720px; margin-left: auto; margin-right: auto; }
main > .card.center { max-width: 460px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.card.center { max-width: 460px; margin: 40px auto; }
.card h1 { margin: 0 0 8px; letter-spacing: -0.01em; color: var(--brand); font-size: 22px; }
.card .muted { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 16px; }

form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin: 14px 0 0; }
form input[type="text"], form input[type="password"], form input:not([type]),
form textarea, form select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; color: var(--text); background: var(--surface);
  font-family: inherit;
}
form input:focus, form textarea:focus, form select:focus {
  outline: 2px solid var(--brand-2); outline-offset: -1px;
}
form textarea { resize: vertical; min-height: 120px; }

.row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer;
  transition: transform .05s ease, border-color .1s ease, background .1s ease;
}
.btn:hover { border-color: var(--brand-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand-2); color: #fff; border-color: var(--brand-2); }
.btn-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-link { border-color: transparent; background: transparent; color: var(--brand-2); font-weight: 600; }
.btn-link:hover { text-decoration: underline; }

.err { color: var(--danger); font-size: 14px; }

.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border); margin: 4px 0 12px; }
.tab {
  padding: 8px 14px; border: 0; background: transparent;
  color: var(--muted); font: inherit; font-weight: 600; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand-2); }

.linkbox { display: flex; gap: 8px; margin-top: 14px; }
.linkbox input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
  font-size: 13px; color: var(--text);
}

.secretbox {
  background: #0b1220; color: #e8eef7; padding: 16px 18px; border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
  font-size: 14px; white-space: pre-wrap; word-break: break-word;
  overflow-x: auto; margin: 12px 0;
}
#viewout .btn-primary { margin-top: 4px; }

footer { border-top: 1px solid var(--border); background: var(--surface); }
.foot {
  max-width: 960px; margin: 0 auto; padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  color: var(--muted); font-size: 13px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #121a2b;
    --border: #1e2a44;
    --text: #e8eef7;
    --muted: #9fb0c9;
    --brand: #5ec9dd;
    --brand-2: #45b8ce;
  }
  .chip { background: #14335a; color: #cfe1ff; }
  code { background: #ffffff10; }
  .secretbox { background: #060a14; color: #e8eef7; }
}
