/* Snowguide app layer — loaded last on every page, after the page's own <style>.
   The pages were written against three generations of styling. This file makes the shared furniture identical
   everywhere: one flat header, pill controls, flat panels, and the shell pieces (phone menu, messages, map popups)
   that used to live in skiai-components.css. Page-specific layout stays in the page. */

:root { --content-top: 88px; }   /* 64px header + 24px breathing room for pages that float content under it */

/* hidden means hidden: .sk-btn and friends set display, which would otherwise override the attribute */
[hidden] { display: none !important; }

/* ---- one header on every page: flat, full width, 64px, hairline under it ---- */
body > header, body > #bar, body > .page > header {
  top: 0 !important; left: 0 !important; right: 0 !important; margin: 0 !important;
  height: var(--header-h); min-height: var(--header-h); display: flex; align-items: center; gap: 16px;
  padding: 0 24px !important; background: var(--panel) !important; border: 0 !important;
  border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; box-shadow: none !important; z-index: 40;
}
body > header .sk-wordmark, body > #bar .sk-wordmark {
  display: inline-flex; align-items: center; gap: 8px; font: 800 22px/1 var(--font-display); letter-spacing: -.04em;
  color: var(--text); text-decoration: none; white-space: nowrap; flex: none;
}
body > header .sk-wordmark span, body > #bar .sk-wordmark span { color: var(--accent); }
body > header .sk-wordmark img, body > #bar .sk-wordmark img { width: 26px; height: 26px; }
body > header nav, body > #bar nav { display: flex; gap: 2px; background: transparent; border: 0; padding: 0; white-space: nowrap; }
body > header nav a, body > #bar nav a, body > header nav button, body > #bar nav button {
  color: var(--muted); padding: 8px 14px; font: 600 14px var(--font); border-radius: 999px; text-decoration: none;
  background: none; border: 0; line-height: 1.2;
}
body > header nav a:hover, body > #bar nav a:hover { color: var(--text); background: none; }
body > header nav a.on, body > #bar nav a.on, body > header nav .on, body > #bar nav .on { background: var(--primary) !important; color: var(--on-primary) !important; }

/* every page starts its content the same distance below the header */
body > header + :is(main, .wrap, #app), body > header + script + :is(main, .wrap, #app) { padding-top: 28px !important; }
@media (max-width: 720px) { body > header + :is(main, .wrap, #app), body > header + script + :is(main, .wrap, #app) { padding-top: 18px !important; } }

/* the More dropdown (built by skiai-shell.js) */
.sk-more-pop { position: absolute; top: calc(100% + 10px); left: 0; z-index: 60; min-width: 270px; padding: 6px;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop); display: grid; gap: 1px; }
.sk-more-pop[hidden] { display: none; }
body > header nav .sk-more-pop a, body > #bar nav .sk-more-pop a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); background: none !important; font: inherit; }
body > header nav .sk-more-pop a:hover, body > #bar nav .sk-more-pop a:hover { background: var(--panel2) !important; }
body > header nav .sk-more-pop a.here, body > #bar nav .sk-more-pop a.here { background: var(--panel2) !important; }
.sk-more-pop b { display: block; font: 600 14px var(--font); color: var(--text); }
.sk-more-pop span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* account + icon buttons in the header */
body > header #acct, body > header #acct-link, body > #bar #acct, body > #bar #acct-link, body > header .sk-account, body > #bar .sk-account {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  background: transparent; border: 1px solid var(--line-strong); color: var(--text); font: 600 14px var(--font);
  text-decoration: none; white-space: nowrap; box-shadow: none;
}
body > header .sk-account:has(.sk-avatar), body > #bar .sk-account:has(.sk-avatar) { padding: 0 14px 0 5px; }
body > header #acct:hover, body > header #acct-link:hover, body > #bar #acct-link:hover, body > #bar #acct:hover, body > header .sk-account:hover { border-color: var(--text); }
body > header .ibtn, body > header .sk-icon-btn, body > #bar .ibtn, body > #bar .sk-icon-btn {
  width: 40px; height: 40px; min-width: 40px; border-radius: 999px; background: transparent; border: 1px solid var(--line-strong);
  color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none; box-shadow: none;
}
body > header .ibtn:hover, body > header .sk-icon-btn:hover, body > #bar .ibtn:hover, body > #bar .sk-icon-btn:hover { color: var(--text); border-color: var(--text); }
body > header .ibtn svg, body > header .sk-icon-btn svg, body > #bar .ibtn svg, body > #bar .sk-icon-btn svg {
  width: 18px !important; height: 18px !important; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
