/* The editor's look: calm, large, readable. No external fonts or scripts. */
:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --ink: #1c1b1f;
  --muted: #5f5c66;
  --line: #e6e3de;
  --field: #b8b4ad;
  /* Buttons are near-black; the site's own colour (--site, from teema.css) is the accent. */
  --brand: #24222b;
  --brand-soft: #efede8;
  --brand-ink: #ffffff;
  --danger: #a3172d;
  --ok-bg: #e6f4ea;
  --ok-ink: #1e5631;
  --err-bg: #fdecee;
  --warn: #8a4b00;
  --radius: 1rem;
  --shadow: 0 1px 2px rgb(31 27 36 / 0.06), 0 4px 16px rgb(31 27 36 / 0.05);
  /* Named fonts first: system-ui follows the desktop's interface font, which on some machines is monospace. */
  font-family:
    'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', 'Liberation Sans', Arial, sans-serif;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.55;
}
a {
  color: var(--brand);
}
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}

/* ---- Page frame ---- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.top.has-site {
  border-top: 4px solid var(--site, var(--brand));
}
.site-name {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: auto;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}
@media (max-width: 34rem) {
  .top {
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }
  .top .user > span {
    display: none;
  }
  .site-name {
    padding-left: 0.75rem;
  }
}
.site-name .dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--site, var(--brand));
}
.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}
main {
  max-width: 46rem;
  margin: 2rem auto 4rem;
  padding: 0 1rem;
}
main.wide {
  max-width: 64rem;
}
h1 {
  font-size: clamp(1.6rem, 4vw, 2rem);
  line-height: 1.2;
  margin: 0.2rem 0 1.25rem;
}
h2 {
  font-size: 1.2rem;
  margin: 0 0 0.25rem;
}
.eyebrow {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.back {
  margin: 0 0 0.25rem;
}
.back a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.back a:hover {
  color: var(--brand);
}
.muted,
.hint {
  color: var(--muted);
}
.hint {
  display: block;
  font-size: 0.9rem;
  font-weight: 400;
  margin: 0.1rem 0 0.35rem;
}
.optional {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 0.35rem;
}
.head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.head h1 {
  margin-bottom: 0;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.stack {
  display: grid;
  gap: 1.1rem;
}

/* ---- Fields ---- */
label {
  display: block;
  font-weight: 600;
}
label.inline {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 500;
}
.field {
  display: block;
}
.field .label {
  display: block;
  font-weight: 650;
}
input:not([type='checkbox'], [type='file']),
textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.7rem 0.8rem;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--field);
  border-radius: 0.6rem;
}
input:not([type='checkbox'], [type='file']):focus,
textarea:focus {
  border-color: var(--brand);
  outline: 3px solid var(--brand-soft);
  outline-offset: 0;
}
input::placeholder,
textarea::placeholder {
  color: #8d8696;
}
input[type='checkbox'] {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--brand);
}
textarea {
  resize: vertical;
}
.row {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}
.counter {
  display: block;
  min-height: 1.3em;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
}
.counter.warn {
  color: var(--warn);
}
.error {
  margin: 0;
  color: var(--danger);
  font-weight: 600;
}
.error:empty {
  display: none;
}

/* ---- Buttons ---- */
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.9rem;
  padding: 0.6rem 1.3rem;
  font: inherit;
  font-weight: 650;
  color: var(--brand-ink);
  background: var(--brand);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
