/* MiniNexus look: the shared styles of all MiniNexus panels (repo ~/dev/mininexus-look, see README.md).
   Fonts are OFL, files in fonts/ next to this file (licences in fonts/SOURCE.md). look.js and look-store.js overwrite the
   variables that depend on the choice (palette, accent, font, sizes) on the <html> element. An app adds its own styles in
   its own file after this one and uses these variables; it never changes this file (a new version comes from the repo). */

@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-display: swap; font-weight: 100 700;
  src: url("fonts/ibm-plex-sans/ibm-plex-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-display: swap; font-weight: 100 700;
  src: url("fonts/ibm-plex-sans/ibm-plex-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url("fonts/jetbrains-mono/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url("fonts/jetbrains-mono/jetbrains-mono-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/manrope/manrope-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/manrope/manrope-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url("fonts/dm-sans/dm-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url("fonts/dm-sans/dm-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("fonts/source-sans-3/source-sans-3-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("fonts/source-sans-3/source-sans-3-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url("fonts/figtree/figtree-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url("fonts/figtree/figtree-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root {
  --fs: 13px; --font: "IBM Plex Sans", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --radius: 5px; --pad: 10px; --grad: 1; --dim: .6; --card-a: 60%;
  --bg1: #0d0b1e; --bg2: #0b2a44;
  --surface: rgba(255,255,255,.05); --surface2: rgba(255,255,255,.09); --line: rgba(255,255,255,.10);
  --text: #ebe9fb; --muted-0: #a8a4c8; --muted: var(--muted-0);
  --muted-fill: color-mix(in srgb, var(--muted-0) 60%, var(--text));
  --accent: #ffffff; --accent-text: #ffffff; --on-accent: #000000; --accent-2: #d6d6d6; --accent-ring: #a3a3a5;
  --ok: #4ade80; --warn: #fbbf24; --err: #ffa8a8; --on-err: #000000;
  --surface-solid: color-mix(in srgb, var(--bg1) 92%, #ffffff);
  --link: var(--accent-text); --on: var(--on-accent); --r-card: var(--radius); --r-btn: calc(var(--radius) - 1px);
  color-scheme: dark;
}
:root.light {
  --surface: rgba(255,255,255,.72); --surface2: rgba(20,20,60,.06); --line: rgba(20,20,60,.12);
  --surface-solid: color-mix(in srgb, var(--bg1) 96%, var(--text));
  --ok: #15803d; --warn: #a16207; --err: #b91c1c; --on-err: #ffffff;
  --muted: var(--muted-fill); /* on a light page the secondary text of the palette is too pale for 4,5:1 */
  color-scheme: light;
}
:root.has-wall { --muted: var(--muted-fill);
  --surface: color-mix(in srgb, var(--bg1) var(--card-a), transparent); }

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg1); }
body { margin: 0; min-height: 100vh; font: var(--fs)/1.45 var(--font); color: var(--text); }
body::before { content: ""; position: fixed; inset: 0; z-index: -2;
  background-image: linear-gradient(135deg, var(--bg1), color-mix(in srgb, var(--bg2) calc(var(--grad) * 100%), var(--bg1))); }
[hidden] { display: none !important; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
button, select, input, textarea { font: inherit; color: inherit; }

/* shared parts, all with the mn- prefix so that they never clash with the classes of an app */
.mn-top { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 16px; min-height: 42px;
  padding-top: calc(6px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg1) 78%, transparent); backdrop-filter: blur(10px); }
.mn-brand { font-weight: 700; display: flex; gap: 8px; align-items: center; text-decoration: none; color: inherit; white-space: nowrap; }
.mn-brand i { width: 16px; height: 16px; border-radius: 4px; background: var(--accent); }
.mn-tools { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.mn-tab { padding: 3px 9px; border-radius: var(--r-btn); border: 0; background: none; color: var(--muted); font-weight: 600; font-size: .92em; min-height: 26px; line-height: 20px; text-decoration: none; white-space: nowrap; cursor: pointer; }
.mn-tab.on { background: var(--surface2); color: var(--text); }
.mn-iconbtn, .mn-btn { border: 1px solid var(--line); background: var(--surface2); border-radius: var(--r-btn); min-height: 26px; padding: 0 9px; cursor: pointer;
  color: var(--text); font-size: .9em; font-weight: 600; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; white-space: nowrap; }
.mn-iconbtn { min-width: 34px; padding: 0 8px; }
.mn-iconbtn::after, .mn-btn::after { content: ""; position: absolute; inset: -9px; }   /* 44 px touch target around a small button */
.mn-iconbtn svg { width: 16px; height: 16px; display: block; }
/* the main button and something switched on (a tile, a toggle): like an ordinary one, with a frame in the accent
   (--accent-ring) and a light tint of it; the text keeps the normal text colour, so it reads on any background */
.mn-btn.primary, .mn-on { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--text); border-color: var(--accent-ring);
  box-shadow: inset 0 0 0 1px var(--accent-ring); }   /* looks 2 px, keeps the size of the button */
.mn-btn:disabled, .mn-iconbtn:disabled { opacity: .55; cursor: not-allowed; }
.mn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; display: inline-block; }
.mn-dot.stale { background: var(--warn); }
.mn-dot.missing { background: var(--err); }
.mn-dot.off { background: var(--muted); }
.mn-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--pad) 14px; min-width: 0; }
.mn-card h2 { font-size: 1em; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; line-height: 20px; }
.mn-tile { display: grid; gap: 8px; padding: 12px 14px; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
  transition: transform .15s, border-color .15s, box-shadow .15s; }
.mn-tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.mn-tile:active { transform: scale(.98); }
.mn-chip { font-size: .82em; line-height: 18px; padding: 0 7px; border-radius: 6px; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.mn-chip.ok { color: var(--ok); }
.mn-chip.warn { color: var(--warn); }
.mn-muted { color: var(--muted); }

/* notice: one short message at the top of the screen, right under the header (MnLook.notice) */
.mn-notice { position: sticky; top: calc(50px + env(safe-area-inset-top)); z-index: 6; display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap;
  margin: 8px auto 0; width: min(560px, calc(100% - 24px)); padding: 8px 12px; border-radius: var(--r-card); font-size: .95em; line-height: 1.35;
  background: var(--surface-solid); border: 1px solid var(--line); border-left: 4px solid var(--ok); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.mn-notice.warn { border-left-color: var(--warn); }
.mn-notice.err { border-left-color: var(--err); }
@media (prefers-reduced-motion: no-preference) { .mn-notice:not([hidden]) { animation: mn-drop .18s ease-out; } }
@keyframes mn-drop { from { transform: translateY(-6px); opacity: .4; } }

/* own wallpaper: a fixed layer under the page, dimmed by a slider. wall-boot.js (in <head>) sets has-wall and --wall-c (the average
   colour of the photo) before the first paint; appearance.js puts the photo itself in as soon as it is decoded. */
.wall { position: fixed; inset: 0; z-index: -1; background-size: cover; background-position: center; display: none; }
.wall::after { content: ""; position: absolute; inset: 0; background: var(--bg1); opacity: var(--dim); }
:root.has-wall .wall { display: block; background-color: var(--wall-c, #101114); }
:root.has-wall body::before { display: none; }

/* appearance panel (MnLook.create builds it inside <aside class="drawer" id="drawer">) */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 340px; max-width: 100vw; z-index: 20;
  transform: translateX(100%); transition: transform .2s ease; visibility: hidden;
  background: color-mix(in srgb, var(--bg1) 90%, #000); border-left: 1px solid var(--line);
  box-shadow: -10px 0 40px rgba(0,0,0,.35); overflow-y: auto; overflow-x: hidden; padding: 12px 14px; }
:root.light .drawer { background: color-mix(in srgb, var(--bg1) 92%, #fff); }
.drawer.open { transform: none; visibility: visible; }
.drawer h3 { margin: 0 0 4px; font-size: 1.1em; display: flex; align-items: center; justify-content: space-between; }
.drawer .sec { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.drawer .sec > b { display: block; margin-bottom: 6px; }
.drawer .swgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.drawer .swgrid button { height: 36px; border-radius: calc(var(--radius) - 1px); border: 1px solid var(--line); cursor: pointer; }
.drawer .swgrid button.on, .drawer .dots button.on { outline: 2px solid var(--text); outline-offset: 1px; }
.drawer .swgrid button.on:focus-visible, .drawer .dots button.on:focus-visible { outline-width: 3px; outline-offset: 3px; }
.drawer .dots { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.drawer .dots button { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.drawer .dots input[type=color] { width: 28px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.drawer .filerow { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.drawer .filerow input[type=file] { width: 100%; min-width: 0; }
.drawer .filerow .linkbtn { align-self: flex-end; }
.drawer .rangerow { display: grid; grid-template-columns: 1fr 56px; gap: 8px; align-items: center; }
.drawer .rangerow output { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mn-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 15; display: none; }
.mn-scrim.open { display: block; }

.drawer .field { display: grid; gap: 4px; margin-bottom: 8px; min-width: 0; }
.drawer .field.gap { margin-top: 8px; }
.drawer .field label { font-weight: 600; font-size: .9em; color: var(--muted); }
.drawer .field .hint { font-size: .9em; color: var(--muted); }
.drawer .field .error { font-size: .9em; color: var(--err); }
.drawer .hint { font-size: .9em; color: var(--muted); }
.drawer .hint.gap { margin-top: 6px; }
.drawer .hint:empty, .drawer .error:empty { display: none; }
.drawer .hint.err { color: var(--err); }
.drawer .hidden { display: none !important; }
.drawer .linkbtn { border: 0; background: none; color: var(--accent-text); cursor: pointer; padding: 0 4px; font-weight: 600; min-height: 24px; min-width: 24px; }
.drawer .btn { border: 1px solid var(--line); background: var(--surface2); border-radius: var(--r-btn); color: var(--text); font-weight: 600;
  height: auto; padding: 5px 12px; cursor: pointer; }
.drawer .muted { color: var(--muted); }
.drawer .btn::after { content: none; }
.drawer input[type=file] { font: inherit; color: var(--text); max-width: 100%; }
.drawer select { font: inherit; color: var(--text); background: rgba(0,0,0,.18); border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px); padding: 5px 8px; width: 100%; min-width: 0; }
:root.light .drawer select { background: rgba(255,255,255,.8); }
.drawer select option { background: var(--bg1); color: var(--text); }
.drawer .modes { display: flex; gap: 4px; background: rgba(0,0,0,.15); padding: 3px; border-radius: var(--radius); margin-bottom: 8px; }
.drawer .modes button { flex: 1; border: 0; background: none; padding: 4px; border-radius: calc(var(--radius) - 2px); cursor: pointer; color: var(--muted-fill); font-weight: 600; }
.drawer .modes button.on { background: var(--surface2); color: var(--text); }
.drawer .row-status { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.drawer :disabled { opacity: .55; cursor: not-allowed; }
@media (forced-colors: active) { .wall, body::before { display: none; } .drawer .swgrid button, .drawer .dots button { forced-color-adjust: none; } .drawer { background: Canvas; border-color: CanvasText; } }
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }
