:root {
  --bg: #F4F6F7; --panel: #FFFFFF; --ink: #16252B; --muted: #56666D; --line: #DDE3E6; --soft: #EAF1F2;
  --accent: #1D6A74; --on-accent: #FFFFFF; --warn-bg: #FFF6E6; --warn-line: #F0D9A8; --warn-ink: #5A4415;
  --chip: #FFFFFF;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F1719; --panel: #162124; --ink: #E4ECEE; --muted: #9AABB1; --line: #26363B; --soft: #1C2A2E;
  --accent: #5FB7C0; --on-accent: #0F1719; --warn-bg: #2A2416; --warn-line: #4A3F22; --warn-ink: #EAD9AE;
  --chip: #F4F6F7;
  color-scheme: dark;
}
html { font-size: 17px; }
html.big { font-size: 20px; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.5; }
a { color: var(--accent); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* sign-in and loading */
.center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.mark { width: 2.2rem; height: 2.2rem; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .72rem; flex: none; }
.big-mark { width: 4rem; height: 4rem; border-radius: 14px; font-size: 1.1rem; }
.signin { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 36px 32px; max-width: 440px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.signin h1 { margin: 0; font-size: 1.6rem; }
.signin p { margin: 0; }
.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); border-radius: 10px; padding: 10px 14px; font-size: .9rem; text-align: left; }
#gbtn { min-height: 44px; }
.signin { padding: 0; overflow: hidden; gap: 0; }
.signin-brand { background: #1D232B; width: 100%; padding: 30px 32px; display: flex; justify-content: center; }
.signin-brand img { width: 100%; max-width: 300px; height: auto; display: block; }
.signin-body { padding: 26px 32px 30px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.signin-body h1 { font-family: 'Spectral', Georgia, 'Times New Roman', serif; font-weight: 500; letter-spacing: .02em; }
.fmg-logo { display: block; height: 2.4rem; width: auto; }
.loading-logo { height: auto; width: 260px; max-width: 70vw; }
.fmg-slot { height: 2.6rem; }
/* Logos keep their real colours in both modes: in night mode they sit on a white tile. */
:root[data-theme="dark"] .fmg-slot { background: #FFFFFF; border-radius: 8px; padding: 4px 8px; height: auto; }
:root[data-theme="dark"] .loading-logo { background: #FFFFFF; border-radius: 12px; padding: 14px 18px; }

/* header */
header.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.bar { max-width: 1160px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .title { font-weight: 700; font-size: 1rem; white-space: nowrap; }
.logo-slot { display: flex; align-items: center; height: 2.4rem; }
.logo-slot img { max-height: 2.4rem; max-width: 190px; object-fit: contain; display: block; }
.logo-slot.chip, .logo-card .preview.chip { background: #FFFFFF; border-radius: 8px; padding: 4px 8px; }
.divider { width: 1px; height: 1.8rem; background: var(--line); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 600; font-size: .85rem; cursor: pointer; text-decoration: none; }
.btn[aria-pressed="true"] { background: var(--soft); border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.icon { width: 44px; padding: 0; }
.btn svg { width: 20px; height: 20px; }
.user { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.avatar { width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 600; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* page */
main { max-width: 1160px; margin: 0 auto; padding: 36px 24px 56px; display: flex; flex-direction: column; gap: 36px; }
h1.greet { margin: 0; font-size: 2rem; line-height: 1.2; }
.sub { margin: 6px 0 0; color: var(--muted); }
.search { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 4px 16px; max-width: 720px; margin-top: 16px; }
.search:focus-within { border-color: var(--accent); }
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { flex: 1; border: 0; outline: none; background: transparent; font-size: 1.05rem; padding: 12px 0; min-width: 0; }
h2 { margin: 0; font-size: 1.2rem; }
.section { display: flex; flex-direction: column; gap: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px 26px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.row > .panel { flex: 3 1 480px; }
.row > .panel.narrow { flex: 2 1 320px; }
.panel-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel-head .more { margin-left: auto; font-weight: 600; font-size: .9rem; }
.panel-head svg { width: 24px; height: 24px; color: var(--accent); flex: none; }

/* apps */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile { display: flex; gap: 14px; align-items: center; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); min-height: 76px; }
.tile:hover { border-color: var(--accent); }
.tile .ini { width: 2.7rem; height: 2.7rem; flex: none; border-radius: 10px; background: var(--soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; }
.tile .name { font-weight: 700; }
.tile .desc { color: var(--muted); font-size: .85rem; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 20px; }
.list a { display: flex; gap: 10px; align-items: center; padding: 11px 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.list a:hover { color: var(--accent); }
.list svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.stack { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.stack a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-radius: 10px; background: var(--soft); color: var(--ink); text-decoration: none; font-weight: 600; }
.stack a small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.stack svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.note { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); border-radius: 10px; padding: 12px 14px; font-size: .9rem; }
.note a { color: inherit; font-weight: 700; }

/* checklist */
.progress { height: 8px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.progress div { height: 8px; background: var(--accent); border-radius: 999px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 28px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.steps input { width: 22px; height: 22px; margin: 3px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.steps label { font-weight: 600; cursor: pointer; }
.steps li.done label { text-decoration: line-through; color: var(--muted); }
.steps .hint { color: var(--muted); font-size: .85rem; }
.steps a { font-size: .85rem; font-weight: 600; }

/* logos */
.logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.logo-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--panel); }
.logo-card .preview { height: 90px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: #FFFFFF; border: 1px solid var(--line); padding: 10px; }
.logo-card .preview img { max-width: 100%; max-height: 70px; object-fit: contain; }
.logo-card .name { font-weight: 600; font-size: .9rem; }
.logo-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.logo-card .btn { min-height: 38px; font-size: .8rem; }

#results:empty { display: none; }
.viewas { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--soft); border: 2px solid var(--accent); border-radius: 14px; padding: 16px 20px; }
.viewas > div { flex: 1 1 320px; min-width: 0; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.mbox { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mbox h3 { margin: 0; font-size: 1rem; }
.mbox p { margin: 0; font-size: .85rem; }
.mrow { display: flex; gap: 8px; flex-wrap: wrap; }
.mrow input { flex: 1 1 160px; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.mrow input[type="date"] { flex: 0 1 160px; }
.mlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mlist li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .85rem; overflow-wrap: anywhere; }
.mbtns { display: flex; gap: 6px; flex: none; }
.gallery summary { cursor: pointer; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; list-style: none; }
.gallery summary::-webkit-details-marker { display: none; }
.gallery summary::before { content: '\25B8'; color: var(--accent); }
.gallery[open] summary::before { content: '\25BE'; }
.glist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 6px; }
.gcard { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.gprev { width: 100%; height: 70px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 8px; }
.gprev img { max-width: 100%; max-height: 54px; object-fit: contain; }
.gname { font-size: .78rem; font-weight: 600; overflow-wrap: anywhere; }
.btn.small { min-height: 34px; padding: 0 10px; font-size: .78rem; }
.results a .sec { margin-left: auto; color: var(--muted); font-size: .8rem; }
footer.foot { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); padding-top: 18px; flex-wrap: wrap; }
footer.foot svg { width: 18px; height: 18px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; z-index: 10; max-width: calc(100% - 32px); }

@media (max-width: 640px) {
  .bar, main { padding-left: 16px; padding-right: 16px; }
  .user .uname, .btn .lbl { display: none; }
  h1.greet { font-size: 1.6rem; }
  .steps, .list { grid-template-columns: 1fr; }
}

/* Keep logos in their real colours even when Windows contrast themes or a browser's
   automatic dark mode try to recolour the page. */
.fmg-slot, .logo-slot, .gprev, .loading-logo, .signin-brand { forced-color-adjust: none; }
img { forced-color-adjust: none; filter: none !important; }
@media (forced-colors: active) {
  .fmg-slot, .logo-slot.chip, .gprev { background: #FFFFFF !important; border-radius: 8px; padding: 4px 8px; }
  .signin-brand { background: #1D232B !important; }
}

/* ---------- colour themes (chosen under your name; saved per computer) ---------- */
:root[data-palette="navy"]  { --accent: #2B4A7A; --soft: #E9EEF6; --bg: #F3F5F9; }
:root[data-palette="sage"]  { --accent: #3F6B4A; --soft: #E9F2EB; --bg: #F4F7F4; }
:root[data-palette="plum"]  { --accent: #6B3E6E; --soft: #F3ECF4; --bg: #F7F4F7; }
:root[data-palette="clay"]  { --accent: #9A4A26; --soft: #F8EDE6; --bg: #FAF6F2; }
:root[data-palette="slate"] { --accent: #44515C; --soft: #ECEFF2; --bg: #F4F5F7; }
:root[data-palette="ocean"]    { --accent: #1F5F99; --soft: #E8F0F8; --bg: #F3F7FB; }
:root[data-palette="burgundy"] { --accent: #8A2433; --soft: #F6E8EA; --bg: #FAF4F5; }
:root[data-palette="gold"]     { --accent: #7A5C0E; --soft: #F5EDD8; --bg: #FAF7EF; }
:root[data-palette="lavender"] { --accent: #5B4B9A; --soft: #EEEBF8; --bg: #F6F5FB; }
:root[data-theme="dark"][data-palette="ocean"]    { --accent: #86B7E8; --soft: #18232F; --bg: #0E141B; --panel: #151E28; --line: #253445; }
:root[data-theme="dark"][data-palette="burgundy"] { --accent: #E79AA5; --soft: #2B1A1D; --bg: #170F11; --panel: #221619; --line: #3D262A; }
:root[data-theme="dark"][data-palette="gold"]     { --accent: #E3C26B; --soft: #29231A; --bg: #16130C; --panel: #201B12; --line: #3A3122; }
:root[data-theme="dark"][data-palette="lavender"] { --accent: #B7A9EC; --soft: #221E30; --bg: #121019; --panel: #1B1824; --line: #312C42; }
:root[data-theme="dark"][data-palette="navy"]  { --accent: #8FB0E3; --soft: #1B2433; --bg: #0F141C; --panel: #161D29; --line: #263247; }
:root[data-theme="dark"][data-palette="sage"]  { --accent: #8CC79A; --soft: #1C2A20; --bg: #0F1712; --panel: #16211A; --line: #26382C; }
:root[data-theme="dark"][data-palette="plum"]  { --accent: #D3A6D6; --soft: #2A1E2C; --bg: #161017; --panel: #211823; --line: #3A2B3D; }
:root[data-theme="dark"][data-palette="clay"]  { --accent: #E9A07D; --soft: #2E211B; --bg: #17110E; --panel: #221914; --line: #3D2C23; }
:root[data-theme="dark"][data-palette="slate"] { --accent: #A9B7C4; --soft: #1F262D; --bg: #12161A; --panel: #1A2026; --line: #2C353E; }

/* a little colour so the page isn't bleak */
header.top { border-top: 4px solid var(--accent); }
main > section[aria-label="Welcome"] { background: var(--soft); border-radius: 18px; padding: 28px 28px 24px; }
main > section[aria-label="Welcome"] .search { background: var(--panel); }
.tile .ini { background: var(--accent); color: var(--on-accent); }

/* your-settings menu */
.user-wrap { position: relative; }
.userbtn { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: .85rem; }
.userbtn:hover, .userbtn[aria-expanded="true"] { border-color: var(--accent); }
.userbtn .chev { width: 16px; height: 16px; color: var(--muted); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); width: 290px; max-width: calc(100vw - 32px); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 14px; display: flex; flex-direction: column; gap: 14px; z-index: 20; }
.menu-h { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.swatch { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: .82rem; font-weight: 600; text-align: left; }
.swatch[aria-pressed="true"] { border: 2px solid var(--accent); background: var(--soft); }
.swatch .dot { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 0; background: var(--panel); cursor: pointer; font-weight: 600; font-size: .82rem; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.seg svg { width: 16px; height: 16px; }
.menu-note { margin: 0; font-size: .75rem; text-align: center; }
@media (max-width: 640px) { .menu { right: -8px; } }

.mrow input, .search input { caret-color: var(--accent); color: var(--ink); }
.mrow input::placeholder { color: var(--muted); }

/* Your logos (compact, inside Company info) */
.mylogos { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.mylogos h3 { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mylogos ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mylogos li { display: flex; align-items: center; gap: 10px; }
.mthumb { width: 76px; height: 34px; flex: none; background: #FFFFFF; border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; justify-content: center; padding: 3px 5px; forced-color-adjust: none; }
.mthumb img { max-width: 100%; max-height: 26px; object-fit: contain; }
.mname { flex: 1; min-width: 0; font-size: .82rem; font-weight: 600; overflow-wrap: anywhere; }

/* clickable logo thumbnails + large viewer */
button.mthumb, button.gprev { cursor: zoom-in; font: inherit; }
button.mthumb:hover, button.gprev:hover { border-color: var(--accent); }
.zoom { border: 0; border-radius: 16px; padding: 20px; width: min(760px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.zoom::backdrop { background: rgba(10, 14, 18, .6); }
.zoom-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.zoom-head h2 { font-size: 1.05rem; }
.zoom-img { background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; min-height: 200px; display: flex; align-items: center; justify-content: center; padding: 24px; forced-color-adjust: none; }
.zoom-img img { max-width: 100%; max-height: 55vh; object-fit: contain; }
.zoom-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.zoom-tip { margin: 10px 0 0; font-size: .78rem; }
