:root {
  --accent: #635bff; --accent-hover: #5449e0;
  --ink: #30313d; --ink-2: #4b5563; --muted: #6a7383;
  --line: #e6e9ee; --line-2: #eef1f4; --bg: #ffffff; --bg-soft: #f6f8fa;
  --warn-bg: #fff8e6; --warn-line: #f2d78a; --warn-ink: #7a5b00;
  --green: #0a7d33; --radius: 8px;
  --shadow: 0 1px 2px rgba(20,24,40,.06), 0 6px 20px rgba(20,24,40,.08);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-size: 14px; color: var(--ink); background: var(--bg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
[dir="rtl"] .app { grid-template-columns: 236px 1fr; }

.sidebar { border-inline-end: 1px solid var(--line); background: var(--bg-soft); padding: 16px 12px; display: flex; flex-direction: column; gap: 14px; }
.brand { padding: 4px 8px 2px; }
.workspace { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.ws-dot { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: #fff; font-weight: 600; display: grid; place-items: center; font-size: 13px; flex: 0 0 auto; }
.ws-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.ws-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-sub { font-size: 11.5px; color: var(--muted); }
.chev { margin-inline-start: auto; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 6px; color: var(--ink-2); font-size: 13.5px; text-decoration: none; cursor: pointer; }
.nav-item:hover { background: #eef1f6; color: var(--ink); }
.nav-item.active { background: #e9ecff; color: #3b34c9; font-weight: 600; }
.ni { width: 16px; text-align: center; opacity: .8; font-size: 13px; }
.nav-group { margin-top: 10px; }
.nav-group-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 9px 3px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; gap: 16px; }
.search { display: flex; align-items: center; gap: 8px; color: var(--muted); padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; width: 320px; background: #fff; font-size: 13px; }
.search kbd { margin-inline-start: auto; font-family: inherit; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.top-right { display: flex; align-items: center; gap: 14px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); background: #f2fbf5; border: 1px solid #d5efdd; padding: 4px 9px; border-radius: 999px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.14); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #e9ecff; color: #3b34c9; display: grid; place-items: center; font-weight: 600; font-size: 12px; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch-label { font-size: 12.5px; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.track { width: 34px; height: 20px; border-radius: 999px; background: #d7dce3; position: relative; transition: background .15s ease; }
.thumb { position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s ease; }
.switch input:checked + .track { background: #f0b429; }
.switch input:checked + .track .thumb { transform: translateX(14px); }
[dir="rtl"] .switch input:checked + .track .thumb { transform: translateX(-14px); }
body.test-mode .live-badge { background: #fff8e6; border-color: #f2d78a; color: #7a5b00; }
body.test-mode .live-dot { background: #f0b429; box-shadow: 0 0 0 3px rgba(240,180,41,.16); }

.content { padding: 26px 30px 48px; max-width: 1040px; width: 100%; }
.banner { display: flex; align-items: flex-start; gap: 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 13px 14px; margin-bottom: 24px; }
.banner-icon { width: 20px; height: 20px; flex: 0 0 auto; border-radius: 50%; background: #f0b429; color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; margin-top: 1px; }
.banner-text { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--warn-ink); }
.banner-text strong { font-size: 13.5px; color: #5c4600; }
.banner-btn { margin-inline-start: auto; flex: 0 0 auto; border: 1px solid var(--warn-line); background: #fff; color: #6b5100; font-weight: 600; font-size: 12.5px; padding: 6px 11px; border-radius: 6px; cursor: pointer; }
.banner-btn:hover { background: #fffdf5; }

.page-head { margin-bottom: 18px; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.3px; margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0; font-size: 13.5px; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 20px; align-items: start; }
.col-main { min-width: 0; }
.card { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 20px; background: #fff; box-shadow: 0 1px 2px rgba(20,24,40,.03); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.card-head h2 { font-size: 14.5px; font-weight: 600; margin: 0; }
.ghost-sm, .reveal-btn { white-space: nowrap; }
.ghost-sm { border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 12.5px; font-weight: 500; padding: 5px 10px; border-radius: 6px; cursor: pointer; }
.ghost-sm:hover { background: var(--bg-soft); }

table.keys { width: 100%; border-collapse: collapse; }
table.keys th { text-align: start; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 16px; background: #fbfcfd; border-bottom: 1px solid var(--line-2); }
table.keys td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.keys tr:last-child td { border-bottom: none; }
.token { font-weight: 500; color: var(--ink); width: 190px; }
.token-sub { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.keyval code { color: var(--ink-2); letter-spacing: .2px; }
.right { text-align: end; white-space: nowrap; }
.reveal-btn { border: 1px solid var(--accent); background: #fff; color: var(--accent); font-weight: 600; font-size: 12.5px; padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.reveal-btn:hover { background: #f5f4ff; }

.empty { padding: 22px 16px; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 4px; font-weight: 600; color: var(--ink-2); font-size: 13px; }
.empty span { font-size: 12.5px; }
.fineprint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.side-card { padding: 16px; margin-bottom: 10px; }
.side-head { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.side-icon { width: 32px; height: 32px; border-radius: 8px; background: #7f54b3; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: 0 0 auto; }
.side-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.side-sub { font-size: 11.5px; color: var(--muted); }
.status { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 7px; background: #fff8e6; border: 1px solid #f2d78a; margin-bottom: 14px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #f0b429; }
.status-text { font-size: 12.5px; font-weight: 600; color: #7a5b00; }
body.test-mode .status { background: #f2fbf5; border-color: #d5efdd; }
body.test-mode .status-dot { background: #16a34a; }
body.test-mode .status-text { color: var(--green); }
.meta { margin: 0 0 15px; display: flex; flex-direction: column; gap: 7px; }
.meta div { display: flex; justify-content: space-between; font-size: 12.5px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; font-weight: 500; }
.btn.full { width: 100%; justify-content: center; }
.side-link { display: block; text-align: center; margin-top: 10px; font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 500; }
.side-link:hover { text-decoration: underline; }
.side-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin: 0; }

.overlay { position: fixed; inset: 0; background: rgba(26,31,54,.45); display: grid; place-items: center; padding: 20px; z-index: 40; backdrop-filter: blur(1.5px); }
.overlay[hidden] { display: none; }
.modal { width: 520px; max-width: 100%; background: #fff; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(6px) scale(.985); opacity: .6 } to { transform: none; opacity: 1 } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.x { border: none; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.modal-body { padding: 18px 20px 20px; }
.lede { margin: 0 0 12px; color: var(--ink-2); font-size: 13px; }
.steps { margin: 0 0 16px; padding-inline-start: 18px; color: var(--ink-2); font-size: 13px; line-height: 1.65; }
.steps code { background: var(--bg-soft); border: 1px solid var(--line); padding: 1px 4px; border-radius: 4px; }
.field-label { display: block; font-size: 12.5px; font-weight: 600; margin: 12px 0 6px; }
.input-row { display: flex; gap: 8px; }
.text-input { width: 100%; border: 1px solid #d7dce3; border-radius: 7px; padding: 9px 11px; font-size: 13px; color: var(--ink); outline: none; transition: border-color .12s, box-shadow .12s; font-family: inherit; }
.text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,91,255,.16); }
.text-input.invalid { border-color: #d93b3b; box-shadow: 0 0 0 3px rgba(217,59,59,.12); }
.paste-btn { flex: 0 0 auto; border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink-2); font-weight: 600; font-size: 12.5px; padding: 0 14px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.paste-btn:hover { background: #eef1f6; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.hint.bad { color: #b3261e; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.btn { border-radius: 7px; padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid transparent; display: inline-flex; align-items: center; gap: 8px; }
.btn.secondary { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn.secondary:hover { background: var(--bg-soft); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary[disabled] { opacity: .7; cursor: default; }
.spinner { width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.secure { display: flex; align-items: center; gap: 5px; justify-content: center; color: var(--muted); font-size: 11.5px; margin: 14px 0 0; }

.success { position: fixed; inset: 0; background: rgba(26,31,54,.4); display: grid; place-items: center; z-index: 50; }
.success[hidden] { display: none; }
.success-card { background: #fff; border-radius: 12px; padding: 30px 34px; text-align: center; box-shadow: var(--shadow); max-width: 380px; animation: pop .2s ease-out; }
.check { width: 54px; height: 54px; border-radius: 50%; background: #16a34a; display: grid; place-items: center; margin: 0 auto 14px; }
.success-card h3 { margin: 0 0 6px; font-size: 17px; }
.success-card p { margin: 0; color: var(--muted); font-size: 13px; }
.toast { position: fixed; bottom: 22px; inset-inline-start: 50%; transform: translateX(-50%); background: #1a1f36; color: #fff; padding: 9px 15px; border-radius: 8px; font-size: 12.5px; box-shadow: var(--shadow); z-index: 60; }
.toast[hidden] { display: none; }

@media (max-width: 1024px) { .cols { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .search { width: 180px; }
  .content { padding: 20px 16px 40px; }
  .token { width: 150px; }
}
@media (max-width: 640px) {
  .content { padding: 16px 14px 40px; }
  h1 { font-size: 21px; }
  .topbar { height: 52px; padding: 0 14px; }
  .search { width: auto; flex: 1; }
  .search kbd, .switch-label { display: none; }
  .live-badge { padding: 3px 8px; font-size: 11.5px; }
  .banner { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .banner-text { flex: 1 1 100%; }
  .banner-btn { margin-inline-start: 0; width: 100%; padding: 9px; }
  table.keys, table.keys tbody, table.keys tr, table.keys td { display: block; width: 100%; }
  table.keys thead { display: none; }
  table.keys tr { padding: 12px 0 4px; border-bottom: 1px solid var(--line-2); }
  table.keys tr:last-child { border-bottom: none; }
  table.keys td { border: none; padding: 2px 14px; }
  .token { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; width: auto; }
  .token-sub { text-transform: none; letter-spacing: 0; }
  .keyval { margin: 3px 0 10px; }
  .keyval code { word-break: break-all; }
  td.right { text-align: start; padding-bottom: 10px; }
  .input-row { flex-direction: column; }
  .paste-btn { padding: 10px 14px; }
  .modal-actions .btn { flex: 1; justify-content: center; }
  .overlay { padding: 10px; place-items: start center; overflow-y: auto; }
  .modal { width: 100%; max-width: 100%; margin-top: 12px; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 14px 16px 18px; }
  .modal-head h3 { font-size: 15px; }
  .success-card { margin: 0 14px; padding: 26px 22px; }
}
[dir="rtl"] .keyval code, [dir="rtl"] #keyInput, [dir="rtl"] .token-sub { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .token-sub { display: inline-block; }

.hp{position:absolute!important;left:-9999px!important;width:1px;height:1px;opacity:0;pointer-events:none}
