/* Each user's own look (appearance.js): the menu's own card at its foot, the settings panel opened from Opti, and
   what the chosen cards / width do to the page. The colour and the corners come as CSS variables set on <html>. */

/* ---- cards with a border instead of a shadow ---- */
:root[data-cards="border"] :is(.panel, .table-card, .sd-card, .kpi-card, .site-card, .bank-sum, #dashMapCard) {
  box-shadow: none !important; border: 1px solid var(--line) !important; }
/* ---- boxed: the page in the middle, at a reading width ---- */
:root[data-width="boxed"] .content { max-width: 1320px; margin-inline: auto; }

/* ---- who is signed in (top right): the owner's face instead of a letter ---- */
.avatar.has-photo { overflow: hidden; padding: 0; background: #fff; }
.avatar.has-photo img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 15%; }
.user-chip .avatar.has-photo { width: 34px; height: 34px; }

/* ---- choosing a picture (the panel, and a user's window in settings) ---- */
.av-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 10px; }
.av-pick { position: relative; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; padding: 0; border: 2px solid var(--line); border-radius: 50%;
  background: #fff; color: var(--muted); font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.av-pick img { width: 100%; height: 100%; object-fit: cover; }
.av-pick:hover { border-color: var(--primary-line); }
.av-pick[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.av-ini { background: var(--primary); color: #fff; font-size: 18px; font-weight: 700; }
.av-up { background: var(--panel-muted); border-style: dashed; }
.av-wrap, .hero-pick-wrap { position: relative; display: block; }
.av-wrap .av-pick { width: 100%; }
.pick-del { position: absolute; top: -6px; right: -6px; z-index: 1; width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 2px solid var(--panel);
  border-radius: 50%; background: var(--red); color: #fff; font: 700 14px/1 sans-serif; cursor: pointer; opacity: 0; transition: opacity .15s; }
.av-wrap:hover .pick-del, .hero-pick-wrap:hover .pick-del, .pick-del:focus-visible { opacity: 1; }
@media (hover: none) { .pick-del { opacity: 1; } }
.av-up .icon { width: 20px; height: 20px; }

/* ---- the bar while the owner is in someone else's account ---- */
.switch-bar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 10px 18px;
  background: var(--amber); color: #2a1a00; font-size: 13px; }
.switch-bar .icon { width: 18px; height: 18px; flex: none; }
.switch-bar span { flex: 1; min-width: 220px; }
.switch-bar .btn { background: #2a1a00; color: #fff; border-color: #2a1a00; }
.switch-bar .btn:hover { background: #000; }

/* ---- the users list: their picture, and switching into their account ---- */
.user-row-who { display: flex; align-items: center; gap: 10px; }
.user-row-ava { width: 32px; height: 32px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; font-weight: 700; }
.user-row-ava img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.user-row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---- the panel ---- */
.lk-backdrop { position: fixed; inset: 0; z-index: 140; background: rgba(8, 12, 22, .35); backdrop-filter: blur(2px); }
.lk-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 141; width: min(340px, 100vw); display: flex; flex-direction: column;
  background: var(--panel); color: var(--text); box-shadow: -10px 0 30px rgba(0, 0, 0, .18); animation: lk-in .22s ease-out; }
.lk-backdrop.hidden, .lk-panel.hidden { display: none; }
@keyframes lk-in { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lk-panel { animation: none; } }
.lk-panel header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.lk-panel h2 { margin: 0; font-size: 18px; font-weight: 650; }
.lk-x { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.lk-x:hover { background: var(--panel-muted); color: var(--text); }
.lk-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: 18px 20px 24px; }
.lk-body section { display: flex; flex-direction: column; gap: 10px; }
.lk-body section[hidden] { display: none; }
.lk-body h3 { display: flex; justify-content: space-between; margin: 0; font-size: 14px; font-weight: 650; }
.lk-body h3 b { color: var(--muted); font-weight: 500; }
.lk-body small { color: var(--muted); font-size: 12px; }
.lk-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lk-seg button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s; }
.lk-seg button .icon { width: 17px; height: 17px; }
.lk-seg button:hover { border-color: var(--primary-line); }
.lk-seg button[aria-pressed="true"] { border-color: transparent; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.lk-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 10px; }
.lk-sw { position: relative; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; }
.lk-sw::after { content: ""; width: 20px; height: 20px; border-radius: 50%; background: var(--c); }
.lk-sw[aria-pressed="true"]::after, .lk-own.is-on::after { box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--c, var(--primary)); }
.lk-own { overflow: hidden; color: var(--muted); }
.lk-own::after { display: none; }
.lk-own.is-on { --c: var(--primary); color: var(--primary); border-color: var(--primary); }
.lk-own input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.lk-own .icon { width: 18px; height: 18px; }
.lk-link { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--primary); font: inherit; font-size: 12.5px; cursor: pointer; }
.lk-link:hover { text-decoration: underline; }
.lk-body input[type="range"] { width: 100%; accent-color: var(--primary); }
.lk-body input[type="text"] { min-height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; }
.lk-reset { margin-top: 4px; }

/* ---- the profile page: the two built-in dashboard pictures and one's own ---- */
.hero-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.hero-pick-wrap .hero-pick { width: 100%; }
.hero-pick { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: end center; overflow: hidden; padding: 6px 6px 0; border: 2px solid var(--line); border-radius: 14px;
  background: var(--panel-muted); color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; transition: border-color .15s; }
.hero-pick img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hero-pick:hover { border-color: var(--primary-line); }
.hero-pick[aria-pressed="true"], .hero-own.is-on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.hero-own { place-items: center; padding: 6px; }
.hero-own span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hero-own .icon { width: 20px; height: 20px; }
.hero-own img:not([hidden]) + span { position: absolute; inset: auto 0 0 0; padding: 3px; background: color-mix(in srgb, var(--panel) 85%, transparent); flex-direction: row; justify-content: center; font-size: 11px; }
.hero-own img:not([hidden]) + span .icon { width: 13px; height: 13px; }
