/* Sections: a project-tracker app. A dark rail down the left, a tinted surface, a toolbar row,
   and the list as a dense table with column rules. Items open in a side panel. */
.themed.tpl-sections {
  --rail: var(--occ-band); --rail-dot: color-mix(in srgb, var(--occ-band-ink) 28%, var(--occ-band)); --surface: var(--paper); --toolbar: var(--card);
  background: var(--surface);
}

/* The rail: app navigation drawn as decoration (desktop only). */
@media (min-width: 1024px) {
  .themed.tpl-sections.list-page, .themed.tpl-sections { padding-left: 4.5rem; position: relative; }
  .themed.tpl-sections::before {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 4.5rem; background:
      radial-gradient(circle, var(--want) 0.55rem, transparent 0.6rem) center 1.6rem / 100% 3rem no-repeat,
      radial-gradient(circle, var(--rail-dot) 0.45rem, transparent 0.5rem) center 5rem / 100% 3rem repeat-y,
      var(--rail);
    background-size: 100% 3rem, 100% 3rem, auto; background-position: center 1rem, center 4.5rem, 0 0;
  }
}
.themed.tpl-sections .list-hero { background: var(--toolbar); border-bottom: 1px solid var(--line); }
.themed.tpl-sections .list-hero > .wrap { max-width: none; padding: 1.1rem 1.5rem 0; display: grid; gap: 0.3rem; }
.themed.tpl-sections .list-hero .eyebrow { order: 1; margin: 0.35rem 0 0; }
.themed.tpl-sections .list-title { display: flex; align-items: center; gap: 0.75rem; margin: 0; font-size: 1.45rem; font-weight: 650; letter-spacing: -0.01em; }
.themed.tpl-sections .list-title-mark {
  display: inline-block; flex: none; width: 2.1rem; height: 2.1rem; border-radius: 0.55rem; background: var(--want);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7h14M5 12h14M5 17h9'/%3E%3C/svg%3E");
  background-size: 60%; background-position: center; background-repeat: no-repeat;
}
.themed.tpl-sections .list-hero .list-desc { margin-top: 0.1rem; font-size: 0.9rem; }
/* The stats become a toolbar row along the bottom of the header. */
.themed.tpl-sections .list-hero > .wrap > div:not(:has(.chip-live)) {
  order: 2; margin: 0.75rem -1.5rem 0; padding: 0.55rem 1.5rem; gap: 0.5rem 0.75rem;
  border-top: 1px solid var(--line); font-size: 0.82rem;
}
.themed.tpl-sections .list-hero > .wrap > div:not(:has(.chip-live)) > span:not(:has(button)) {
  display: inline-flex; align-items: center; gap: 0.3em; min-height: 1.9rem; padding: 0 0.7rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
}
.themed.tpl-sections .list-hero > .wrap > div:has(.chip-live) { order: 3; margin: 0 0 0.6rem; }
.themed.tpl-sections > .wrap { max-width: none; padding: 1.25rem 1.5rem 3rem; gap: 1.5rem; }

/* The table. */
.themed.tpl-sections .ix-sections { background: var(--toolbar); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; gap: 0; }
.themed.tpl-sections .ix-table-head { padding: 0.55rem 0.5rem; background: var(--surface); border-bottom: 1px solid var(--line-strong); font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.7rem; }
.themed.tpl-sections .ix-table-head > span, .themed.tpl-sections .ix-row > .ix-cell { border-left: 1px solid var(--line); padding-left: 0.6rem; align-self: stretch; display: flex; align-items: center; }
.themed.tpl-sections .ix-table-head > :first-child { border-left: 0; }
.themed.tpl-sections .ix-group-head { border-radius: 0; background: var(--toolbar); border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.themed.tpl-sections .ix-group-head:hover { background: var(--surface); }
.themed.tpl-sections .ix-row { min-height: 2.75rem; padding-block: 0; }
.themed.tpl-sections .ix-row .check-toggle { border-color: var(--line-strong); color: var(--ink-3); }
.themed.tpl-sections .ix-row .check-toggle:not(.is-checked):not([aria-checked="true"])::after { content: "✓"; font-size: 0.8rem; opacity: 0.6; }
.themed.tpl-sections .ix-row .check-toggle[aria-checked="true"], .themed.tpl-sections .ix-row .check-toggle.is-checked { background: var(--deal); border-color: var(--deal); color: #fff; }
.themed.tpl-sections .ix-title { font-weight: 500; font-size: 0.92rem; }
.themed.tpl-sections .ix-row .ix-meta { font-size: 0.75rem; }
.themed.tpl-sections .ix-pill { border-radius: 4px; }
.themed.tpl-sections .ix-pill.is-open { background: var(--surface); color: var(--ink-2); }
.themed.tpl-sections .ix-pill.is-in_progress { background: #fff1cc; color: #5c3d00; }
.themed.tpl-sections .ix-pill.is-done { background: var(--deal-soft); color: var(--deal); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .themed.tpl-sections .ix-pill.is-in_progress { background: #4a3a10; color: #ffe8a8; } }
:root[data-theme="dark"] .themed.tpl-sections .ix-pill.is-in_progress { background: #4a3a10; color: #ffe8a8; }
.themed.tpl-sections .ix-add { color: var(--ink-3); padding-left: 3.25rem; border-bottom: 1px solid var(--line); border-radius: 0; }
.themed.tpl-sections .ix-empty { padding: 1rem 1.25rem; }
.themed.tpl-sections .item-title { font-family: var(--font-sans); font-weight: 650; }
.themed.tpl-sections .add-item, .themed.tpl-sections > .wrap > aside.card { background: var(--toolbar); border-radius: 8px; box-shadow: none; }

/* Occasions: the rail takes the occasion's band and pattern, the title mark becomes its glyph,
   and its strip runs along the top of the toolbar row. */
@media (min-width: 1024px) {
  .themed.tpl-sections.has-occ::before { background: var(--occ-pattern, none), var(--rail); }
}
.themed.tpl-sections.has-occ .list-title-mark { background: var(--want); border-radius: 0; -webkit-mask: var(--occ-mark) center / contain no-repeat; mask: var(--occ-mark) center / contain no-repeat; }
.themed.tpl-sections.has-occ .list-hero > .wrap > div:not(:has(.chip-live)) { border-top: 0; position: relative; }
.themed.tpl-sections.has-occ .list-hero > .wrap > div:not(:has(.chip-live))::before { content: ""; position: absolute; inset: 0 0 auto; height: var(--occ-strip-h); max-height: 10px; background: var(--occ-strip); }
.themed.tpl-sections.has-occ .list-hero > .wrap > div:not(:has(.chip-live)) { padding-top: calc(0.55rem + min(var(--occ-strip-h), 10px)); }
