/* Chickadee's admin theme, layered over the stock admin.

   The colours are the bird's: charcoal cap, slate wing, buff flank. The layout habits
   come from current back-office tools: a quiet sidebar with a small name plate and
   pill-shaped menu items, hairline borders instead of filled bars, compact buttons,
   and a dark theme built on blue-black rather than flat grey.

   Light values are set first, then dark for people who chose it and for people whose
   computer asks for it. Every token changed for one theme is set for the other. */

/* ---------- Tokens: light ---------- */
:root,
.w-theme-light,
.w-theme-system {
  /* Charcoal: headings and labels */
  --w-color-primary-hue: 214;
  --w-color-primary-saturation: 22%;
  --w-color-primary-lightness: 18%;
  --w-color-primary-200-hue: 214;
  --w-color-primary-200-saturation: 22%;
  --w-color-primary-200-lightness: 12%;
  /* Slate blue: buttons, links */
  --w-color-secondary-hue: 211;
  --w-color-secondary-saturation: 62%;
  --w-color-secondary-lightness: 36%;
  --w-color-secondary-600-hue: 211;
  --w-color-secondary-600-saturation: 66%;
  --w-color-secondary-600-lightness: 28%;
  --w-color-secondary-400-hue: 211;
  --w-color-secondary-400-saturation: 62%;
  --w-color-secondary-400-lightness: 42%;
  --w-color-secondary-100-hue: 211;
  --w-color-secondary-100-saturation: 70%;
  --w-color-secondary-100-lightness: 68%;
  --w-color-secondary-75-hue: 211;
  --w-color-secondary-75-saturation: 55%;
  --w-color-secondary-75-lightness: 88%;
  --w-color-secondary-50-hue: 211;
  --w-color-secondary-50-saturation: 55%;
  --w-color-secondary-50-lightness: 95%;
  --w-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Neutral greys, cooled slightly toward the charcoal */
  --w-color-grey-800-hue: 214;
  --w-color-grey-800-saturation: 8%;
  --w-color-grey-800-lightness: 11.4%;

  --w-color-surface-menus: #f6f4f0;
  --w-color-surface-menu-item-active: #e9e0d0;
  --w-color-text-label-menus-default: #3a4450;
  --w-color-text-label-menus-active: #151b22;
  --w-color-surface-header: #ffffff;
  --w-color-surface-dashboard-panel: #ffffff;
  --w-color-border-furniture: #e6e3dd;

  --chickadee-buff: #e2d3bb;
  --chickadee-flyout: #fcfbf9;
  --chickadee-scroll-shadow: rgb(21 27 34 / 16%);
  --chickadee-menu-hover: rgb(21 27 34 / 6%);
  --chickadee-row-hover: #faf9f6;
  --chickadee-card-shadow: 0 1px 2px rgb(21 27 34 / 5%);
  --chickadee-card-shadow-hover: 0 8px 24px rgb(21 27 34 / 10%);
  --chickadee-radius: 8px;
  --chickadee-radius-lg: 12px;
}