button:hover,
.button:hover {
  filter: brightness(1.12);
}
button:disabled {
  cursor: progress;
  opacity: 0.7;
}
.button.big {
  min-height: 3.2rem;
  padding: 0.7rem 1.6rem;
  font-size: 1.1rem;
}
.button.small,
button.small {
  min-height: 2.4rem;
  padding: 0.35rem 1rem;
  font-size: 0.95rem;
}
button.secondary,
.button.secondary {
  color: var(--brand);
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--brand);
}
.button.ghost {
  background: transparent;
}
.danger-text,
.button.danger-text {
  color: var(--danger);
}
button.danger {
  background: var(--danger);
}
button.link {
  min-height: 0;
  padding: 0;
  color: var(--brand);
  background: none;
  text-decoration: underline;
  font-weight: 400;
}
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ---- Messages ---- */
.flash {
  padding: 0.9rem 1.1rem;
  border-radius: 0.7rem;
  background: var(--ok-bg);
  color: var(--ok-ink);
  font-weight: 650;
}
.flash a {
  color: inherit;
  margin-left: 0.4rem;
}
.errors {
  padding: 0.9rem 1.1rem;
  border-radius: 0.7rem;
  background: var(--err-bg);
  border: 1px solid #f2b8c0;
  margin-bottom: 1.25rem;
}
.errors p {
  margin: 0 0 0.3rem;
  font-weight: 700;
}
.errors ul {
  margin: 0;
  padding-left: 1.2rem;
}

/* ---- Post list ---- */
.list-section {
  margin-bottom: 2.25rem;
}
.list-section > .hint {
  margin-bottom: 0.9rem;
}
.posts,
.cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.post-card {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto;
  gap: 1rem 1.25rem;
  align-items: center;
  padding: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.post-card .thumb {
  display: block;
  width: 6.5rem;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0.6rem;
  background: var(--brand-soft);
}
.post-card .thumb.empty,
.post-card .date-tile {
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--brand);
  background: var(--brand-soft);
}
.post-card .thumb.empty svg {
  width: 2.2rem;
  height: 2.2rem;
  opacity: 0.55;
}
.post-card .thumb-link {
  text-decoration: none;
}
.post-card .date-tile {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.1;
}
.post-card .date-tile strong {
  font-size: 1.9rem;
}
.post-text {
  min-width: 0;
}
.post-text .title {
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
}
.post-text .title:hover {
  text-decoration: underline;
}
.post-text p {
  margin: 0.25rem 0 0;
}
.post-text .summary {
  font-size: 0.95rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta {
  font-size: 0.9rem;
}
.badge {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
}
.badge.past {
  color: var(--muted);
  background: #eeecef;
}
.cards a {
  display: block;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
}
.empty-state {
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--surface);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
}
.empty-state p {
  max-width: 30rem;
  margin: 0.5rem auto 1.5rem;
  color: var(--muted);
}
@media (max-width: 40rem) {
  .post-card {
    grid-template-columns: 4.5rem 1fr;
  }
  .post-card .thumb {
    width: 4.5rem;
  }
  .post-card .actions {
    grid-column: 1 / -1;
  }
  .head .actions {
    width: 100%;
  }
  .head .button.big {
    flex: 1;
  }
}

