/*
 * Site overrides on the UI kit's precompiled styles (tailwind.css, style.css), loaded after them.
 * Only classes already in tailwind.css work in templates, so small fixes like these go here.
 */

/* Sidebar: hovering a link is fainter than the current page's highlight (full grey plus red
   text), so a hovered link can't be mistaken for the page you're on. */
#side a:hover {
  background-color: rgb(var(--color-secondery) / 0.45);
}
.dark #side a:hover {
  background-color: rgb(30 41 59 / 0.45);
}
#side .active a:hover {
  background-color: rgb(var(--color-secondery) / 1);
}

/* Group discussions (resources/views/groups/posts) */
.gp-text {
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.gp-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gp-photo-single {
  max-height: 640px;
}
.gp-photo-more::after {
  content: attr(data-more);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 0.5);
  color: #fff;
  font-size: 1.75rem;
  font-weight: 600;
}
.gp-preview-remove {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: rgb(0 0 0 / 0.6);
  color: #fff;
  line-height: 1.5rem;
  text-align: center;
}
/* the composer's tiles while each file is sent (public/js/group-posts.js) */
.gp-upload-bar {
  position: absolute;
  left: 0.375rem;
  right: 0.375rem;
  bottom: 0.375rem;
  height: 0.3rem;
  border-radius: 9999px;
  background: rgb(0 0 0 / 0.35);
  overflow: hidden;
}
.gp-upload-bar > span {
  display: block;
  height: 100%;
  background: #fff;
  transition: width 0.2s;
}
.gp-upload-failed {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 0.6);
  color: #fff;
}
.gp-input {
  border: 0;
  border-radius: 1rem;
  background-color: rgb(var(--color-secondery) / 1);
}
.dark .gp-input {
  background-color: rgb(51 65 85 / 1);
}
.gp-photo-label {
  background: rgb(0 0 0 / 0.6);
}
.gp-scroll {
  max-height: min(70vh, 40rem);
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* UIkit notifications (UIkit.notification(); the theme's CSS doesn't include them) */
.uk-notification {
  position: fixed;
  z-index: 1040;
  box-sizing: border-box;
  width: 360px;
  max-width: calc(100vw - 2rem);
}
.uk-notification-bottom-center {
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
}
.uk-notification-top-center {
  top: 5rem;
  left: 50%;
  transform: translateX(-50%);
}
.uk-notification-message {
  position: relative;
  margin-top: 0.5rem;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgb(30 41 59);
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.25rem;
  box-shadow: 0 10px 25px rgb(0 0 0 / 0.2);
  cursor: pointer;
}
.uk-notification-message-success {
  background: rgb(22 101 52);
}
.uk-notification-message-warning {
  background: rgb(180 83 9);
}
.uk-notification-message-danger {
  background: rgb(185 28 28);
}
.uk-notification-close {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  color: #fff;
}

/* a destructive action's box, e.g. deleting a group */
.nw-danger-box {
    border: 1px solid rgb(254 202 202);
}
.dark .nw-danger-box {
    border-color: rgb(239 68 68 / 0.3);
}

/* the Create post dialog's text box (components/wall-post-composer) */
/* the post composer's dialog: room for the text and the photos (components/wall-post-composer);
   the text box takes the height the photos don't */
.nw-composer-dialog { display: flex; flex-direction: column; min-height: min(600px, calc(100vh - 2rem)); }
.nw-composer-dialog > form { flex: 1; display: flex; flex-direction: column; }
.nw-composer-dialog .nw-composer-text { flex: 1 1 auto; min-height: 140px; }
@media (min-width: 768px) {
    .nw-composer-dialog { width: 760px; min-height: min(680px, calc(100vh - 10rem)); }
}
.nw-composer-previews { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 640px) {
    .nw-composer-previews { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* five to a row: a full post (10) is two rows, so the dialog still fits the window */
@media (min-width: 768px) {
    .nw-composer-previews { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.nw-composer-text {
    display: block;
    width: 100%;
    min-height: 6rem;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 1.125rem;
    line-height: 1.6;
    resize: none;
    box-shadow: none;
}
.nw-composer-text:focus {
    outline: none;
    box-shadow: none;
}
.dark .nw-composer-text {
    color: #fff;
}

/* Tailwind utilities used by the error box (auth/_errors, group-posts.js) that the theme's
   precompiled CSS doesn't include */
.text-red-700 {
    color: rgb(185 28 28);
}
.dark .dark\:bg-red-500\/10 {
    background-color: rgb(239 68 68 / 0.1);
}
.dark .dark\:text-red-300 {
    color: rgb(252 165 165);
}
/* ...and by the status message (auth/_status), which was a light box in dark mode */
.text-green-800 {
    color: rgb(22 101 52);
}
.dark .dark\:bg-green-500\/10 {
    background-color: rgb(34 197 94 / 0.1);
}
.dark .dark\:text-green-300 {
    color: rgb(134 239 172);
}

/* Like / Comment buttons under posts and photos: emoji icons, like the reaction picker */
.nw-action {
    display: flex;
    flex: 1 1 0%;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.15s;
}
.nw-action:hover {
    background-color: rgb(241 245 249);
}
.dark .nw-action {
    color: rgb(226 232 240);
}
.dark .nw-action:hover {
    background-color: rgb(255 255 255 / 0.08);
}
.nw-action.nw-action-mine,
.dark .nw-action.nw-action-mine {
    color: rgb(220 38 38);
}
.nw-action-icon {
    font-size: 1.25rem;
    line-height: 1;
}

/* Messages (resources/views/messages): chat bubbles keep line breaks and wrap long words */
.nw-bubble {
    max-width: 75%;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* Settings page labels: above the field on phones, beside it (right-aligned) from md up */
.nw-settings-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}
@media (min-width: 768px) {
    .nw-settings-label {
        width: 8rem;
        flex-shrink: 0;
        margin-bottom: 0;
        text-align: right;
    }
    .nw-settings-label-wide {
        width: 11rem;
    }
}

/* visible to screen readers only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* the photo viewer's previous / next buttons (components/photo-modal) */
.nw-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    background: rgb(255 255 255 / 0.85);
    color: #111;
}
.nw-viewer-nav:hover {
    background: #fff;
}

/* the selected-photos bar on your Photos tab (members/photos), kept in view */
.nw-bulk-bar {
    position: sticky;
    bottom: 1rem;
    z-index: 20;
    margin-top: 1rem;
    border: 1px solid rgb(0 0 0 / .1);
}

.dark .nw-bulk-bar {
    border-color: rgb(255 255 255 / .15);
}

/* placeholders dimmer than what's typed (the theme gives them the text's own color); :root
   outranks the theme's input[type='text']::placeholder rules. nw-fake-input is a button that
   looks like an empty box (the feed's "What's on your mind"), so its text is a placeholder too */
:root :is(input, textarea, select)::placeholder,
.nw-fake-input {
    color: rgb(156 163 175) !important;
    opacity: 1;
}
:root .dark :is(input, textarea, select)::placeholder,
.dark .nw-fake-input {
    color: rgb(255 255 255 / .4) !important;
}

/* the theme's dark text color skips search boxes, leaving typed text dark on dark */
.dark input[type='search'] {
    color: rgb(255 255 255 / .9);
}

/* album cards on the Photos tab's Albums section (members/photos) */
.nw-album-card:hover .aspect-square {
    opacity: .85;
}

/* Staff powers: anything a member can do only because they're staff (deleting others' posts,
   moderating a group they don't moderate, the reports queue) is violet, with a shield icon
   (shield-checkmark-outline), so it's never mistaken for an ordinary action. One color site-wide;
   change it here. */
:root {
    --nw-staff: 124 58 237;
}
.dark {
    --nw-staff: 167 139 250;
}
.nw-staff {
    color: rgb(var(--nw-staff)) !important;
}
a.nw-staff:hover,
button.nw-staff:hover,
a:hover > .nw-staff {
    background-color: rgb(var(--nw-staff) / .1) !important;
}
.nw-staff-button {
    background-color: rgb(124 58 237) !important;
    color: #fff !important;
}
.nw-staff-button:hover {
    background-color: rgb(109 40 217) !important;
}
.nw-staff-note {
    border: 1px solid rgb(var(--nw-staff) / .35);
    background-color: rgb(var(--nw-staff) / .08);
    color: rgb(var(--nw-staff));
}

/* read by screen readers and search engines, not shown (the theme's CSS lacks Tailwind's) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Video.js players (partials/videojs): the site's red, rounded like the cards around them */
.video-js.vjs-nudeweb {
    border-radius: .5rem;
    overflow: hidden;
}
.video-js.vjs-nudeweb .vjs-play-progress,
.video-js.vjs-nudeweb .vjs-volume-level {
    background-color: #dc2626;
}
.video-js.vjs-nudeweb .vjs-big-play-button {
    width: 2em;
    height: 2em;
    line-height: 2em;
    margin-left: -1em;
    margin-top: -1em;
    border: 0;
    border-radius: 9999px;
    background-color: rgb(220 38 38 / .85);
}
.video-js.vjs-nudeweb:hover .vjs-big-play-button,
.video-js.vjs-nudeweb .vjs-big-play-button:focus {
    background-color: #dc2626;
}

/* the sidebar's own scrolling (components/sidebar), with a thin scrollbar */
.nw-side-scroll {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* sidebars that stay in view (public/js/sidebar.js sets their top) */
@media (min-width: 1024px) {
  [data-sticky-side] {
    position: sticky;
    top: 80px;
  }
}

/* the test site's marker next to the logo (partials/staging-badge, APP_ENV=staging) */
.nw-staging {
    display: inline-block;
    margin-left: .5rem;
    padding: .125rem .5rem;
    border-radius: 9999px;
    background-color: rgb(245 158 11);
    color: #111827;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}
.nw-staging-auth {
    position: absolute;
    top: 2.5rem;
    left: 13.75rem; /* after the logo (2.5rem in, 168px wide) */
    margin: 0 !important; /* not the form column's spacing (space-y-10) */
}

/* the profile's tabs stuck under the header while scrolling (components/member/profile-header):
   see-through like the header, in its dark colour in dark mode, and lifted off the page by a
   clear shadow (on dark pages a shadow needs to be dark and wide to show, plus a faint edge) */
.nw-sticky-tabs {
    background-color: rgb(255 255 255 / .85);
    box-shadow: 0 10px 24px -6px rgb(15 23 42 / .28), 0 2px 6px rgb(15 23 42 / .12);
}
.dark .nw-sticky-tabs {
    background-color: rgb(30 41 59 / .92);
    box-shadow: 0 14px 30px -6px rgb(0 0 0 / .75), 0 2px 8px rgb(0 0 0 / .45), inset 0 -1px 0 rgb(255 255 255 / .08);
}

/* the sidebar's counts on Messages and Friends (components/sidebar), like the header's badges */
.nw-side-count {
    margin-left: auto;
    min-width: 1.375rem;
    height: 1.375rem;
    padding: 0 .4rem;
    border-radius: 9999px;
    background-color: rgb(220 38 38);
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.375rem;
    text-align: center;
}
.nw-side-count[hidden] {
    display: none;
}

/* a card's comment box waits for its Comment button until there are comments (comments/_section):
   hidden must win over the form's flex */
[data-gp-comment-form][hidden],
[data-gp-comments][hidden] {
    display: none !important;
}

/* the viewer's side panel (photos/_viewer, videos/_panel in the viewer): the comments fill what's
   left of it and scroll, with the comment box kept at the foot (comments/_section's $panel) */
.nw-comments-panel {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    /* (sticky stops at the padding: the box's own pads it instead) */
    padding-bottom: 0;
}
.nw-comments-panel > [data-gp-comment-form] {
    position: sticky;
    bottom: 0;
    padding-bottom: 0.75rem;
    background: #fff;
}
.dark .nw-comments-panel > [data-gp-comment-form] {
    background: rgb(30 41 59);
}

/* pages grow with their content and end with some space below the last card (the theme gave
   <main> the window's height, so the page ran on past it and stopped at the window's edge);
   layouts/app, all but the messages page */
#site__main.nw-main-flow {
    height: auto;
    min-height: calc(100vh - var(--m-top));
    padding-bottom: 2.5rem;
}

/* in dark mode, a select's list of options (drawn by the browser) gets a dark background to go
   with the white text it inherits; it was white on white (the register form, settings) */
.dark select {
    color-scheme: dark;
}
.dark select option {
    background-color: rgb(30 41 59);
    color: #fff;
}

/* a small label above an element on hover, without script (data-nw-tip="Love"; the reaction
   picker, comments/_react_button), styled as UIkit's tooltips */
[data-nw-tip] {
    position: relative;
}
[data-nw-tip]:hover::after,
[data-nw-tip]:focus-visible::after {
    content: attr(data-nw-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translate(-50%, -6px);
    padding: 3px 6px;
    border-radius: 2px;
    background: #666;
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
}

/* the groups directory's choices (groups/index): room for the arrow after the longest label */
[data-groups-filters] select {
    padding-right: 2.25rem;
}

/* "Who's joining?" (auth/register, settings): a choice drawn as a card; its radio is visually hidden */
.nw-choice-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
}
.dark .nw-choice-card {
    border-color: #334155;
    background: rgb(255 255 255 / 0.04);
}
.nw-choice-card-row {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
.nw-choice-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.nw-choice-card:has(input:checked) {
    border-color: #dc2626;
    background: rgb(220 38 38 / 0.06);
}
.nw-choice-card:has(input:focus-visible) {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

/* a couple's partners: their color dots, and the phone's tabs between them (auth/register) */
.nw-partner-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.nw-partner-dot-1 { background: #3b82f6; }
.nw-partner-dot-2 { background: #f59e0b; }
.nw-partner-tabs {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 5px;
    border-radius: 12px;
    background: #f1f5f9;
}
.dark .nw-partner-tabs { background: rgb(255 255 255 / 0.06); }
/* phones only, and only for a couple */
@media (max-width: 639.98px) {
    .nw-partner-tabs:not([hidden]) { display: grid; }
}
.nw-partner-tabs button {
    height: 44px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    color: #64748b;
}
.nw-partner-tabs button[aria-selected="true"] {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}
.dark .nw-partner-tabs button[aria-selected="true"] {
    background: #334155;
    color: #fff;
}

/* Settings → Profile: a card per person (settings/_people) and its detail chips */
.nw-person-card {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 16px 18px;
}
.dark .nw-person-card {
    border-color: #334155;
    background: rgb(255 255 255 / 0.03);
}
.nw-chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    background: #f1f5f9;
    color: #475569;
}
.dark .nw-chip {
    background: rgb(255 255 255 / 0.06);
    color: #cbd5e1;
}
.nw-settings-note {
    border-radius: 12px;
    padding: 14px 16px;
    background: #fef3c7;
    color: #78350f;
}
.dark .nw-settings-note {
    background: rgb(245 158 11 / 0.12);
    color: #fde68a;
}
.nw-settings-note[hidden] { display: none; }

/* a couple's partners in a profile's About box (members/show) */
.nw-partner-card {
    border-radius: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border-top: 3px solid #3b82f6;
    line-height: 1.5;
}
.nw-partner-card-2 { border-top-color: #f59e0b; }
.dark .nw-partner-card { background: rgb(255 255 255 / 0.04); }

/* The header's logo from tablet width up: its own size (w-42 isn't in the compiled Tailwind, so
   between 768 and 1024 px it showed at full size, 400 to 537 px, over the search box) */
.nw-logo {
    width: 168px;
    max-width: 100%;
    height: auto;
}


/* Tablet width (768-1023 px): the search box gives way to the header's buttons on its right */
@media (min-width: 768px) and (max-width: 1023px) {
    #search--box {
        width: min(24rem, calc(100vw - 520px));
    }
}

/*
 * Settings (settings/index): the sections listed down the side, the open one beside them. On a
 * phone the page is the list until a section is chosen (.nw-settings-chosen), then just that
 * section with a way back.
 */
.nw-settings {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 32px;
    padding-top: 8px;
}
.nw-settings-nav {
    flex: 1 1 240px;
    max-width: 280px;
}
.nw-settings-main {
    flex: 999 1 520px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-size: 14px;
    color: #0f172a;
}
.dark .nw-settings-main { color: #d1d5db; }
.nw-settings-hint { color: #64748b; }
.dark .nw-settings-hint { color: #94a3b8; }
.nw-settings-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nw-settings-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 9px 14px;
    border-radius: 12px;
    color: #0f172a;
}
.dark .nw-settings-links a { color: #f1f5f9; }
.nw-settings-links a:hover { background: rgb(15 23 42 / 0.04); }
.dark .nw-settings-links a:hover { background: rgb(255 255 255 / 0.04); }
.nw-settings-links a[aria-current="page"] {
    background: #fff;
    box-shadow: inset 3px 0 0 #dc2626, 0 1px 3px rgb(0 0 0 / 0.08);
}
.dark .nw-settings-links a[aria-current="page"] {
    background: #1e293b;
    box-shadow: inset 3px 0 0 #dc2626;
}
.nw-settings-links a > span { flex: 1; }
.nw-settings-chevron,
.nw-settings-list-title,
.nw-settings-back { display: none; }
.nw-settings-camera {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #fff;
    background: #475569;
    border: 3px solid #f1f5f9;
}
.dark .nw-settings-camera { border-color: #0f172a; }

/* a section's cards, rows and fields */
.nw-settings-card {
    border-radius: 14px;
    padding: 24px;
    background: #fff;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.08);
}
.dark .nw-settings-card {
    background: #1e293b;
    box-shadow: none;
}
.nw-settings-rows { padding-top: 6px; padding-bottom: 6px; }
.nw-settings-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 24px;
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
}
.dark .nw-settings-row { border-color: #334155; }
.nw-settings-row:last-of-type { border-bottom: 0; }
/* a fieldset's legend can't be a flex item: floated, it lines up with its choices */
fieldset.nw-settings-row > legend {
    float: left;
    flex: 1 1 220px;
    padding: 0;
}
.nw-settings-field-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

/* a "Who can..." row's choices: radios drawn as one segmented control */
.nw-segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: #f1f5f9;
}
.dark .nw-segmented { background: #0f172a; }
.nw-segmented label { position: relative; }
.nw-segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.nw-segmented span {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}
.dark .nw-segmented span { color: #cbd5e1; }
.nw-segmented input:checked + span {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.1);
}
.dark .nw-segmented input:checked + span {
    background: #f1f5f9;
    color: #0f172a;
}
.nw-segmented input:focus-visible + span {
    outline: 2px solid #dc2626;
    outline-offset: 1px;
}

/* an on/off choice drawn as a switch (a real checkbox) */
.nw-switch {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex-shrink: 0;
    width: 52px;
    height: 30px;
    margin: 0;
    /* (over the theme's checkbox look: border, tick, focus ring) */
    border: 0 !important;
    border-radius: 999px !important;
    background: #cbd5e1 !important;
    background-image: none !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background 0.15s;
}
.dark .nw-switch { background: #475569 !important; }
.nw-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.15s;
}
.nw-switch:checked,
.dark .nw-switch:checked { background: #dc2626 !important; }
.nw-switch:checked::after { left: 25px; }
.nw-switch:focus-visible {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

/* a section's save bar: at the bottom of the window while the form has changes */
.nw-save-bar {
    position: sticky;
    bottom: 16px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px 12px 18px;
    border-radius: 14px;
    background: #1e293b;
    color: #f1f5f9;
    box-shadow: 0 8px 24px rgb(15 23 42 / 0.25);
}
.dark .nw-save-bar { background: #334155; }
.nw-save-bar[hidden] { display: none; }
.nw-save-bar-undo { color: #e2e8f0; }

@media (max-width: 767.98px) {
    .nw-settings { gap: 16px; }
    .nw-settings-nav,
    .nw-settings-main { flex-basis: 100%; max-width: none; }
    .nw-settings:not(.nw-settings-chosen) .nw-settings-main,
    .nw-settings-chosen .nw-settings-nav { display: none; }
    .nw-settings-list-title { display: block; font-size: 1.5rem; font-weight: 700; margin: 4px 4px 12px; }
    .nw-settings-chevron { display: block; font-size: 18px; color: #94a3b8; }
    .nw-settings-back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; min-height: 44px; font-weight: 600; color: #dc2626; }
    .nw-settings-links { gap: 0; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.08); }
    .dark .nw-settings-links { background: #1e293b; box-shadow: none; }
    .nw-settings-links li + li { border-top: 1px solid #e2e8f0; }
    .dark .nw-settings-links li + li { border-color: #334155; }
    .nw-settings-links a,
    .nw-settings-links a[aria-current="page"],
    .dark .nw-settings-links a[aria-current="page"] { border-radius: 0; box-shadow: none; background: transparent; }
    .nw-settings-card { padding: 18px; }
    .nw-save-bar { bottom: 8px; }
}

/* a notification's × (notifications/_item): on hover where there is one, always on touch screens */
.nw-note > a { padding-right: 2.75rem; }
.nw-note-remove {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    color: #64748b;
    font-size: 1.1rem;
    opacity: 0;
}
.nw-note-remove:hover { background: rgb(100 116 139 / 0.15); color: #0f172a; }
.dark .nw-note-remove:hover { color: #fff; }
.nw-note:hover .nw-note-remove,
.nw-note-remove:focus-visible { opacity: 1; }
.nw-note:hover [aria-label="New"] { opacity: 0; }
@media (hover: none) {
    .nw-note-remove { opacity: 1; }
    .nw-note [aria-label="New"] { right: 2.5rem; }
}

/* the staff dashboard (staff/dashboard) */
.nw-stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) {
    .nw-stat-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.nw-stat-table tr:first-child { border-top: 0; }
.nw-break { overflow-wrap: anywhere; }
.nw-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* reactions' emoji (comments/_summary): full strength, not faded by the grey around them; larger under a post */
.nw-reaction-emoji { color: #000; line-height: 1; }
.nw-reactions-large .nw-reaction-emoji { font-size: 1.25rem; }
.nw-reactors-link:hover .nw-reaction-count { text-decoration: underline; }

/* scrollbars, site-wide: thin, rounded, in the theme's slate (the page's own too: dark mode is a class
   on body, so the html element follows it with :has) */
html { scrollbar-color: #cbd5e1 transparent; }
html:has(body.dark) { scrollbar-color: #475569 #0f172a; }
body.dark { scrollbar-color: #475569 transparent; }
* { scrollbar-width: thin; }
/* (browsers without scrollbar-color, such as Safari) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #94a3b8; }
body.dark ::-webkit-scrollbar-thumb { background-color: #475569; }
body.dark ::-webkit-scrollbar-thumb:hover { background-color: #64748b; }

/* the left menu's Live Cams icon: a red "live" dot on the screen's corner */
.nw-live-dot { position: absolute; top: -2px; right: -3px; width: 9px; height: 9px; border-radius: 9999px; background: #ef4444; }

/* the reactions dialog's list (comments/_assets): between 40% and 70% of the window, however many reacted */
.nw-reactors-body { min-height: 40vh; max-height: 70vh; overflow-y: auto; padding-right: 0.5rem; }
.nw-reactors-body .gp-scroll { max-height: none; overflow: visible; padding-right: 0; }

/* the Feedback button and panel (partials/feedback) */
.nw-feedback-pill { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 900; display: flex; align-items: center; border-radius: 9999px; background: #dc2626; color: #fff; box-shadow: 0 8px 24px rgb(15 23 42 / 0.3); font-size: 0.9rem; font-weight: 600; }
.nw-feedback-pill[hidden], .nw-feedback-panel[hidden] { display: none; }
.nw-feedback-open { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.9rem 0.6rem 1.1rem; }
.nw-feedback-dismiss { display: flex; align-items: center; padding: 0.6rem 0.8rem 0.6rem 0.6rem; border-left: 1px solid rgb(255 255 255 / 0.35); opacity: 0.85; }
.nw-feedback-dismiss:hover, .nw-feedback-open:hover { opacity: 1; }
.nw-feedback-panel { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 900; width: min(25rem, calc(100vw - 2rem)); border-radius: 14px; background: #fff; color: #0f172a; box-shadow: 0 12px 32px rgb(15 23 42 / 0.3); font-size: 0.9rem; }
.dark .nw-feedback-panel { background: #1e293b; color: #f1f5f9; }
.nw-feedback-head { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1.1rem; border-bottom: 1px solid #e2e8f0; }
.dark .nw-feedback-head, .dark .nw-feedback-foot { border-color: #334155; }
.nw-feedback-head h2 { font-size: 1rem; font-weight: 700; }
.nw-feedback-close { display: flex; opacity: 0.7; }
.nw-feedback-close:hover { opacity: 1; }
.nw-feedback-body { padding: 0.9rem 1.1rem; display: flex; flex-direction: column; gap: 0.8rem; }
.nw-feedback-kinds { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.nw-feedback-kinds input { position: absolute; opacity: 0; pointer-events: none; }
.nw-feedback-kinds span { display: inline-block; padding: 0.3rem 0.75rem; white-space: nowrap; border-radius: 9999px; border: 1px solid #cbd5e1; cursor: pointer; font-weight: 500; }
.dark .nw-feedback-kinds span { border-color: #475569; }
.nw-feedback-kinds input:checked + span { border-color: #dc2626; background: rgb(220 38 38 / 0.1); color: #dc2626; font-weight: 600; }
.dark .nw-feedback-kinds input:checked + span { color: #fca5a5; }
.nw-feedback-kinds input:focus-visible + span { outline: 2px solid #dc2626; outline-offset: 2px; }
.nw-feedback-body textarea { width: 100%; resize: vertical; border-radius: 10px; }
.nw-feedback-note { font-size: 0.8rem; color: #64748b; }
.nw-feedback-note.nw-feedback-error { color: #dc2626; }
.nw-feedback-foot { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 1.1rem; border-top: 1px solid #e2e8f0; font-size: 0.75rem; color: #64748b; }
.dark .nw-feedback-foot { color: #94a3b8; }
.nw-feedback-foot .button { margin-left: auto; flex-shrink: 0; }
@media (max-width: 639.98px) {
    .nw-feedback-pill { right: 0.75rem; bottom: 0.75rem; }
    .nw-feedback-panel { right: 1rem; bottom: 1rem; }
    /* the three choices still on one line */
    .nw-feedback-kinds { gap: 0.3rem; }
    .nw-feedback-kinds span { padding: 0.3rem 0.55rem; font-size: 0.8rem; }
}

.nw-feedback-body[hidden], .nw-feedback-foot[hidden], .nw-feedback-thanks[hidden] { display: none; }
.nw-feedback-panel { display: flex; flex-direction: column; }
.nw-feedback-thanks { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; padding: 1.5rem; text-align: center; }
.nw-feedback-thanks-icon { font-size: 3rem; color: #dc2626; }
.nw-feedback-thanks-title { font-size: 1.1rem; font-weight: 700; }
.nw-feedback-thanks .button { margin-top: 0.75rem; }

/* the search page (search/index): choice chips, and the filters behind a button on phones */
.nw-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.nw-chips input { position: absolute; opacity: 0; pointer-events: none; }
.nw-chips span { display: inline-block; padding: 0.3rem 0.8rem; border-radius: 9999px; border: 1px solid #cbd5e1; cursor: pointer; font-weight: 500; white-space: nowrap; }
.dark .nw-chips span { border-color: #475569; }
.nw-chips input:checked + span { border-color: #dc2626; background: rgb(220 38 38 / 0.1); color: #dc2626; font-weight: 600; }
.dark .nw-chips input:checked + span { color: #fca5a5; }
.nw-chips input:focus-visible + span { outline: 2px solid #dc2626; outline-offset: 2px; }
.nw-search-toggle { display: none; align-items: center; gap: 0.35rem; }
.nw-search-more summary::-webkit-details-marker { display: none; }
.nw-search-more summary { list-style: none; }
@media (max-width: 767.98px) {
    .nw-search-toggle { display: inline-flex; }
    .nw-search-filters { display: none; }
    .nw-search-open .nw-search-filters { display: block; }
    form[data-search-filters] button[type=submit] { display: none; }
}

/* the header's Create menu: the Photo tile (a file picker, so reached by Tab like the links) */
.nw-create-photo { background: rgb(254 243 199 / 0.6); color: #d97706; }
.dark .nw-create-photo { background: rgb(71 85 105); color: #fff; }
.nw-create-photo:focus-within { outline: 2px solid #d97706; outline-offset: 2px; }

/* the header's Create menu: the Photo tile (its file picker unseen, but reached by Tab like the links) */
.nw-create-photo { background: rgb(254 243 199 / 0.6); color: #d97706; }
.dark .nw-create-photo { background: rgb(71 85 105); color: #fff; }
.nw-create-photo input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.nw-create-photo:focus-within { outline: 2px solid #d97706; outline-offset: 2px; }

/* the account menu's theme choice (System, Light, Dark): one segmented control */
.nw-theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; border-radius: 0.5rem; background: #f1f5f9; }
.dark .nw-theme-switch { background: rgb(15 23 42 / 0.45); }
.nw-theme-switch button { display: flex; align-items: center; justify-content: center; gap: 0.3rem; padding: 0.35rem 0.25rem; border-radius: 0.375rem; font-size: 0.8rem; font-weight: 500; color: #64748b; }
.dark .nw-theme-switch button { color: rgb(255 255 255 / 0.7); }
.nw-theme-switch button:hover { color: #0f172a; }
.dark .nw-theme-switch button:hover { color: #fff; }
.nw-theme-switch button[aria-pressed="true"] { background: #fff; color: #dc2626; font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }
.dark .nw-theme-switch button[aria-pressed="true"] { background: rgb(71 85 105); color: #fff; }
.nw-theme-switch button:focus-visible { outline: 2px solid #dc2626; outline-offset: 1px; }
.nw-theme-switch ion-icon { font-size: 1rem; flex-shrink: 0; }
