:root {
  --bg: #F2F4F4;
  --white: #FFFFFF;
  --dark: #051114;
  --dark-2: #0c1d21;
  --accent: #E3FC72;
  --accent-ink: #051114;
  --text: #051114;
  --text-dim: #55605e;
  --text-faint: #0511147a;
  --on-dark: rgba(255, 255, 255, .72);
  --on-dark-dim: rgba(255, 255, 255, .5);
  --border: #E4E7E7;
  --border-strong: #D2D2D2;
  --field-border: #D2D2D2;
  --red: #F10A26;
  --green: #12A150;
  --orange: #C9930B;
  --link: #1770C1;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Inter", "Helvetica Neue", Arial, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  letter-spacing: .01em;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }

.layout { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--dark);
  color: var(--on-dark);
  padding: 22px 14px; display: flex; flex-direction: column; gap: 4px;
}
.brand {
  display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px;
  letter-spacing: .02em; color: var(--white); margin: 4px 8px 24px;
  text-decoration: none;
}
a.brand { cursor: pointer; transition: opacity .15s ease; }
a.brand:hover { opacity: .8; text-decoration: none; }
.topbar a.brand { margin: 0; }

.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-right: 44px; }
.pass-toggle {
  position: absolute; top: 0; right: 0; height: 42px; width: 42px; padding: 0;
  border: none; background: transparent; color: var(--text-faint); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pass-toggle:hover { color: var(--text); background: transparent; }
.pass-toggle svg { width: 19px; height: 19px; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 8px; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.brand .mark svg { width: 26px; height: 26px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--on-dark); cursor: pointer; font-weight: 500; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: var(--white); }
.nav-item.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav-badge {
  margin-left: auto; display: none; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 1;
  animation: badgePop .25s cubic-bezier(.34, 1.56, .64, 1);
}
.nav-badge.show { display: inline-flex; }
.nav-item.active .nav-badge { background: var(--dark); color: var(--white); }
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }
.sidebar .spacer { flex: 1; }
.sidebar .brand .badge { margin-left: 6px; background: rgba(255, 255, 255, .1); border-color: transparent; color: var(--white); }
.content { padding: 30px 34px; overflow: auto; }

.ico { display: inline-flex; width: 18px; height: 18px; flex: 0 0 auto; }
.ico svg { width: 100%; height: 100%; }
.nav-label { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--on-dark-dim); margin: 6px 12px 6px; }

