/* Gumba Developer Portal
   Visual language mirrors the Gumba web app (GumbaReact): teal primary, yellow accent,
   soft rounded cards, teal→yellow accent strips and ring decorations, light + dark theme. */

:root {
  --primary: #1fa7cb;
  --primary-hover: #1598bb;
  --primary-ink: #0c8caf;
  --primary-soft: rgba(31, 167, 203, 0.12);
  --primary-softer: rgba(31, 167, 203, 0.06);
  --accent: #f4da1e;
  --success: #3db37a;
  --warning: #f4da1e;
  --error: #d64545;

  --heading: #111111;
  --title: #1c2b31;
  --text: #27333a;
  --text-2: #555555;
  --muted: #687880;
  --faint: #7a8790;

  --bg: #f2f5f7;
  --bg-grad-top: #f8fbfc;
  --bg-grad-bottom: #eef3f5;
  --surface: #ffffff;
  --surface-2: #f5fafc;
  --surface-3: #f2f7fa;
  --input-bg: #ffffff;
  --border: #dce4e8;
  --border-strong: #cfdae0;
  --border-split: #e8edf0;

  --ring-yellow: rgba(244, 218, 30, 0.78);
  --ring-teal: rgba(31, 167, 203, 0.24);
  --strip: linear-gradient(90deg, #1fa7cb 0%, #f4da1e 100%);
  --shadow-card: 0 10px 24px rgba(18, 49, 60, 0.06);
  --shadow-panel: 0 12px 28px rgba(16, 44, 55, 0.07);
  --shadow-header: 0 8px 24px rgba(15, 49, 61, 0.08);
  --shadow-pop: 0 14px 30px rgba(0, 0, 0, 0.12);

  --code-bg: #f2f7fa;
  --mono: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  --font: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --sider-w: 256px;
  --sider-collapsed-w: 80px;
  --header-h: 72px;

  color-scheme: light;
}

html[data-theme="dark"] {
  --primary: #1fa7cb;
  --primary-hover: #31b8db;
  --primary-ink: #63d7ef;
  --primary-soft: rgba(31, 167, 203, 0.2);
  --primary-softer: rgba(31, 167, 203, 0.08);

  --heading: #e2eff3;
  --title: #d4e3e9;
  --text: #d5e3e9;
  --text-2: #b6c9d2;
  --muted: #8fa4af;
  --faint: #95aab3;

  --bg: #0d151a;
  --bg-grad-top: #10191f;
  --bg-grad-bottom: #0d151a;
  --surface: #152129;
  --surface-2: #16232b;
  --surface-3: #1c2a33;
  --input-bg: #121e25;
  --border: #2a3942;
  --border-strong: #2f404a;
  --border-split: #293841;

  --ring-yellow: rgba(244, 218, 30, 0.3);
  --ring-teal: rgba(31, 167, 203, 0.14);
  --strip: linear-gradient(90deg, #24b3d8 0%, #f4da1e 100%);
  --shadow-card: 0 12px 30px rgba(0, 0, 0, 0.33);
  --shadow-panel: 0 14px 30px rgba(0, 0, 0, 0.35);
  --shadow-header: 0 10px 26px rgba(0, 0, 0, 0.32);
  --shadow-pop: 0 16px 30px rgba(0, 0, 0, 0.4);

  --code-bg: #101b22;

  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(circle at 100% 0, rgba(244, 218, 30, 0.22) 0 210px, transparent 212px),
    linear-gradient(180deg, var(--bg-grad-top) 0%, var(--bg-grad-bottom) 100%);
  background-attachment: fixed;
  background-color: var(--bg);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 100% 0, rgba(244, 218, 30, 0.14) 0 210px, transparent 213px),
    linear-gradient(180deg, var(--bg-grad-top) 0%, var(--bg-grad-bottom) 100%);
  background-attachment: fixed;
  background-color: var(--bg);
}

img, svg { max-width: 100%; }

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: #0e91b5; }
html[data-theme="dark"] a:hover { color: #6ddcf0; }

h1, h2, h3 { color: var(--title); margin: 0; line-height: 1.2; }

p { margin: 0; }

code, .mono { font-family: var(--mono); font-size: 12.5px; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.icon { width: 1em; height: 1em; flex: none; vertical-align: -0.125em; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background-color: #e8edf0; }
::-webkit-scrollbar-thumb { background-color: rgba(31, 167, 203, 0.35); border-radius: 10px; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background-color: #1a252c; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background-color: #2a4451; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid #cdd7db;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: 600 14px/1.2 var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn:hover { color: #0f95b9; border-color: var(--primary); background: #f1f9fc; }
.btn .icon { font-size: 16px; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(31, 167, 203, 0.24);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

.btn-danger { background: var(--error); border-color: var(--error); color: #fff; }
.btn-danger:hover { background: #b93636; border-color: #b93636; color: #fff; }

.btn-dashed { border-style: dashed; }
.btn-block { width: 100%; }
.btn-lg { min-height: 44px; border-radius: 11px; font-size: 15px; font-weight: 700; }
.btn-sm { min-height: 32px; padding: 5px 12px; font-size: 13px; border-radius: 8px; }

.btn-link {
  border: 0; background: none; box-shadow: none; padding: 0; min-height: 0;
  color: var(--primary); font: 600 14px var(--font); cursor: pointer;
}
.btn-link:hover { color: #0e91b5; background: none; }

html[data-theme="dark"] .btn { background: #182730; color: #d6e3e9; border-color: #32434c; }
html[data-theme="dark"] .btn:hover { color: #4ecde8; border-color: #2c95b0; background: #1c2f39; }
html[data-theme="dark"] .btn-primary { background: #1fa7cb; border-color: #1fa7cb; color: #061216; box-shadow: 0 8px 20px rgba(31, 167, 203, 0.26); }
html[data-theme="dark"] .btn-primary:hover { background: #31b8db; border-color: #31b8db; color: #041014; }
html[data-theme="dark"] .btn-danger { background: #c44747; border-color: #c44747; color: #fff; }
html[data-theme="dark"] .btn-danger:hover { background: #db5656; border-color: #db5656; color: #fff; }
html[data-theme="dark"] .btn-link { background: none; color: #52d1eb; }

/* ---------- Forms ---------- */

.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; color: #42525a; font-weight: 700; font-size: 14px; }
html[data-theme="dark"] .field label { color: #a9bdc8; }

.field input,
.field select,
.field textarea,
.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--input-bg);
  color: var(--text);
  font: 14px var(--font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder, .input::placeholder { color: #a3b0b6; }
html[data-theme="dark"] .field input::placeholder { color: #7f98a4; }
.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(31, 167, 203, 0.18);
}
.field.has-error input { border-color: var(--error); }
.field.has-error input:focus { box-shadow: 0 0 0 2px rgba(214, 69, 69, 0.16); }

.checkbox-field { display: flex !important; align-items: flex-start; gap: 10px; cursor: pointer; }
.checkbox-field input { width: 18px; min-height: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.checkbox-field span { font-weight: 500; color: var(--text); line-height: 1.45; }

.help { margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.help ul { margin: 4px 0 0; padding-left: 18px; }
.field-error { margin-top: 5px; color: var(--error); font-size: 13px; }

.form-errors { margin-bottom: 16px; }
.form-errors .errorlist { margin: 0; padding: 0; list-style: none; }

/* ---------- Alerts (Ant Design–style) ---------- */

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  border: 1px solid;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
}
.alert .icon { font-size: 16px; margin-top: 2px; }
.alert-title { display: block; font-weight: 700; color: var(--title); margin-bottom: 2px; }
.alert + .alert { margin-top: 10px; }

.alert-info, .alert-debug { background: #eef8fb; border-color: #b6e2ef; color: #1c5566; }
.alert-info .icon, .alert-debug .icon { color: var(--primary); }
.alert-success { background: #edf8f2; border-color: #b9e3cc; color: #1f5c3f; }
.alert-success .icon { color: var(--success); }
.alert-warning { background: #fffbe6; border-color: #f6e58a; color: #6b5a00; }
.alert-warning .icon { color: #d4b400; }
.alert-error { background: #fdf0f0; border-color: #f0c2c2; color: #8a2f2f; }
.alert-error .icon { color: var(--error); }

html[data-theme="dark"] .alert-info, html[data-theme="dark"] .alert-debug { background: #12262f; border-color: #1f5568; color: #bfe3ee; }
html[data-theme="dark"] .alert-success { background: #12261d; border-color: #24563d; color: #bfe6d0; }
html[data-theme="dark"] .alert-warning { background: #26230f; border-color: #5c5218; color: #efe3a0; }
html[data-theme="dark"] .alert-error { background: #2a1517; border-color: #5e2a2d; color: #f2c4c4; }
html[data-theme="dark"] .alert-title { color: inherit; }

.messages { margin-bottom: 18px; }

/* ---------- Tags ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  white-space: nowrap;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-pending { color: #8a7000; background: #fffbe6; border-color: #f6e58a; }
.tag-approved { color: #23774f; background: #edf8f2; border-color: #b9e3cc; }
.tag-rejected, .tag-suspended { color: #b23a3a; background: #fdf0f0; border-color: #f0c2c2; }
html[data-theme="dark"] .tag-pending { color: #f4da1e; background: #26230f; border-color: #5c5218; }
html[data-theme="dark"] .tag-approved { color: #6fd5a0; background: #12261d; border-color: #24563d; }
html[data-theme="dark"] .tag-rejected, html[data-theme="dark"] .tag-suspended { color: #f08a8a; background: #2a1517; border-color: #5e2a2d; }

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  min-width: 0;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-split);
}
.card-head h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card-head h2 .icon { color: var(--primary); font-size: 18px; }
.card-body { padding: 24px; }
html[data-theme="dark"] .card-head { background: var(--surface-2); border-radius: 16px 16px 0 0; }

/* =========================================================================
   Public layout (home, sign in, register) — mirrors the Gumba login page
   ========================================================================= */

.public {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  padding: 24px;
  background:
    linear-gradient(140deg, #eff6f9 0%, #f8fbfc 56%, #edf3f5 100%);
}
.public::before {
  content: "";
  position: absolute;
  right: -140px;
  top: -120px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  border: 68px solid rgba(244, 218, 30, 0.9);
  pointer-events: none;
}
.public::after {
  content: "";
  position: absolute;
  left: -110px;
  bottom: -130px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 52px solid rgba(31, 167, 203, 0.18);
  pointer-events: none;
}
html[data-theme="dark"] .public { background: linear-gradient(140deg, #0f171c 0%, #111c23 56%, #0b1318 100%); }
html[data-theme="dark"] .public::before { border-color: rgba(244, 218, 30, 0.48); opacity: 0.55; }
html[data-theme="dark"] .public::after { border-color: rgba(31, 167, 203, 0.14); }

.public-bar {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.public-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--title); }
.public-brand:hover { color: var(--title); }
.public-brand img { width: 38px; height: 38px; }
.public-brand span { font-size: 15px; font-weight: 700; color: #077fa3; white-space: nowrap; }
html[data-theme="dark"] .public-brand span { color: #79d4ea; }
.public-actions { display: flex; align-items: center; gap: 8px; }

.public-main {
  flex: 1;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 460px);
  gap: 26px;
  align-items: center;
  padding: 16px 0;
}
.home-shell { grid-template-columns: minmax(0, 900px); justify-content: center; }
.home-shell .brand-panel { padding: clamp(32px, 6vw, 62px); }
.home-shell .brand-panel h1 { max-width: 700px; }
.home-shell .brand-panel .description { max-width: 680px; }

.brand-panel {
  position: relative;
  overflow: hidden;
  padding: 40px;
  border-radius: 24px;
  border: 1px solid rgba(31, 167, 203, 0.24);
  background: linear-gradient(160deg, #1fa7cb 0%, #1191b6 100%);
  color: #fff;
  box-shadow: 0 20px 44px rgba(8, 53, 67, 0.26);
}
.brand-panel::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 52px solid rgba(244, 218, 30, 0.96);
  opacity: 0.95;
  pointer-events: none;
}
html[data-theme="dark"] .brand-panel { background: linear-gradient(160deg, #1488a9 0%, #0c6f8b 100%); border-color: rgba(54, 191, 220, 0.3); }
.brand-panel > * { position: relative; z-index: 1; }

.brand-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; color: #fff; }
.brand-logo:hover { color: #fff; }
.brand-logo img {
  width: 52px; height: 52px; padding: 6px;
  background: #fff; border-radius: 14px;
  box-shadow: 0 8px 18px rgba(4, 45, 58, 0.22);
}
.brand-logo span { font-size: 20px; font-weight: 800; letter-spacing: 0.02em; }

.kicker {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand-panel .kicker { color: rgba(255, 255, 255, 0.84); }

.brand-panel h1 {
  color: #fff;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.08;
  margin: 10px 0 14px;
  max-width: 560px;
}
.brand-panel .description {
  max-width: 530px;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.highlights { margin-top: 28px; display: grid; gap: 10px; }
.highlight { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: #fff; }
.highlight-icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 16px;
}

.brand-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.brand-actions .btn { min-height: 44px; border-radius: 11px; }
.btn-on-brand { background: #fff; border-color: #fff; color: #0b7fa1; box-shadow: 0 10px 22px rgba(4, 45, 58, 0.22); }
.btn-on-brand:hover { background: #f1fbfe; border-color: #f1fbfe; color: #076b88; }
.btn-ghost-brand { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.5); color: #fff; }
.btn-ghost-brand:hover { background: rgba(255, 255, 255, 0.2); border-color: #fff; color: #fff; }
html[data-theme="dark"] .btn-on-brand { background: #fff; color: #0b7fa1; border-color: #fff; }
html[data-theme="dark"] .btn-ghost-brand { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.45); }

.form-panel { display: flex; justify-content: center; }
.form-card {
  position: relative;
  width: 100%;
  padding: 30px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid #dbe6eb;
  box-shadow: 0 16px 38px rgba(17, 58, 71, 0.14);
  overflow: hidden;
}
.form-card::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 180px; height: 4px;
  background: var(--strip);
}
html[data-theme="dark"] .form-card { border-color: #2d3f49; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4); }
.form-card h2 { font-size: 26px; font-weight: 800; color: var(--title); }
.form-subtitle { margin: 8px 0 20px; color: var(--muted); }
.form-foot { margin-top: 16px; display: grid; gap: 8px; }
.form-foot-text { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 4px; }

.steps { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 8px 0 12px; }
.step { position: relative; overflow: hidden; padding: 22px; }
.step::before { content: ""; position: absolute; top: 0; left: 0; width: 120px; height: 4px; background: var(--strip); }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary-ink);
  font-size: 17px; margin-bottom: 14px;
}
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { color: var(--muted); }

/* =========================================================================
   Workspace layout (signed in) — mirrors the Gumba primary layout
   ========================================================================= */

.layout { display: flex; min-height: 100vh; }

.sider {
  position: sticky;
  top: 0;
  flex: 0 0 var(--sider-w);
  width: var(--sider-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 30;
  border-right: 1px solid #d9e5ea;
  background: linear-gradient(180deg, #fff 0%, #f5fafc 100%);
  box-shadow: 0 0 36px rgba(15, 63, 79, 0.15);
  transition: width 0.2s, flex-basis 0.2s, transform 0.25s;
}
.sider::after {
  content: "";
  position: absolute;
  left: -70px;
  bottom: -80px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 30px solid rgba(244, 218, 30, 0.7);
  pointer-events: none;
}
html[data-theme="dark"] .sider { border-right-color: #253741; background: linear-gradient(180deg, #101a20 0%, #111f26 100%); box-shadow: 0 0 30px rgba(0, 0, 0, 0.35); }
html[data-theme="dark"] .sider::after { border-color: rgba(244, 218, 30, 0.5); opacity: 0.55; }

.sider-brand {
  height: var(--header-h);
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 21px;
  border-bottom: 1px solid #dde8ec;
  color: inherit;
}
.sider-brand:hover { color: inherit; }
.sider-brand img { width: 38px; height: 38px; margin-right: 10px; flex: none; }
.sider-brand .brand-name { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.sider-brand strong { font-size: 15px; font-weight: 700; color: #077fa3; white-space: nowrap; }
.sider-brand small { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
html[data-theme="dark"] .sider-brand { border-bottom-color: #273943; }
html[data-theme="dark"] .sider-brand strong { color: #79d4ea; }

.menu { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 0 20px; position: relative; z-index: 1; }
.menu-label {
  margin: 14px 24px 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  margin: 4px 12px;
  padding: 0 14px;
  border-radius: 10px;
  color: #495a62;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.menu-item .icon { font-size: 17px; }
.menu-item:hover { color: #0e93b7; background: rgba(31, 167, 203, 0.12); }
.menu-item.active { color: #0c8caf; background: rgba(31, 167, 203, 0.17); font-weight: 700; }
.menu-item .external { margin-left: auto; font-size: 12px; opacity: 0.6; }
html[data-theme="dark"] .menu-item { color: #9eb2bd; }
html[data-theme="dark"] .menu-item:hover { color: #58d4ec; background: rgba(31, 167, 203, 0.18); }
html[data-theme="dark"] .menu-item.active { color: #63d7ef; background: rgba(31, 167, 203, 0.24); }

.switch-theme {
  position: relative;
  z-index: 1;
  flex: none;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 16px 6px;
  border-top: 1px solid #dbe5e9;
  color: #4b5c63;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.switch-theme > span { display: inline-flex; align-items: center; gap: 6px; overflow: hidden; }
.switch-theme .icon { font-size: 14px; color: #0d8fb3; }
/* keep the label readable over the sider's yellow ring */
.switch-theme { background: rgba(245, 250, 252, 0.9); backdrop-filter: blur(2px); }
html[data-theme="dark"] .switch-theme { border-top-color: #273943; color: #9fb4be; background: rgba(17, 31, 38, 0.9); }
html[data-theme="dark"] .switch-theme .icon { color: #7fd8ed; }

.switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 22px;
  border: 0;
  border-radius: 100px;
  background: #bac7cc;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 35, 11, 0.2);
  transition: left 0.2s;
}
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"]::after { left: 24px; }
html[data-theme="dark"] .switch { background: #395561; }
html[data-theme="dark"] .switch[aria-checked="true"] { background: var(--primary); }

/* Collapsed sider (desktop) */
html.sider-collapsed .sider { flex-basis: var(--sider-collapsed-w); width: var(--sider-collapsed-w); }
html.sider-collapsed .sider-brand { padding: 0 21px; }
html.sider-collapsed .sider-brand .brand-name,
html.sider-collapsed .menu-item span,
html.sider-collapsed .menu-item .external,
html.sider-collapsed .menu-label,
html.sider-collapsed .switch-theme > span { display: none; }
html.sider-collapsed .menu-item { justify-content: center; padding: 0; }
html.sider-collapsed .switch-theme { justify-content: center; padding: 0 0 6px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.main::before {
  content: "";
  position: fixed;
  right: -140px;
  top: -120px;
  width: 360px;
  height: 360px;
  border: 64px solid var(--ring-yellow);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.main::after {
  content: "";
  position: fixed;
  left: calc(var(--sider-w) - 110px);
  bottom: -130px;
  width: 300px;
  height: 300px;
  border: 52px solid var(--ring-teal);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
html[data-theme="dark"] .main::before, html[data-theme="dark"] .main::after { opacity: 0.5; }

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid #d7e3e9;
  background: linear-gradient(90deg, #fff 0%, #f5fafc 100%);
  box-shadow: var(--shadow-header);
}
.header::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 180px; height: 3px;
  background: linear-gradient(90deg, #1fa7cb 0%, #f4da1e 100%);
}
html[data-theme="dark"] .header { border-bottom-color: #273943; background: linear-gradient(90deg, #132029 0%, #101a21 100%); }

.header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-title { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.header-title .kicker { margin: 0; color: #6a7981; }
.header-title h2 { margin: 2px 0 0; font-size: 17px; font-weight: 700; color: #203039; white-space: nowrap; }
html[data-theme="dark"] .header-title .kicker { color: #8ea3ad; }
html[data-theme="dark"] .header-title h2 { color: #d5e4ea; }

.icon-button {
  width: 42px; height: 42px;
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #cfe0e7;
  border-radius: 10px;
  background: #fff;
  color: #4a5860;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
}
.icon-button:hover { color: #0f95b9; border-color: var(--primary); background: #f1f9fc; }
html[data-theme="dark"] .icon-button { border-color: #2b3d47; background: #15242c; color: #9db2bc; }
html[data-theme="dark"] .icon-button:hover { color: #6ddbef; border-color: #2ea6c4; background: #1b2f39; }

.header-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.user-menu { position: relative; }
.user-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border: 1px solid #d4e0e6;
  border-radius: 12px;
  background: #fff;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.user-trigger:hover { border-color: var(--primary); }
.greeting { color: var(--faint); font-size: 12px; }
.user-name { font-size: 13px; font-weight: 700; color: #2a3840; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px; font-weight: 700;
}
.user-arrow { color: #7c8a93; font-size: 12px; transition: transform 0.2s; }
.user-trigger[aria-expanded="true"] .user-arrow { transform: rotate(180deg); }
html[data-theme="dark"] .user-trigger { border-color: #2b3d47; background: #15232b; }
html[data-theme="dark"] .user-name { color: #d0dee4; }

.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  padding: 6px;
  border: 1px solid #dce5e9;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  z-index: 40;
}
.dropdown[hidden] { display: none; }
.dropdown-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border-split); margin-bottom: 6px; }
.dropdown-head strong { display: block; color: var(--title); overflow-wrap: anywhere; }
.dropdown-head span { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.dropdown form { margin: 0; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0; border-radius: 8px;
  background: none;
  color: var(--text);
  font: 14px var(--font);
  text-align: left;
  cursor: pointer;
}
.dropdown-item:hover { background: #edf7fb; color: var(--text); }
.dropdown-item .icon { color: var(--muted); }
.dropdown-item.danger:hover { color: var(--error); }
.dropdown-item.danger:hover .icon { color: var(--error); }
html[data-theme="dark"] .dropdown { border-color: #2b3d47; background: #132028; }
html[data-theme="dark"] .dropdown-item:hover { background: #1f313b; }

.content {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 20px;
}

.bread {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid #dbe5ea;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(17, 53, 67, 0.06);
  color: #66757d;
  font-weight: 500;
}
.bread a { display: inline-flex; align-items: center; gap: 6px; color: #506168; }
.bread a:hover { color: #0f93b7; }
.bread .sep { color: #a9b6bc; }
.bread .current { color: #607078; font-weight: 600; }
html[data-theme="dark"] .bread { border-color: #2b3c45; box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24); color: #a4bac4; }
html[data-theme="dark"] .bread a { color: #b6c9d2; }
html[data-theme="dark"] .bread a:hover { color: #6ddcf0; }
html[data-theme="dark"] .bread .current { color: #a4bac4; }

.content-inner {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: calc(100vh - 230px);
  padding: 24px;
  background: var(--surface);
  border: 1px solid #dce5e9;
  border-radius: 18px;
  box-shadow: var(--shadow-panel);
}
.content-inner::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 180px; height: 4px;
  background: var(--strip);
}
html[data-theme="dark"] .content-inner { border-color: #2b3c45; }

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.heading { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.heading-icon {
  flex: 0 0 48px;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 22px;
  font-weight: 800;
}
.heading h1 { font-size: 22px; font-weight: 700; margin: 2px 0 4px; overflow-wrap: anywhere; }
.heading p { color: var(--muted); }
.heading-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; color: var(--muted); font-size: 13px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.stat-icon {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px; font-size: 20px;
  background: var(--primary-soft); color: var(--primary-ink);
}
.stat-icon.yellow { background: rgba(244, 218, 30, 0.2); color: #9a7f00; }
.stat-icon.green { background: rgba(61, 179, 122, 0.14); color: #23774f; }
.stat-icon.red { background: rgba(214, 69, 69, 0.12); color: #b23a3a; }
html[data-theme="dark"] .stat-icon.yellow { color: #f4da1e; }
html[data-theme="dark"] .stat-icon.green { color: #6fd5a0; }
html[data-theme="dark"] .stat-icon.red { color: #f08a8a; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { color: var(--title); font-size: 24px; font-weight: 700; line-height: 1.2; }

/* Application cards */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.app-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.app-card:hover { color: var(--text); transform: translateY(-2px); border-color: rgba(31, 167, 203, 0.5); box-shadow: 0 16px 32px rgba(18, 49, 60, 0.1); }
.app-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.app-avatar {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 18px; font-weight: 800;
}
.app-card h3 { margin: 16px 0 4px; font-size: 16px; overflow-wrap: anywhere; }
.app-url { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-split);
  font-size: 12.5px;
  color: var(--muted);
}
.app-card .app-url { margin-bottom: 16px; }
.app-meta strong { display: inline-flex; align-items: center; gap: 6px; color: var(--title); font-weight: 600; }
.app-meta strong .icon { color: var(--success); }
.app-meta strong.none .icon { color: var(--faint); }

.empty {
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  background: var(--primary-softer);
}
.empty-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 18px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 30px;
}
.empty h2 { font-size: 18px; margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 440px; margin: 0 auto 20px; }

.stack { display: grid; gap: 18px; min-width: 0; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

/* Two-column page body */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 18px; align-items: start; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.form-layout .card-body { padding: 24px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--border-split); }

/* Descriptions */
.descriptions { margin: 0; }
.descriptions > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-split); }
.descriptions > div:first-child { padding-top: 0; }
.descriptions > div:last-child { border-bottom: 0; padding-bottom: 0; }
.descriptions dt { color: var(--muted); font-size: 13px; }
.descriptions dd { margin: 0; color: var(--title); overflow-wrap: anywhere; }
.descriptions code { color: var(--title); }

/* Timeline (review progress) */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 20px 30px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute; left: 6px; top: 18px; bottom: -2px;
  width: 2px; background: var(--border-split);
}
.timeline li:last-child::before { display: none; }
.timeline .dot {
  position: absolute; left: 0; top: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 3px solid var(--border-strong);
  background: var(--surface);
}
.timeline li.done .dot { border-color: var(--success); background: var(--success); }
.timeline li.current .dot { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline li.failed .dot { border-color: var(--error); background: var(--error); }
.timeline strong { display: block; color: var(--title); }
.timeline span { color: var(--muted); font-size: 13px; }

/* Credentials */
.secret-fields { display: grid; gap: 14px; margin-top: 16px; }
.secret-field label { display: block; margin-bottom: 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); }
.field-control { display: flex; gap: 8px; align-items: stretch; }
.field-control .input { font-family: var(--mono); font-size: 13px; background: var(--code-bg); min-width: 0; }
.field-control .btn { flex: none; }
.btn.copied { color: var(--success); border-color: var(--success); }

.credential-masked { display: grid; gap: 10px; }
.credential-masked > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--code-bg); border: 1px solid var(--border-split); }
.credential-masked span { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.credential-masked code { color: var(--title); overflow-wrap: anywhere; text-align: right; }

.rotation-actions { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-split); }
.rotation-actions > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.rotation-actions strong, .rotation-actions span { display: block; }
.rotation-actions strong { color: var(--title); font-size: 13px; }
.rotation-actions span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.rotation-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 18px; align-items: start; }
.rotation-form { margin-top: 22px; }

.reveal-card { margin-bottom: 18px; border-color: #f6e58a; }
html[data-theme="dark"] .reveal-card { border-color: #5c5218; }

.side-note { display: flex; gap: 12px; }
.side-note .icon { flex: none; font-size: 20px; color: var(--primary); margin-top: 2px; }
.side-note p { color: var(--muted); }
.side-note p + p { margin-top: 8px; }
.side-note strong { color: var(--title); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 10px; color: var(--text-2); }
.checklist .icon { flex: none; color: var(--primary); margin-top: 3px; }
html[data-theme="dark"] .checklist li { color: var(--text-2); }

/* Technical documentation */
.docs-hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin: -24px -24px 24px; padding: 38px 34px;
  color: #fff; background: linear-gradient(125deg, #0d3544 0%, #0f7895 62%, #1697b8 100%);
  position: relative; overflow: hidden;
}
.public-docs { margin: 16px 0; overflow: hidden; border: 1px solid var(--border-split); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-panel); }
.public-docs .docs-hero { margin: 0; }
.public-docs .docs-layout { padding: 30px; }
.docs-hero::after {
  content: ""; position: absolute; width: 240px; height: 240px; right: -75px; top: -120px;
  border: 36px solid rgba(244, 218, 30, .24); border-radius: 50%; pointer-events: none;
}
.docs-hero > * { position: relative; z-index: 1; }
.docs-kicker { display: block; margin-bottom: 8px; color: #f5df3d; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.docs-hero h1 { margin: 0 0 10px; color: #fff; font-size: clamp(26px, 4vw, 38px); line-height: 1.12; }
.docs-hero p { max-width: 720px; margin: 0; color: #d8edf3; font-size: 15.5px; }
.docs-version { min-width: 110px; padding: 12px 15px; border: 1px solid rgba(255,255,255,.24); border-radius: 12px; background: rgba(5,36,48,.25); backdrop-filter: blur(4px); }
.docs-version span, .docs-version strong { display: block; }
.docs-version span { color: #c5e3ec; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.docs-version strong { margin-top: 2px; color: #fff; font-size: 18px; }

.docs-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 30px; align-items: start; max-width: 1280px; margin: 0 auto; }
.docs-toc { position: sticky; top: calc(var(--header-h) + 18px); padding: 16px; border: 1px solid var(--border-split); border-radius: 12px; background: var(--surface); }
.docs-toc strong { display: block; margin-bottom: 8px; color: var(--title); font-size: 13px; }
.docs-toc a { display: block; padding: 7px 9px; border-left: 2px solid transparent; color: var(--muted); font-size: 13px; }
.docs-toc a:hover { border-left-color: var(--primary); color: var(--primary); background: var(--primary-softer); }
.docs-content { min-width: 0; }
.docs-section { padding: 2px 0 34px; scroll-margin-top: calc(var(--header-h) + 20px); }
.docs-section + .docs-section { padding-top: 30px; border-top: 1px solid var(--border-split); }
.docs-section p { color: var(--text-2); line-height: 1.72; }
.docs-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.docs-heading > span { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 11px; color: var(--primary-ink); background: var(--primary-soft); }
.docs-heading > span .icon { font-size: 19px; }
.docs-heading small { display: block; margin-bottom: 1px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.docs-heading h2 { margin: 0; color: var(--title); font-size: 21px; }

.docs-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.docs-flow > div { min-height: 132px; padding: 16px; border: 1px solid var(--border-split); border-radius: 12px; background: var(--primary-softer); }
.docs-flow span { width: 26px; height: 26px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 50%; color: #fff; background: var(--primary); font-size: 12px; font-weight: 800; }
.docs-flow strong, .docs-flow small { display: block; }
.docs-flow strong { color: var(--title); }
.docs-flow small { margin-top: 4px; color: var(--muted); line-height: 1.4; }

.docs-steps { margin: 18px 0 0; padding: 0; list-style: none; }
.docs-steps li { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border-split); }
.docs-steps li:last-child { border-bottom: 0; }
.docs-steps li > span { color: var(--primary); font: 700 13px var(--mono); }
.docs-steps strong { color: var(--title); }
.docs-steps p { margin: 3px 0 0; }

.code-block { margin: 18px 0; overflow: hidden; border: 1px solid #263d48; border-radius: 12px; background: #0e1b22; box-shadow: 0 12px 28px rgba(10, 29, 38, .12); }
.code-title { display: flex; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid #263d48; color: #9eb5bf; background: #132630; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.code-block pre { margin: 0; padding: 18px; overflow-x: auto; }
.code-block code { color: #d9f0f5; font-size: 13px; line-height: 1.75; }
.code-title button { padding: 0; border: 0; background: none; color: #8fd8e8; font: 700 11px var(--font); text-transform: uppercase; letter-spacing: .06em; cursor: pointer; }
.code-title button:hover, .code-title button.copied { color: #f5df3d; }
.language-tabs { margin-top: 20px; border: 1px solid var(--border-split); border-radius: 14px; background: var(--surface); overflow: hidden; }
.language-tab-list { display: flex; gap: 4px; padding: 7px; border-bottom: 1px solid var(--border-split); background: var(--primary-softer); }
.language-tab { min-width: 110px; min-height: 38px; padding: 7px 16px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font: 700 13px var(--font); cursor: pointer; }
.language-tab:hover { color: var(--primary-ink); background: var(--primary-soft); }
.language-tab.active { border-color: var(--border-split); color: var(--primary-ink); background: var(--surface); box-shadow: 0 4px 12px rgba(16, 62, 78, .08); }
.language-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.language-panel { padding: 20px; }
.language-panel[hidden] { display: none; }
.language-meta { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.language-meta strong, .language-meta span { display: block; }
.language-meta strong { color: var(--title); }
.language-meta span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.language-meta > code { padding: 6px 9px; border: 1px solid var(--border-split); border-radius: 7px; color: var(--primary-ink); background: var(--code-bg); white-space: nowrap; }
.code-example { margin: 0; }
.code-example pre { max-height: 610px; }
.implementation-notes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.implementation-notes span { padding: 5px 9px; border-radius: 999px; color: var(--muted); background: var(--primary-softer); border: 1px solid var(--border-split); font-size: 11px; font-weight: 600; }
.docs-note, .docs-warning { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 14px 16px; border-radius: 11px; }
.docs-note { border: 1px solid #b6e2ef; background: #eef8fb; }
.docs-note > span, .docs-warning > span { flex: none; margin-top: 2px; }
.docs-note > span { color: var(--primary); }
.docs-note p, .docs-warning p { margin: 0; }
.docs-warning { border: 1px solid #f2d27a; background: #fff9df; }
.docs-warning > span { color: #b88b00; }
.docs-warning strong { display: block; margin-bottom: 2px; color: #6b5500; }
.docs-warning p { color: #756214; }
html[data-theme="dark"] .docs-note { border-color: #1f5568; background: #12262f; }
html[data-theme="dark"] .docs-warning { border-color: #5c5218; background: #26230f; }
html[data-theme="dark"] .docs-warning strong, html[data-theme="dark"] .docs-warning p { color: #efe3a0; }

.docs-table-wrap { margin-top: 18px; overflow-x: auto; border: 1px solid var(--border-split); border-radius: 12px; }
.docs-table { width: 100%; border-collapse: collapse; min-width: 700px; }
.docs-table th, .docs-table td { padding: 13px 15px; border-bottom: 1px solid var(--border-split); text-align: left; vertical-align: top; }
.docs-table tr:last-child td { border-bottom: 0; }
.docs-table th { color: var(--title); background: var(--primary-softer); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.docs-table td { color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.docs-table td:first-child { white-space: nowrap; }
.docs-table code { color: var(--primary-ink); font-weight: 700; }

.docs-compact-list { margin: 18px 0 0; padding-left: 21px; color: var(--text-2); }
.docs-compact-list li { margin: 9px 0; padding-left: 4px; }
.docs-muted { margin-top: 18px; padding-left: 13px; border-left: 3px solid var(--border-strong); color: var(--muted) !important; font-size: 13px; }
.docs-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.docs-check-grid li { display: flex; gap: 10px; align-items: flex-start; padding: 13px; border: 1px solid var(--border-split); border-radius: 10px; color: var(--text-2); background: var(--primary-softer); }
.docs-check-grid .icon { flex: none; margin-top: 2px; color: var(--success); }
.docs-faq { display: grid; gap: 9px; margin-top: 18px; }
.docs-faq details { border: 1px solid var(--border-split); border-radius: 10px; background: var(--surface); }
.docs-faq summary { padding: 14px 16px; color: var(--title); font-weight: 700; cursor: pointer; }
.docs-faq details[open] summary { border-bottom: 1px solid var(--border-split); }
.docs-faq p { margin: 0; padding: 14px 16px; }

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  padding: 10px 16px 22px;
  text-align: center;
  color: #6b7b84;
}
.footer .links { margin-bottom: 6px; }
.footer .links a { color: #5c6c74; font-weight: 600; }
.footer .links a:not(:last-child) { margin-right: 32px; }
.footer .links a:hover { color: #0f95b9; }
html[data-theme="dark"] .footer { color: #8ea3ad; }
html[data-theme="dark"] .footer .links a { color: #9ab0bb; }
html[data-theme="dark"] .footer .links a:hover { color: #6edcf0; }

.backdrop { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
  .header-title { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .form-layout, .grid-2, .rotation-layout { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-toc { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .docs-toc strong { flex-basis: 100%; }
  .docs-toc a { border-left: 0; border-bottom: 2px solid transparent; }
  .docs-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; gap: 14px; max-width: 620px; margin: 0 auto; width: 100%; }
  .brand-panel { padding: 24px; }
  .brand-panel h1 { font-size: clamp(26px, 8vw, 34px); }
  .steps { grid-template-columns: 1fr; max-width: 620px; margin-left: auto; margin-right: auto; width: 100%; }
}

@media (max-width: 767px) {
  .sider {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    box-shadow: none;
  }
  html.sider-collapsed .sider { flex-basis: var(--sider-w); width: var(--sider-w); }
  html.sider-collapsed .sider-brand .brand-name,
  html.sider-collapsed .menu-item span,
  html.sider-collapsed .menu-label,
  html.sider-collapsed .switch-theme > span { display: revert; }
  html.sider-collapsed .menu-item { justify-content: flex-start; padding: 0 14px; }
  html.sider-collapsed .switch-theme { justify-content: space-between; padding: 0 16px 6px; }
  html.sider-open .sider { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, 0.25); }
  html.sider-open .backdrop {
    display: block;
    position: fixed; inset: 0;
    z-index: 25;
    background: rgba(22, 33, 39, 0.42);
  }
  .main::before, .main::after { display: none; }
  .header { padding: 0 10px; }
  .greeting, .user-name { display: none; }
  .content { padding: 12px; }
  .content-inner { padding: 16px; min-height: calc(100vh - 160px); }
  .docs-hero { margin: -16px -16px 20px; padding: 28px 20px; }
  .public-docs .docs-hero { margin: 0; }
  .public-docs .docs-layout { padding: 20px; }
  .card-head { padding: 0 16px; }
  .card-body { padding: 16px; }
  .descriptions > div { grid-template-columns: 1fr; gap: 2px; }
  .page-header > .btn { width: 100%; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .public { padding: 14px; }
  .public::before { width: 260px; height: 260px; border-width: 46px; right: -110px; top: -100px; }
  .footer .links a:not(:last-child) { margin-right: 18px; }
}

@media (max-width: 560px) {
  .brand-panel, .form-card { border-radius: 16px; padding: 20px; }
  .brand-panel::after { width: 190px; height: 190px; border-width: 34px; right: -80px; bottom: -100px; }
  .public-actions .btn:not(.btn-primary) { display: none; }
  .public-actions .public-doc-link { display: inline-flex; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 20px; }
  .field-control { flex-direction: column; }
  .app-grid { grid-template-columns: 1fr; }
  .rotation-actions > div { align-items: stretch; flex-direction: column; }
  .rotation-actions .btn { width: 100%; }
  .docs-hero { align-items: flex-start; flex-direction: column; }
  .docs-version { min-width: 0; }
  .docs-flow, .docs-check-grid { grid-template-columns: 1fr; }
  .language-tab-list { overflow-x: auto; }
  .language-tab { min-width: 100px; }
  .language-panel { padding: 14px; }
  .language-meta { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (max-width: 480px) {
  .content { padding: 8px; }
  .content-inner { padding: 12px; border-radius: 12px; }
  .docs-hero { margin: -12px -12px 18px; }
  .public-docs { margin: 8px 0; border-radius: 12px; }
  .public-docs .docs-hero { margin: 0; }
  .public-docs .docs-layout { padding: 14px; }
  .public-brand span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
