/* UsageCube: shared look of the home page, the guide and the panel. Dark by default, light with data-theme="light" on <html> */
:root {
  color-scheme: dark;
  --bg: #151514; --bg2: #181817; --card: #1f1f1d; --card2: #262624; --line: #2f2f2b; --line2: #44443e;
  --text: #ececea; --text2: #c4c4be; --dim: #a3a39d; --dim2: #8a8a84;
  --accent: #3fae75; --accent-text: #0d1f15; --green: #3fd68c; --green-bg: #23352b; --green-line: #2c4636;
  --amber: #f2b632; --amber-bg: #2a2418; --amber-line: #4a3d1e; --amber-ink: #1a1405; --red: #f08a74; --red-line: #4a2c26;
  --code-bg: #2a2a27; --sel: #34342f;
  --dev-a: #2e2e2b; --dev-b: #1a1a19; --dev-edge: #3f3f3a;
  --lg-top: #3a3a36; --lg-left: #26262a; --lg-right: #1b1b1e; --lg-edge: #4a4a45; --lg-a: #3fd68c; --lg-b: #f2b632;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f6f4; --bg2: #efefeb; --card: #ffffff; --card2: #f3f3ef; --line: #deded8; --line2: #c9c9c2;
  --text: #1d1d1b; --text2: #3d3d39; --dim: #64645f; --dim2: #6f6f6a;
  --accent: #1f7a4d; --accent-text: #ffffff; --green: #157a47; --green-bg: #e3f3ea; --green-line: #b9dfc9;
  --amber: #8a5d00; --amber-bg: #fbf1dc; --amber-line: #ecd6a4; --amber-ink: #ffffff; --red: #b03a22; --red-line: #eac2b8;
  --code-bg: #ecece7; --sel: #e2e2dc;
  --dev-a: #3a3a37; --dev-b: #232322; --dev-edge: #4a4a45;
  --lg-top: #d9d9d3; --lg-left: #ffffff; --lg-right: #ecece6; --lg-edge: #b9b9b2; --lg-a: #149c5c; --lg-b: #c98a00;
}
/* Public pages default to Free until the Worker enables Cube+. */
:root:not([data-cube-plus="true"]) [data-cube-plus-only],
:root[data-cube-plus="true"] [data-launch-only] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--green); }
code { font: .92em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--code-bg); padding: 1px 6px; border-radius: 4px; word-break: break-word; }
[hidden] { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

/* Logo drawn inline with the page theme (same geometry and colours as tools/logo/render.py) */
.logo { width: 1.3em; height: 1.3em; flex: none; vertical-align: middle; }
.logo .lt, .logo .lk { fill: var(--lg-top); } .logo .ll { fill: var(--lg-left); } .logo .lr { fill: var(--lg-right); }
.logo .le { fill: none; stroke: var(--lg-edge); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.logo .la { fill: var(--lg-a); } .logo .lb { fill: var(--lg-b); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 20px; }
.brand .logo { width: 36px; height: 36px; }
/* Brand name: U and C in the logo colours, letters appear one by one like on the display's boot screen */
.bname .u { color: var(--lg-a); } .bname .c { color: var(--lg-b); }
.bname span { animation: bnIn 1ms backwards; animation-delay: calc(200ms + var(--i) * 80ms); }
@keyframes bnIn { from, to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .bname span { animation: none; } }

/* Header: the same on every page (markup in each page, behaviour in nav.js).
   Wide: logo, section links, language and theme, search, Sign in or the account circle.
   Up to 960 px: logo, search, Sign in or the account circle and the menu button, the rest opens under the header.
   Signed in: a second row with the panel's sections on every page (links here, tab buttons in the panel) */
.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; gap: 12px 28px; min-height: 68px; padding-top: 10px; padding-bottom: 10px; }
.top nav.site { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; flex: 1; min-width: 0; }
.top nav.site a { color: var(--dim); text-decoration: none; font-size: 15px; white-space: nowrap; }
.top nav.site a:hover, .top nav.site a[aria-current="page"] { color: var(--text); }
.top .opts { display: flex; gap: 8px; margin-left: auto; }
.tools { display: flex; align-items: center; gap: 8px; }
.hav { width: 36px; height: 36px; border-radius: 50%; background: var(--green-bg); color: var(--green); border: 1px solid var(--green-line);
          display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; text-decoration: none; text-transform: uppercase; }
.hav:hover { border-color: var(--green); }
.top .menubtn { display: none; }
.menubtn .x { display: none; }
.top.open .menubtn .x { display: block; } .top.open .menubtn .bars { display: none; }
@media (max-width: 960px) {
  .top .wrap { gap: 8px; min-height: 60px; }
  .top .brand { margin-right: auto; }
  .top .menubtn { display: inline-flex; }
  .top nav.site { display: none; }
  /* The open menu: a panel under the whole header (also under the second row - .top is the containing block), one link per line, language and theme at the bottom */
  .top.open nav.site { display: flex; flex-direction: column; align-items: stretch; gap: 0; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 16px 32px rgba(0,0,0,.35);
    padding: 6px max(16px, env(safe-area-inset-right, 0px)) 14px max(16px, env(safe-area-inset-left, 0px)); }
  .top.open nav.site a { font-size: 17px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); }
  .top.open nav.site a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--green); padding-left: 12px; }
  .top .opts { margin: 12px 0 0; }
}
@media (max-width: 359px) { .top .bname { display: none; } }
.top nav.site a[data-coffee], .top.open nav.site a[data-coffee] { color: var(--green); }
.top nav.site a[data-coffee]:hover { text-decoration: underline; }
.ptabs { border-top: 1px solid var(--line); background: var(--bg2); }
.ptabs[hidden], .tabs > [hidden] { display: none !important; }
.ptabs .tabs { min-height: 0; padding-top: 0; padding-bottom: 0; display: flex; gap: 2px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.tabs > button, .tabs > a { font: 500 15px system-ui, -apple-system, "Segoe UI", sans-serif; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--dim);
  padding: 0 14px; min-height: 46px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.tabs > :first-child { margin-left: -14px; }
.tabs > :hover { color: var(--text); }
.tabs > [aria-selected="true"] { color: var(--text); border-bottom-color: var(--green); }
/* only for admins: /admin in amber, so it does not look like a part of the user panel */
.tabs > a.admtab { color: var(--amber); padding: 0 12px; }
.tabs > a.admtab:hover { border-bottom-color: var(--amber); }
@media (max-width: 700px) {
  .tabs > button, .tabs > a:not(.admtab) { flex: 1; padding: 0 6px; font-size: 14px; }
  .tabs > :first-child { margin-left: 0; }
}
.tbtn { font: inherit; font-size: 14px; background: none; border: 1px solid var(--line2); color: var(--dim); border-radius: 8px; min-width: 36px; height: 36px; padding: 0 10px;
        display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.tbtn:hover { color: var(--text); }
.tbtn svg { width: 18px; height: 18px; }

/* Buttons */
.btn { font: 600 16px/1 system-ui, -apple-system, "Segoe UI", sans-serif; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
       min-height: 44px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); color: var(--text);
       text-decoration: none; cursor: pointer; }
.btn.main { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.small { min-height: 36px; font-size: 14px; padding: 0 14px; border-radius: 8px; font-weight: 500; }
.btn.danger { color: var(--red); border-color: var(--red-line); background: none; }
.btn:disabled { opacity: .6; cursor: default; }
.link { font: inherit; border: 0; background: none; padding: 0; color: var(--dim); text-decoration: underline; cursor: pointer; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
/* Cube+ (the paid plan): gold, lighter than the amber of warnings (owner's choice 17.11.2026). Badge "★ Cube+" and the buy button - the same in the panel and the pricing */
:root { --prem: #f5d37a; --prem-bg: #2f2918; --prem-line: #6b5a2a; --prem-btn: linear-gradient(135deg, #f7dc8c, #d9a93c); --prem-btn-text: #2a1f05; }
:root[data-theme="light"] { --prem: #8a6400; --prem-bg: #fbf3d9; --prem-line: #e6cf8f; --prem-btn: linear-gradient(135deg, #e9bf4e, #c08a18); }
.pbadge { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; font: 700 11px system-ui, -apple-system, "Segoe UI", sans-serif; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--prem-line); color: var(--prem); background: var(--prem-bg); vertical-align: 2px; white-space: nowrap; letter-spacing: .02em; }
.pbadge::before { content: "\2605"; font-size: 10px; }
.btn.prem { background: var(--prem-btn); border-color: transparent; color: var(--prem-btn-text); }
.note { color: var(--dim); font-size: 14px; }
.ok { color: var(--green); font-weight: 600; }
.err { color: var(--red); font-weight: 600; }
/* Block, not flex: a flex row would split text and inline links into separate columns */
.check { position: relative; padding-left: 24px; }
/* A trap under a list item (what you need): its own line in amber with a warning sign */
.warnline { display: block; margin-top: 3px; font-size: 13px; font-weight: 600; color: var(--amber); }
.warnline::before { content: "\26A0\FE0E  "; }

/* A warning before running a command or adding a plugin (owner's choice 19.11.2026, variant C): panel and FAQ */
.doubt { border: 2px solid var(--amber); background: var(--amber-bg); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.doubt .tag { align-self: flex-start; font: 700 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: .06em; text-transform: uppercase;
              background: var(--amber); color: var(--amber-ink); padding: 6px 10px; border-radius: 99px; }
.doubt .tag::before { content: "\26A0\FE0E  "; }
.doubt h3 { margin: 0; font-size: 17px; font-weight: 600; text-wrap: balance; }
.doubt .cmd { border-color: var(--amber-line); }
.doubt .btn.am { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.check::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px;
  background: var(--green); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/contain no-repeat; }

/* The display: dark housing around the 240x240 screen canvas */
.device { display: inline-flex; background: linear-gradient(155deg, var(--dev-a), var(--dev-b)); border-radius: 22px; padding: 22px;
          box-shadow: 0 24px 48px rgba(0,0,0,.45), inset 0 0 0 1px var(--dev-edge), inset 0 2px 0 rgba(255,255,255,.08); }
.device .screen { background: #050505; border-radius: 6px; padding: 8px; box-shadow: 0 0 0 1px #3fd68c33, inset 0 0 0 2px #1a1a1a; display: flex; }
.device canvas { display: block; image-rendering: pixelated; width: 240px; height: 240px; }
.device.sm { padding: 10px; border-radius: 12px; }
.device.sm .screen { padding: 3px; border-radius: 3px; }

.foot { border-top: 1px solid var(--line); }
.foot .wrap { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; font-size: 14px; color: var(--dim); }
.foot nav { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.foot nav a { color: var(--dim); }

/* Confirmation dialog (dialog.js) instead of the browser's confirm() and prompt() */
.ucdlg { width: min(440px, calc(100vw - 32px)); padding: 22px; border: 1px solid var(--line2); border-radius: 16px; background: var(--card); color: var(--text);
         box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.ucdlg::backdrop { background: rgba(0,0,0,.55); }
.ucdlg-msg { margin: 0 0 18px; line-height: 1.5; white-space: pre-line; }
.ucdlg-in { font: inherit; width: 100%; padding: 9px 12px; margin: -6px 0 18px; border: 1px solid var(--line2); border-radius: 8px; background: var(--bg); color: var(--text); }
.ucdlg-btns { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.ucdlg .btn.danger { background: var(--red); border-color: var(--red); color: var(--bg); }
.ucdlg .btn:focus-visible, .ucdlg-in:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.coffee-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.coffee-dialog h2 { font-size: 18px; line-height: 1.3; margin: 0; }
.coffee-dialog p { margin: 0 0 16px; color: var(--dim); font-size: 14px; }
.coffee-amounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.coffee-amounts .btn { padding: 0 8px; white-space: nowrap; }
.coffee-direct { display: inline-block; margin-top: 12px; font-size: 14px; }
.coffee-continue { width: 100%; }

/* Help search (search.js): the field on the FAQ, the dialog and the answer a result leads to */
.sfield { font: inherit; font-size: 15px; width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; cursor: text; margin: 0 0 24px;
          background: var(--card); border: 1px solid var(--line2); border-radius: 12px; color: var(--dim); min-height: 48px; padding: 0 14px; }
.sfield:hover { border-color: var(--dim2); color: var(--text2); }
.sfield svg { width: 18px; height: 18px; flex: none; }
.sfield span { flex: 1; min-width: 0; }
kbd { font: 12px ui-monospace, Menlo, Consolas, monospace; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; color: var(--dim); }
@media (hover: none) { .sfield kbd { display: none; } }
.srch-on, .srch-on body { overflow: hidden; }
.srch { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.srch-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.srch-box { position: relative; width: 100%; max-width: 640px; max-height: 78vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line2);
            border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); overflow: hidden; }
.srch-in { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.srch-in > svg { width: 20px; height: 20px; color: var(--dim); flex: none; }
.srch-in input { flex: 1; min-width: 0; font: inherit; font-size: 17px; background: none; border: 0; outline: 0; color: var(--text); height: 44px; }
.srch-in input::-webkit-search-cancel-button { display: none; }
.srch-list { overflow-y: auto; padding: 6px; }
.srch-list a[data-n] { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text); }
.srch-list a[data-n][aria-selected="true"] { background: var(--sel); }
.srch-list b { font-weight: 600; font-size: 15px; }
.srch-x2 { color: var(--dim); font-size: 14px; line-height: 1.5; }
.srch-k { align-self: flex-start; font-size: 12px; font-weight: 600; color: var(--green); }
.srch-k.srch-guide { color: var(--amber); }
.srch-k.srch-device { color: var(--text2); }
.srch-list mark { background: var(--amber-bg); color: var(--text); border-radius: 3px; box-shadow: 0 0 0 1px var(--amber-line); }
.srch-msg { margin: 0; padding: 18px 12px; color: var(--dim); font-size: 15px; }
.srch-foot { margin: 0; padding: 8px 16px; border-top: 1px solid var(--line); color: var(--dim2); font-size: 12px; }
.srch-foot:empty { display: none; }
@media (hover: none) { .srch-foot { display: none; } }
@media (max-width: 600px) { .srch { padding: 8px; } .srch-box { max-height: calc(100vh - 16px); } }
.hit { animation: hit 2.4s ease-out; }
@keyframes hit { 0%, 30% { box-shadow: 0 0 0 2px var(--green); } 100% { box-shadow: 0 0 0 2px transparent; } }

/* Two ways to add a display (guide and home page): tabs Android phone / Computer, the choice in gp in usagecube */
  .paths { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
  .paths button { font: 500 15px system-ui, -apple-system, "Segoe UI", sans-serif; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
                  padding: 10px 14px; color: var(--dim); cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
  .paths button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--green); font-weight: 600; }
  .paths .tag { font-size: 12px; font-weight: 600; border-radius: 99px; padding: 1px 9px; background: var(--green-bg); color: var(--green); border: 1px solid var(--green-line); }
@media (max-width: 600px) { .paths { flex-wrap: nowrap; } .paths button { padding: 10px 8px; font-size: 14px; white-space: nowrap; gap: 6px; } .paths .tag { padding: 1px 7px; } }

/* Installation (once) and After installation (when needed): phase tags in the guide and on the home page */
.ptag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 2px 10px; line-height: 1.5; vertical-align: middle; }
.ptag.once { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-line); }
.ptag.later { background: var(--card2); color: var(--text2); border: 1px solid var(--line2); }
.afterbar { margin-top: 18px; padding: 12px 16px; border: 1px solid var(--line2); background: var(--card2); border-radius: 10px; font-size: 15px; color: var(--text2); }
.afterbar a { font-weight: 600; }

/* Tutorial videos (video.js): a 16:9 player, the note under it */
.vid { margin: 14px 0 4px; }
.vid video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; border: 1px solid var(--line); background: #000; }
.vidnote { margin: 6px 0 0; font-size: 13px; color: var(--dim); }
.vidthumb { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 560px; padding: 10px; text-align: left; cursor: pointer;
  background: var(--card2); border: 1px solid var(--line2); border-radius: 14px; color: var(--text); font: inherit; }
.vidthumb:hover { border-color: var(--green); }
.vidthumb .vt-img { position: relative; flex: none; width: 168px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.vidthumb .vt-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vidthumb .vt-img i { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 18px; padding-left: 3px; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.vidthumb .vt-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vidthumb .vt-txt b { font-size: 16px; }
.vidthumb .vt-txt small { color: var(--dim); font-size: 13px; }
@media (max-width: 480px) { .vidthumb .vt-img { width: 120px; } }
.vidnext { margin-top: 10px; padding: 10px 16px; border-radius: 10px; border: 0; background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; }
