/* =========================================================================
   Roberts Limbrick Home — styles (v4, from scratch)
   Direction: glass + gradient, app-shell with a full-height brand sidebar.
   Soft gradient-mesh page, frosted-glass cards, big rounded corners, soft
   float. Colour tokens in themes.css. Drawn from _inspiration_selected.
   V2
   ========================================================================= */

:root {
  --radius:    20px;   /* cards */
  --radius-sm: 12px;   /* buttons */
  --radius-lg: 22px;   /* modal */
  --side-w:    290px;
  --gap:       22px;
  
  /* --brkp-1: var(--bg-page);
  --brkp-2: var(--bg-page);
  --brkp-3: var(--bg-page);
  --brkp-4: var(--bg-page); */

  /* --brkp-1: #feffe0;
  --brkp-2: #ffd7a6;
  --brkp-3: rgb(253, 167, 138);
  --brkp-4: rgb(119 77 194); */
}

*, *::before, *::after {box-sizing: border-box;}
* { margin: 0; padding: 0; }
/* html { -webkit-text-size-adjust: 100%; } */

body {
  min-height: 100vh;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg-page);
  background-attachment: fixed;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
:focus-visible { outline: 2.5px solid var(--ring); outline-offset: 2px; border-radius: 8px; }
input::placeholder {
  opacity: 0.5;
}
.hidden {display: none !important;}

/* =========================================================================
   APP SHELL: full-height sidebar rail + scrolling main
   ========================================================================= */
.shell { position: relative; }

/* ---------- Sidebar (its own dark-blue background, full height) ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--side-w);
  height: 100vh;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px 20px 20px;
  background: var(--side-bg);
  color: var(--side-ink);
  border-right: 1px solid var(--side-border);
  /* overflow: hidden; */
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--side-border);
}
.sidebar-brand .logo-icon { height: 34px; width: auto; color: var(--side-ink); flex: none; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: var(--side-ink); }

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-right: 4px;
}

.side-group { display: flex; flex-direction: column; }
.side-group-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.card-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--side-dot); flex: none; }
.side-group-title {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  font-weight: 700;
  color: var(--side-ink);
}
.side-note { font-size: 12px; line-height: 1.45; color: var(--side-muted); margin: 0 0 8px 16px; }

.side-links { list-style: none; display: flex; flex-direction: column; gap: 1px; }
.side-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--side-ink);
  text-decoration: none;
  padding: 8px 10px 8px 16px;
  border-radius: 10px;
  transition: background 0.14s ease, color 0.14s ease;
}
.side-links a:hover { background: var(--side-hover); color: #fff; border-radius: 25px}
.side-links a:hover span.link-icon.rotate {
    rotate: -45deg;
    transition: rotate 0.5s
  }
.highlight a {
    border: 0px dashed #ffffff5c;
    border-radius: 25px;
    background-color: rgba(var(--accent-rgb), 0.12);
    backdrop-filter: opacity(0.5);
    padding-top: 5px;
    padding-bottom: 5px;
}
.side-links .link-icon { width: 15px; height: 15px; color: var(--side-muted); flex: none; display: inline-flex; }
.side-links .link-icon svg { width: 14px; height: 14px; fill: currentColor; display: block; }
.side-links .link-icon:empty { display: none; }

.sidebar-foot { padding-top: 8px; border-top: 1px solid var(--side-border); display: flex; flex-direction: row; align-items: center; gap: 8px; }
/* Compact icon-only buttons, evenly spread across the row */

.sidebar-foot .theme-btn-label { display: none; }
/* Keep the theme popover readable even though its button is now narrow */
.sidebar-foot .theme-menu { right: 0; left: auto; min-width: 180px; }

/* =========================================================================
   MAIN AREA
   ========================================================================= */
.main {
  margin-left: var(--side-w);
  min-width: 0;
  padding: clamp(24px, 2.8vw, 44px) clamp(20px, 2.8vw, 52px) 72px;
}

/* ---------- Top bar: greeting + clock/weather ---------- */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: clamp(24px, 2vw, 40px);
  /* margin-bottom: clamp(24px, 2vw, 40px); */
  /* border-bottom: 1px solid var(--border-soft); */
}
.greeting h1 {
  font-size: clamp(30px, 4.4vw, 50px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.02;
  color: var(--ink);
}
.subtitle {
           font-size: clamp(14px, 1.5vw, 17px);
           font-weight: 400;
           color: var(--muted);
           margin-top: 10px;
           color: var(--accent-strong);
           min-width: 160px;
          }
#date.subtitle {
    white-space: nowrap;
}
.topbar-right {
  display: flex;
  gap: clamp(10px, 2.0vw, 16px);
  flex: none;
}
.clock {text-align: right;line-height: 1;min-width: 130px;}
.time {font-size: 32px;font-weight: 700;letter-spacing: -0.03em;color: var(--ink);font-variant-numeric: tabular-nums;line-height: 1.02;}
.date { font-size: clamp(12px, 1.2vw, 15px); font-weight: 500; color: var(--muted); margin-top: 8px; }