/* ---- Post form ---- */
.post-form,
.content-form {
  display: grid;
  gap: 1rem;
}
.card {
  display: grid;
  gap: 1.1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.title-input {
  font-size: 1.35rem !important;
  font-weight: 650 !important;
}
.js .no-js {
  display: none;
}

/* The toolbar editor (client/editor.ts) */
.rich {
  margin-top: 0.3rem;
  border: 1px solid var(--field);
  border-radius: 0.6rem;
  background: var(--surface);
}
.rich.focused {
  border-color: var(--brand);
  outline: 3px solid var(--brand-soft);
}
.toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem;
  background: #faf9fb;
  border-bottom: 1px solid var(--line);
  border-radius: 0.6rem 0.6rem 0 0;
}
.toolbar button {
  min-height: 2.5rem;
  min-width: 2.5rem;
  padding: 0.3rem 0.6rem;
  color: var(--ink);
  background: transparent;
  border-radius: 0.45rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.toolbar button:hover {
  background: #eeeaf2;
  filter: none;
}
.toolbar button[aria-pressed='true'] {
  color: var(--brand);
  background: var(--brand-soft);
}
.toolbar button:disabled {
  opacity: 0.35;
  cursor: default;
}
.toolbar svg {
  width: 1.25rem;
  height: 1.25rem;
}
@media (max-width: 30rem) {
  .toolbar {
    gap: 0;
  }
  .toolbar .wide-only {
    display: none;
  }
  .toolbar .sep {
    margin: 0 0.1rem;
  }
  .title-input {
    font-size: 1.15rem !important;
  }
}
.toolbar .sep {
  width: 1px;
  height: 1.6rem;
  margin: 0 0.2rem;
  background: var(--line);
}
.rich-content {
  min-height: 16rem;
  padding: 0.9rem 1rem 1.2rem;
  outline: none;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-variant-ligatures: none;
}
.rich-content > :first-child {
  margin-top: 0;
}
.rich-content p {
  margin: 0 0 0.9em;
}
.rich-content h2 {
  font-size: 1.3rem;
  margin: 1.2em 0 0.4em;
}
.rich-content h3 {
  font-size: 1.1rem;
  margin: 1em 0 0.3em;
}
.rich-content ul,
.rich-content ol {
  margin: 0 0 0.9em;
  padding-left: 1.5rem;
}
.rich-content li p {
  margin: 0.15em 0;
}
.rich-content a {
  color: var(--brand);
  text-decoration: underline;
}
.rich-content p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  height: 0;
  color: #8d8696;
  pointer-events: none;
}
.ProseMirror-hideselection *::selection {
  background: transparent;
}
.ProseMirror-gapcursor {
  display: none;
}

