/* vclu cloud. Palette and type follow vclu.pl and the vCLU web UI. */

:root {
    --bg: #141A21;
    --surface: #1B2430;
    --surface-2: #1E2833;
    --border: #2A3441;
    --hairline: rgba(230, 237, 243, 0.06);
    --text: #E6EDF3;
    --text2: #9DA7B3;
    --accent: #27C2A8;
    --accent-hover: #22AD96;
    --accent-soft: rgba(39, 194, 168, 0.1);
    --accent-line: rgba(39, 194, 168, 0.3);
    --warn: #FF7A45;
    --danger: #F2545B;
    --owner: #F2B544; /* a home's owner: the sidebar and the top bar mark it */
    --mono: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, monospace;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;

    --sidebar-collapsed: 56px;
    --sidebar-expanded: 200px;
    --topbar-height: 50px;
    color-scheme: dark;
}

/* Light theme exists only in the app shell, as in the vCLU UI. */
:root[data-theme="light"] {
    --bg: #F2F5F8;
    --surface: #FFFFFF;
    --surface-2: #E8ECF0;
    --border: #D4DAE0;
    --hairline: rgba(20, 26, 33, 0.08);
    --text: #141A21;
    --text2: #6B7785;
    --accent-hover: #1FA88E;
    --owner: #B7791F;
    color-scheme: light;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.5; }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: .9em; color: var(--accent); }
.muted { color: var(--text2); }
.v { color: var(--accent); }

.ico {
    width: 18px; height: 18px; flex-shrink: 0;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}

.brand-mark { font-family: var(--mono); font-weight: 600; letter-spacing: .08em; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .6rem 1.3rem; border-radius: 8px;
    font: 600 .9rem var(--sans); letter-spacing: .02em;
    text-decoration: none; cursor: pointer; border: 1px solid transparent;
    transition: background .2s, border-color .2s, box-shadow .2s, transform .2s, color .2s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-outline {
    background: linear-gradient(135deg, rgba(39,194,168,0.15), rgba(39,194,168,0.08));
    border-color: var(--accent-line); color: var(--accent);
}
.btn-outline:hover { background: rgba(39,194,168,0.2); box-shadow: 0 0 30px rgba(39,194,168,0.15); transform: translateY(-1px); }
.btn-sm { padding: .3rem .8rem; font-size: .75rem; font-family: var(--mono); font-weight: 500; border-radius: 6px; }
.btn-lg { padding: .75rem 1.9rem; font-size: .95rem; }
.btn-block { width: 100%; }
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px;
    background: none; border: 0; color: var(--text2); cursor: pointer;
    transition: background .15s, color .15s;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

.tag {
    display: inline-block; font: 400 .65rem var(--mono);
    color: var(--accent); background: var(--accent-soft);
    padding: .12rem .4rem; border-radius: 4px; vertical-align: middle;
}
.btn-primary .tag { color: #fff; background: rgba(255,255,255,0.18); }

/* ===== Public site: nav ===== */
.nav {
    position: fixed; inset: 0 0 auto 0; z-index: 200;
    height: 48px; padding: 0 2rem;
    display: flex; align-items: center; gap: 1.5rem;
    background: rgba(20,26,33,0.85); backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(230,237,243,0.04);
    font-family: var(--mono); font-size: .75rem;
}
.nav-brand { color: var(--text); text-decoration: none; margin-right: auto; display: flex; align-items: baseline; gap: .45rem; }
.nav-brand-suffix { color: var(--text2); letter-spacing: .08em; }
.nav-login { color: var(--text2); text-decoration: none; letter-spacing: .03em; transition: color .2s; }
.nav-login:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 1rem; }

/* ===== Landing: one quiet sign-in screen ===== */
.landing-box { position: relative; width: 100%; max-width: 360px; text-align: center; animation: fadeUp .8s ease .2s both; }
.landing-brand { font-family: var(--mono); font-size: 1.6rem; font-weight: 600; letter-spacing: .12em; }
.hero-suffix { color: var(--text2); font-weight: 400; margin-left: .6rem; }
.landing-prompt { margin: .9rem 0 2.2rem; font: .9rem var(--mono); color: var(--accent); min-height: 1.2em; }
.landing-form { text-align: left; }
.t-prompt::before { content: '>'; opacity: .6; margin-right: .5rem; }
.landing-contact { margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid var(--hairline); font: .75rem var(--mono); color: var(--text2); display: grid; gap: .5rem; }
.landing-contact h2 { font: 600 .72rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text2); }
.landing-contact a { color: var(--text2); text-decoration: none; transition: color .2s; }
.landing-contact a:hover { color: var(--accent); }
.landing-contact .sep { opacity: .3; margin: 0 .35rem; }
.cursor { display: inline-block; width: 8px; height: 1.05em; background: var(--accent); vertical-align: text-bottom; animation: blink 1.1s step-end infinite; }