/* ---------- Content sections ---------- */
.content {display: flex;flex-direction: row;flex-wrap: wrap;margin-top:  clamp(24px, 2vw, 40px);}
.rl-section {display: flex;flex-direction: column;gap: clamp(16px, 1.8vw, 24px);width: 100%;}
.rl-section + .rl-section {
  /* margin-top: clamp(30px, 3.6vw, 50px); */
  padding-top: clamp(30px, 3.6vw, 50px);
  /* border-top: 1px solid var(--border-soft); */
}

.section-head {display: flex;flex-direction: column;gap: 8px;flex-wrap: wrap;}
.section-title {
  font-size: 14px;
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  }
.section-title:before {
    background: var(--accent-strong);
    width: 10px;
    height: 10px;
    display: inline-block;
    content: "";
    border-radius: 5px;
    margin-right:5px
}
.section-intro {font-size: 15px;line-height: 1.55;color: var(--muted);/* max-width: 74ch; */}
.section-actions {display: flex;gap: 12px;margin-top: 6px;flex-direction: row;flex-wrap: wrap;}

.card-row {display: grid;grid-template-columns: repeat(3, minmax(0, 1fr));gap: var(--gap);align-items: start;}
.card-row--2 {grid-template-columns: repeat(2, minmax(0, 1fr));}
.card-row--1 { grid-template-columns: minmax(0, 1fr); }


section.rl-section.projects {}

.section-content {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    flex-direction: column;
    flex-wrap: nowrap;
    /* min-height: 100px; */
    justify-content: space-between;
}

section#custom-links-section {width: 100%}
section.rl-section.projects {
    width: 66%;
    margin-right: 2%;
}

section.rl-section.crm {
    width: 32%;
    /* margin-right: 2%; */
}
section.rl-section.fauxnet {
    width: 32%;
}

.section-content.vertical {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
}

/* =========================================================================
   GO TO PROJECT box  (js/project-search.js)
   ========================================================================= */
.project-go-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.project-go-input {
  width: 260px; max-width: 100%;
  font: inherit; font-size: 13.5px; font-weight: 500; line-height: 20px; color: var(--ink);
  padding: 10px 16px; border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft); background: var(--accent-soft);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.project-go-input::placeholder { color: var(--muted); }
