/* EdgeOwl app. Tokens are copied from edgeowl-site/src/styles/global.css, classes from the Account artboard
   of the canvas "EdgeOwl Site V1" (see DESIGN.md, «Приложение»). No build step, no inline styles: strict CSP. */

/* ── Onest, self-hosted (SIL OFL, licence beside the file). One variable file, weight 100–900. ── */
@font-face {
  font-family: "Onest";
  src: url("/fonts/Onest-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens: light on :root; dark by prefers-color-scheme unless data-theme="light"; data-theme="dark" forces dark. ── */
:root {
  color-scheme: light;
  --c-bg: #ffffff; --c-surface: #ffffff; --c-mist: #f5f5f5;
  --c-text: #000000; --c-muted: #6b7075;
  --c-border: #e6e6e6; --c-border-strong: #c9cccf;
  --c-danger: #b42318; --c-danger-hover: #8f1d13; --c-error-text: #b42318;
  --c-amber: #f2a900;
  --c-auth-bg: #f5f5f5;
  --sh-btn: 2px 2px 0 rgba(0, 0, 0, 0.16);
  --sh-btn-pressed: 1px 1px 0 rgba(0, 0, 0, 0.16);
  --sh-card: 4px 4px 0 rgba(0, 0, 0, 0.12);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --c-bg: #101113; --c-surface: #17181a; --c-mist: #1f2124;
    --c-text: #f2f2f2; --c-muted: #9aa0a6;
    --c-border: #2b2d30; --c-border-strong: #45484c;
    --c-danger: #e5484d; --c-danger-hover: #f06a6e; --c-error-text: #f08a8d;
    --c-auth-bg: #0b0c0d;
    --sh-btn: 2px 2px 0 rgba(0, 0, 0, 0.55);
    --sh-btn-pressed: 1px 1px 0 rgba(0, 0, 0, 0.55);
    --sh-card: 4px 4px 0 rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --c-bg: #101113; --c-surface: #17181a; --c-mist: #1f2124;
  --c-text: #f2f2f2; --c-muted: #9aa0a6;
  --c-border: #2b2d30; --c-border-strong: #45484c;
  --c-danger: #e5484d; --c-danger-hover: #f06a6e; --c-error-text: #f08a8d;
  --c-auth-bg: #0b0c0d;
  --sh-btn: 2px 2px 0 rgba(0, 0, 0, 0.55);
  --sh-btn-pressed: 1px 1px 0 rgba(0, 0, 0, 0.55);
  --sh-card: 4px 4px 0 rgba(0, 0, 0, 0.45);
}

/* ── Base ── */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--c-bg); }
a { color: inherit; }
a:hover { color: inherit; }
:focus-visible { outline: 2px solid var(--c-text); outline-offset: 2px; }
.topbar :focus-visible { outline-color: #ffffff; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── Classes of the Account artboard ── */
.app{font-family:"Onest",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;font-size:14px;line-height:1.5;color:var(--c-text);background:var(--c-bg);font-variant-numeric:tabular-nums;display:flex;flex-direction:column}
.app *{box-sizing:border-box}
.app h1,.app h2,.app h3,.app p{margin:0}
.wrap{width:100%;max-width:1120px;margin-inline:auto;padding-inline:16px}
/* app topbar, black in both themes */
.topbar{background:#000000;color:#ffffff}
.topbar a{color:#a6abb3;text-decoration:none}
.topbar a:hover{color:#ffffff}
.topbar .inner{display:flex;align-items:center;gap:16px;min-height:52px;flex-wrap:wrap;padding-block:8px}
.topbar .brand{color:#ffffff;font-size:16px;font-weight:800;letter-spacing:-.01em;display:inline-flex;align-items:center;gap:8px}
.topbar .brand img{width:24px;height:24px}
.topbar .nav{display:flex;gap:6px;align-items:center;list-style:none;margin:0;padding:0;flex:1;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
.topbar .nav::-webkit-scrollbar{display:none}
.topbar .nav a{display:inline-block;padding:4.8px 11px;font-size:14px;border:1px solid transparent;border-radius:6px;white-space:nowrap}
.topbar .nav a.is-active{color:#ffffff;font-weight:600;border-color:#ffffff;box-shadow:2px 2px 0 rgba(255,255,255,.25)}
.topbar .right{display:flex;align-items:center;gap:8px;margin-left:auto}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:0;border-radius:6px;background:transparent;color:#a6abb3;cursor:pointer}
.icon-btn svg{width:16px;height:16px}
.icon-btn:hover{background:rgba(255,255,255,.12);color:#ffffff}
.icon-btn.is-active{background:#ffffff;color:#000000}
.theme-switch{display:inline-flex;gap:2px;padding:2px;border:1px solid rgba(255,255,255,.25);border-radius:999px}
.theme-switch .icon-btn{width:26px;height:26px;border-radius:999px}
/* page */
.page-title{font-size:21.6px;font-weight:700;letter-spacing:-.015em}
.page-subtitle{color:var(--c-muted);font-size:14.4px}
.subnav{display:flex;gap:8px;border-bottom:1px solid var(--c-border);overflow-x:auto;scrollbar-width:none}
.subnav::-webkit-scrollbar{display:none}
.subnav button{padding:6.4px 12px;font-size:14px;font-family:inherit;color:var(--c-muted);background:transparent;border:0;border-bottom:2px solid transparent;margin-bottom:-1px;white-space:nowrap;cursor:pointer;line-height:1.5}
.subnav button:hover{color:var(--c-text)}
.subnav button.is-active{color:var(--c-text);border-bottom-color:var(--c-text);font-weight:600}
.subnav button:focus-visible{outline:2px solid var(--c-text);outline-offset:-2px}
.panel{background:var(--c-surface);border:1px solid var(--c-border);border-radius:10px;padding:24px;display:flex;flex-direction:column;gap:16px}
.panel-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap}
.panel-title{font-size:16px;font-weight:700;letter-spacing:-.01em}
.panel-desc{color:var(--c-muted);font-size:13px;max-width:60ch;margin-top:2px}
.panel-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.label{font-size:12.8px;font-weight:600}
.hint{font-size:12.5px;color:var(--c-muted)}
.input{padding:8px 10px;border:1px solid var(--c-border-strong);border-radius:6px;font-size:14px;font-family:inherit;background:var(--c-surface);color:var(--c-text);width:100%}
.input:focus-visible{outline:2px solid var(--c-text);outline-offset:1px;border-color:var(--c-text)}
.form-footer{border-top:1px solid var(--c-border);padding-top:16px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6.4px 14.4px;border:1px solid var(--c-border-strong);border-radius:6px;font-size:13.6px;font-family:inherit;font-weight:600;line-height:1.5;cursor:pointer;text-decoration:none;background:var(--c-surface);color:var(--c-text);box-shadow:var(--sh-btn);transition:background .12s,color .12s,box-shadow .12s,transform .12s;white-space:nowrap}
.btn:hover{transform:translate(1px,1px);box-shadow:var(--sh-btn-pressed)}
.btn:active{transform:translate(2px,2px);box-shadow:none}
.btn-primary{border-color:var(--c-text)}
.btn-primary:hover{background:var(--c-text);color:var(--c-bg)}
.btn-secondary{color:var(--c-muted)}
.btn-secondary:hover{color:var(--c-text)}
.btn-danger{border-color:var(--c-danger);color:var(--c-danger)}
.btn-danger:hover{background:var(--c-danger);color:#ffffff}
.btn-sm{padding:3.5px 9.6px;font-size:12.5px}
.btn svg{width:14px;height:14px}
.badge{display:inline-block;padding:1.6px 8px;border-radius:999px;font-size:12px;font-weight:600;border:1px solid transparent;white-space:nowrap}
.badge-ok{background:var(--c-text);color:var(--c-bg)}
.badge-attention{border-color:var(--c-text)}
.badge-error{border-color:var(--c-danger);color:var(--c-danger)}
.badge-none{border-color:var(--c-border-strong);color:var(--c-muted)}
.rows{display:flex;flex-direction:column}
.row{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:10px 0;border-top:1px solid var(--c-border)}
.row:first-child{border-top:0}
.row .main{font-weight:600}
.row .sub{font-size:12.5px;color:var(--c-muted)}
.kv{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:8px 24px;margin:0;font-size:14px}
.kv dt{color:var(--c-muted)}.kv dd{margin:0;overflow-wrap:anywhere}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px}
.switch{display:inline-flex;align-items:center;gap:10px;cursor:pointer;font-size:14px}
.switch .track{width:36px;height:20px;border:1px solid var(--c-text);border-radius:999px;position:relative;background:var(--c-surface);flex:none}
.switch .knob{position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:var(--c-text)}
.switch.on .track{background:var(--c-text)}
.switch.on .knob{left:18px;background:var(--c-bg)}
.table{width:100%;border-collapse:collapse;font-size:14px}
.table th,.table td{text-align:left;padding:10px 12px;border-bottom:1px solid var(--c-border);vertical-align:top}
.table th{color:var(--c-muted);font-size:12.8px;font-weight:600;border-bottom-color:var(--c-text);white-space:nowrap}
.danger{border-color:var(--c-danger)}
.text-danger{color:var(--c-danger)}
.flash{padding:8px 16px;border:1px solid var(--c-border);border-left:3px solid var(--c-text);border-radius:6px;font-size:14px;background:var(--c-surface)}
@media (max-width:760px){
.form-grid{grid-template-columns:1fr}
.row{flex-direction:column;align-items:flex-start;gap:8px}
.topbar .signout-label{display:none}
.panel{padding:20px 16px}
}

/* ── Sign-in screens: classes of the Auth artboard, scoped because .btn, .card and .input differ from the Account ones ── */
.auth{--c-bg:var(--c-auth-bg);min-height:100vh}
.auth{font-family:"Onest",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;font-size:14px;line-height:1.5;color:var(--c-text);background:var(--c-bg);font-variant-numeric:tabular-nums;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px 16px;box-sizing:border-box}
.auth *{box-sizing:border-box}
.auth h1,.auth h2,.auth p{margin:0}
.auth .card{background:var(--c-surface);border:1px solid var(--c-text);border-radius:10px;box-shadow:var(--sh-card);padding:32px;width:100%;max-width:400px;display:flex;flex-direction:column;gap:20px}
.auth .brand{display:inline-flex;align-items:center;gap:8px;font-size:19px;font-weight:800;letter-spacing:-.01em;justify-content:center}
.auth .brand img{width:28px;height:28px}
.auth .title{text-align:center;display:flex;flex-direction:column;gap:4px}
.auth .title h1{font-size:16px;font-weight:700;letter-spacing:-.01em}
.auth .title p{font-size:13.5px;color:var(--c-muted)}
.auth .field{display:flex;flex-direction:column;gap:6px}
.auth .label{font-size:12.8px;font-weight:600}
.auth .label-row{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.auth .input{padding:9px 11px;border:1px solid var(--c-border-strong);border-radius:6px;font-size:14px;font-family:inherit;background:var(--c-surface);color:var(--c-text);width:100%}
.auth .input::placeholder{color:var(--c-muted);opacity:.7}
.auth .input:focus-visible{outline:2px solid var(--c-text);outline-offset:1px;border-color:var(--c-text)}
.auth .btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:8px 14px;border:1px solid var(--c-border-strong);border-radius:6px;font-size:14px;font-family:inherit;font-weight:600;line-height:1.5;cursor:pointer;text-decoration:none;background:var(--c-surface);color:var(--c-text);box-shadow:var(--sh-btn);transition:background .12s,color .12s,box-shadow .12s,transform .12s;width:100%}
.auth .btn:hover{transform:translate(1px,1px);box-shadow:var(--sh-btn-pressed)}
.auth .btn:active{transform:translate(2px,2px);box-shadow:none}
.auth .btn-primary{border-color:var(--c-text)}
.auth .btn-primary:hover{background:var(--c-text);color:var(--c-bg)}
.auth .btn svg{width:18px;height:18px;flex:none}
.auth .divider{display:flex;align-items:center;gap:12px;color:var(--c-muted);font-size:12.5px}
.auth .divider::before,.auth .divider::after{content:"";flex:1;border-top:1px solid var(--c-border)}
.auth .small{font-size:12.8px;color:var(--c-muted)}
.auth .small a,.auth .link{color:var(--c-text);font-weight:600;text-decoration:none}
.auth .small a:hover,.auth .link:hover{text-decoration:underline}
.auth .center{text-align:center}
.auth .check{display:flex;gap:10px;align-items:flex-start;font-size:13px}
.auth .check input{margin:3px 0 0;accent-color:var(--c-text)}
.auth .account{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid var(--c-border-strong);border-radius:6px}
.auth .avatar{width:40px;height:40px;border-radius:50%;background:var(--c-text);color:var(--c-bg);display:flex;align-items:center;justify-content:center;font-weight:700;flex:none}
.auth .codes{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.auth .codes input{text-align:center;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:22px;font-weight:600;padding:10px 0;height:52px}
.auth .status{display:flex;align-items:center;gap:10px;padding:12px;border:1px solid var(--c-border);border-left:3px solid var(--c-text);border-radius:6px;font-size:13.5px;background:var(--c-surface)}
.auth .dot{width:8px;height:8px;border-radius:50%;background:var(--c-amber);flex:none}
.auth .flash{padding:8px 12px;border:1px solid var(--c-border);border-left:3px solid var(--c-danger);border-radius:6px;font-size:13px;background:var(--c-surface);color:var(--c-danger)}
.auth .foot{display:flex;gap:16px;justify-content:center;flex-wrap:wrap;font-size:12.5px;color:var(--c-muted);margin-top:20px}
.auth .foot a{text-decoration:none}
.auth .foot a:hover{text-decoration:underline}
.auth .mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.auth .mark-dark{display:none}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .auth .mark-light{display:none}:root:not([data-theme="light"]) .auth .mark-dark{display:inline}}
:root[data-theme="dark"] .auth .mark-light{display:none}:root[data-theme="dark"] .auth .mark-dark{display:inline}

/* ── Not on the artboard: below 900px the menu takes its own row, as in the site header; on one row it gets clipped ── */
@media (max-width:900px){
.topbar .nav{order:3;flex-basis:100%;gap:2px;padding-top:6px;border-top:1px solid rgba(255,255,255,.15);-webkit-overflow-scrolling:touch}
.topbar .nav a{font-size:13.5px;padding:4px 8px}
}

/* ── Not on the artboard: inline styles of the mock-up (the CSP forbids them) and the sticky footer ── */
.app { min-height: 100vh; }
.page { flex: 1; width: 100%; padding-block: 24px 48px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-direction: column; gap: 4px; }
.app-footer { border-top: 1px solid var(--c-border); padding: 16px; text-align: center; font-size: 12.5px; color: var(--c-muted); }
.app-footer a { text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 10px; }

/* ── Added for the working screens (T-004) ── */
[hidden] { display: none !important; }
.flash-error { border-left-color: var(--c-danger); color: var(--c-danger); }
.auth .flash-ok { border-left-color: var(--c-text); color: var(--c-text); }
.page-flash { padding-top: 16px; }
.inline-form { display: inline-flex; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.subnav a { padding: 6.4px 12px; font-size: 14px; color: var(--c-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; line-height: 1.5; text-decoration: none; }
.subnav a:hover { color: var(--c-text); }
.subnav a.is-active { color: var(--c-text); border-bottom-color: var(--c-text); font-weight: 600; }
.subnav a:focus-visible { outline: 2px solid var(--c-text); outline-offset: -2px; }
.row { flex-wrap: wrap; }
.confirm summary { list-style: none; }
.confirm summary::-webkit-details-marker { display: none; }
.confirm[open] { flex-basis: 100%; }
.confirm-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.confirm-form .input { flex: 1 1 180px; width: auto; min-width: 0; }
.passkey-name { margin-top: 6px; }
.qr { width: 192px; max-width: 100%; border: 1px solid var(--c-border); border-radius: 6px; overflow: hidden; line-height: 0; }
.qr svg { display: block; width: 100%; height: auto; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin: 0; padding: 0; list-style: none; max-width: 320px; }
@media (max-width:760px){
.grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* The 2FA account box and the small forgot link: inline styles of the mock-up (the CSP forbids them) */
.auth .auth-account-text { min-width: 0; }
.auth .auth-account-mail { font-weight: 600; overflow-wrap: anywhere; }
.auth .auth-account-small { overflow-wrap: anywhere; }
.auth a.auth-forgot { font-weight: 500; text-decoration: none; }
.auth a.auth-forgot:hover { text-decoration: underline; }
.auth a.brand { text-decoration: none; }
.auth form.stack { gap: 20px; }