/* Image */
.image-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: stretch;
}
.image-picker .thumb {
  width: 10rem;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0.6rem;
  background: var(--brand-soft);
}
.drop {
  position: relative;
  flex: 1 1 14rem;
  display: grid;
  place-content: center;
  gap: 0.2rem;
  min-height: 7.5rem;
  padding: 1rem;
  text-align: center;
  font-weight: 400;
  color: var(--muted);
  background: #faf9fb;
  border: 2px dashed var(--field);
  border-radius: 0.7rem;
  cursor: pointer;
}
.drop:hover,
.drop:focus-within {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.drop strong {
  color: var(--brand);
}
.drop .hint {
  margin: 0;
  font-size: 0.85rem;
}
.drop input[type='file'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.js .image-card:not(.has-image) .image-alt,
.js .image-card:not(.has-image) .remove-image,
.js .image-field:not(.has-image) .image-alt,
.js .image-field:not(.has-image) .remove-image {
  display: none;
}
/* An image field of a list item or the page texts: label, picker, description. */
.image-field {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}
.image-field > .label {
  font-weight: 650;
}
.image-field .error:empty {
  display: none;
}

/* List items: the post card, with a number where there is no picture and arrows to reorder. */
.item-card .thumb.number {
  font-size: 1.5rem;
  font-weight: 700;
}
.item-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.item-card .move {
  display: flex;
  gap: 0.25rem;
  margin-right: 0.25rem;
}

/* Change history */
.history {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.history-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
}
.history-row + .history-row {
  border-top: 1px solid var(--line);
}
.history-row p {
  margin: 0;
}
.history-label {
  font-weight: 650;
}

/* Event: the fields show when the switch is on */
.switch {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  cursor: pointer;
  font-weight: 400;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch-ui {
  flex: none;
  position: relative;
  width: 3rem;
  height: 1.75rem;
  margin-top: 0.1rem;
  background: #cfc9d4;
  border-radius: 999px;
  transition: background 0.15s;
}
.switch-ui::after {
  content: '';
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.35rem;
  height: 1.35rem;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
  transition: transform 0.15s;
}
.switch input:checked + .switch-ui {
  background: var(--brand);
}
.switch input:checked + .switch-ui::after {
  transform: translateX(1.25rem);
}
.switch input:focus-visible + .switch-ui {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
.switch .hint {
  margin: 0.1rem 0 0;
}
.event-fields {
  display: grid;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.event-card:not(:has(input[name='isEvent']:checked)) .event-fields {
  display: none;
}

/* More settings */
.more summary {
  cursor: pointer;
  font-weight: 650;
  list-style-position: outside;
}
.more summary .hint {
  display: inline;
  margin-left: 0.4rem;
}
.more-fields {
  display: grid;
  gap: 1.1rem;
  margin-top: 1rem;
}

/* Bottom bar with the main buttons; stays in view while writing */
.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0.5rem -0.5rem 0;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -6px 20px rgb(31 27 36 / 0.08);
}
.actionbar .status {
  flex: 1 1 16rem;
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}
.post-form.dirty:not(.busy) .actionbar .status::before,
.content-form.dirty:not(.busy) .actionbar .status::before {
  content: '● ';
  color: var(--warn);
}
.actionbar .buttons {
  flex: 0 1 auto;
}
@media (max-width: 30rem) {
  .actionbar .buttons {
    width: 100%;
  }
  .actionbar .buttons button {
    flex: 1;
  }
}
.busy .actionbar {
  background: var(--brand-soft);
}

/* Preview */
.preview {
  margin-bottom: 1.5rem;
  border: 2px solid var(--brand);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.preview-bar {
  margin: 0;
  padding: 0.7rem 1rem;
  background: var(--brand);
  color: var(--brand-ink);
}
.preview iframe {
  display: block;
  width: 100%;
  height: 75vh;
  border: 0;
}

/* Link dialog */
.link-dialog {
  width: min(28rem, calc(100vw - 2rem));
  padding: 1.4rem;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.25);
}
.link-dialog::backdrop {
  background: rgb(31 27 36 / 0.45);
}
.link-dialog h2 {
  margin: 0;
}
.link-dialog .buttons {
  justify-content: flex-end;
}

code {
  font-size: 0.85em;
  background: #eeeaf2;
  padding: 0.05rem 0.3rem;
  border-radius: 0.3rem;
}

/* ---- Site front page: one card per content type ---- */
.dash {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}
.dash-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--site, var(--brand));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.dash-card h2 {
  margin: 0;
  font-size: 1.15rem;
}
.dash-card p {
  margin: 0;
}
.dash-figure {
  font-size: 1.35rem;
  font-weight: 700;
}
.dash-figure .badge {
  font-size: 0.9rem;
  vertical-align: middle;
}
.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
}
.badge.draft {
  color: var(--warn);
  background: #fbefdc;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- Price list form ---- */
.price-group {
  min-width: 0;
  margin: 0;
}
.price-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}
.price-group-head .field {
  flex: 1 1 16rem;
}
input.group-title {
  font-size: 1.2rem;
  font-weight: 700;
}
.price-rows {
  display: grid;
  margin: 0 -0.5rem;
}
/* Order, name, price, detail, remove: the same five columns on every row. */
.price-row {
  display: grid;
  grid-template-columns: 5.4rem minmax(0, 3fr) minmax(6rem, 9rem) minmax(0, 4fr) auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.45rem 0.5rem;
  border-radius: 0.6rem;
}
.price-row:not(.price-row-head):nth-child(odd) {
  background: var(--bg);
}
.price-row:focus-within {
  background: var(--brand-soft);
}
.price-row-head {
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--muted);
  padding-bottom: 0.2rem;
}
.price-row input.price {
  font-weight: 650;
  text-align: right;
}
.icons {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
button.icon {
  min-height: 2.4rem;
  min-width: 2.4rem;
  padding: 0 0.5rem;
  color: var(--ink);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--field);
  font-size: 1.05rem;
}
button.icon:hover {
  filter: none;
  background: var(--brand-soft);
}
button.icon:disabled {
  cursor: default;
  opacity: 0.3;
}
/* Up and down sit together as one control. */
.icons.move {
  gap: 0;
}
.icons.move button.icon:first-child {
  border-radius: 0.6rem 0 0 0.6rem;
}
.icons.move button.icon:last-child {
  border-radius: 0 0.6rem 0.6rem 0;
  margin-left: -1px;
}
button.icon.text {
  padding: 0 0.9rem;
  font-size: 0.92rem;
}
button.icon.danger-text {
  color: var(--danger);
  box-shadow: none;
  background: transparent;
}
button.icon.danger-text:hover {
  background: var(--err-bg);
}
.price-group > button {
  justify-self: start;
}
@media (max-width: 52rem) {
  .price-rows {
    margin: 0;
    gap: 0.6rem;
  }
  .price-row {
    grid-template-columns: 1fr 8rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
  }
  .price-row > input:nth-of-type(3) {
    grid-column: 1 / -1;
  }
  .price-row .icons.move {
    order: 9;
  }
  .price-row > button.icon.text {
    order: 10;
    justify-self: end;
  }
  .price-row-head {
    display: none;
  }
}

/* ---- Notice form ---- */
.notice-preview {
  border: 1px dashed var(--field);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 1rem;
}
.notice-preview p {
  margin: 0;
}
.notice-preview-label {
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 0.5rem !important;
}
.notice-preview-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1rem;
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--site, var(--brand)) 16%, white);
  font-weight: 600;
  text-align: center;
  overflow-wrap: anywhere;
}
.notice-preview-link {
  text-decoration: underline;
  font-weight: 700;
}
.notice-preview-off {
  display: none;
  color: var(--muted);
}
.notice-preview.is-off .notice-preview-bar {
  display: none;
}
.notice-preview.is-off .notice-preview-off {
  display: block;
}
.field.narrow input {
  max-width: 14rem;
}
/* Hints under a field, so labels and inputs line up across columns. */
.field > input + .hint,
.field > textarea + .hint {
  margin: 0.35rem 0 0;
}
.row {
  align-items: start;
}