.project-go-input:focus { outline: none; border-color: var(--accent-strong); box-shadow: 0 0 0 3px var(--ring); }
.project-go-input[aria-invalid="true"] { border-color: #c0392b; }
.project-go-err { font-size: 12.5px; color: #c0392b; margin: -12px 0 0; }
.project-go-err:empty { display: none; }

/* =========================================================================
   CUSTOM USER SHORTCUTS  (built by js/custom-links.js)
   Section stays hidden until the person adds a shortcut.
   ========================================================================= */
.rl-section[hidden] { display: none; }
.user-custom .custom-item { position: relative; display: inline-flex; }
.user-custom .custom-icon { width: 20px; height: 20px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.user-custom .custom-icon img { width: 20px; height: 20px; object-fit: contain; border-radius: 4px; display: block; }
.user-custom .custom-icon svg { width: 16px; height: 16px; fill: none; stroke: var(--ink); }
.user-custom .btn:hover .custom-icon svg { stroke: var(--accent-ink); }
.user-custom .btn.custom {max-width: unset;overflow: hidden;text-overflow: ellipsis;padding: 10px 15px;}

/* Edit mode: dashed "Add" tile + small remove badge on each shortcut */
.user-custom .custom-add {
  background: transparent; color: var(--ink-soft);
  border: 1.5px dashed var(--muted);
}
.user-custom .custom-add svg { width: 16px; height: 16px; fill: none; stroke: currentColor; }
.user-custom .custom-add:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); box-shadow: none; }
.user-custom .custom-add:hover svg { stroke: currentColor; }
.user-custom.is-editing .btn.custom { border-style: dashed; border-color: var(--muted); }
.user-custom.is-editing .custom-item { cursor: grab; }
.user-custom.is-editing .custom-item:active { cursor: grabbing; }
.user-custom .custom-item.is-dragging { opacity: 0.35; }
.custom-remove {
  position: absolute; top: -7px; right: -7px;
  width: 22px; height: 22px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border-soft);
  background: var(--glass-strong, #fff); color: var(--ink-soft);
  cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: background 0.12s ease, color 0.12s ease;
}
.custom-remove svg { width: 11px; height: 11px; }
.custom-remove:hover { background: #c0392b; color: #fff; border-color: #c0392b; }
html[data-view="compact"] .section-actions.user-custom { flex-wrap: wrap; }
html[data-view="compact"] p.section-intro.custom-empty:not([hidden]) { display: block; }

/* Edit button in the sidebar foot (sits next to the settings cog) */
.custom-edit-btn .icon-done { display: none; }
.custom-edit-btn[aria-pressed="true"] { background: var(--accent-strong); color: var(--accent-ink); border-color: var(--accent-strong); }
.custom-edit-btn[aria-pressed="true"] .icon-edit { display: none; }
.custom-edit-btn[aria-pressed="true"] .icon-done { display: block; }

/* Add / edit shortcut form (inside the shared modal) */
.custom-form { display: flex; flex-direction: column; gap: 16px; }
.custom-form .form-field { display: flex; flex-direction: column; gap: 6px; }
.custom-form label { font-size: 13px; font-weight: 600; color: var(--ink); }
.custom-form .form-optional { font-weight: 500; color: var(--muted); }
.custom-form input[type="text"] {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--ink);
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft); background: rgba(255, 255, 255, 0.5);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.custom-form input[type="text"]::placeholder { color: var(--muted); }
.custom-form input[type="text"]:focus { outline: none; border-color: var(--accent-strong); box-shadow: 0 0 0 3px var(--ring); }
.custom-form input[aria-invalid="true"] { border-color: #c0392b; }
.custom-form .form-hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.custom-form .form-error { font-size: 12.5px; color: #c0392b; margin: 0; }
.custom-form .form-error:empty { display: none; }
.custom-form .form-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.custom-form .form-spacer { flex: 1; }
.custom-form .custom-remove-link:hover { background: #c0392b; border-color: #c0392b; color: #fff; }
/* =========================================================================
   GLASS CARDS
   ========================================================================= */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  /* box-shadow: var(--shadow-md), inset 0 1px 0 var(--glass-hi); */
  box-shadow: var(--shadow);
  padding: clamp(14px, 1.5vw, 20px);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {/* box-shadow: 0 22px 54px rgba(26, 44, 78, 0.20), inset 0 1px 0 var(--glass-hi); */}

/* Header: frosted icon chip + title */
.card-head {display: flex;align-items: center;gap: 13px;margin-bottom: 2px;justify-content: flex-start;}
.card-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  /* border-radius: 13px; */
  /* color: var(--accent); */
  /* background: var(--glass); */
  /* border: 1px solid var(--glass-border); */
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  /* backdrop-filter: blur(8px); */
  /* display: none; */
}
.card-icon img {width: 36px;}
.card-icon svg {width: 22px;height: 22px;display: none;}
.card-head h2, .card-head h3 {
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; color: var(--ink);
}

.card-desc {font-size: 14px;line-height: 1.55;color: var(--ink-soft);margin-top: 12px;min-height: 42px;}

.card-note {
  position: relative;
  font-size: 13px; line-height: 1.5; color: var(--ink-soft);
  background: var(--accent-soft);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 11px 34px 11px 14px;
  margin-top: 14px;
}
.card-note.is-dismissed { display: none; }

/* Close (x) button injected into each card-note */
.card-note-close {
  position: absolute; top: 7px; right: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0;
  border: none; border-radius: 6px; cursor: pointer;
  color: var(--ink-soft); background: transparent;
  transition: background 0.12s ease, color 0.12s ease;
}
.card-note-close:hover { background: var(--border-soft); color: var(--ink); }
.card-note-close svg { width: 14px; height: 14px; }
.crm-progress-container .card-desc {
  margin-bottom:5px; min-height: unset;
}

.crm-progress {
    display: block;
    background:  var(--accent-stronger);

    /* border: 1px solid black; */
    border-radius: 15px;
    height: 10px;
    overflow: hidden;
}
.crm-progress span.track { height:10px; background: var(--accent-strong); display: block;
                         }
.crm-progress-values {
    font-family: Consolas;
    font-size: 0.8em;
    color: var(--accent-strong);
}

.notes-restore-count { font-weight: 600; }

/* =========================================================================
   BUTTONS
   ========================================================================= */
.card-actions { gap: 10px; margin-top: 18px; 
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

.card-actions--stack { flex-direction: column; align-items: stretch; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  padding: 10px 15px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease, transform 0.12s ease, box-shadow 0.14s ease;
  /* text-wrap: balance; */
  line-height: 20px;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; fill: var(--ink);}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  /* box-shadow: 0 8px 20px rgba(31, 95, 168, 0.28); */
}
.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: var(--shadow-hover);
}

.btn-secondary {
  background: var(--accent-soft);
  color: var(--ink);
  border-color: var(--border-soft);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  /* border-color: var(--accent); */
  color: var(--accent-ink);
  background: var(--accent-strong);
  box-shadow: var(--shadow-hover);
}

a.btn.btn-mail {
    background: #ffffff24;
    border-color: var(--accent);
}


/* =========================================================================
   IN-CARD SUB-GROUPS
   ========================================================================= */
.card-sub { margin-top: 20px; }
.card-sub + .card-sub { margin-top: 16px; }
.card-sub-label {
  display: flex; align-items: center; gap: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 10.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px;
}
p.card-sub-label::after {content: "";flex: 1;height: 1px;background: var(--border-soft);}

/* ---- Guide triggers: open Help & resources / How to… in a modal ---- */
.card-guides {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
  display: none;
}
.guide-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--link);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 8px 10px;
  margin: 0;
  border-radius: 9px;
  transition: background 0.12s ease, color 0.12s ease;
}
.guide-btn:hover { background: var(--accent-soft); color: var(--accent); }
.guide-btn .arrow { flex: none; display: inline-flex; color: var(--muted); }
.guide-btn .arrow svg { width: 15px; height: 15px; }
.guide-btn:hover .arrow { color: var(--accent); }