/* ---------- Tokens: dark ---------- */
.w-theme-dark {
  --w-color-grey-800-hue: 214;
  --w-color-grey-800-saturation: 14%;
  --w-color-grey-800-lightness: 6.5%;

  --w-color-surface-menus: var(--w-color-grey-800);
  --w-color-surface-menu-item-active: rgb(226 211 187 / 13%);
  --w-color-text-label-menus-default: #b9c0c9;
  --w-color-text-label-menus-active: #f1e8d8;
  --w-color-surface-header: var(--w-color-grey-600);
  --w-color-surface-dashboard-panel: var(--w-color-grey-700);
  --w-color-border-furniture: var(--w-color-grey-500);
  --w-color-border-field-default: hsl(214 12% 42%);
  --w-color-text-label: var(--w-color-grey-100);

  --chickadee-flyout: var(--w-color-grey-700);
  --chickadee-scroll-shadow: rgb(0 0 0 / 60%);
  --chickadee-menu-hover: rgb(255 255 255 / 6%);
  --chickadee-row-hover: rgb(255 255 255 / 3%);
  --chickadee-card-shadow: none;
  --chickadee-card-shadow-hover: 0 8px 24px rgb(0 0 0 / 40%);
}
@media (prefers-color-scheme: dark) {
  .w-theme-system {
    --w-color-grey-800-hue: 214;
    --w-color-grey-800-saturation: 14%;
    --w-color-grey-800-lightness: 6.5%;

    --w-color-surface-menus: var(--w-color-grey-800);
    --w-color-surface-menu-item-active: rgb(226 211 187 / 13%);
    --w-color-text-label-menus-default: #b9c0c9;
    --w-color-text-label-menus-active: #f1e8d8;
    --w-color-surface-header: var(--w-color-grey-600);
    --w-color-surface-dashboard-panel: var(--w-color-grey-700);
    --w-color-border-furniture: var(--w-color-grey-500);
    --w-color-border-field-default: hsl(214 12% 42%);
    --w-color-text-label: var(--w-color-grey-100);

    --chickadee-flyout: var(--w-color-grey-700);
    --chickadee-scroll-shadow: rgb(0 0 0 / 60%);
    --chickadee-menu-hover: rgb(255 255 255 / 6%);
    --chickadee-row-hover: rgb(255 255 255 / 3%);
    --chickadee-card-shadow: none;
    --chickadee-card-shadow-hover: 0 8px 24px rgb(0 0 0 / 40%);
  }
}

/* ---------- Sidebar ---------- */
.sidebar__inner,
.sidebar-loading__inner { border-inline-end: 1px solid var(--w-color-border-furniture); }