/* header search */
body > header #omnibox, body > #bar #omnibox, body > header .sk-omnibox, body > #bar .sk-omnibox {
  height: 44px; border-radius: 999px; background: var(--panel2); border: 1px solid transparent; padding: 0 14px 0 16px; box-shadow: none;
}
body > header #omnibox:focus-within, body > #bar #omnibox:focus-within, body > header .sk-omnibox:focus-within { background: var(--panel); border-color: var(--text); }
body > header #omnibox input, body > #bar #omnibox input { font: 15px var(--font); color: var(--text); }

/* ---- flat panels: no glass, no blur ---- */
.glass:not(:where(body > header, #bar)) {   /* :where keeps this at one class of specificity, so a page's own nested rule still wins */
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel);
  box-shadow: var(--shadow); -webkit-backdrop-filter: none; backdrop-filter: none;
}

/* a segmented control never pushes past its container */
.sk-seg button { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ---- the legacy control classes, drawn as the system's controls ---- */
.btn { border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); font-family: var(--font); font-weight: 600; box-shadow: none; }
.btn:hover { border-color: var(--text); }
.btn.primary, .btn.solid, button.primary, .sk-btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.primary:hover, .btn.solid:hover, button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.ibtn { border-radius: 999px; }
.seg { background: var(--panel2) !important; border: 0 !important; border-radius: 999px !important; padding: 3px !important; gap: 2px; }
.seg button { border-radius: 999px !important; color: var(--muted); font-family: var(--font); font-weight: 600; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel) !important; color: var(--text) !important; box-shadow: 0 1px 2px rgba(17,17,20,.08); }
/* five or more options do not fit one pill track in a rail; they become a wrapping row of chips instead */
.seg:has(> button:nth-child(5)) { background: none !important; padding: 0 !important; flex-wrap: wrap; gap: 6px; }
.seg:has(> button:nth-child(5)) > button { flex: none; border: 1px solid var(--line-strong) !important; padding: 6px 12px; min-height: 32px; font-size: 13px; }
.seg:has(> button:nth-child(5)) > button.on { background: var(--primary) !important; color: var(--on-primary) !important; border-color: var(--primary) !important; box-shadow: none; }
.chip { border-radius: 999px; }
.chip.on { background: var(--primary) !important; color: var(--on-primary) !important; border-color: var(--primary) !important; }
.input, input.input, select.input, textarea.input {
  background: var(--panel2); border: 1px solid transparent; border-radius: var(--r-field); color: var(--text); font-family: var(--font);
}
.input:focus, input.input:focus, select.input:focus, textarea.input:focus { background: var(--panel); border-color: var(--text); box-shadow: none; outline: none; }
h1 { font-family: var(--font-display); letter-spacing: -.035em; }

/* ---- small screens: the header folds into the shell's menu ---- */
@media (max-width: 720px) {
  body > header, body > #bar { gap: 8px !important; padding: 0 12px !important; }
  body > header nav, body > #bar nav, .sk-nav { display: none !important; }
  .sk-wordmark { font-size: 19px !important; }
  body > header #omni, body > header #omnibox, body > #bar #omnibox { display: none; }
  .sk-btn, .sk-icon-btn, .btn { min-height: 40px; }
  input, select, textarea { font-size: 16px; }   /* below 16px iOS zooms the page on focus */
}
#sk-menu-btn { display: none !important; }
@media (max-width: 720px) {
  #sk-menu-btn { display: inline-flex !important; align-items: center; justify-content: center; order: -1; }
  #sk-menu { position: fixed; inset: 0; z-index: 60; background: rgba(17,17,20,.45); display: block;
    padding: calc(72px + env(safe-area-inset-top)) 12px 12px; overflow: auto; }
  #sk-menu[hidden] { display: none; }
  .sk-menu-card { background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--r-panel);
    box-shadow: var(--shadow-pop); padding: 6px; display: grid; gap: 2px; max-width: 520px; margin: 0 auto; }
  .sk-menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
    padding: 11px 14px; border-radius: 10px; color: var(--text); text-decoration: none; font: inherit; min-height: 44px; }
  .sk-menu-item:hover, .sk-menu-item:focus-visible { background: var(--panel2); }
  .sk-menu-item.on { background: var(--primary); color: var(--on-primary); }
  .sk-menu-item.accent { background: var(--accent-soft); color: var(--accent); }
  .sk-menu-item b { display: block; font: 600 15px/1.3 var(--font); }
  .sk-menu-item span { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
  .sk-menu-item.on span, .sk-menu-item.accent span { color: inherit; opacity: .75; }
  .sk-menu-head { padding: 12px 14px 4px; font: 600 12px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .sk-menu-foot { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
  body.sk-menu-open { overflow: hidden; }
}
@media (max-width: 480px) {
  body > header, body > #bar { gap: 6px !important; }
  .sk-account { font-size: 0 !important; gap: 0 !important; padding: 3px !important; }
  .sk-account .sk-avatar { font-size: 12px; }
}
@media (max-width: 400px) {
  .sk-wordmark { font-size: 0 !important; gap: 0 !important; }
  .sk-wordmark img { width: 30px !important; height: 30px !important; }
}

/* ---- direct messages in the header ---- */
.sk-dot-n { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 700 10px/16px var(--font);
  text-align: center; box-shadow: 0 0 0 2px var(--panel); }
#sk-dm { position: fixed; top: calc(var(--header-h) + 8px); right: 12px; z-index: 70; width: min(380px, calc(100vw - 24px));
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--r-panel);
  box-shadow: var(--shadow-pop); overflow: hidden; }
#sk-dm[hidden] { display: none; }
.sk-dm-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.sk-dm-head b { flex: 1; font: 700 16px var(--font-display); letter-spacing: -.02em; }
.sk-dm-new, .sk-dm-back { background: none; border: 0; color: var(--muted); text-decoration: none; cursor: pointer;
  font: 600 17px/1 var(--font); padding: 4px 10px; border-radius: 999px; min-height: 32px; }
.sk-dm-new:hover, .sk-dm-back:hover { background: var(--panel2); color: var(--text); }
.sk-dm-list { max-height: min(56vh, 420px); overflow: auto; }
.sk-dm-empty { padding: 28px 18px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.6; }
.sk-dm-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none;
  border: 0; border-bottom: 1px solid var(--line-row); padding: 10px 14px; cursor: pointer; color: var(--text);
  font: inherit; min-height: 58px; }
.sk-dm-row:hover { background: var(--panel2-soft); }
.sk-dm-row img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--panel2); flex: none; }
.sk-dm-who { flex: 1; min-width: 0; display: grid; gap: 1px; }
.sk-dm-who b { font: 600 14px var(--font); }
.sk-dm-last { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-dm-row.unread .sk-dm-last { color: var(--text); font-weight: 600; }
.sk-dm-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; flex: none; }
.sk-dm-pip { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent);
  color: var(--on-accent); font: 700 10px/18px var(--font); text-align: center; }
.sk-dm-thread { padding: 10px 12px 12px; }
.sk-dm-thread .skc-log { max-height: min(46vh, 330px); }
@media (max-width: 720px) {
  #sk-dm { top: auto; left: 0; right: 0; bottom: 0; width: auto; border-radius: 18px 18px 0 0;
    max-height: 82vh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
  .sk-dm-list { max-height: none; flex: 1; }
}

/* ---- map popup for a member offering a service ---- */
.guide-pop .maplibregl-popup-content { background: var(--panel-solid); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-pop); }
.guide-pop .maplibregl-popup-tip { border-top-color: var(--panel-solid); border-bottom-color: var(--panel-solid); }
.guide-pop .gp { display: grid; gap: 3px; min-width: 190px; max-width: 250px; }
.guide-pop .gp-kind { font: 500 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.guide-pop .gp b { font: 700 15px var(--font-display); letter-spacing: -.02em; }
.guide-pop .gp-head { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.guide-pop .gp-price { font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.guide-pop .gp-acts { display: flex; gap: 12px; margin-top: 7px; }
.guide-pop .gp-acts a { color: var(--accent); font-weight: 600; font-size: 13px; text-decoration: none; }
.guide-pop .gp-acts a:hover { text-decoration: underline; }

/* ---- icons (skiai-icons.js): Lucide strokes that sit on the text baseline ---- */
svg.ico { width: 1.1em; height: 1.1em; vertical-align: -.18em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
svg.ico.fill { fill: currentColor; }
i[data-ico] { font-style: normal; display: inline-flex; align-items: center; justify-content: center; vertical-align: -.18em; }
i[data-ico] svg.ico { vertical-align: 0; }