.card-links {list-style: none;display: flex;flex-direction: row;margin-top: 18px;flex-wrap: wrap;gap: 8px 25px;}
.card-links--cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.card-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  padding: 4px 10px;
  /* margin: 0 -9px; */
  border-radius: 20px;
  transition: background 0.12s ease, color 0.12s ease;
  background: var(
  --accent-stronger);
}
.card-links a:hover { background: var(--accent-soft); color: var(--accent); }

.link-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; color: var(--muted); }
.link-icon img {width: 24px;}
.link-icon svg { display: block; width: 15px; height: 15px; fill: currentColor; }
.link-icon:empty { display: none; }

span.explain {border-bottom: 2px dashed var(--ink-soft);}
span.help {
    border: 1px solid;
    padding: 0 5px;
    border-radius: 30px;
    font-size: 11px;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.6;
}
span.help:hover {
    cursor: pointer;
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    color: var(--accent-ink)
}
/* ---------- TBC placeholders ---------- */
.card-links a.tbc { color: var(--muted); }
a.tbc::after {
  content: "TBC"; font-size: 9px; font-weight: 700; letter-spacing: 0.05em; line-height: 1;
  color: var(--muted); background: var(--glass); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 4px; margin-left: 6px; display: none;
}
.btn.tbc::after { margin-left: 8px; }
.btn.btn-primary.tbc::after { color: var(--accent-ink); background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.4); }

/* =========================================================================
   THEME SWITCHER (in the sidebar foot — light text on dark rail)
   ========================================================================= */