.footer {
    padding: 3rem 2rem; border-top: 1px solid rgba(230,237,243,0.04);
    display: flex; align-items: center; justify-content: center; gap: 1.5rem; flex-wrap: wrap;
    font: .72rem var(--mono); color: var(--text2);
}
.footer a { color: var(--text2); text-decoration: none; transition: color .2s; }
.footer a:hover { color: var(--accent); }
.footer .sep { opacity: .2; }
.site-legal {
    max-width: 720px; margin: -1.5rem auto 0; padding: 0 16px 2.5rem; text-align: center;
    font-size: .72rem; line-height: 1.6; color: var(--text2); opacity: .7;
}

/* PL · EN, in the site footer and the app topbar */
.lang-switch { font: .72rem var(--mono); color: var(--text2); white-space: nowrap; }
.lang-switch a { color: var(--text2); text-decoration: none; transition: color .2s; }
.lang-switch a:hover { color: var(--accent); }
.lang-switch [aria-current] { color: var(--text); }
.topbar .lang-switch { margin-right: 4px; }

/* ===== Auth pages ===== */
body.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth-wrap {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 6rem 16px 3rem; position: relative;
}
.auth-wrap::before {
    content: ''; position: absolute; width: 520px; height: 520px; max-width: 100%;
    background: radial-gradient(circle, rgba(39,194,168,0.06) 0%, transparent 70%);
    top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none;
}
.auth-card {
    position: relative; width: 100%; max-width: 420px;
    background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px;
    padding: 2rem; box-shadow: 0 0 80px rgba(39,194,168,0.05), 0 30px 80px rgba(0,0,0,0.35);
    animation: fadeUp .5s ease both;
}
.auth-card.center { text-align: center; }
.auth-head { text-align: center; margin-bottom: 1.6rem; }
.auth-icon {
    display: inline-flex; width: 52px; height: 52px; border-radius: 12px; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent); margin-bottom: 1rem;
}
.auth-icon .ico { width: 26px; height: 26px; }
.auth-head h1, .auth-card h1 { font-size: 1.35rem; font-weight: 700; }
.auth-head p { color: var(--text2); font: .8rem var(--mono); margin-top: .3rem; }
.auth-alt { margin-top: 1.4rem; text-align: center; font-size: .85rem; color: var(--text2); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.code-404 { font: 700 3rem var(--mono); color: var(--accent); letter-spacing: .1em; margin-bottom: .5rem; }

.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field > span { font-size: .8rem; color: var(--text2); }
.field em { font-style: normal; opacity: .6; }
.field small { font-size: .72rem; color: var(--text2); opacity: .7; }
.field input {
    width: 100%; padding: .65rem .85rem; border-radius: 8px;
    background: var(--bg); color: var(--text); border: 1px solid var(--border);
    font: .95rem var(--sans); transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(39,194,168,0.2); }
.form .btn-block { margin-top: .4rem; }

.alert {
    padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .85rem;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.alert-danger { background: rgba(242,84,91,0.1); border-color: rgba(242,84,91,0.35); color: #FF9CA0; }
:root[data-theme="light"] .alert-danger { color: #B3262D; }
.alert-success { background: var(--accent-soft); border-color: var(--accent-line); }
.field-row { display: flex; justify-content: space-between; align-items: baseline; }
.field-link { font-size: .75rem; text-decoration: none; }
.field-link:hover { text-decoration: underline; }
.auth-icon.warn { background: rgba(255,122,69,0.12); color: var(--warn); }
.auth-card.center .auth-icon { margin-bottom: 1rem; }
.auth-card.center h1 { margin-bottom: .4rem; }

/* ===== App shell (same structure as the vCLU UI) ===== */
body.app { height: 100vh; overflow: hidden; }
.app-container { display: flex; height: 100vh; }

.sidebar {
    width: var(--sidebar-collapsed); min-width: var(--sidebar-collapsed); height: 100vh;
    display: flex; flex-direction: column; overflow: hidden; z-index: 1000;
    background: var(--surface); border-right: 1px solid var(--border);
    transition: width .2s ease, min-width .2s ease;
}
.sidebar.expanded { width: var(--sidebar-expanded); min-width: var(--sidebar-expanded); }
.sidebar-header { display: flex; align-items: center; gap: 10px; padding: 9px 12px; min-height: var(--topbar-height); border-bottom: 1px solid var(--border); }
.sidebar-logo {
    display: flex; align-items: center; justify-content: center; min-width: 32px; height: 32px;
    border-radius: 8px; background: var(--accent-soft); text-decoration: none;
    font: 700 1.1rem var(--mono);
}
.sidebar-title { display: none; white-space: nowrap; font-size: 1.1rem; font-weight: 600; }
.sidebar-title .brand-mark { font-family: var(--sans); letter-spacing: 0; }
.sidebar.expanded .sidebar-title { display: inline; }
.sidebar-nav { flex: 1; padding: 8px; overflow-y: auto; overflow-x: hidden; }
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 11px; margin-bottom: 4px;
    border-radius: 8px; color: var(--text2); text-decoration: none; white-space: nowrap; transition: all .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-label { display: none; font-size: .9rem; }
.sidebar.expanded .nav-label { display: inline; }
/* A home under "Domy", and the sections of the open one; shown with labels only */
.nav-sub {
    display: none; padding: 6px 11px 6px 46px; margin-bottom: 2px; border-radius: 8px;
    color: var(--text2); text-decoration: none; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar.expanded .nav-sub { display: block; }
.nav-sub:hover { background: var(--surface-2); color: var(--text); }
.nav-home.open { color: var(--text); font-weight: 600; }
.nav-home.owned::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--owner); margin: 0 7px 1px -13px; vertical-align: middle; }

/* Who you are here: a cloud administrator gets a red line along the top of every page and a pill
   in the top bar; a home's owner a pill on that home's pages */
body.site-admin::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--danger); z-index: 1000; pointer-events: none; }
.who-pill { display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px; border: 1px solid; font: 600 .72rem var(--sans); letter-spacing: .03em; text-decoration: none; white-space: nowrap; }
.who-pill-admin { color: var(--danger); border-color: var(--danger); background: rgba(242, 84, 91, 0.12); }
.who-pill-owner { color: var(--owner); border-color: var(--owner); background: rgba(242, 181, 68, 0.12); }
.nav-section { padding-left: 58px; font-size: .82rem; }
.nav-section.active { color: var(--accent); background: var(--accent-soft); }

/* The sections of a home as tabs above its content */
.home-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.home-tab {
    display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; margin-bottom: -1px;
    color: var(--text2); text-decoration: none; font-size: .9rem; border-bottom: 2px solid transparent;
}
.home-tab .ico { width: 15px; height: 15px; }
.home-tab:hover { color: var(--text); }
.home-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-count {
    font: 600 .7rem var(--mono); padding: 1px 6px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent);
}
h2.home-tab { margin: 0; font-size: inherit; cursor: default; }
.tab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text2); }
.tab-dot.online { background: var(--accent); }
.tab-dot.offline { background: var(--warn); }