.account {
  display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 10px;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--radius-sm);
}
.account__avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: 0 0 auto;
}
.account__info { min-width: 0; flex: 1; }
.account__email { color: var(--white); font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__role { color: var(--on-dark-dim); font-size: 11px; margin-top: 1px; }
.account__logout {
  width: 32px; height: 32px; padding: 0; flex: 0 0 auto; border: none; background: transparent;
  color: var(--on-dark-dim); border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.account__logout:hover { background: rgba(255, 255, 255, .1); color: var(--white); }
.account__logout .ico { width: 17px; height: 17px; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.page-head .sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-5 { grid-template-columns: repeat(5, 1fr); }

.stat { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stat .label { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 8px; letter-spacing: -.01em; }
.stat .value small { font-size: 14px; color: var(--text-dim); font-weight: 500; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12px; color: var(--text); margin-bottom: 7px; letter-spacing: .03em; }
input, select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border-radius: var(--radius-sm);
  background: var(--white); color: var(--text); border: 1px solid var(--field-border); outline: none;
  transition: border-color .15s;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--dark); outline: 3px solid rgba(227, 252, 114, .55); outline-offset: 0; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
button:focus-visible, .btn:focus-visible { outline: 3px solid rgba(227, 252, 114, .55); outline-offset: 1px; }
select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23051114' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.check input { width: auto; height: auto; accent-color: var(--dark); }

button, .btn {
  cursor: pointer; border: 1px solid var(--border-strong); background: var(--white); color: var(--text);
  height: 42px; padding: 0 18px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  letter-spacing: .02em; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, border-color .15s, filter .15s;
}
button:hover, .btn:hover { background: #f6f7f7; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover, .btn.primary:hover { filter: brightness(.95); background: var(--accent); }
button.danger { background: var(--white); border-color: var(--red); color: var(--red); }
button.danger:hover { background: #fef2f3; }
button.success, .btn.success { background: var(--green); border-color: var(--green); color: var(--white); }
button.success:hover, .btn.success:hover { filter: brightness(.95); background: var(--green); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: rgba(5, 17, 20, .05); }
button.sm, .btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
button:disabled { opacity: .5; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--text-dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: none; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--border-strong); color: var(--text-dim); }
.badge.ok, .badge.warn, .badge.err { border-color: transparent; }
.badge.ok { color: #0d7a3c; background: rgba(18, 161, 80, .1); }
.badge.warn { color: #96700a; background: rgba(201, 147, 11, .12); }
.badge.err { color: #c40820; background: rgba(241, 10, 38, .08); }
.badge.ok::before, .badge.warn::before, .badge.err::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto;
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; flex-wrap: wrap; }
.tab { padding: 10px 15px; cursor: pointer; color: var(--text-dim); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); font-weight: 600; border-bottom-color: var(--dark); }
.subtabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.subtab { padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-dim); border: 1px solid var(--border-strong); background: var(--white); }
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }

.hidden { display: none !important; }
.muted { color: var(--text-dim); }
.mono { font-family: var(--mono); }
.toast {
  position: fixed; right: 20px; bottom: 20px; background: var(--dark); color: var(--white); border: 1px solid var(--dark);
  padding: 13px 18px; border-radius: var(--radius-sm); opacity: 0; transform: translateY(10px);
  transition: .2s; z-index: 50; max-width: 360px; font-size: 14px;
}
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--red); border-color: var(--red); }
.section-title { font-size: 15px; font-weight: 700; margin: 4px 0 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.section-head .section-title { margin: 0; }
.empty { color: var(--text-dim); text-align: center; padding: 42px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .ico { width: 40px; height: 40px; color: var(--border-strong); }
.empty b { color: var(--text); font-size: 15px; }
.empty span { font-size: 13.5px; }
canvas { width: 100%; display: block; }

.danger-zone { border-color: rgba(241, 10, 38, .35); }
.danger-zone .section-title { color: var(--red); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #b9bebe; }
::-webkit-scrollbar-track { background: transparent; }
.table-wrap { width: 100%; overflow-x: auto; }
.table-wrap table { min-width: 480px; }

.rows { display: flex; flex-direction: column; gap: 8px; }
.kv-row { display: flex; gap: 8px; align-items: center; }
.kv-row input { flex: 1; min-width: 0; }
.kv-row .kv-k { max-width: 42%; }
.icon-btn {
  flex: 0 0 auto; width: 38px; height: 38px; padding: 0; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--white); color: var(--text-dim);
  font-size: 20px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--red); color: var(--red); background: #fef2f3; }
.rows__add { margin-top: 10px; }
.field-hint { font-size: 12px; color: var(--text-dim); margin: -2px 0 8px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(5, 17, 20, .38);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px;
  z-index: 100; overflow-y: auto; animation: fade .12s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(540px, 100%); background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); margin: auto; animation: pop .14s ease;
}
@keyframes pop { from { transform: translateY(8px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal__head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.modal__close { width: 34px; height: 34px; padding: 0; border: none; background: transparent; color: var(--text-dim); font-size: 22px; line-height: 1; cursor: pointer; border-radius: var(--radius-sm); }
.modal__close:hover { background: rgba(5, 17, 20, .06); color: var(--text); }
.modal__body { padding: 20px; }
.modal__body .field:last-child { margin-bottom: 0; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }
.form-grid { display: grid; gap: 14px; }
.form-grid .field { margin-bottom: 0; }

@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sheetIn { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }

.view-in { animation: viewIn .26s cubic-bezier(.22, .61, .36, 1); }
.view-in > .card, .view-in > .grid > .card, .view-in > .grid > .stat { animation: rowIn .34s cubic-bezier(.22, .61, .36, 1) both; }
.view-in > .grid > *:nth-child(2) { animation-delay: .05s; }
.view-in > .grid > *:nth-child(3) { animation-delay: .1s; }
.view-in > .grid > *:nth-child(4) { animation-delay: .15s; }

.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border-strong); border-top-color: var(--dark); border-radius: 50%; animation: spin .7s linear infinite; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--text-dim); padding: 14px 2px; animation: fadeIn .2s ease; }

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a { color: var(--text-dim); cursor: pointer; }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.crumbs .sep { opacity: .45; }
.crumbs .cur { color: var(--text); font-weight: 600; }

.card { transition: border-color .18s ease; }
.stat { transition: border-color .18s ease, transform .18s ease; }
.stat:hover { border-color: var(--border-strong); transform: translateY(-2px); }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fafbfb; }
.tab, .subtab, .nav-item { transition: color .15s ease, background .15s ease, border-color .15s ease; }
.badge { transition: background .15s ease, border-color .15s ease; }
button, .btn { transition: background .15s ease, border-color .15s ease, filter .15s ease, transform .06s ease; }
button:active, .btn:active { transform: translateY(1px); }
.subtab:active { transform: scale(.97); }

.topbar { display: none; }
.hamburger { width: 40px; height: 40px; align-items: center; justify-content: center; background: rgba(255, 255, 255, .1); border: none; border-radius: var(--radius-sm); color: var(--white); font-size: 18px; cursor: pointer; padding: 0; }
.hamburger:hover { background: rgba(255, 255, 255, .16); }
.nav-backdrop { display: none; }

@media (min-width: 901px) {
  .topbar, .nav-backdrop { display: none !important; }
  .layout { height: 100vh; }
  .sidebar { height: 100vh; overflow-y: auto; }
  .content { height: 100vh; }
}
@media (max-width: 900px) {
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 120;
    background: var(--dark); color: var(--white); padding: 10px 14px;
  }
  .topbar .brand { margin: 0; font-size: 17px; color: var(--white); }
  .topbar .brand .mark { width: 24px; height: 24px; border-radius: 7px; }
  .topbar .brand .mark svg { width: 22px; height: 22px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 264px; z-index: 200;
    transform: translateX(-100%); transition: transform .28s cubic-bezier(.22, .61, .36, 1);
    flex-direction: column; overflow-y: auto;
  }
  .sidebar.open { transform: none; }
  .nav-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(5, 17, 20, .42); z-index: 150;
    opacity: 0; visibility: hidden; transition: opacity .24s ease, visibility .24s ease;
  }
  .nav-backdrop.show { opacity: 1; visibility: visible; }
  .content { padding: 20px 16px; }
  .grid.cols-3, .grid.cols-4, .grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
  .tabs, .subtabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar, .subtabs::-webkit-scrollbar { height: 0; }
  .tab, .subtab { white-space: nowrap; }
}
@media (max-width: 560px) {
  .card-table { min-width: 0 !important; }
  .card-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .card-table, .card-table tbody, .card-table tr, .card-table td { display: block; width: 100%; }
  .card-table tr {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 6px 14px; margin-bottom: 10px; animation: rowIn .3s ease both;
  }
  .card-table tr:last-child { margin-bottom: 0; }
  .card-table td {
    border: none; padding: 9px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px;
    border-bottom: 1px solid var(--border);
  }
  .card-table td::before {
    content: attr(data-label); color: var(--text-dim); font-size: 12px; font-weight: 600;
    letter-spacing: .02em; flex: 0 0 auto;
  }
  .card-table td .origin-list { flex: 1 1 auto; min-width: 0; text-align: right; font-size: 13px; }
  .card-table td.actions { border-bottom: none; padding: 12px 0 6px; }
  .card-table td.actions::before { content: none; }
  .card-table td.actions button { width: 100%; }

  .content { padding: 16px 13px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head h1 { font-size: 20px; }
  .page-head > button, .page-head > .btn { width: 100%; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-5 { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  .row > * { width: 100%; }
  .kv-row { flex-wrap: nowrap; }
  .kv-row .kv-k { max-width: none; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { width: 100%; border-radius: var(--radius) var(--radius) 0 0; animation: sheetIn .26s cubic-bezier(.22, .61, .36, 1); max-height: 92vh; overflow-y: auto; }
}
/* ── Updates / changelog feed ── */
.updates { max-width: 820px; margin: 0 auto; }
.updates__hero {
  position: relative; overflow: hidden; background: var(--dark); color: var(--white);
  border-radius: var(--radius); padding: 32px 30px; margin-bottom: 28px;
  animation: viewIn .4s cubic-bezier(.22, .61, .36, 1);
}
.updates__hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(227, 252, 114, .12) 1px, transparent 1px);
  background-size: 22px 22px;
}
.updates__hero::after {
  content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 252, 114, .18), transparent 65%);
  top: -140px; right: -120px; pointer-events: none;
}
.updates__hero-badge {
  position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px;
  border: 1px solid rgba(227, 252, 114, .35); border-radius: 999px; color: var(--accent);
  font-size: 12px; font-weight: 600; letter-spacing: .04em; margin-bottom: 14px;
}
.updates__hero-badge .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(227, 252, 114, .5); } 50% { opacity: .6; box-shadow: 0 0 0 6px rgba(227, 252, 114, 0); } }
.updates__hero h1 { position: relative; margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.updates__hero p { position: relative; margin: 0; color: var(--on-dark-dim); font-size: 14px; line-height: 1.55; }

.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(var(--border-strong), var(--border)); }
.post-item { position: relative; margin-bottom: 18px; }
.post-dot {
  position: absolute; left: -27px; top: 20px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--white); border: 3px solid var(--accent); z-index: 1;
}
.post-item.cat-feature .post-dot { border-color: var(--green); }
.post-item.cat-improvement .post-dot { border-color: var(--link); }
.post-item.cat-fix .post-dot { border-color: var(--orange); }
.post-item.cat-announcement .post-dot { border-color: #8A38F5; }
.post-card { transition: border-color .18s ease, transform .18s ease; }
.post-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.post-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.post-cat { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.post-cat.cat-feature { color: #0d7a3c; background: rgba(18, 161, 80, .12); }
.post-cat.cat-improvement { color: var(--link); background: rgba(23, 112, 193, .12); }
.post-cat.cat-fix { color: #96700a; background: rgba(201, 147, 11, .14); }
.post-cat.cat-announcement { color: #6f24d6; background: rgba(138, 56, 245, .12); }
.post-date { color: var(--text-dim); font-size: 12.5px; }
.post-pin { margin-left: auto; color: var(--text-dim); font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.post-card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.post-body { color: var(--text); font-size: 14.5px; line-height: 1.62; }
.post-body p { margin: 0 0 10px; }
.post-body p:last-child { margin-bottom: 0; }
.post-body strong { font-weight: 700; }
.post-body ul { margin: 6px 0 10px; padding-left: 20px; }
.post-body li { margin: 3px 0; }

.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .55s cubic-bezier(.22, .61, .36, 1), transform .55s cubic-bezier(.22, .61, .36, 1); }

/* ── account block clickable ── */
.account { cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.account:hover { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .18); }
.account__logout { cursor: pointer; }

/* ── profile page ── */
.profile { max-width: 860px; margin: 0 auto; }
.profile__hero {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 20px;
  background: var(--dark); color: var(--white); border-radius: var(--radius);
  padding: 26px 28px; margin-bottom: 22px; animation: viewIn .4s cubic-bezier(.22, .61, .36, 1);
}
.profile__hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(227, 252, 114, .1) 1px, transparent 1px); background-size: 22px 22px; }
.profile__hero::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(227, 252, 114, .16), transparent 65%); top: -140px; right: -100px; }
.profile__avatar {
  position: relative; width: 72px; height: 72px; border-radius: 20px; flex: 0 0 auto;
  background: linear-gradient(140deg, var(--accent), #b7e83f); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800;
  animation: avatarPop .5s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes avatarPop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.profile__id { position: relative; min-width: 0; }
.profile__id h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; }
.profile__id .sub { color: var(--on-dark-dim); font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile__id .chip { padding: 2px 9px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18); font-size: 12px; }
.profile .card { animation: rowIn .4s cubic-bezier(.22, .61, .36, 1) both; }
.profile .grid.cols-2 > .card:nth-child(2) { animation-delay: .06s; }
.profile__save { display: flex; justify-content: flex-end; margin-top: 4px; }
.pw-strength { height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; margin: 2px 0 4px; }
.pw-strength i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .3s ease, background .3s ease; }

/* ── tickets / support thread ── */
.ticket { padding: 0; overflow: hidden; }
.thread { padding: 20px; display: flex; flex-direction: column; gap: 14px; max-height: 56vh; overflow-y: auto; background: #fafbfb; }
.msg { display: flex; animation: rowIn .3s ease both; }
.msg--me { justify-content: flex-end; }
.msg__bubble { max-width: 76%; background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 11px 14px; }
.msg--me .msg__bubble { background: var(--dark); color: var(--white); border-color: var(--dark); border-bottom-right-radius: 5px; }
.msg:not(.msg--me) .msg__bubble { border-bottom-left-radius: 5px; }
.msg__text { font-size: 14.5px; line-height: 1.55; word-break: break-word; }
.msg__time { font-size: 11px; margin-top: 6px; color: var(--text-dim); }
.msg--me .msg__time { color: rgba(255, 255, 255, .5); }
.msg__atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.msg__att { display: block; width: 120px; height: 90px; border-radius: 10px; background-size: cover; background-position: center; cursor: zoom-in; border: 1px solid var(--border); transition: transform .15s ease; }
.msg__att:hover { transform: scale(1.03); }
.reply { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.reply__actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

.attach { display: flex; flex-direction: column; gap: 8px; }
.attach__preview { display: flex; flex-wrap: wrap; gap: 8px; }
.attach__preview:empty { display: none; }
.attach__thumb { position: relative; width: 66px; height: 66px; border-radius: 9px; background-size: cover; background-position: center; border: 1px solid var(--border-strong); animation: pop .18s ease; }
.attach__thumb button { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: none; background: var(--dark); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.attach__btn { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-dim); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 9px 14px; transition: color .15s ease, border-color .15s ease; }
.attach__btn:hover { color: var(--text); border-color: var(--dark); }
.attach__btn input { display: none; }

.lightbox { position: fixed; inset: 0; background: rgba(5, 17, 20, .86); z-index: 300; display: none; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
.lightbox.show { display: flex; animation: fade .15s ease; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 10px; animation: pop .2s ease; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 20px minmax(90px, 1.2fr) minmax(60px, 1fr) auto; align-items: center; gap: 11px; animation: barIn .4s cubic-bezier(.22, .61, .36, 1) both; }
.bar-rank { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--text-dim); background: var(--bg); border-radius: 6px; flex: 0 0 auto; }
.bar-row:nth-child(1) .bar-rank { background: var(--accent); color: var(--accent-ink); }
.bar-label { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label .flag { font-size: 15px; line-height: 1; flex: 0 0 auto; }
.bar-label .bar-city { font-size: 11px; color: var(--text-faint); flex: 0 0 auto; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #051114, #22424a); width: 0; animation: quotaFill .7s cubic-bezier(.22, 1, .36, 1) both; }
.bar-row:nth-child(1) .bar-track i { background: linear-gradient(90deg, #8a9b1e, var(--accent)); }
.bar-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.bar-val small { font-weight: 500; }
@keyframes barIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.audience-grid { margin-top: 0; }
@media (max-width: 760px) { .audience-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .bar-row {
    grid-template-columns: 22px 1fr auto;
    grid-template-areas: "rank label val" "track track track";
    row-gap: 9px;
  }
  .bar-row .bar-rank { grid-area: rank; }
  .bar-row .bar-label { grid-area: label; }
  .bar-row .bar-val { grid-area: val; }
  .bar-row .bar-track { grid-area: track; }
}

.chart-card { position: relative; }
.chart-card canvas { width: 100%; display: block; touch-action: pan-y; }
.chart-tip { position: fixed; z-index: 9999; pointer-events: none; display: none; background: var(--dark); color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.5; box-shadow: 0 6px 24px rgba(5,17,20,.28); transform: translateY(-100%); white-space: nowrap; }
.chart-tip .tip-time { color: var(--on-dark-dim); font-size: 11px; margin-bottom: 3px; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 6px; }
.chart-tip .tip-row i { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto; }
.chart-tip .tip-row b { font-weight: 700; }
.chart-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.chart-head .section-title { margin: 0; }
.chart-legend { display: flex; align-items: center; gap: 14px; }
.chart-legend .leg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); font-weight: 500; }
.chart-legend .leg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-range { margin-left: auto; font-size: 12px; color: var(--text-faint); font-weight: 500; }

.deploy-log { margin-top: 12px; max-height: 320px; overflow: auto; background: var(--dark); color: var(--on-dark); font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; padding: 12px 14px; border-radius: var(--radius-sm); }

.badge.muted { background: var(--bg); color: var(--text-dim); }
.badge.cert-pending { animation: certPulse 1.3s ease-in-out infinite; }
@keyframes certPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.link-domain { font-weight: 700; color: var(--text); cursor: pointer; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .15s, color .15s; }
.link-domain:hover { color: var(--link); border-bottom-color: var(--link); }
.origin-list { min-width: 0; }
.origin-ip { line-height: 1.5; overflow-wrap: anywhere; }
.origin-ip + .origin-ip { margin-top: 2px; }

.tcp-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); }
.tcp-cta b { font-size: 14px; }
.tcp-grant-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.tcp-grant-row:last-child { border-bottom: none; }
.tcp-grant-row .tcp-dom { flex: 1 1 140px; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.tcp-grant-row .tcp-ports { flex: 0 0 auto; }
.tcp-grant-row .tcp-add { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.tcp-grant-row .tcp-add input { width: 96px; height: 34px; }
.tcp-grant-row .badge a { text-decoration: none; opacity: .7; }
.tcp-grant-row .badge a:hover { opacity: 1; }

.quota-card { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 16px; }
.quota-item { display: flex; flex-direction: column; gap: 8px; }
.quota-top { display: flex; align-items: baseline; justify-content: space-between; }
.quota-name { font-size: 13px; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.quota-val { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.quota-val.warn { color: var(--orange); }
.quota-bar { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.quota-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); width: 0; animation: quotaFill .6s cubic-bezier(.22, 1, .36, 1) forwards; }
.quota-bar i.warn { background: var(--orange); }
.quota-hint { font-size: 12px; color: var(--text-dim); }
.quota-hint a { color: var(--link); cursor: pointer; font-weight: 600; }
.quota-hint a:hover { text-decoration: underline; }
@keyframes quotaFill { from { width: 0; } }
@media (max-width: 640px) { .quota-card { grid-template-columns: 1fr; gap: 18px; } }

.edge-card__head { display: flex; align-items: center; gap: 8px; }
.edge-card__dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.edge-card__ip { font-size: 12px; color: var(--text-dim); margin: 4px 0 12px; }
.edge-card__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.edge-meters { display: grid; gap: 13px; }
.edge-meters .quota-name { font-size: 11px; }
.edge-meters .quota-val { font-size: 14px; }
.edge-facts { margin-top: 16px; border-top: 1px solid var(--border); }
.edge-fact { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.edge-fact:last-child { border-bottom: 0; padding-bottom: 0; }
.edge-fact > span { color: var(--text-dim); white-space: nowrap; }
.edge-fact > div { text-align: right; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

.terms { max-width: 780px; }
.terms__lead {
  background: var(--dark); color: var(--on-dark); border-radius: var(--radius);
  padding: 22px 24px; font-size: 14.5px; line-height: 1.65; margin-bottom: 26px;
  position: relative; overflow: hidden;
}
.terms__lead::after {
  content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 252, 114, .14), transparent 65%);
  top: -90px; right: -70px; pointer-events: none;
}
.terms__lead b { color: var(--accent); }
.terms__sec { margin-bottom: 26px; }
.terms__sec h2 {
  display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 700;
  margin: 0 0 12px; letter-spacing: -.01em;
}
.terms__num {
  width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex: 0 0 auto;
}
.terms__sec p { margin: 0 0 9px; font-size: 14px; line-height: 1.65; color: var(--text); }
.terms__sec p:last-child { margin-bottom: 0; }
.terms__sec ul { margin: 4px 0 9px; padding-left: 20px; }
.terms__sec li { font-size: 14px; line-height: 1.65; color: var(--text); margin-bottom: 4px; }
.terms__note {
  border-left: 3px solid var(--red); background: rgba(241, 10, 38, .05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 14px; font-size: 13px; line-height: 1.55; color: var(--text); margin-top: 12px;
}
.terms__foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--border); padding-top: 16px; margin-top: 30px;
  color: var(--text-dim); font-size: 12.5px;
}

.tariff { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 22px; margin-top: 10px; }
.tariff__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.tariff__row span { color: var(--text-dim); font-size: 13px; }
.tariff__row b { white-space: nowrap; }
.err-text { color: var(--red); font-weight: 600; }

.pay-notice {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  border-left: 3px solid var(--red); margin-bottom: 16px;
}
.pay-notice__body { display: grid; gap: 5px; min-width: 240px; flex: 1 1 320px; }
.pay-notice__body b { font-size: 15px; }
.pay-notice__body span { color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.pay-notice button { flex: 0 0 auto; }
@media (max-width: 640px) { .pay-notice button { width: 100%; } }

.suspend-banner {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--red); color: #fff; font-size: 13.5px;
  position: sticky; top: 0; z-index: 60; animation: rowIn .3s ease both;
}
.suspend-banner b { font-weight: 700; }
.suspend-banner span { opacity: .92; }
.suspend-banner button {
  height: 30px; padding: 0 14px; font-size: 12.5px; border: none; border-radius: 999px;
  background: #fff; color: var(--red); font-weight: 700; cursor: pointer;
}
.suspend-banner button:hover { filter: brightness(.95); }
@media (max-width: 640px) { .suspend-banner span { display: none; } }

.plan-pick { margin-top: 12px; }
.plan-pick__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.plan-pick__mbit { font-size: 40px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.plan-pick__unit { color: var(--text-dim); font-size: 13px; margin-top: 4px; }
.plan-pick__price { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.plan-pick__price b { font-size: 22px; letter-spacing: -.01em; }
.plan-pick__price span { color: var(--text-dim); font-size: 12px; }
.plan-pick__price i { font-style: normal; color: var(--text-faint); font-size: 11.5px; }
.plan-range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 8px; padding: 0; border: none; border-radius: 999px;
  background: linear-gradient(to right, var(--dark) 0%, var(--dark) var(--fill, 0%), var(--border) var(--fill, 0%), var(--border) 100%);
  outline: none; cursor: pointer;
}
.plan-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--dark); box-shadow: 0 2px 8px rgba(5, 17, 20, .25);
  transition: transform .12s ease;
}
.plan-range::-webkit-slider-thumb:hover { transform: scale(1.12); }
.plan-range::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--dark); box-shadow: 0 2px 8px rgba(5, 17, 20, .25);
}
.plan-range:focus-visible { outline: 3px solid rgba(227, 252, 114, .55); outline-offset: 3px; }
.plan-pick__scale { display: flex; justify-content: space-between; color: var(--text-faint); font-size: 11.5px; margin-top: 8px; }
.plan-pick__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.plan-pick__foot button:disabled { opacity: .45; cursor: default; }

/* ==========================================================================
   Guardora UI polish — v2 (elevation · surfaces · type · micro-interactions)
   Appended override layer. Keeps lime brand #E3FC72 on #051114.
   ========================================================================== */
:root {
  --bg: #EDF0F0;
  --surface: #FFFFFF;
  --surface-2: #F6F8F8;
  --muted: #EAEEEE;
  --border: #E4E9E9;
  --border-strong: #D2D9D9;
  --field-border: #D4DBDB;
  --text: #0A1719;
  --text-dim: #59655F;
  --text-faint: #93999a;
  --accent: #E3FC72;
  --accent-hi: #EEFF9E;
  --accent-deep: #C2E22C;
  --ring: rgba(206, 250, 5, .48);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-xs: 0 1px 2px rgba(5,17,20,.05);
  --shadow-sm: 0 1px 2px rgba(5,17,20,.05), 0 2px 6px -2px rgba(5,17,20,.06);
  --shadow-md: 0 6px 20px -8px rgba(5,17,20,.14), 0 2px 6px -3px rgba(5,17,20,.08);
  --shadow-lg: 0 24px 60px -18px rgba(5,17,20,.34), 0 8px 20px -10px rgba(5,17,20,.16);
  --shadow-accent: 0 6px 20px -8px rgba(194,226,44,.7);
  --ease: cubic-bezier(.32,.72,.32,1);
}

body {
  background:
    radial-gradient(1100px 560px at 100% -8%, rgba(206,250,5,.055), transparent 62%),
    radial-gradient(900px 500px at -6% 108%, rgba(23,112,193,.045), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  letter-spacing: -.005em;
  -moz-osx-font-smoothing: grayscale;
}
.stat .value, table td, .mono, .chart-range, .account__email { font-variant-numeric: tabular-nums; }

/* ---- Sidebar: depth + refined nav ---- */
.sidebar {
  background: linear-gradient(180deg, #0a1a1e 0%, #051114 62%);
  border-right: 1px solid rgba(255,255,255,.06);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.02);
  padding: 20px 12px;
}
.sidebar .brand { margin-bottom: 20px; }
.nav-item {
  position: relative; font-size: 13.5px; padding: 9px 12px; border-radius: 10px;
  transition: background .18s var(--ease), color .18s var(--ease), transform .12s var(--ease);
}
.nav-item .ico { opacity: .82; transition: opacity .18s; }
.nav-item:hover { background: rgba(255,255,255,.05); transform: translateX(1px); }
.nav-item:hover .ico { opacity: 1; }
.nav-item.active {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  color: var(--accent-ink); box-shadow: var(--shadow-accent);
}
.nav-item.active .ico { opacity: 1; }
.nav-item.active::before {
  content:""; position:absolute; left:-12px; top:50%; transform:translateY(-50%);
  width:3px; height:20px; border-radius:0 3px 3px 0; background: var(--accent);
}
.nav-label { letter-spacing: .16em; color: rgba(255,255,255,.4); margin-top: 10px; }
.account { border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.02); border-radius: 12px; transition: background .18s; }
.account:hover { background: rgba(255,255,255,.05); cursor: pointer; }
.account__avatar { box-shadow: var(--shadow-accent); }

/* ---- Content & headings ---- */
.content { padding: 32px 36px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 25px; font-weight: 720; letter-spacing: -.02em; }
.page-head .sub { font-size: 13px; color: var(--text-dim); }
.section-title { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }

/* ---- Cards ---- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 22px;
}

/* ---- Stat tiles ---- */
.stat {
  position: relative; overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 17px 19px;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s;
}
.stat::after {
  content:""; position:absolute; inset:0 auto 0 0; width:3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  opacity:0; transition: opacity .2s var(--ease);
}
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.stat:hover::after { opacity:.9; }
.stat .label { font-size: 10.5px; letter-spacing: .09em; color: var(--text-dim); }
.stat .value { font-size: 27px; font-weight: 730; margin-top: 7px; letter-spacing: -.02em; }

/* ---- Buttons ---- */
button, .btn {
  border-radius: var(--radius-sm); font-weight: 600; letter-spacing: .01em;
  box-shadow: var(--shadow-xs);
  transition: background .16s var(--ease), border-color .16s, box-shadow .18s var(--ease), transform .08s var(--ease), filter .16s;
}
button:hover, .btn:hover { background: var(--surface-2); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0); box-shadow: var(--shadow-xs); }
button.primary, .btn.primary {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent)); border-color: var(--accent-deep);
  box-shadow: var(--shadow-accent);
}
button.primary:hover, .btn.primary:hover { filter: none; background: linear-gradient(180deg, #f2ffb4, var(--accent-hi)); box-shadow: 0 8px 24px -8px rgba(194,226,44,.85); transform: translateY(-1px); }
button.ghost { box-shadow: none; }
button.ghost:hover { background: rgba(5,17,20,.055); box-shadow: none; transform: none; }
button:disabled { box-shadow: none; transform: none; }

/* ---- Inputs ---- */
input, select, textarea {
  background: var(--surface); border: 1px solid var(--field-border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs); transition: border-color .16s, box-shadow .16s, background .16s;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--accent-deep); box-shadow: 0 0 0 3px var(--ring); outline: none; }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }

/* ---- Tables: row hover, refined header ---- */
th {
  background: var(--surface-2); color: var(--text-dim); font-size: 10.5px; letter-spacing: .07em;
}
th:first-child { border-top-left-radius: 10px; }
th:last-child { border-top-right-radius: 10px; }
td { padding: 13px 14px; }
tbody tr { transition: background .13s var(--ease); }
tbody tr:hover td { background: var(--surface-2); }
.card table { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }

/* ---- Badges ---- */
.badge { border-radius: 8px; padding: 3px 9px; font-size: 11.5px; box-shadow: var(--shadow-xs); }
.badge.ok  { color:#0b7a3b; background: rgba(18,161,80,.12); }
.badge.warn{ color:#8a6608; background: rgba(201,147,11,.14); }
.badge.err { color:#c40820; background: rgba(241,10,38,.1); }

/* ---- Tabs / subtabs ---- */
.tab.active { border-bottom-color: var(--accent-deep); }
.tab.active::after { content:""; }
.subtab { border-radius: 999px; box-shadow: var(--shadow-xs); transition: background .16s, color .16s, border-color .16s, box-shadow .16s; }
.subtab.active { background: linear-gradient(180deg, var(--accent-hi), var(--accent)); border-color: var(--accent-deep); box-shadow: var(--shadow-accent); }

/* ---- Modals / toasts / dropdowns: real elevation ---- */
.modal-overlay { background: rgba(5,17,20,.42); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal { border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.toast { border-radius: 12px; box-shadow: var(--shadow-lg); backdrop-filter: blur(6px); }
.spinner { border-top-color: var(--accent-deep); }

/* ---- Chart card ---- */
.chart-card { box-shadow: var(--shadow-sm); }

/* ---- Scrollbars ---- */
::-webkit-scrollbar-thumb { background: #c3cbcb; border: 2px solid var(--bg); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #aab3b3; }

/* ---- Motion accessibility ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Guardora — Dark theme + toggle (v3). Token-driven; brand lime kept.
   ========================================================================== */
:root{
  --hover-ghost: rgba(5,17,20,.055);
  --hover-soft: rgba(5,17,20,.06);
  --danger-soft: #fef2f3;
  --scroll-thumb: #c3cbcb; --scroll-thumb-hover: #aab3b3;
  --badge-ok-fg:#0b7a3b; --badge-ok-bg:rgba(18,161,80,.12);
  --badge-warn-fg:#8a6608; --badge-warn-bg:rgba(201,147,11,.14);
  --badge-err-fg:#c40820; --badge-err-bg:rgba(241,10,38,.1);
  --sidebar-a:#0a1a1e; --sidebar-b:#051114;
}
/* surfaces made theme-adaptive (surface = white in light, dark in dark) */
button, .btn { background: var(--surface); }
button.danger, .btn.danger { background: var(--surface); }
.subtab { background: var(--surface); }
.icon-btn { background: var(--surface); }
.modal { background: var(--surface); }
.msg__bubble { background: var(--surface); }
.thread { background: var(--surface-2); }
/* hover/accent surfaces via tokens */
button.ghost:hover, .btn.ghost:hover { background: var(--hover-ghost); }
.modal__close:hover { background: var(--hover-soft); color: var(--text); }
button.danger:hover { background: var(--danger-soft); }
.icon-btn:hover { background: var(--danger-soft); }
.badge.ok  { color: var(--badge-ok-fg);  background: var(--badge-ok-bg); }
.badge.warn{ color: var(--badge-warn-fg);background: var(--badge-warn-bg); }
.badge.err { color: var(--badge-err-fg); background: var(--badge-err-bg); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
.sidebar { background: linear-gradient(180deg, var(--sidebar-a), var(--sidebar-b)); }

/* ---- Dark palette ---- */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0B1619; --surface:#101F23; --surface-2:#16292E; --muted:#193036;
    --border:#21343A; --border-strong:#2C424A; --field-border:#293D44;
    --text:#E9EFED; --text-dim:#98A7A3; --text-faint:#6B7A77;
    --on-dark:rgba(255,255,255,.74); --on-dark-dim:rgba(255,255,255,.5);
    --ring:rgba(206,250,5,.4);
    --hover-ghost:rgba(255,255,255,.06); --hover-soft:rgba(255,255,255,.09);
    --danger-soft:rgba(241,10,38,.18);
    --scroll-thumb:#2b3d43; --scroll-thumb-hover:#374b52;
    --badge-ok-fg:#4fd58a; --badge-ok-bg:rgba(18,161,80,.17);
    --badge-warn-fg:#e6b942; --badge-warn-bg:rgba(201,147,11,.18);
    --badge-err-fg:#ff6b7e; --badge-err-bg:rgba(241,10,38,.2);
    --sidebar-a:#0a1a1e; --sidebar-b:#03090b;
    --shadow-xs:0 1px 2px rgba(0,0,0,.5);
    --shadow-sm:0 1px 2px rgba(0,0,0,.5),0 2px 8px -2px rgba(0,0,0,.55);
    --shadow-md:0 10px 28px -10px rgba(0,0,0,.65),0 2px 8px -3px rgba(0,0,0,.5);
    --shadow-lg:0 34px 80px -22px rgba(0,0,0,.8),0 10px 26px -12px rgba(0,0,0,.6);
    --shadow-accent:0 6px 22px -10px rgba(194,226,44,.4);
  }
  :root:not([data-theme="light"]) select{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A7B4B0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"]{
  --bg:#0B1619; --surface:#101F23; --surface-2:#16292E; --muted:#193036;
  --border:#21343A; --border-strong:#2C424A; --field-border:#293D44;
  --text:#E9EFED; --text-dim:#98A7A3; --text-faint:#6B7A77;
  --on-dark:rgba(255,255,255,.74); --on-dark-dim:rgba(255,255,255,.5);
  --ring:rgba(206,250,5,.4);
  --hover-ghost:rgba(255,255,255,.06); --hover-soft:rgba(255,255,255,.09);
  --danger-soft:rgba(241,10,38,.18);
  --scroll-thumb:#2b3d43; --scroll-thumb-hover:#374b52;
  --badge-ok-fg:#4fd58a; --badge-ok-bg:rgba(18,161,80,.17);
  --badge-warn-fg:#e6b942; --badge-warn-bg:rgba(201,147,11,.18);
  --badge-err-fg:#ff6b7e; --badge-err-bg:rgba(241,10,38,.2);
  --sidebar-a:#0a1a1e; --sidebar-b:#03090b;
  --shadow-xs:0 1px 2px rgba(0,0,0,.5);
  --shadow-sm:0 1px 2px rgba(0,0,0,.5),0 2px 8px -2px rgba(0,0,0,.55);
  --shadow-md:0 10px 28px -10px rgba(0,0,0,.65),0 2px 8px -3px rgba(0,0,0,.5);
  --shadow-lg:0 34px 80px -22px rgba(0,0,0,.8),0 10px 26px -12px rgba(0,0,0,.6);
  --shadow-accent:0 6px 22px -10px rgba(194,226,44,.4);
}
:root[data-theme="dark"] select{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A7B4B0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
body{ transition: background-color .3s var(--ease); }

/* ---- Theme toggle ---- */
.theme-toggle{
  display:flex; align-items:center; gap:10px; width:100%; margin:0 0 6px;
  padding:9px 12px; border-radius:10px; border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.02); color:var(--on-dark); cursor:pointer;
  font-weight:500; font-size:13.5px; font-family:var(--font); letter-spacing:.01em;
  transition:background .18s var(--ease), color .18s;
}
.theme-toggle:hover{ background:rgba(255,255,255,.06); color:#fff; }
.theme-toggle .ico{ width:18px; height:18px; display:inline-flex; opacity:.85; }
.theme-toggle .ico svg{ width:100%; height:100%; }
.theme-toggle .moon{ display:none; }
:root[data-theme="dark"] .theme-toggle .sun,
:root[data-theme="dark"] .theme-toggle .moon{ }
.theme-toggle__label{ flex:1; text-align:left; }
.theme-toggle .knob{ margin-left:auto; width:34px; height:20px; border-radius:999px; background:rgba(255,255,255,.14); position:relative; transition:background .2s var(--ease); flex:0 0 auto; }
.theme-toggle .knob::after{ content:""; position:absolute; top:2px; left:2px; width:16px; height:16px; border-radius:50%; background:#fff; transition:transform .22s var(--ease); box-shadow:0 1px 3px rgba(0,0,0,.4); }
:root[data-theme="dark"] .theme-toggle .knob{ background:var(--accent); }
:root[data-theme="dark"] .theme-toggle .knob::after{ transform:translateX(14px); background:var(--accent-ink); }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .theme-toggle .knob{ background:var(--accent); }
  :root:not([data-theme="light"]) .theme-toggle .knob::after{ transform:translateX(14px); background:var(--accent-ink); }
}

/* ==========================================================================
   Guardora — v4: 3D nav icons + cabinet dark fixes
   ========================================================================== */
:root{ --msg-me-bg: var(--dark); --msg-me-border: var(--dark); }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){ --msg-me-bg:#24464F; --msg-me-border:#2E565F; }
}
:root[data-theme="dark"]{ --msg-me-bg:#24464F; --msg-me-border:#2E565F; }
.msg--me .msg__bubble{ background: var(--msg-me-bg); border-color: var(--msg-me-border); }

.ico-3d{ width:20px; height:20px; display:inline-flex; flex:0 0 auto;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.45));
  transition: transform .2s var(--ease), filter .2s var(--ease); }
.ico-3d svg{ width:100%; height:100%; }
.nav-item .ico-3d{ opacity:1; }
.nav-item:hover .ico-3d{ transform: translateY(-1.5px) scale(1.08) rotate(-3deg); filter: drop-shadow(0 5px 8px rgba(0,0,0,.55)); }
.nav-item.active .ico-3d{ filter: drop-shadow(0 2px 3px rgba(5,17,20,.4)); }
.nav-item.active:hover .ico-3d{ transform: translateY(-1px) scale(1.05); }
@media (prefers-reduced-motion: reduce){ .ico-3d{ transition:none; } }

/* ==========================================================================
   Guardora — v5: click flash & number spinners cleanup
   ========================================================================== */
* { -webkit-tap-highlight-color: transparent; }
a:focus:not(:focus-visible),
.nav-item:focus:not(:focus-visible),
.link-domain:focus:not(:focus-visible),
tr:focus:not(:focus-visible),
[onclick]:focus:not(:focus-visible) { outline: none; }
button:focus:not(:focus-visible), .btn:focus:not(:focus-visible) { outline: none; box-shadow: var(--shadow-xs); }
button.ghost:focus:not(:focus-visible) { box-shadow: none; }

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* v6: в тёмной теме ссылки белые вместо синих */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --link: #FFFFFF; }
}
:root[data-theme="dark"] { --link: #FFFFFF; }

/* v7: смена вида без «белой вспышки» — контент виден сразу, только лёгкий сдвиг */
@keyframes gzSlide { from { transform: translateY(6px); } to { transform: none; } }
.view-in { animation: gzSlide .2s var(--ease); }
.view-in > .card, .view-in > .grid > .card, .view-in > .grid > .stat { animation: none; }
.view-in > .grid > *:nth-child(2),
.view-in > .grid > *:nth-child(3),
.view-in > .grid > *:nth-child(4) { animation-delay: 0s; }

/* v8: выпадающие списки без стрелочек */
select { background-image: none !important; padding-right: 12px !important; }
select::-ms-expand { display: none; }

/* v9: документация API */
.api-m { display:inline-flex; align-items:center; justify-content:center; min-width:52px; padding:2px 8px; border-radius:7px; font-size:11px; font-weight:700; letter-spacing:.04em; font-family:var(--mono); }
.api-m--get { color:#0b7a3b; background:rgba(18,161,80,.13); }
.api-m--post { color:#5b21b6; background:rgba(138,56,245,.13); }
.api-m--put { color:#8a6608; background:rgba(201,147,11,.16); }
.api-m--patch { color:#0f6a8a; background:rgba(23,146,193,.14); }
.api-m--delete { color:#c40820; background:rgba(241,10,38,.11); }
:root[data-theme="dark"] .api-m--get { color:#4fd58a; }
:root[data-theme="dark"] .api-m--post { color:#c4a5ff; }
:root[data-theme="dark"] .api-m--put { color:#e6b942; }
:root[data-theme="dark"] .api-m--patch { color:#6fc6e8; }
:root[data-theme="dark"] .api-m--delete { color:#ff6b7e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .api-m--get { color:#4fd58a; }
  :root:not([data-theme="light"]) .api-m--post { color:#c4a5ff; }
  :root:not([data-theme="light"]) .api-m--put { color:#e6b942; }
  :root:not([data-theme="light"]) .api-m--patch { color:#6fc6e8; }
  :root:not([data-theme="light"]) .api-m--delete { color:#ff6b7e; }
}
.api-group { font-size:11px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--text-dim); margin:18px 0 8px; }
.api-group:first-of-type { margin-top:8px; }
.api-table td { font-size:13px; }
.api-table td:first-child { width:70px; }
.api-ex__t { font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--text-dim); margin:14px 0 6px; }
.api-ex__t:first-child { margin-top:0; }
.api-ex .deploy-log { white-space:pre-wrap; }

.chart-head { flex-wrap: wrap; row-gap: 6px; }
.chart-legend { flex-wrap: wrap; row-gap: 4px; }
.chart-canvas { height: 220px; }
.chart-canvas.short { height: 180px; }
.edge-compact { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.edge-compact:last-child { border-bottom: 0; }
@media (max-width: 900px) {
  .chart-canvas, .chart-canvas.short { height: 190px; }
}
@media (max-width: 560px) {
  .chart-canvas, .chart-canvas.short { height: 160px; }
  .chart-range { margin-left: 0; width: 100%; }
}
