/* ============================================================
   Release Notes — Stylesheet
   Visual reference: Zoho CRM "What's New" release-notes page
   ============================================================ */

   :root {
    --brand: #0067ff;
    --brand-dark: #0050cc;
    --brand-soft: #d9ecff;
    --text: #222222;
    --text-muted: #555555;
    --text-faint: #6b6b6b;
    --bg: #ffffff;
    --bg-card: #ffffff;
    --bg-page: #ffffff;
    --border: #efefef;
    --border-strong: #b2b2b2;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 0 10px 0px #e6e6e6;
    --radius: 8px;
    --radius-lg: 10px;
    --transition: 150ms ease;

    /* Icon sprite — one 100x47 sheet, used as a plain background image so each
       icon keeps the colour it was drawn with (blue arrow, white tick, navy
       chevron, black X). Icons sit at these coordinates in the sheet:
         arrow    (0,    0,    17 x 18)
         tick     (59.5, 0.5,  17.2 x 14.7)
         chevron  (79.5, 0.5,  20.4 x 13.2)
         close X  (58,   30.5, 15.2 x 15.5)
       Each rule below sets its box size, then background-size / -position to
       scale the sheet and slide that icon into view. All those numbers derive
       from the coordinates above, so never rescale the sheet without redoing
       them. */
    --sprite: url(/sites/zweb/images/tables/releasenotes/release-notes-sprite.svg);
  
    /* Tag palette — CRM style solid backgrounds */
    --tag-new-bg: #d2fbe9;
    --tag-new-fg: #166534;
    --tag-enh-bg: #bcddfe;
    --tag-enh-fg: #1e3a8a;
    --tag-bug-bg: #fee2e2;
    --tag-bug-fg: #991b1b;
    --tag-chg-bg: #fef6c7;
    --tag-chg-fg: #92400e;
    --tag-sol-bg: #d8daff;
    --tag-sol-fg: #5b21b6;
    --tag-plat-bg: #e0f2fe;
    --tag-plat-fg: #075985;
    --tag-teal-bg: #cdf3f0;
    --tag-teal-fg: #115e59;

    /* ---- Tag tone palette ----
       Twenty background/foreground pairs. app.js hashes each tag's NAME to a
       tone, so a tag always gets the same colour everywhere and new tags the
       team adds later are coloured automatically with no CSS change.
       Tones 1-7 alias the original palette above, so themes that already
       override those variables keep working; 8-20 were added to give ~20
       distinct hues before any two tags have to share a colour.
       Every pair clears WCAG AA for normal text (measured 4.6:1 - 8.5:1). */
    --tag-tone-1-bg: var(--tag-new-bg);   --tag-tone-1-fg: var(--tag-new-fg);
    --tag-tone-2-bg: var(--tag-enh-bg);   --tag-tone-2-fg: var(--tag-enh-fg);
    --tag-tone-3-bg: var(--tag-bug-bg);   --tag-tone-3-fg: var(--tag-bug-fg);
    --tag-tone-4-bg: var(--tag-chg-bg);   --tag-tone-4-fg: var(--tag-chg-fg);
    --tag-tone-5-bg: var(--tag-sol-bg);   --tag-tone-5-fg: var(--tag-sol-fg);
    --tag-tone-6-bg: var(--tag-plat-bg);  --tag-tone-6-fg: var(--tag-plat-fg);
    --tag-tone-7-bg: var(--tag-teal-bg);  --tag-tone-7-fg: var(--tag-teal-fg);
    /* 8-20: hue, then muted hue, so neighbours in a row stay tellable apart */
    --tag-tone-8-bg:  #ffe0e9;  --tag-tone-8-fg:  #9f1239;  /* rose       */
    --tag-tone-9-bg:  #fbe1f7;  --tag-tone-9-fg:  #86198f;  /* fuchsia    */
    --tag-tone-10-bg: #f0e2fd;  --tag-tone-10-fg: #6b21a8;  /* purple     */
    --tag-tone-11-bg: #e4e3fd;  --tag-tone-11-fg: #4338ca;  /* periwinkle */
    --tag-tone-12-bg: #d2f1f9;  --tag-tone-12-fg: #155e75;  /* cyan       */
    --tag-tone-13-bg: #c6ecd2;  --tag-tone-13-fg: #14532d;  /* deep green */
    --tag-tone-14-bg: #e9f5c9;  --tag-tone-14-fg: #3f6212;  /* lime       */
    --tag-tone-15-bg: #fdecc8;  --tag-tone-15-fg: #854d0e;  /* amber      */
    --tag-tone-16-bg: #ffe4d1;  --tag-tone-16-fg: #9a3412;  /* orange     */
    --tag-tone-17-bg: #f0e6da;  --tag-tone-17-fg: #7c4a13;  /* brown      */
    --tag-tone-18-bg: #e4e9f0;  --tag-tone-18-fg: #334155;  /* slate      */
    --tag-tone-19-bg: #ece0ea;  --tag-tone-19-fg: #6b2d5b;  /* plum       */
    --tag-tone-20-bg: #e5ecd9;  --tag-tone-20-fg: #4a5d23;  /* sage       */

    /* Filter option result-count badge */
    --count-bg: #f1f3f7;
    --count-fg: #6b7280;
    --count-active-bg: var(--brand-soft);
    --count-active-fg: var(--brand-dark);

    /* "Enabled on request" callout — amber info tone */
    --alert-info-bg: #fffbeb;
    --alert-info-border: #f7dfa5;
    --alert-info-fg: #8a6414;
    --alert-info-icon: #d9a222;
  }
  
  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  
  body {
    /*font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;*/
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
  }
  .zw-template-inner a{
    color: var(--zwc-link-clr);
    }
  .visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0;
    margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
  }
  
  /* Focus visible */
  :focus { outline: none; }
  :focus-visible,
  .filter-option:focus-visible,
  .month-cell:focus-visible,
  .page-number:focus-visible,
  .year-arrow:focus-visible,
  .year-clr-btn:focus-visible,
  .year-add-btn:focus-visible,
  .view-all-btn:focus-visible,
  .back-to-top-wrap:focus-visible,
  .clear-all-btn:focus-visible,
  .filter-group-header:focus-visible,
  .page-btn:focus-visible,
  .chip-remove:focus-visible,
  .empty-clear:focus-visible,
  .search-box input:focus-visible,
  .sort-filter select:focus-visible,
  .read-more:focus-visible,
  .share-toggle:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
  }
  
  .skip-link {
    position: absolute; top: -40px; left: 12px;
    background: var(--brand); color: #fff;
    padding: 8px 16px; border-radius: 5px;
    font-weight: 600; font-size: 14px;
    text-decoration: none; z-index: 1000;
    transition: top var(--transition);
  }
  .skip-link:focus { top: 12px; }
  
  /* ========== Banner (CRM style) ========== */
  .banner-section {
    background: linear-gradient(275deg, rgba(205,214,229,1) 0%, rgba(211,246,242,1) 100%);
    text-align: center;
    padding: 120px 30px 100px;
  }
  
  .banner-section h1 {
    margin: 0 0 10px;
    font-size: 56px;
    font-weight: 600;
    letter-spacing: -0.5px;
    line-height: 1.2;
    color: var(--text);
  }
  
  .banner-section .no-brk {
    white-space: nowrap;
  }
  
  .banner-subtitle {
    margin: 0 auto 50px;
    font-size: 20px;
    line-height: 1.6;
    color: var(--text-muted);
  }
  
  .search-section {
    display: flex;
    justify-content: center;
    max-width: 850px;
    margin: 0 auto;
  }
  
  .search-box {
    width: 75%;
    max-width: 640px;
    background: #fff;
    border: 4px solid #fff;
    border-radius: 10px;
    display: flex;
    box-shadow: 0 10px 10px -10px rgba(0,0,0,0.1);
    overflow: hidden;
  }
  
  .search-box input {
    width: calc(100% - 45px);
    border: 0;
    font-size: 16px;
    padding: 14px 30px 14px 20px;
    outline: none;
    color: var(--text);
    background: #fff;
  }
  
  .search-btn {
    background-color: var(--brand-soft);
    width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
  }
  
  .search-btn::before {
    content: '';
    width: 18px;
    height: 18px;
    display: block;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat center / contain;
  }
  
  /* ========== Main layout ========== */
  .main-notes-section {
    display: flex;
    justify-content: space-between;
    max-width: 1360px;
    margin: 0 auto;
    padding: 40px 30px 100px;
  }
  
  /* ========== Filter sidebar ========== */
  .filters-wrapper {
    width: 300px;
    flex-shrink: 0;
    position: relative;
  }
  
  .filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
  }
  
  .filters-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .filters-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3'/%3E%3C/svg%3E") no-repeat center / contain;
  }
  
  .clear-all-btn {
    background: none;
    border: none;
    padding: 4px 0;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    display: none;
  }
  
  .clear-all-btn.visible {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  
  /* Sprite X, replacing the &times; glyph this span used to hold. 10px rather
     than the label's 12px because the sprite X is a heavier stroke than the
     text glyph was, so matching the font size leaves it bolder than "Clear
     all" beside it. Centred by .clear-all-btn.visible (inline-flex + center).

     font-size: 0 is load-bearing, not tidiness: any &times; left inside the
     span — this file's markup dropped it, but a CMS template that still emits
     it would too — renders ON TOP of the sprite and you see two X's, a grey
     glyph over the black icon. Zeroing the font size hides any such leftover
     text while the box keeps its explicit size, so the icon is the only thing
     that can ever draw here. */
  .close-icon {
    width: 10px;
    height: 10.2px;
    flex-shrink: 0;
    font-size: 0;
    background: var(--sprite) no-repeat;
    background-size: 65.79px auto;
    background-position: -38.16px -20.07px;
  }
  
  .clear-all-btn:hover {
    color: var(--brand);
  }
  
  .filters-section {
    padding: 0;
  }
  
  .filter-group {
    margin-bottom: 20px;
  }
  
  .filter-group:last-child {
    margin-bottom: 0;
  }
  
  .filter-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    background: none;
    border: none;
    padding: 0 0 14px 0;
    font: inherit;
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    position: relative;
  }
  
  .filter-group-title {
    flex: 1;
  }
  
  .filter-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    border-radius: 50%;
    background: #d6dae3;
    color: #333;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    user-select: none;
    transition: background 0.2s ease;
  }
  
  .filter-tooltip:hover,
  .filter-tooltip:focus-visible {
    background: #888;
    color: #fff;
    outline: none;
  }
  
  .filter-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #1f2937;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: normal;
    width: max-content;
    max-width: 240px;
    text-align: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1000;
  }
  
  .filter-tooltip::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1000;
  }
  
  .filter-tooltip:hover::after,
  .filter-tooltip:focus-visible::after,
  .filter-tooltip:hover::before,
  .filter-tooltip:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
  
  /* Sprite chevron. The old border-triangle was a 10x10 box whose ink sat in
     one corner, so it never optically centred against the 16px header text;
     the sprite tile is the glyph's own bounds, and the header flexbox centres
     it. Points down when open, flips to up when collapsed — same as before. */
  .filter-group-chevron {
    width: 10px;
    height: 6.47px;
    flex-shrink: 0;
    transition: transform var(--transition);
    background: var(--sprite) no-repeat;
    background-size: 49.02px auto;
    background-position: -38.97px -0.25px;
  }
  
  .filter-group.collapsed .filter-group-chevron {
    transform: rotate(180deg);
  }
  
  .filter-group.collapsed .filter-options,
  .filter-group.collapsed .date-filter-body {
    display: none;
  }
  
  .filter-options {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
  }
  
  .filter-options::-webkit-scrollbar { width: 5px; }
  .filter-options::-webkit-scrollbar-thumb { background: #eee; border-radius: 5px; }
  .filter-options::-webkit-scrollbar-track { background: #fff; }
  
  .filter-options-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  
  /* Auto-fitting columns rather than a fixed three: once a count badge sits
     next to the label a 3-up grid clips longer values like "Android" in the
     300px sidebar. This settles on two columns there and still goes wider on
     roomier layouts. */
  .filter-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 4px;
  }
  
  .filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition);
    user-select: none;
  }
  
  /* Truncate rather than clip when a tag name outgrows its column */
  .filter-option-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Result count badge on the right of each filter option. Shows how many
     notes clicking that option would return, given everything else that is
     currently selected. `tabular-nums` stops the badges jittering in width
     as the digits change while filtering. */
  .filter-option-count {
    flex: 0 0 auto;
    min-width: 24px;
    padding: 1px 7px;
    border-radius: 10px;
    background: var(--count-bg);
    color: var(--count-fg);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.7;
    text-align: center;
    font-variant-numeric: tabular-nums;
    transition: background var(--transition), color var(--transition);
  }

  .filter-option:hover {
    color: var(--text);
  }

  .filter-option.active {
    color: var(--text);
    font-weight: 500;
  }

  .filter-option.active .filter-option-count {
    background: var(--count-active-bg);
    color: var(--count-active-fg);
  }

  /* Nothing behind this option with the current selection — matches the
     treatment months without data already get in the date filter. */
  .filter-option.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
  }

  .filter-options-grid .filter-option {
    padding: 6px 6px;
    gap: 6px;
  }

  .filter-options-grid .filter-option-count {
    min-width: 20px;
    padding: 1px 5px;
  }
  
  /* ========== Checkbox indicator ========== */
  .filter-checkbox {
    position: relative;
    display: inline-block;
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    border: 1.5px solid #ccc;
    border-radius: 3px;
    background: var(--bg-card);
    transition: background var(--transition), border-color var(--transition);
  }
  
  .filter-option:hover .filter-checkbox,
  .month-cell:hover .filter-checkbox {
    border-color: var(--brand);
  }
  
  .filter-option.active .filter-checkbox,
  .month-cell.active .filter-checkbox {
    background: var(--brand);
    border-color: var(--brand);
  }
  
  /* Sprite tick, centred in the 17px box by translate rather than by hand-
     tuned offsets, so it stays centred if the box size ever changes.
     The sprite tick is white, which is why it only appears on .active — the
     box has the brand fill behind it there. */
  .filter-option.active .filter-checkbox::after,
  .month-cell.active .filter-checkbox::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 11px;
    height: 9.4px;
    transform: translate(-50%, -50%);
    background: var(--sprite) no-repeat;
    background-size: 63.95px auto;
    background-position: -38.05px -0.32px;
  }
  
  /* ========== Date filter ========== */
  .date-filter-body {
    padding: 0;
  }
  
  .year-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    padding: 6px 20px;
    margin-bottom: 12px;
    margin-top: 4px;
  }
  
  .year-arrow {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: none;
    cursor: pointer;
    transition: opacity var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Sprite chevron in place of the ‹ › glyphs, rotated a quarter turn each way.
     Rotating a flex-centred child keeps it centred on the button's midpoint,
     which the text glyphs never quite were — ‹ and › carry asymmetric side
     bearings and sat a pixel right of centre. */
  .year-arrow::before {
    content: '';
    width: 12px;
    height: 7.76px;
    background: var(--sprite) no-repeat;
    background-size: 58.82px auto;
    background-position: -46.76px -0.29px;
  }
  
  .year-arrow-left::before  { transform: rotate(90deg); }
  .year-arrow-right::before { transform: rotate(-90deg); }
  
  /* The chevron is a background image now, so `color` cannot tint it on
     hover; a slight fade gives the same affordance. */
  .year-arrow:hover:not([disabled]) {
    opacity: 0.6;
  }
  
  .year-arrow[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
  }
  
  .year-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    padding: 0 20px;
  }
  
  .month-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  
  .month-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 6px 8px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition);
    user-select: none;
  }
  
  .month-cell-label { flex: 1; min-width: 0; }
  
  .month-cell:hover {
    color: var(--text);
  }
  
  .month-cell.active {
    color: var(--text);
    font-weight: 500;
  }
  
  .month-cell.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
  }
  
  /* Date filter: clear / check all */
  .clear-add-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
  }
  
  .year-clr-btn,
  .year-add-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
    user-select: none;
    transition: color var(--transition);
  }
  
  .year-clr-btn:hover:not(.btn-dimmed),
  .year-add-btn:hover:not(.btn-dimmed) {
    color: var(--brand);
  }
  
  .year-clr-btn.btn-dimmed,
  .year-add-btn.btn-dimmed {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
  }
  
  /* ========== Back to top (CRM style — sticky inside sidebar) ========== */
  .back-to-top-wrap {
    cursor: pointer;
    position: sticky;
    margin-top: 50px;
    top: calc(100vh - 100px);
    display: flex;
    align-items: center;
    width: max-content;
  }
  
  .back-to-top-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: 0.3px;
  }
  
  .back-to-top-arrow {
    width: 50px;
    height: 50px;
    display: block;
    margin-left: 20px;
    background: #e6e6e6;
    border-radius: 50%;
    position: relative;
    transition: background 0.3s;
  }
  
  /* Arrow is drawn in CSS, not taken from the sprite: a 2px stem (::before)
     plus a 10px corner rotated into an arrowhead (::after). Both are centred
     on the circle with calc(50% - half), so the pair stays centred whatever
     the circle size. */
  .back-to-top-arrow::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 18px;
    top: calc(50% - 9px);
    left: calc(50% - 1px);
    background: #000;
  }
  
  .back-to-top-arrow::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid #000;
    transform: rotate(-135deg);
    border-left: 0;
    border-top: 0;
    top: calc(50% - 10px);
    left: calc(50% - 5px);
  }
  
  .back-to-top-wrap:hover .back-to-top-arrow {
    background: #000;
    transition: 0.3s;
  }
  
  .back-to-top-wrap:hover .back-to-top-arrow::before {
    background: #fff;
  }
  
  .back-to-top-wrap:hover .back-to-top-arrow::after {
    border: 2px solid #fff;
    border-left: 0;
    border-top: 0;
  }
  
  /* ========== Notes column ========== */
  .notes-wrapper {
    width: calc(100% - 340px);
    min-width: 0;
  }
  
  .notes-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 0;
    flex-wrap: wrap;
  }
  
  .selected-filters {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
  }
  
  .chip-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    width: max-content;
  }
  
  .filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 28px 5px 10px;
    background: #eeeeee;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    color: var(--text);
    position: relative;
    white-space: nowrap;
  }
  
  .chip-remove {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }
  
  .chip-remove:hover {
    color: var(--brand);
  }
  
  .sort-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  
  .sort-title {
    font-size: 16px;
    color: var(--text);
    font-weight: 400;
  }
  
  .sort-select-wrap {
    position: relative;
  }
  
  .sort-select-wrap::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #666;
    margin-top: -2px;
    border-radius: 2px;
    pointer-events: none;
  }
  
  .sort-filter select {
    border: none;
    background: none;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    appearance: none;
    padding-right: 20px;
    outline: none;
    font-weight: 500;
    position: relative;
    z-index: 1;
  }
  
  /* ========== Note cards (CRM style) ========== */
  .notes-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 50px;
  }
  
  .note-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 30px;
    position: relative;
    z-index: 1;
    transition: box-shadow var(--transition);
  }
  
  .note-card:hover {
    box-shadow: var(--shadow-md);
  }
  
  .note-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
  }
  
  .note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  
  .note-tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 400;
    border-radius: 5px;
    letter-spacing: 0.1px;
  }
  
  /* ---- Tag colours ----
     Assigned by tone, not by tag name. app.js adds a `note-tag-tone-N` class
     derived from a hash of the tag's name, so:
       • the same tag name always renders the same colour, on every card and
         every page load;
       • a tag nobody has used before still gets a colour automatically —
         no CSS edit needed when the team adds "Integration", "Features", …
       • past twenty distinct names, colours start repeating, which is fine:
         the pill is a label, not a legend.
     A tag can be pinned to a specific tone via `ui.tagColors` in the JSON.
     Fallback below keeps an unclassed pill legible if JS ever fails. */
  .note-tag { background: #f1f3f5; color: var(--text-muted); }

  .note-tag-tone-1 { background: var(--tag-tone-1-bg); color: var(--tag-tone-1-fg); }
  .note-tag-tone-2 { background: var(--tag-tone-2-bg); color: var(--tag-tone-2-fg); }
  .note-tag-tone-3 { background: var(--tag-tone-3-bg); color: var(--tag-tone-3-fg); }
  .note-tag-tone-4 { background: var(--tag-tone-4-bg); color: var(--tag-tone-4-fg); }
  .note-tag-tone-5 { background: var(--tag-tone-5-bg); color: var(--tag-tone-5-fg); }
  .note-tag-tone-6 { background: var(--tag-tone-6-bg); color: var(--tag-tone-6-fg); }
  .note-tag-tone-7 { background: var(--tag-tone-7-bg); color: var(--tag-tone-7-fg); }
  .note-tag-tone-8 { background: var(--tag-tone-8-bg); color: var(--tag-tone-8-fg); }
  .note-tag-tone-9 { background: var(--tag-tone-9-bg); color: var(--tag-tone-9-fg); }
  .note-tag-tone-10 { background: var(--tag-tone-10-bg); color: var(--tag-tone-10-fg); }
  .note-tag-tone-11 { background: var(--tag-tone-11-bg); color: var(--tag-tone-11-fg); }
  .note-tag-tone-12 { background: var(--tag-tone-12-bg); color: var(--tag-tone-12-fg); }
  .note-tag-tone-13 { background: var(--tag-tone-13-bg); color: var(--tag-tone-13-fg); }
  .note-tag-tone-14 { background: var(--tag-tone-14-bg); color: var(--tag-tone-14-fg); }
  .note-tag-tone-15 { background: var(--tag-tone-15-bg); color: var(--tag-tone-15-fg); }
  .note-tag-tone-16 { background: var(--tag-tone-16-bg); color: var(--tag-tone-16-fg); }
  .note-tag-tone-17 { background: var(--tag-tone-17-bg); color: var(--tag-tone-17-fg); }
  .note-tag-tone-18 { background: var(--tag-tone-18-bg); color: var(--tag-tone-18-fg); }
  .note-tag-tone-19 { background: var(--tag-tone-19-bg); color: var(--tag-tone-19-fg); }
  .note-tag-tone-20 { background: var(--tag-tone-20-bg); color: var(--tag-tone-20-fg); }
  
  .note-date {
    font-size: 12px;
    color: var(--text-faint);
    position: relative;
    margin-left: 10px;
  }
  
  .note-date::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #8e8e8e;
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
  }
  
  /* Card becomes a 2-column flex row when it has media on the right.
     align-items: flex-start + margin-top on .note-media keeps the media
     below the share button (which sits at top:20px right:20px of the card),
     so they never overlap. */
  .note-card.has-media {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 28px;
  }
  
  .note-card-body {
    flex: 1 1 auto;
    min-width: 0;
  }
  
  .note-media {
    position: relative;
    flex: 0 0 38%;
    max-width: 340px;
    margin-top: 28px;
    aspect-ratio: 16 / 9;
    /* border-radius: var(--radius-md, 10px); */
    overflow: hidden;
    background: #f4f4f5;
  }
  
  .note-media .note-video,
  .note-media .note-thumbnail {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  /* Custom inline play/pause control — bottom-right corner of the video */
  .note-video-ctrl {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 2;
    transition: background var(--transition), transform var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  .note-video-ctrl:hover,
  .note-video-ctrl:focus-visible {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.06);
    outline: none;
  }
  
  .note-video-ctrl svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
  }
  
  /* Optical nudge so the play triangle looks centered */
  .note-video-ctrl[aria-label="Play"] svg { margin-left: 2px; }
  
  /* Make the video itself feel clickable (toggles play/pause) */
  .note-media-video .note-video { cursor: pointer; }
  
  /* An image with no video expands on click */
  .note-media-image .note-thumbnail { cursor: zoom-in; }
  
  /* ---- Expand button — top-right corner of the media box ---- */
  .note-media-expand {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 2;
    opacity: 0;
    transition: opacity var(--transition), background var(--transition), transform var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  /* Reveal on hover/focus within the media; always visible on touch (no hover) */
  .note-media:hover .note-media-expand,
  .note-media:focus-within .note-media-expand,
  .note-media-expand:focus-visible {
    opacity: 1;
  }
  
  .note-media-expand:hover,
  .note-media-expand:focus-visible {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.06);
    outline: none;
  }
  
  .note-media-expand svg { width: 16px; height: 16px; }
  
  /* ---- WorkDrive video — round play-icon popup trigger, bottom-right ----
     Icon only (no "Watch Overview" text), so the thumbnail stays fully visible.
     Mirrors .note-video-ctrl. Scoped to .note-media-workdrive so it never
     clashes with any global .watch-video styling the CMS applies elsewhere. */
  .note-media-workdrive { cursor: pointer; }

  .note-media-workdrive .watch-video {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: background var(--transition), transform var(--transition);
  }

  .note-media-workdrive .watch-video svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    margin-left: 2px; /* optical centering of the play triangle */
    transition: transform var(--transition);
  }

  /* Nudge the play icon up a touch on hover for a livelier feel */
  .note-media-workdrive:hover .watch-video svg,
  .note-media-workdrive .watch-video:hover svg,
  .note-media-workdrive .watch-video:focus-visible svg {
    transform: scale(1.15);
  }

  /* The whole thumbnail is a click target — a hover overlay makes that clear */
  .note-media-workdrive::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background var(--transition);
    pointer-events: none; /* clicks pass through to the image/container */
    z-index: 1;           /* sits under the play button (z-index: 2) */
  }

  .note-media-workdrive:hover::after {
    background: rgba(0, 0, 0, 0.18);
  }

  /* Hovering anywhere on the thumbnail also lights up the play button */
  .note-media-workdrive:hover .watch-video,
  .note-media-workdrive .watch-video:hover,
  .note-media-workdrive .watch-video:focus-visible {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.06);
  }

  /* Keyboard focus ring on the play button (white reads on the dark button) */
  .note-media-workdrive .watch-video:focus-visible {
    outline: 2px solid #0047ff;
    outline-offset: 1px;
  }
  
  @media (hover: none) {
    .note-media-expand { opacity: 1; }
  }
  
  /* ---- Lightbox (enlarged media) ---- */
  body.lightbox-lock { overflow: hidden; }
  
  .lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.82);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
  }
  
  .lightbox-overlay.open {
    opacity: 1;
    visibility: visible;
  }
  
  .lightbox-dialog {
    position: relative;
    display: flex;
    max-width: min(1000px, 92vw);
    max-height: 88vh;
    transform: scale(0.96);
    transition: transform var(--transition);
  }
  
  .lightbox-overlay.open .lightbox-dialog { transform: scale(1); }
  
  .lightbox-stage { display: flex; }
  
  .lightbox-image,
  .lightbox-video {
    display: block;
    width: auto;
    height: auto;
    max-width: min(1000px, 92vw);
    max-height: 88vh;
    border-radius: var(--radius, 8px);
    background: #000;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  }

  .lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 1;
    transition: background var(--transition), transform var(--transition);
  }
  
  .lightbox-close:hover,
  .lightbox-close:focus-visible {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.06);
    outline: none;
  }
  
  /* Sprite X, inverted to white because the sprite ink is black and this
     button sits on a dark overlay. Centred by the button's own grid. */
  /* Sprite X. .lightbox-close sets color: #fff, so currentColor paints it
     white over the dark overlay; the button's grid centres it. */
  /* Sprite X, inverted because its ink is black and this button sits on a
     dark overlay. Centred by .lightbox-close's own grid. */
  .lightbox-close-icon {
    width: 18px;
    height: 18.36px;
    background: var(--sprite) no-repeat;
    background-size: 118.42px auto;
    background-position: -68.68px -36.12px;
    filter: invert(1);
  }
  
  /* Stack vertically on narrow screens */
  @media (max-width: 720px) {
    .note-card.has-media {
      flex-direction: column;
      align-items: stretch;
    }
    .note-media {
      flex: 0 0 auto;
      width: 100%;
      max-width: none;
    }
  }
  
  .note-title {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    padding-right: 60px;
  }
  
  .note-description {
    margin: 0 0 14px;
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.5;
    padding: 6px 0;
  }
  
  /* ---- "Enabled on request" callout ----
     Sits directly under the note description. Amber info tone so it reads
     as a caveat about availability, not as an error. */
  .note-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 16px;
    padding: 12px 16px;
    border: 1px solid var(--alert-info-border);
    border-radius: var(--radius);
    background: var(--alert-info-bg);
    color: var(--alert-info-fg);
    font-size: 15px;
    line-height: 1.5;
  }

  .note-alert-icon {
    flex: 0 0 auto;
    display: inline-flex;
    margin-top: 1px;
    color: var(--alert-info-icon);
  }

  .note-alert-icon svg {
    width: 18px;
    height: 18px;
    display: block;
  }

  .note-alert-text {
    flex: 1 1 auto;
    min-width: 0;
  }

  .note-alert-link {
    color: inherit;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .note-alert-link:hover {
    text-decoration-thickness: 2px;
  }

  .note-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
  }
  
  .note-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
    min-width: 0;
  }
  
  .note-meta-item strong {
    color: var(--text);
    font-weight: 600;
  }
  
  .read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--brand);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
  }
  
  .read-more:hover {
    text-decoration: none;
  }
  
  /* Blue arrow from the sprite. 12px wide is the sheet's arrow scaled to the
     label's cap height, so it sits level with the capitals instead of
     overshooting them; .read-more is inline-flex + align-items: center, and
     top nudges it the last half pixel off the line-box centre onto the cap
     centre. */
  .read-more-arrow {
    width: 12px;
    height: 12.7px;
    flex-shrink: 0;
    position: relative;
    top: 0.5px;
    background: var(--sprite) no-repeat;
    background-size: 70.59px auto;
    background-position: 0 0;
    transition: transform 0.35s ease;
  }
  
  .read-more:hover .read-more-arrow {
    transform: translateX(4px);
  }
  
  /* ========== Share button (CRM style) ========== */
  .share-toggle {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: none;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
  }
  
  .share-toggle:hover {
    background: #f0f0f0;
  }
  
  .share-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #555;
    stroke-width: 2;
  }
  
  .share-toggle.active {
    background: #e9f0fd;
  }
  
  .share-toggle.active svg {
    display: none;
  }
  
  .share-toggle.active::before,
  .share-toggle.active::after {
    content: '';
    display: block;
    width: 15px;
    height: 2px;
    background: #000;
    position: absolute;
  }
  
  .share-toggle.active::before {
    transform: rotate(45deg);
  }
  
  .share-toggle.active::after {
    transform: rotate(-45deg);
  }
  
  /* Social share group */
  .social-group {
    position: absolute;
    right: 68px;
    top: 18px;
    display: flex;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    /* visibility:hidden removes the share links from the keyboard tab order and
       the screen-reader tree while the panel is closed. It is delayed until the
       fade-out finishes so the animation is preserved. */
    visibility: hidden;
    transform: translateX(20px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
    z-index: 4;
  }
  
  .social-group.show {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateX(0);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s;
  }
  
  .social-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px 0px #e6e6e6;
    background: #fff;
    transition: box-shadow 0.2s, transform 0.2s;
  }
  
  .social-btn:hover {
    box-shadow: 0 0 12px 0 #bebebe;
    transform: scale(1.08);
  }
  
  .social-btn svg {
    width: 18px;
    height: 18px;
  }
  
  .social-btn.copy-btn {
    position: relative;
  }
  
  .copy-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  
  .copy-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #000;
  }
  
  .copy-tooltip.show {
    opacity: 1;
  }
  
  /* ========== Empty state ========== */
  .empty-state {
    background: var(--bg-card);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    margin-top: 50px;
  }
  
  .empty-state p {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 14px;
  }
  
  .empty-clear {
    background: var(--brand);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
  }
  
  .empty-clear:hover {
    background: var(--brand-dark);
  }
  
  /* ========== Pagination ========== */
  .pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
  }
  
  .page-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 16px;
    font-weight: 400;
    color: var(--text);
    cursor: pointer;
  }
  
  .page-btn:hover:not([disabled]) {
    color: var(--brand);
  }
  
  .page-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
  }
  
  .page-numbers {
    list-style: none;
    margin: 0;
    padding: 0 16px;
    display: flex;
    gap: 10px;
  }
  
  .page-number {
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    font: inherit;
    font-size: 14px;
    color: #a7a7a7;
    cursor: pointer;
  }
  
  .page-number:hover {
    color: var(--text);
  }
  
  .page-number.active {
    color: var(--brand);
    font-weight: 600;
  }
  
  .page-ellipsis {
    display: inline-flex;
    align-items: center;
    color: var(--text-faint);
  }
  
  .pagination-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 50px;
    padding: 0 30px;
    gap: 16px;
  }
  
  .pagination-section .pagination {
    margin-top: 0;
    flex: 1;
    justify-content: flex-start;
  }
  
  .view-all-btn {
    background: var(--bg-card);
    border: 1px solid #dcdcdc;
    border-radius: 5px;
    padding: 8px 30px;
    font-size: 16px;
    font-weight: 400;
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition);
  }
  
  .view-all-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
  }
  
  .view-all-btn.active {
    border-color: var(--brand);
    color: var(--brand);
  }
  
  /* ========== Footer ========== */
  .site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 20px 48px;
    text-align: center;
    color: var(--text-faint);
    font-size: 13px;
  }
  
  /* ========== Responsive ========== */
  @media (max-width: 1024px) {
    .main-notes-section {
      padding: 24px;
      gap: 24px;
    }
    .filters-wrapper { width: 260px; }
    .notes-wrapper { width: calc(100% - 290px); }
  }
  
  @media (max-width: 768px) {
    .banner-section {
      padding: 80px 20px 60px;
    }
  
    .banner-section h1 {
      font-size: 32px;
    }
  
    .banner-subtitle {
      font-size: 16px;
      margin-bottom: 30px;
    }
  
    .search-box {
      width: 100%;
    }
  
    .main-notes-section {
      flex-direction: column;
      padding: 20px 16px 48px;
      gap: 16px;
    }
  
    .filters-wrapper {
      width: 100%;
    }
  
    .notes-wrapper {
      width: 100%;
    }
  
    .notes-toolbar {
      flex-direction: column;
      align-items: stretch;
    }
  
    .note-card {
      padding: 24px 18px;
    }
  
    .note-title {
      font-size: 20px;
      padding-right: 50px;
    }
  
    .note-description {
      font-size: 14px;
    }

    .note-alert {
      padding: 10px 12px;
      font-size: 13.5px;
      gap: 8px;
    }

    .note-alert-icon svg {
      width: 16px;
      height: 16px;
    }

    .note-footer {
      flex-direction: column;
      align-items: flex-start;
    }
  
    .social-group {
      right: auto;
      left: 18px;
      top: auto;
      bottom: -48px;
    }
  
    .pagination-section {
      flex-direction: column;
      padding: 0;
      margin-top: 24px;
      gap: 16px;
    }
  
    .pagination-section .pagination {
      justify-content: center;
    }
  
    .back-to-top-wrap {
      display: none;
    }
  }
  
  /* Respect users who request reduced motion (WCAG 2.3.3) */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
  