/* The vCLU's status, from its last health report */
.status-list { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.2rem; margin-top: 1.1rem; font-size: .9rem; }
.status-list dt { color: var(--text2); }
.status-list dd { margin: 0; }
.status-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.sidebar-footer { padding: 11px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.sidebar.expanded .sidebar-footer { flex-direction: row; justify-content: space-between; }
.sidebar.expanded .sidebar-toggle .ico { transform: rotate(180deg); }

.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: var(--topbar-height); display: flex; align-items: center; gap: 12px; padding: 0 20px;
    background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.hamburger { display: none; }
.page-title { font-size: 1.05rem; font-weight: 600; margin: 0; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--text2); }
.avatar {
    width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent); font: 600 .8rem var(--mono); text-transform: uppercase;
}
.only-light { display: none; }
:root[data-theme="light"] .only-light { display: inline-flex; }
:root[data-theme="light"] .only-dark { display: none; }

.page-content { flex: 1; overflow-y: auto; padding: 24px 20px; }
.content-wrapper { max-width: 1280px; }

/* A dashboard framed inside the home's page: it takes the whole content area. */
.page-content.page-embed { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.page-embed > .banner, .page-embed > .flash { margin: 12px 16px 0; }
.embed-bar {
    display: flex; align-items: center; gap: 8px; padding: 8px 16px;
    border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap;
}
.embed-switch { display: flex; gap: 4px; overflow-x: auto; flex: 1; min-width: 0; }
.embed-pill {
    padding: 4px 12px; border-radius: 999px; font-size: .82rem; white-space: nowrap;
    color: var(--text2); text-decoration: none; border: 1px solid transparent;
}
.embed-pill:hover { color: var(--text); }
.embed-pill.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.embed-new { margin-left: auto; }
.embed-frame { flex: 1; width: 100%; border: 0; background: var(--bg); }
.embed-offline { padding: 24px 20px; }
.banner {
    max-width: 1280px; margin: 0 0 20px; padding: .75rem 1rem; border-radius: 8px;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    background: rgba(255,122,69,0.08); border: 1px solid rgba(255,122,69,0.3); font-size: .88rem;
}
.banner em { display: block; font-style: normal; color: var(--text2); font-size: .8rem; margin-top: .2rem; }
.greeting { color: var(--text2); margin-bottom: 1.2rem; }
.greeting strong { color: var(--text); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.25rem; }
/* A card's title is a bar across its top, as the card headers in the vclu UI */
.card > .card-title:first-child, .card > .card-head:first-child {
    margin: -1rem -1.25rem 1rem; padding: .7rem 1.25rem; border-bottom: 1px solid var(--border);
    background: var(--surface-2); border-radius: 8px 8px 0 0;
}
.card > .card-title:first-child { font-size: .95rem; font-weight: 500; }
.card > .card-head:first-child .card-title { font-size: .95rem; font-weight: 500; }
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-icon {
    display: inline-flex; width: 56px; height: 56px; border-radius: 14px; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent); margin-bottom: 1rem;
}
.empty-icon .ico { width: 28px; height: 28px; }
.empty-state h2 { font-size: 1.15rem; margin-bottom: .4rem; }
.empty-state > p { color: var(--text2); font-size: .9rem; max-width: 460px; margin: 0 auto 1.4rem; }
.mini-steps {
    text-align: left; max-width: 400px; margin: 0 auto 1.6rem; padding-left: 1.2rem;
    color: var(--text2); font-size: .85rem; line-height: 1.9;
}
.mini-steps li::marker { color: var(--accent); font-family: var(--mono); }