/* ---- Side menu: the site's sections, always in view ---- */
.shell {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  align-items: start;
  max-width: 84rem;
  margin: 0 auto;
}
.has-side main {
  margin-top: 2rem;
}
.side {
  position: sticky;
  top: 0;
  padding: 2rem 0.75rem 2rem 1.25rem;
}
.side ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}
.side a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 2.9rem;
  padding: 0.5rem 0.85rem;
  border-radius: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.side a:hover {
  color: var(--ink);
  background: var(--brand-soft);
}
.side a[aria-current='page'] {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.side a[aria-current='page'] .icon {
  color: var(--site, var(--brand));
}
.icon {
  flex: none;
}
@media (max-width: 56rem) {
  .shell {
    display: block;
  }
  .side {
    position: static;
    padding: 0.6rem 1rem 0;
    overflow-x: auto;
  }
  .side ul {
    display: flex;
    gap: 0.4rem;
  }
  .side a {
    white-space: nowrap;
    min-height: 2.6rem;
    background: var(--surface);
    border: 1px solid var(--line);
  }
  .side a[aria-current='page'] {
    border-color: var(--site, var(--brand));
    box-shadow: none;
  }
  .has-side main {
    margin-top: 1.25rem;
  }
}

/* ---- Dashboard polish ---- */
.lead {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 1.1rem;
}
.head h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
}
.dash {
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
}
.dash-card {
  padding: 1.5rem;
  border-top-width: 1px;
  transition:
    box-shadow 0.15s ease,
    transform 0.15s ease;
}
.dash-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 2px 4px rgb(31 27 36 / 0.06),
    0 12px 28px rgb(31 27 36 / 0.1);
}
.dash-card h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
}
.dash-icon {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.8rem;
  color: var(--site, var(--brand));
  background: color-mix(in srgb, var(--site, var(--brand)) 12%, white);
}
.dash-figure {
  font-size: 1.9rem;
  letter-spacing: -0.02em;
  margin-top: 0.5rem !important;
}
@media (prefers-reduced-motion: reduce) {
  .dash-card {
    transition: none;
  }
  .dash-card:hover {
    transform: none;
  }
}

main > .lead {
  margin: 0 0 1.25rem;
}

/* ---- Social links form ---- */
.social-row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 0.75rem 1rem;
}
@media (max-width: 40rem) {
  .social-row {
    grid-template-columns: 1fr;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
  }
}