.theme-switcher { position: relative; }
.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 18px;
  border: 1px solid var(--side-border);
  border-radius: 12px;
  cursor: pointer;
  color: var(--side-ink);
  background: var(--side-hover);
  transition: background 0.12s ease;

  justify-content: center;
}
.theme-btn:hover { background: rgba(255,255,255,0.16); }
.theme-btn svg { width: 18px; height: 18px; flex: none; }
.theme-btn-label { font: inherit; font-size: 14px; font-weight: 600; }

.theme-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface, #fff);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 60;
}
.theme-menu[hidden] { display: none; }
.theme-opt {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: none; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 500; text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}
.theme-opt svg { width: 18px; height: 18px; flex: none; }
.theme-opt .theme-opt-label { flex: 1; }
.theme-opt-check { opacity: 0; color: var(--accent); }
.theme-opt:hover { background: var(--accent-soft); }
.theme-opt[aria-checked="true"] { color: var(--accent); }
.theme-opt[aria-checked="true"] .theme-opt-check { opacity: 1; }

/* =========================================================================
   MODAL (glass)
   ========================================================================= */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(14, 22, 34, 0.5);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-backdrop.is-open { opacity: 1; visibility: visible; }
.modal {
  width: 100%;
  max-width: 540px;
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  backdrop-filter: blur(30px) saturate(1.4);
  color: var(--ink);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-hi);
  transform: translateY(8px) scale(0.99);
  transition: transform 0.2s ease;
}
.modal-backdrop.is-open .modal { transform: none; }
.modal-header { display: flex; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--border-soft); }
.modal-header .card-icon {width: 40px;height: 40px;display: none;}
.modal-title { flex: 1; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.modal-close {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 1px solid var(--border-soft); border-radius: 9px;
  cursor: pointer; color: var(--muted); background: transparent;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.modal-close:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--border); }
.modal-close svg { width: 17px; height: 17px; }
.modal-body { padding: 20px 22px 24px; overflow: auto; font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); }
.modal-body > * + * { margin-top: 12px; }
.modal-body h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-top: 18px; font-weight: 700; }
.modal-body ul { padding-left: 20px; }
.modal-body li { margin-top: 6px; }
.modal-body strong { color: var(--ink); font-weight: 600; }
body.modal-open { overflow: hidden; }

/* Guide modal sections + link lists */
.guide-sec + .guide-sec { margin-top: 8px; }
.guide-sec h3 { margin-top: 0; }
.guide-sec p { margin-top: 6px; }
.modal-bullets { padding-left: 20px; margin-top: 6px; }
.modal-bullets li { margin-top: 6px; }
.modal-links { list-style: none; padding-left: 0; margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.modal-links li { margin-top: 0; }
.modal-links a {
  display: flex; align-items: center; gap: 10px;
  font-size: 14.5px; font-weight: 500; color: var(--link);
  text-decoration: none;
  padding: 9px 12px; margin: 0 -12px;
  border-radius: 10px;
  transition: background 0.12s ease, color 0.12s ease;
}
.modal-links a::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.5; flex: none; }
.modal-links a:hover { background: var(--accent-soft); color: var(--accent); }
.modal-links a.tbc { color: var(--muted); }




/* ---------- Scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--dot-idle) transparent; }
.sidebar-scroll { scrollbar-color: rgba(255,255,255,0.28) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--dot-idle); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }

/* =========================================================================
   TOOLTIPS — a single floating bubble (added to <body> by main.js), so it
   never clips inside the sidebar scroll area or a modal. Content comes from
   each element's data-tip="…" attribute (numbered placeholders for now).
   ========================================================================= */
#rl-tooltip {
  position: fixed;
  z-index: 200;
  max-width: 260px;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  color: #fff;
  background: #1b2836;
  box-shadow: 0 10px 30px rgba(10, 18, 30, 0.35);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: normal;
}
#rl-tooltip.is-visible { opacity: 1; transform: none; }
#rl-tooltip .rl-tip-arrow {
  position: absolute;
  width: 9px; height: 9px;
  background: inherit;
  transform: rotate(45deg);
}
/* Dark theme: flip the bubble so it stays high-contrast */
:root[data-theme="dark"] #rl-tooltip { background: #e8eef6; color: #10151c; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }


/* =========================================================================
   NOTICE BANNER  (added — reads announcements.json via js/notices.js)
   Sits under the header, above .content. Reuses the site's glass tokens.
   ========================================================================= */
:root { 
    --nt-reminder:rgb(31, 95, 168); 
    --nt-reminder-rgb: 31, 95, 168;
    --nt-news:rgb(42, 157, 143); 
    --nt-news-rgb: 42, 157, 143;
    --nt-important:rgb(192, 57, 43); 
    --nt-important-rgb: 192, 57, 43;
    --nt-action:rgb(217, 72, 21);
    --nt-action-rgb: 217, 72, 21;
    }
:root[data-theme="dark"] { --nt-reminder:#5d7eb5; --nt-news:#57c5b0; --nt-important:#e5677a; --nt-action:#f0824e; }

#rl-notices { display:flex; flex-direction:column; gap:12px; margin:0 0 22px; }
#rl-notices:empty { display:none; }

.rl-notice {
  --nt: var(--nt-reminder);
  position:relative;
  display:flex;
  gap:13px;
  align-items: center;
  padding:14px 44px 14px 16px;
  background:var(--glass-strong);
  border:1px solid var(--glass-border);
  border-left:4px solid var(--nt);
  /* border-radius:var(--card-radius, 12px); */
  /* box-shadow:var(--shadow-md); */
  -webkit-backdrop-filter:blur(14px);
  backdrop-filter:blur(14px);
  animation:rl-notice-in .25s ease both;
}
@keyframes rl-notice-in { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
.rl-notice[data-type="reminder"]  { --nt:var(--nt-reminder);  background: rgba(var(--nt-reminder-rgb),0.2)}
.rl-notice[data-type="news"]      { --nt:var(--nt-news);      background: rgba(var(--nt-news-rgb),0.2)}
.rl-notice[data-type="important"] { --nt:var(--nt-important); background: rgba(var(--nt-important-rgb),0.2)}
.rl-notice[data-type="action"]    { --nt:var(--nt-action);   background: rgba(var(--nt-action-rgb),0.2)}

.rl-notice-icon {
  flex:0 0 auto; width:30px; height:30px; margin-top:1px; border-radius:9px;
  display:grid; place-items:center;
  color:var(--nt); background:color-mix(in srgb, var(--nt) 14%, transparent);
}
.rl-notice-icon svg { width:17px; height:17px; display:block; }
.rl-notice-body {min-width:0;display: flex;gap: 20px;align-items: center; width:100%}
.rl-notice-body a {margin-left: auto}
.rl-notice-title { font-weight:650; color:var(--ink); margin:1px 0 2px; white-space:nowrap;}
.rl-notice-msg { color:var(--ink-soft); margin:0; }
.rl-notice-link {
  display:inline-block;
  /* margin-top:9px; */
  font-size:13px;
  font-weight:600;
  text-decoration:none;
  color:#fff;
  background:var(--nt);
  padding:6px 13px;
  border-radius:999px;
  white-space:nowrap;
}
.rl-notice-link:hover { filter:brightness(1.06); }
.rl-notice-close {
  position:absolute; top:9px; right:9px; width:26px; height:26px;
  border:0; border-radius:8px; cursor:pointer; line-height:1;
  color:var(--muted); background:transparent; font-size:17px;
}
.rl-notice-close:hover { color:var(--ink); background:var(--border-soft); }
@media (max-width:520px) {
  .rl-notice-body {flex-direction: column; align-items: flex-start;}
  .rl-notice { padding-right:16px; align-items: flex-start}
  .rl-notice-close { position:static; align-self:flex-start; margin-left:auto; }
}

/* ===== Settings menu (cogwheel) — group labels + separator ===== */
.settings-menu .settings-group-label {
  font-size:11px; text-transform:uppercase; letter-spacing:.05em;
  color:var(--muted); margin:6px 8px 2px; font-weight:700;
}
.settings-menu .settings-sep { height:1px; background:var(--border-soft); margin:8px 4px; }

/* The foot's .theme-btn sets display:inline-flex, which was overriding the
   [hidden] attribute on the restore button — keep hidden meaning hidden. */
.sidebar-foot .theme-btn[hidden] { display: none !important; }