/* ===== App components ===== */
.stack { display: grid; gap: 20px; }
.card-title { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-head .card-title { margin-bottom: 0; }
.subhead { font-size: .8rem; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; margin: 1.5rem 0 .6rem; }
.hint { font-size: .78rem; color: var(--text2); margin-top: .6rem; }
.hint + .btn { margin-top: 1rem; }
.small { font-size: .78rem; }
.form-error { color: var(--danger); font-size: .82rem; margin-top: .5rem; }
:root[data-theme="light"] .form-error { color: #B3262D; }
.warn-text { color: var(--warn); font-weight: 600; }
.form.narrow { max-width: 420px; }

.crumb { color: var(--text2); text-decoration: none; font-weight: 500; }
.crumb:hover { color: var(--text); }
.crumb-sep { color: var(--text2); opacity: .5; margin: 0 .3rem; }

.btn-ghost { background: none; color: var(--text2); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text2); }
.btn-ghost.danger:hover { color: var(--danger); border-color: var(--danger); }
.btn-danger { background: rgba(242,84,91,0.12); color: var(--danger); border-color: rgba(242,84,91,0.4); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn .ico { width: 16px; height: 16px; }

.inline-form { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.inline-form.centered { justify-content: center; max-width: 460px; margin: 0 auto; }
/* adding another home: a small card, not a full-width form */
.add-home { max-width: 520px; }
.add-home .card-head { margin-bottom: .75rem; }
.add-home .inline-form input { padding: .45rem .7rem; font-size: .85rem; }
.inline-form input, .inline-form select, .field select {
    flex: 1 1 200px; min-width: 0; padding: .6rem .85rem; border-radius: 8px;
    background: var(--bg); color: var(--text); border: 1px solid var(--border); font: .92rem var(--sans);
}
.inline-form select { flex: 0 0 auto; }
/* the browser's own arrow sits against the edge; draw one with room around it */
.inline-form select, .field select {
    appearance: none; padding-right: 2.2rem;
    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='%238b949e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .8rem center;
}
.invite-form { max-width: 640px; }
.app-form { max-width: 520px; }
.app-form > .btn { justify-self: start; }
.inline-form input:focus, .inline-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(39,194,168,0.2); }

.flash {
    max-width: 1280px; margin: 0 0 20px; padding: .7rem 1rem; border-radius: 8px; font-size: .88rem;
    background: var(--accent-soft); border: 1px solid var(--accent-line); animation: fadeUp .3s ease both;
}
.stack > .flash { margin: 0; max-width: none; }
.flash-error { background: rgba(242,84,91,0.1); border-color: rgba(242,84,91,0.35); }
.flash-site { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 150; width: calc(100% - 32px); max-width: 520px; text-align: center; }

.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.home-card { text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s; }
.home-card:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.home-card h2 { font-size: 1.05rem; margin: .9rem 0 .2rem; }
.home-card p { font-size: .82rem; }
.home-card-head { display: flex; align-items: center; justify-content: space-between; }
.home-icon, .invite-icon {
    display: inline-flex; width: 38px; height: 38px; border-radius: 10px; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent); flex-shrink: 0;
}
.status-pill { font: .68rem var(--mono); padding: .15rem .5rem; border-radius: 99px; border: 1px solid var(--border); color: var(--text2); white-space: nowrap; }
.status-pill::before { content: '\25CF  '; color: #5A6370; }
.status-pill.online { color: var(--accent); border-color: var(--accent-line); }
.status-pill.trouble { color: var(--warn); border-color: var(--warn); }
.status-pill.trouble::before { color: var(--warn); }
.day-problem { color: var(--warn); font-size: .88rem; margin: 0 0 .4rem; }
.day-failed { color: var(--danger); }
.ping-chart { display: block; width: 100%; height: 90px; margin-top: .6rem; border-bottom: 1px solid var(--border); }
.ping-line { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ping-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.ping-gap { fill: var(--danger); }
.activity-bar { fill: var(--accent); opacity: .7; }
.day-verdict { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--text); }
.day-verdict .muted { margin-left: auto; }
/* One row, not a card with a header bar */
.card.day-verdict > .card-title:first-child { margin: 0; padding: 0; border: 0; background: none; border-radius: 0; }
.day-verdict:hover { border-color: var(--accent-line); }
.ping-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--text2); margin-top: .3rem; }
.mini-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem 1.4rem; margin-top: .8rem; }
.mini-chart .ping-chart { height: 60px; margin-top: .3rem; }
.mini-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; font-size: .85rem; color: var(--text2); }
.mini-chart-head strong { color: var(--text); font-size: 1rem; }
.mini-chart-link { display: block; color: inherit; text-decoration: none; border-radius: 6px; }
.mini-chart-link:hover .mini-chart-head span { color: var(--accent); }
.mid-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 1.2rem 1.6rem; margin-top: .8rem; }
.mid-charts .ping-chart { height: 120px; }
.big-chart-back { margin: 0 0 .6rem; font-size: .85rem; }
.big-chart-tabs { margin-bottom: 1rem; }
.big-chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem 1rem; margin-bottom: .8rem; }
.big-chart-head .card-title { margin: 0; }
.big-chart-ranges { display: flex; flex-wrap: wrap; gap: .4rem; }
.big-chart-ranges a { text-decoration: none; }
.big-chart { display: block; width: 100%; height: auto; margin-top: .8rem; }
.big-chart-bar { fill: var(--accent); opacity: .75; }
.big-chart-hit { fill: transparent; }
.big-chart-hit:hover { fill: var(--accent); opacity: .12; }
.big-chart-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; }
.big-chart-axis { stroke: var(--text2); stroke-width: 1; }
.big-chart-label { fill: var(--text2); font-size: 12px; }
.status-pill.online::before { color: var(--accent); }
.status-pill.offline { color: var(--warn); border-color: rgba(255,122,69,0.35); }
.status-pill.offline::before { color: var(--warn); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.dash-tile {
    display: flex; flex-direction: column; gap: .6rem; padding: 1rem; border: 1px solid var(--border); border-radius: 10px;
    text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s;
}
.dash-tile:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.dash-tile.dash-offline { opacity: .55; }
.dash-name { font-weight: 600; font-size: .95rem; }
.dash-flags { font: .68rem var(--mono); }
.device-actions { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.pair-card { text-align: center; padding: 2.5rem 1.5rem; }
.pair-card > p.muted { max-width: 520px; margin: 0 auto 1.4rem; font-size: .9rem; }
.pair-card .hint { max-width: 520px; margin: 1rem auto 0; }
.choice-list { display: grid; gap: .5rem; }
.choice { display: flex; gap: .7rem; align-items: center; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.choice > span { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; flex: 1; }
.choice-input { flex: 1 1 200px; padding: .45rem .7rem; border-radius: 6px; background: var(--bg); color: var(--text); border: 1px solid var(--border); font: .9rem var(--sans); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .85rem; color: var(--text2); }
/* a radio or checkbox inside .field is not a text input: no full width, padding or border */
.check input { width: auto; flex: none; margin: .15rem 0 0; padding: 0; accent-color: var(--accent); }
.form-actions { display: flex; gap: .6rem; }
.steps { padding-left: 1.3rem; margin: .25rem 0 .75rem; }
.steps li { margin: .2rem 0; }
.vclu-card { display: flex; align-items: center; gap: 1rem; }
.vclu-card .card-title { margin-bottom: .2rem; }
.vclu-card p { font-size: .85rem; }
.vclu-card .status-pill { margin-left: auto; }
/* not paired yet: the text takes the room, the button sits at the right edge (under the text on phones) */
.vclu-card { flex-wrap: wrap; }
.vclu-card > div { flex: 1 1 240px; min-width: 0; }
.vclu-card > .btn { margin-left: auto; flex: none; }

.invite-card { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 16px; border-color: var(--accent-line); }
.invite-text { flex: 1 1 240px; font-size: .9rem; }
.invite-actions, .invite-buttons { display: flex; gap: .5rem; }
.invite-buttons { justify-content: center; margin-top: 1.4rem; }

.member-list { list-style: none; }
.member { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.member:first-child { border-top: 0; }
.member-text { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; font-size: .9rem; }
.member-text .muted { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; }
.member-actions { display: flex; gap: .4rem; }
.member-actions .inline-form { gap: .4rem; flex-wrap: nowrap; }
.member-actions .inline-form input { flex: 0 1 9rem; padding: .3rem .6rem; font-size: .8rem; }
.member-name .muted { font-size: .85rem; }
.invite-for { margin: 1.4rem 0 1rem; font-size: .88rem; color: var(--text2); }
.muted-avatar { background: var(--surface-2); color: var(--text2); }
.muted-avatar .ico { width: 14px; height: 14px; }
.role-pill { font: .68rem var(--mono); padding: .15rem .5rem; border-radius: 4px; background: var(--surface-2); color: var(--text2); white-space: nowrap; vertical-align: middle; }
.role-owner { background: rgba(255,122,69,0.12); color: var(--warn); }
.role-admin { background: var(--accent-soft); color: var(--accent); }
.role-warn { background: rgba(255,122,69,0.12); color: var(--warn); }
.role-own { background: transparent; border: 1px solid var(--border); }
.member-roles { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .25rem; }
.chip-form { display: inline; }
.role-chip { display: inline-flex; align-items: center; gap: .25rem; }
.chip-x { border: 0; background: none; color: var(--text2); cursor: pointer; padding: 0 0 0 .1rem; font: inherit; line-height: 1; }
.chip-x:hover { color: var(--danger); }
.role-add { position: relative; display: inline-block; }
.role-add summary { list-style: none; cursor: pointer; }
.role-add summary::-webkit-details-marker { display: none; }
.role-add-btn { background: transparent; border: 1px dashed var(--border); color: var(--text2); }
.role-add-btn:hover, .role-add[open] .role-add-btn { border-color: var(--accent); color: var(--text); }
.role-add-menu { position: absolute; left: 0; top: calc(100% + 4px); z-index: 5; display: flex; flex-direction: column; gap: .15rem; min-width: 200px; padding: .4rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.role-add-item { width: 100%; text-align: left; border: 0; background: none; color: var(--text); font: .82rem var(--mono); padding: .35rem .5rem; border-radius: 4px; cursor: pointer; }
.role-add-item:hover { background: var(--surface-2); }
.role-add-new { display: flex; gap: .3rem; padding-top: .3rem; margin-top: .2rem; border-top: 1px solid var(--border); }
.role-add-new input { flex: 1; min-width: 0; font: .8rem var(--mono); padding: .3rem .45rem; }
.home-roles { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; }
.role-chip { display: flex; align-items: center; gap: .25rem; font: .72rem var(--mono); color: var(--text2); background: var(--surface-2); border-radius: 6px; padding: .2rem .25rem .2rem .6rem; }
.role-del { display: flex; padding: .2rem; border: 0; border-radius: 4px; background: none; color: var(--text2); opacity: .55; cursor: pointer; }
.role-del:hover, .role-del:focus-visible { opacity: 1; color: var(--danger); background: rgba(242,84,91,0.12); }
.role-del .ico { width: 13px; height: 13px; }
.role-form { max-width: 420px; }

.profile-head { display: flex; align-items: center; gap: 1.2rem; }
.profile-head h2 { font-size: 1.2rem; }
.profile-head p { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.4rem; flex-shrink: 0; }
.topbar-user { text-decoration: none; }
.topbar-user:hover { color: var(--text); }

.code-input { font-family: var(--mono) !important; font-size: 1.15rem !important; letter-spacing: .2em; text-align: center; }
.inline-form .code-input { flex: 0 1 180px; }
.totp-setup { display: flex; gap: 2rem; align-items: flex-start; flex-wrap: wrap; }
.totp-qr { background: #fff; padding: 10px; border-radius: 10px; line-height: 0; flex-shrink: 0; }
.totp-qr img { width: 200px; height: 200px; image-rendering: pixelated; }
.totp-steps { flex: 1 1 320px; }
.totp-steps .mini-steps { margin: 0 0 1.2rem; max-width: none; }
.totp-secret { display: inline-block; margin-top: .3rem; font-size: .9rem; letter-spacing: .08em; word-break: break-all; }
.totp-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-top: 1rem; }
.totp-actions .subhead { margin-top: 0; }
.form.narrow > input, .narrow-inline input {
    width: 100%; padding: .6rem .85rem; border-radius: 8px; background: var(--bg); color: var(--text);
    border: 1px solid var(--border); font: .92rem var(--sans);
}
.narrow-inline { max-width: 420px; }
.recovery-codes { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin: 1.2rem 0; }
.recovery-codes code { display: block; text-align: center; padding: .55rem; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); font-size: .95rem; letter-spacing: .06em; color: var(--text); }
.danger-zone { margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.card.danger-zone { margin-top: 0; padding-top: 1.5rem; border: 1px solid rgba(242,84,91,0.3); }
.danger-zone h4 { font-size: .95rem; color: var(--danger); margin-bottom: .3rem; }
.danger-zone h4 .vclu::first-letter { color: inherit; } /* a warning stays one colour */
.danger-zone p { font-size: .85rem; margin-bottom: .9rem; }

.sidebar-overlay { display: none; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition: none !important; }
    html { scroll-behavior: auto; }
}

@media (max-width: 760px) {
    .nav { padding: 0 16px; }
    .auth-card { padding: 1.5rem; }

    /* App shell: sidebar slides over content */
    .hamburger { display: inline-flex; }
    .sidebar {
        position: fixed; left: 0; top: 0; width: var(--sidebar-expanded); min-width: var(--sidebar-expanded);
        transform: translateX(-100%); transition: transform .2s ease;
    }
    .sidebar.mobile-open { transform: translateX(0); }
    .sidebar .sidebar-title, .sidebar .nav-label { display: inline; }
    .sidebar .nav-sub { display: block; }
    .sidebar .sidebar-footer { flex-direction: row; justify-content: space-between; }
    .sidebar-toggle { visibility: hidden; }
    .sidebar-overlay.visible { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; }
    .topbar { padding: 0 12px; }
    .topbar-user-email { display: none; }
    .page-content { padding: 16px; }
    .embed-new-label { display: none; }
}

/* Home icons: a few Bootstrap Icons (MIT, (c) 2019-2023 The Bootstrap Authors,
   https://icons.getbootstrap.com), the same names the apps draw (homes.Icons). */
@font-face {
    font-family: "bootstrap-icons"; font-display: block;
    src: url("/static/fonts/bootstrap-icons.woff2") format("woff2");
}
.bi::before {
    display: inline-block; font-family: "bootstrap-icons" !important; font-style: normal; font-weight: normal !important;
    line-height: 1; vertical-align: -.125em; -webkit-font-smoothing: antialiased;
}
.bi-house-door::before { content: "\f423"; }
.bi-house-heart::before { content: "\f776"; }
.bi-building::before { content: "\f1dd"; }
.bi-buildings::before { content: "\f87d"; }
.bi-briefcase::before { content: "\f1cc"; }
.bi-shop::before { content: "\f543"; }
.bi-tree::before { content: "\f5e2"; }
.bi-flower1::before { content: "\f3cd"; }
.bi-sun::before { content: "\f5a2"; }
.bi-snow::before { content: "\f56d"; }
.icon-form { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 12px; }
.icon-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-choice input { position: absolute; opacity: 0; pointer-events: none; }
.icon-choice span {
    width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    border: 1px solid var(--border); border-radius: 10px; font-size: 1.25rem; color: var(--text2);
}
.icon-choice span:hover { color: var(--text); }
.icon-choice input:checked + span { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.icon-choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Long text pages (the privacy policy). */
.doc { max-width: 760px; margin: 0 auto; padding: 32px 20px 64px; line-height: 1.6; }
.doc h1 { font-size: 1.8rem; margin: 0 0 4px; }
.doc h2 { font-size: 1.15rem; margin: 32px 0 8px; }
.doc p, .doc li, .doc dd { color: var(--text2); }
.doc a { color: var(--accent); }
.doc-list dt { font-weight: 600; color: var(--text); margin-top: 14px; }
.doc-list dd { margin: 2px 0 0; }
.doc ol, .doc ul { padding-left: 1.3rem; }

/* Admin panel (/admin) */
.admin-numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .8rem; margin-bottom: .4rem; }
.admin-numbers div { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 8px; }
.admin-numbers strong { font-size: 1.4rem; }
.admin-numbers span { font-size: .78rem; color: var(--text2); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: .6rem; }
.admin-table th { text-align: left; font-weight: 500; color: var(--text2); font-size: .78rem; padding: .4rem .5rem; border-bottom: 1px solid var(--border); }
.admin-table td { padding: .55rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-switch { display: flex; gap: .3rem; flex-wrap: wrap; }
.admin-limit input { width: 6rem; padding: .3rem .5rem; font-size: .85rem; }
.voice-log summary { cursor: pointer; }
.voice-step { margin: .5rem 0 0 .8rem; }
.voice-step ul { margin: .2rem 0 0 1rem; }
.voice-step.unused { opacity: .45; }
.voice-step .voice-conf { color: var(--text2); }
.voice-step.weakest .voice-conf { color: var(--warn); font-weight: 600; }
.admin-search { display: flex; gap: .4rem; }
.admin-search input { width: 220px; padding: .35rem .6rem; }

/* An app's token, shown once (home.html, home-apps) */
.app-token { display: block; padding: .6rem .8rem; border-radius: 6px; background: var(--surface-2); font: .8rem var(--mono); word-break: break-all; user-select: all; margin: .4rem 0; }

/* The name in the text: "vclu" with its first letter in the accent colour, as on the logo (brand.js) */
.vclu { display: inline-block; }
.vclu::first-letter { color: var(--accent); }

/* The home's History tab */
.event-list { list-style: none; display: flex; flex-direction: column; gap: .45rem; margin: .4rem 0 .8rem; }
.event-list li { display: flex; gap: .8rem; font-size: .9rem; }
.event-list time { flex: none; min-width: 7.5rem; font-variant-numeric: tabular-nums; }
.empty-note { color: var(--text2); font-size: .9rem; padding: .7rem 0; border-top: 1px solid var(--border); }

/* "this was not me": the home apps that will be deleted */
.plain-list { margin: 0 0 1rem; padding-left: 1.2rem; }
.plain-list li { margin: .2rem 0; }