/* Name plate: the bird, the town, and the product in small type */
.sidebar-custom-branding { margin: 0; padding: 0.5rem 1rem 1rem; text-align: start; text-decoration: none; }
.chickadee-brand { display: flex; align-items: center; gap: 0.625rem; color: var(--w-color-text-label-menus-active); }
.chickadee-brand .chickadee-logo { width: 2rem; height: 2rem; flex: none; }
.chickadee-brand__text { display: grid; min-width: 0; line-height: 1.2; }
.chickadee-brand__name { font-size: 0.875rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chickadee-brand__product { font-size: 0.72rem; color: var(--w-color-text-label-menus-default); }
.sidebar--slim .sidebar-custom-branding { padding: 0.5rem 0 1rem; }
.sidebar--slim .chickadee-brand { justify-content: center; }
.sidebar--slim .chickadee-brand__text { display: none; }

/* Menu items: inset pills instead of full-width bars with an edge stripe */
.sidebar-menu-item { padding: 1px 0.5rem; }
.sidebar-menu-item--active { background-color: transparent; border-color: transparent; text-shadow: none; }
.sidebar-menu-item__link { padding: 0.5rem 0.625rem; border-radius: var(--chickadee-radius); font-weight: 500; }
.sidebar-menu-item__link:hover,
.sidebar-menu-item__link:focus { background-color: var(--chickadee-menu-hover); text-shadow: none; }
.sidebar-menu-item--active > .sidebar-menu-item__link,
.sidebar-sub-menu-item--open > .sidebar-menu-item__link { background-color: var(--w-color-surface-menu-item-active); color: var(--w-color-text-label-menus-active); }
.sidebar-menu-item__link .icon:not(.sidebar-sub-menu-trigger-icon) { width: 1rem; height: 1rem; flex: none; }
.menuitem-label { margin-inline-start: 0.625rem; }
.sidebar--slim .sidebar-menu-item__link { margin-inline: auto; }
.sidebar-main-menu :focus { outline-offset: -2px; }
/* A rule between everyday jobs and the Reports, Settings and Help menus */
.sidebar-main-menu__list > li:not(.sidebar-sub-menu-item) + .sidebar-sub-menu-item {
  margin-top: 0.625rem; padding-top: 0.625rem; border-top: 1px solid var(--w-color-border-furniture); }
.sidebar-footer { border-top: 1px solid var(--w-color-border-furniture); }
.sidebar__inner form[role="search"] button { padding-inline-start: 1.125rem; }

/* When the menu is taller than the window it scrolls. Two cues say so: a slim scrollbar
   that stays visible (many systems hide scrollbars until you scroll), and a soft shadow
   on whichever edge has more items beyond it. The shadow is drawn with backgrounds: the
   two "cover" layers move with the content and hide the shadow at the very top and bottom. */
.sidebar-main-menu {
  background:
    linear-gradient(var(--w-color-surface-menus) 40%, transparent) top / 100% 2.25rem no-repeat local,
    linear-gradient(transparent, var(--w-color-surface-menus) 60%) bottom / 100% 2.25rem no-repeat local,
    linear-gradient(var(--chickadee-scroll-shadow), transparent) top / 100% 0.875rem no-repeat scroll,
    linear-gradient(transparent, var(--chickadee-scroll-shadow)) bottom / 100% 0.875rem no-repeat scroll;
}
/* The stock rules ask for a thin scrollbar in colours that barely show; clear them so the
   scrollbar styled below is used instead. */
.sidebar-main-menu.w-scrollbar-thin,
.sidebar-sub-menu-panel > ul { scrollbar-width: auto; scrollbar-color: auto; }
.sidebar-main-menu::-webkit-scrollbar,
.sidebar-sub-menu-panel > ul::-webkit-scrollbar { width: 9px; height: 9px; }
.sidebar-main-menu::-webkit-scrollbar-track,
.sidebar-sub-menu-panel > ul::-webkit-scrollbar-track { background: transparent; }
.sidebar-main-menu::-webkit-scrollbar-thumb,
.sidebar-sub-menu-panel > ul::-webkit-scrollbar-thumb { background-color: var(--w-color-border-field-default);
  border: 2px solid transparent; border-radius: 999px; background-clip: content-box; }
/* The icon rail is only 60px wide, so its scrollbar is narrower */
.sidebar--slim .sidebar-main-menu::-webkit-scrollbar { width: 5px; }
.sidebar--slim .sidebar-main-menu::-webkit-scrollbar-thumb { border-width: 1px; }
.sidebar--slim .sidebar-main-menu .sidebar-menu-item { padding-inline: 0.25rem; }
@supports not selector(::-webkit-scrollbar) {
  .sidebar-main-menu.w-scrollbar-thin,
  .sidebar-sub-menu-panel > ul { scrollbar-width: thin; scrollbar-color: var(--w-color-border-field-default) transparent; }
}

/* Fly-out menus and the page explorer: a plain panel with a small heading */
.sidebar-sub-menu-panel,
.c-page-explorer,
.c-page-explorer__header { background-color: var(--chickadee-flyout); }
.sidebar-sub-menu-panel { border-inline-end: 1px solid var(--w-color-border-furniture); }
.sidebar-sub-menu-panel--visible,
.sidebar-panel--visible,
.c-page-explorer { box-shadow: 8px 0 24px rgb(0 0 0 / 8%); }
.sidebar-sub-menu-panel > h2 { min-height: 0; align-items: flex-start; text-align: start;
  padding: 1.25rem 1.125rem 0.625rem; font-size: 0.8rem; font-weight: 600; }
.sidebar-main-menu .icon--submenu-header { display: none; }
.sidebar-sub-menu-panel__footer { text-align: start; padding: 0.875rem 1.125rem; font-size: 0.75rem; }

/* ---------- Page furniture ---------- */
.w-slim-header { border-bottom: 1px solid var(--w-color-border-furniture); }
.w-slim-header-action-button { border-radius: var(--chickadee-radius); }

.button { border-radius: var(--chickadee-radius); font-weight: 600; }
/* Slimmer buttons, except the ones the admin sizes itself with utility classes */
.button:not(.button-small, .text-replace, .chooser__choose-button, [class*="w-h-"], [class*="w-p-"], .sidebar__collapse-toggle) {
  height: 2.5em; line-height: calc(2.5em - 2px); padding-inline: 1.1em; }
.sidebar__collapse-toggle { border-radius: 50%; }
.button.button-small { border-radius: 6px; }
.button.bicolor { padding-inline-start: 3.25em; }
.button.bicolor .icon-wrapper { width: 2.5em; }

/* Fields: the stock ones are set in 19px type; bring them down to the size of the text around them */
input:is([type="date"], [type="datetime-local"], [type="email"], [type="file"], [type="month"], [type="number"],
  [type="password"], [type="search"], [type="tel"], [type="text"], [type="time"], [type="url"], [type="week"]),
select, textarea { border-radius: var(--chickadee-radius); font-size: 1rem; }
input:is([type="date"], [type="datetime-local"], [type="email"], [type="month"], [type="number"],
  [type="password"], [type="search"], [type="tel"], [type="text"], [type="time"], [type="url"], [type="week"]) {
  padding-inline: 0.875rem; min-height: 2.5rem; }
select { padding-inline-start: 0.875rem; min-height: 2.5rem; line-height: 2.4; }
/* Search boxes keep room for their magnifying glass */
.w-field__icon + input { padding-inline-start: 2.375rem; }
.w-field__icon { top: 0.75rem; }
textarea { padding: 0.75rem 0.875rem; }

/* Page headings: lighter and smaller than the stock extra-bold */
.w-header .w-header__title, .w-header h1, .w-h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.w-panel__heading { font-size: 1.125rem; font-weight: 650; }

/* Status tags: plain pills, no hatching, no capitals */
.w-status::first-letter { text-transform: uppercase; }
.w-status { background-image: none; border-radius: 999px; text-transform: none; font-weight: 600; padding: 0 0.625rem; letter-spacing: 0; }

/* Listings: quieter headings, solid hairlines, a wash on the row under the pointer */
.listing thead th { font-size: 0.8rem; font-weight: 600; color: var(--w-color-text-meta); }
.listing tbody { border-bottom: 0; }
.listing tbody tr { border-bottom: 1px solid var(--w-color-border-furniture); }
.listing:not(.chooser) tbody tr:hover { background-color: var(--chickadee-row-hover); }
.listing > li { border-bottom-style: solid; border-bottom-color: var(--w-color-border-furniture); }
.listing.full-width + .pagination { border-top-style: solid; }

/* Dashboard panels */
.w-panel--dashboard { border-radius: var(--chickadee-radius-lg); box-shadow: var(--chickadee-card-shadow); overflow: hidden; }

/* ---------- Sign-in page ---------- */
body.login { background: var(--w-color-surface-menus); }
.login .content-wrapper { border: 1px solid var(--w-color-border-furniture); border-radius: 1rem;
  box-shadow: 0 12px 40px rgb(21 27 34 / 8%); }
.login .login-logo { width: auto; text-align: center; }
.login-logo .chickadee-logo { width: 11rem; height: auto; color: var(--w-color-text-label); }

/* ---------- "Page not found" inside the admin ---------- */
.page404__bg { background-color: var(--w-color-surface-menus); color: var(--w-color-text-label); }
.page404__logo { width: 9rem; height: auto; margin-inline-end: 3rem; }
.page404__logo .chickadee-logo { width: 100%; height: auto; }
.page404__text-container { height: auto; text-align: start; }
.page404__header { font-size: 2.25rem; margin: 0 0 0.5rem; }
.page404__text { font-size: 1.0625rem; line-height: 1.5; color: var(--w-color-text-meta); margin: 0 0 1.5rem; }
a.button.page404__button { background-color: var(--w-color-surface-button-default); border: 0;
  color: var(--w-color-text-button); font-size: 0.875rem; height: 2.5em; line-height: 2.5em; padding: 0 1.1em; }
a.button.page404__button:hover { background-color: var(--w-color-surface-button-hover); }

/* ---------- Dashboard task cards ---------- */
.chickadee-actions { margin-bottom: 3rem; }
.chickadee-cards { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 0.875rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.chickadee-card { display: grid; grid-template-columns: auto 1fr; column-gap: 0.875rem; row-gap: 0.125rem;
  align-items: center; align-content: center; height: 100%; padding: 1rem 1.125rem; border-radius: var(--chickadee-radius-lg);
  border: 1px solid var(--w-color-border-furniture); background: var(--w-color-surface-dashboard-panel);
  color: var(--w-color-text-label); text-decoration: none;
  box-shadow: var(--chickadee-card-shadow); transition: box-shadow 0.15s, border-color 0.15s; }
.chickadee-card:hover, .chickadee-card:focus-visible { border-color: var(--w-color-border-field-default);
  box-shadow: var(--chickadee-card-shadow-hover); color: var(--w-color-text-label); }
.chickadee-card__icon { grid-row: span 2; width: 1.125rem; height: 1.125rem; padding: 0.625rem; box-sizing: content-box;
  border-radius: var(--chickadee-radius); background: var(--w-color-surface-menu-item-active);
  color: var(--w-color-text-label-menus-active); }
.chickadee-card__label { font-weight: 650; font-size: 0.95rem; }
.chickadee-card__hint { color: var(--w-color-text-meta); font-size: 0.8125rem; }
.chickadee-section { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1.5rem;
  padding: 0.9rem 0; border-top: 1px solid var(--w-color-border-furniture); }
.chickadee-section__name { margin: 0; font-size: 1rem; min-width: 12rem; }
.chickadee-section__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; }
.chickadee-section__links a { text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .chickadee-card { transition: none; } }

/* ---------- Help page and access screen ---------- */
.chickadee-help { max-width: 46rem; }
.chickadee-help h2 { margin-top: 2rem; }
.chickadee-help li { margin-bottom: 0.4rem; }
.chickadee-member { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.25rem; }

/* ---------- Light/dark and larger-text switches ---------- */
/* Two copies of each, one set shown at a time (see admin.js). While the sidebar is open:
   round buttons in its top corner, beside the collapse button. While it is collapsed to
   icons, or is the slide-out menu on a phone: the last items in the menu, so they scroll
   with the other items and never sit on top of them. */
.chickadee-switch { position: fixed; top: 8px; inset-inline-start: 12px; z-index: 115;
  width: 35px; height: 35px; padding: 0; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 50%;
  color: var(--w-color-text-label-menus-default); }
.chickadee-switch--text { inset-inline-start: 51px; }
.chickadee-switch:hover { background: var(--chickadee-menu-hover); color: var(--w-color-text-label-menus-active); }
.chickadee-switch.is-on { background: var(--chickadee-menu-active, var(--chickadee-menu-hover)); color: var(--w-color-text-label-menus-active); }
.chickadee-switch .chickadee-switch-icon { width: 17px; height: 17px; }
.chickadee-switch--text .chickadee-switch-icon { width: 20px; height: 20px; }
.chickadee-switch-icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chickadee-switch-item .sidebar-menu-item__link { cursor: pointer; }

/* Show the theme you would switch to: a sun while dark, a moon while light */
.chickadee-theme-icon--sun { display: none; }
.w-theme-dark .chickadee-theme-icon--sun { display: block; }
.w-theme-dark .chickadee-theme-icon--moon { display: none; }
@media (prefers-color-scheme: dark) {
  .w-theme-system .chickadee-theme-icon--sun { display: block; }
  .w-theme-system .chickadee-theme-icon--moon { display: none; }
}

/* Which copy shows */
.chickadee-switch-item { display: none; }
.sidebar--slim .chickadee-switch-item,
.sidebar--mobile .chickadee-switch-item { display: block; }
.sidebar-collapsed .chickadee-switch { display: none; }
@media (max-width: 799px) { .chickadee-switch { display: none; } }

/* ---------- Two-step sign-in ---------- */
.chickadee-signin { max-width: 52rem; }
.chickadee-signin h2 { margin-top: 2.25rem; }
.chickadee-method-choices { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.875rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.chickadee-method-choices > li { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem;
  padding: 1.125rem; border: 1px solid var(--w-color-border-furniture); border-radius: var(--chickadee-radius-lg);
  background: var(--w-color-surface-dashboard-panel); }
.chickadee-method-choices h3 { margin: 0; font-size: 1rem; }
.chickadee-method-choices p { margin: 0; color: var(--w-color-text-meta); font-size: 0.875rem; flex: 1; }
.chickadee-method-choices [data-passkey-area] { display: grid; gap: 0.5rem; width: 100%; justify-items: start; }
.chickadee-method-choices [data-passkey-area][hidden] { display: none; }
.chickadee-steps { padding-inline-start: 1.25rem; display: grid; gap: 1.5rem; }
.chickadee-steps > li::marker { font-weight: 700; }
.chickadee-qr { display: inline-block; padding: 0.5rem; background: #fff; border-radius: var(--chickadee-radius);
  border: 1px solid var(--w-color-border-furniture); line-height: 0; }
.chickadee-secret { font-size: 1.05rem; letter-spacing: 0.04em; user-select: all; }
.chickadee-codes { list-style: none; margin: 1rem 0 1.5rem; padding: 1rem 1.25rem; display: grid; gap: 0.5rem 2rem;
  grid-template-columns: repeat(2, max-content); border: 1px solid var(--w-color-border-furniture);
  border-radius: var(--chickadee-radius-lg); width: max-content; max-width: 100%; }
.chickadee-codes code { font-size: 1.05rem; letter-spacing: 0.06em; user-select: all; }
.chickadee-methods form { margin: 0; }

/* The second step, and the Google/Microsoft buttons, on the sign-in card */
.chickadee-two-step__lead { text-align: center; margin: -1rem 0 1.5rem; color: var(--w-color-text-meta); }
.chickadee-two-step__passkey .button, .chickadee-two-step__email .button, .chickadee-sso__button { width: 100%; text-align: center; }
.chickadee-two-step__email { margin-top: 0.75rem; }
.chickadee-two-step__out { margin-top: 2rem; display: grid; gap: 0.25rem; justify-items: center;
  font-size: 0.8125rem; color: var(--w-color-text-meta); text-align: center; }
.chickadee-linkbutton { background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  color: var(--w-color-text-link-default); text-decoration: underline; text-underline-offset: 3px; }
.chickadee-sso { margin-top: 1.25rem; display: grid; gap: 0.625rem; }
.chickadee-sso__or { display: flex; align-items: center; gap: 0.75rem; margin: 0.75rem 0;
  color: var(--w-color-text-meta); font-size: 0.8125rem; }
.chickadee-sso__or::before, .chickadee-sso__or::after { content: ""; flex: 1; border-top: 1px solid var(--w-color-border-furniture); }
.login .chickadee-sso__button { font-weight: 600; margin: 0; }
/* The town's own accounts: first on the card, and the largest thing on it. */
.login .chickadee-sso--main .chickadee-sso__button { min-height: 3.25rem; font-size: 1.0625rem;
  display: grid; place-items: center; }
.chickadee-sso--main { margin-top: 0; margin-bottom: 0.5rem; }
.chickadee-sso__hint { margin: 0; text-align: center; color: var(--w-color-text-meta); font-size: 0.875rem; }
.chickadee-sso__or { margin: 1rem 0 0.5rem; }

/* "Don't ask again on this computer" at the second step */
.chickadee-two-step__remember { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--w-color-border-furniture); }
.chickadee-two-step__remember label { display: flex; align-items: center; gap: 0.625rem; font-weight: 600; cursor: pointer; }
.chickadee-two-step__remember input { flex: none; }
.chickadee-two-step__remember p { margin: 0.375rem 0 0; color: var(--w-color-text-meta); font-size: 0.875rem; }

/* Show/Hide beside every password box (see admin.js) */
.chickadee-password { position: relative; }
.chickadee-password input { padding-inline-end: 4.5rem; }
.chickadee-password__show { position: absolute; inset-block: 0; inset-inline-end: 0; padding: 0 0.875rem;
  background: none; border: 0; cursor: pointer; font: inherit; font-size: 0.875rem; font-weight: 600;
  color: var(--w-color-text-link-default); }
.chickadee-password__show:hover { text-decoration: underline; text-underline-offset: 3px; }
.chickadee-signin input[name="code"] { max-width: 12rem; letter-spacing: 0.08em; }
.chickadee-signin input[name="name"], .chickadee-method-choices input { max-width: 24rem; }

/* ---------- Settings → Themes ---------- */
.chickadee-themes { max-width: 68rem; }
.chickadee-theme-list { list-style: none; margin: 1.5rem 0; padding: 0; display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.chickadee-theme { display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem;
  border: 1px solid var(--w-color-border-furniture); border-radius: var(--chickadee-radius-lg);
  background: var(--w-color-surface-dashboard-panel); }
.chickadee-theme.is-current { border-color: var(--w-color-secondary); box-shadow: 0 0 0 1px var(--w-color-secondary); }
.chickadee-theme h2 { margin: 0.5rem 0 0; display: flex; align-items: center; gap: 0.5rem; }
.chickadee-theme p { margin: 0; color: var(--w-color-text-meta); font-size: 0.875rem; flex: 1; }
.chickadee-theme__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.chickadee-theme__actions form { margin: 0; }
.chickadee-theme__actions .button { margin: 0; }

/* The sketch: always drawn light, in the town's two colours, whatever the admin's theme. */
.chickadee-sketch { --r: 3px; --head: Georgia, serif; --body: system-ui, sans-serif;
  display: grid; grid-template-rows: auto auto auto 1fr auto; aspect-ratio: 16 / 11; overflow: hidden;
  background: #f4f5f3; color: #1f2328; border: 1px solid #d5d9de; border-radius: 6px; font-family: var(--body); }
.chickadee-sketch[data-fonts="sans"] { --head: system-ui, sans-serif; }
.chickadee-sketch[data-fonts="serif"] { --body: Georgia, serif; }
.chickadee-sketch[data-corners="square"] { --r: 0; }
.chickadee-sketch[data-corners="round"] { --r: 7px; }
.chickadee-sketch__header { display: flex; align-items: center; gap: 5px; padding: 5px 8px; background: #fff;
  border-top: 3px solid var(--town-primary); color: var(--town-primary); font: 700 9px var(--head); }
.chickadee-sketch__header span { margin-right: auto; }
.chickadee-sketch__header i { width: 16px; height: 3px; background: currentColor; opacity: 0.45; border-radius: 2px; }
.chickadee-sketch[data-header="colour"] .chickadee-sketch__header { background: var(--town-primary); color: #fff; border-top: 0; }
.chickadee-sketch__hero { display: flex; align-items: flex-end; padding: 8px; height: 62px;
  background: var(--town-primary); color: #fff; font: 700 17px/1 var(--head); }
.chickadee-sketch[data-hero="compact"] .chickadee-sketch__hero { height: 30px; font-size: 12px; }
.chickadee-sketch__tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 0 8px; margin-top: -8px; }
.chickadee-sketch__tiles b { height: 20px; background: #fff; border: 1px solid #d5d9de;
  border-bottom: 2px solid var(--town-primary); border-radius: var(--r); }
.chickadee-sketch__body { display: grid; align-content: start; gap: 4px; padding: 8px; }
.chickadee-sketch__body i { height: 4px; background: #c9ced4; border-radius: 2px; }
.chickadee-sketch__body i:first-child { width: 40%; height: 6px; background: var(--town-primary); box-shadow: 0 5px 0 -2px var(--town-accent); margin-bottom: 3px; }
.chickadee-sketch__body i:last-child { width: 70%; }
.chickadee-sketch__footer { height: 16px; background: color-mix(in srgb, var(--town-primary) 78%, #000); }
.chickadee-sketch[data-footer="dark"] .chickadee-sketch__footer { background: #1b1f24; }
.chickadee-sketch[data-footer="light"] .chickadee-sketch__footer { background: #fff; border-top: 1px solid #d5d9de; }
.chickadee-sketch[data-theme="modern"] { background: #fff; }
.chickadee-sketch[data-theme="modern"] .chickadee-sketch__header { border-top: 0; }
.chickadee-sketch[data-theme="modern"] .chickadee-sketch__tiles b { border: 0; box-shadow: 0 2px 6px rgb(16 24 40 / 0.18); }
.chickadee-sketch[data-theme="heritage"] { background: #f7f5f0; }
.chickadee-sketch[data-theme="heritage"] .chickadee-sketch__header { border-bottom: 3px double var(--town-accent); }
.chickadee-sketch[data-theme="heritage"] .chickadee-sketch__hero { justify-content: center; }
.chickadee-sketch[data-theme="heritage"] .chickadee-sketch__tiles b { border-bottom-width: 1px; border-top: 2px solid var(--town-primary); }
.chickadee-sketch[data-theme="plain"] { background: #fff; }
.chickadee-sketch[data-theme="plain"] .chickadee-sketch__tiles { margin-top: 6px; }
.chickadee-sketch[data-theme="plain"] .chickadee-sketch__tiles b { border: 1.5px solid #1f2328; }

/* ---------- Page editor: one screen ---------- */
/* Every page type has a single tab (see core/editor.py), so there is nothing to switch
   between: hide the lone tab and its rule. */
.w-tabs__wrapper:has(.w-tabs__tab:only-child) {
  display: none;
}
.w-tabs__wrapper:has(.w-tabs__tab:only-child) + .tab-content {
  padding-top: 1.5rem;
}

/* Advanced options: closed until asked for, and visibly set apart from the page's content. */
.chickadee-advanced {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--w-color-border-furniture);
}
.chickadee-advanced .w-panel__heading {
  color: var(--w-color-text-label);
  font-weight: 600;
}

/* The page outline and the comments tool belong with the advanced options: they appear
   when that section is opened, and stay out of the way until then. */
body:has(.chickadee-advanced):not(:has(.chickadee-advanced .w-panel__toggle[aria-expanded="true"]))
  [data-minimap-container],
body:has(.chickadee-advanced):not(:has(.chickadee-advanced .w-panel__toggle[aria-expanded="true"]))
  [data-side-panel-toggle="comments"] {
  display: none;
}

/* Name the tools at the top of the editor instead of leaving them as bare icons. */
@media (min-width: 75em) {
  .w-side-panel-toggle[data-w-tooltip-content-value] {
    width: auto;
    gap: 0.4rem;
    padding-inline: 0.7rem;
  }
  .w-side-panel-toggle[data-w-tooltip-content-value]::after {
    content: attr(data-w-tooltip-content-value);
    font-size: 0.875rem;
    font-weight: 500;
  }
}

/* "Changes not on the website yet", above the page being edited */
.chickadee-waiting {
  margin: 1.25rem 5rem 0;
  padding: 0.875rem 1.125rem;
  border: 1px solid color-mix(in srgb, var(--w-color-warning-100) 45%, var(--w-color-surface-page));
  border-inline-start: 4px solid var(--w-color-warning-100);
  border-radius: 0.375rem;
  /* A tint of the page's own colour, so it reads in the light and the dark theme alike. */
  background: color-mix(in srgb, var(--w-color-warning-100) 14%, var(--w-color-surface-page));
  color: var(--w-color-text-context);
}
.chickadee-waiting p { margin: 0; }
.chickadee-waiting__links { margin-top: 0.375rem !important; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.chickadee-waiting__links a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 50em) { .chickadee-waiting { margin-inline: 1.25rem; } }

/* On the dashboard: pages left half-done */
.chickadee-drafts { margin-bottom: 2.5rem; }
.chickadee-drafts ul { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.chickadee-drafts li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem;
  padding: 0.75rem 1rem; border: 1px solid var(--w-color-border-furniture); border-radius: 0.5rem;
  background: var(--w-color-surface-page); }
.chickadee-drafts__title { font-weight: 600; }
.chickadee-drafts__when { color: var(--w-color-text-meta); font-size: 0.875rem; flex: 1; }

/* The warning beside the save button ("your changes are not being saved"). Its box takes
   the menu colour, which is light here, so its text must be dark to be read. */
.footer__container { color: var(--w-color-text-label); border: 1px solid var(--w-color-border-furniture); }
.footer__emphasise-span-tags span { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.w-theme-dark .footer__container { color: var(--w-color-text-label); }

/* Tables: boxes large enough to read and to click. */
.handsontable td, .handsontable th { font-size: 0.9375rem; padding: 0.375rem 0.5rem; }
