/* Leixlip TTC
   Identity drawn from the sport's own materials: the blue table surface,
   its white edge and centre lines, and one small orange ball.
   Light page, calm type — a real club, not a brand campaign. */

:root {
  --paper: #f4f6f5;
  --card: #ffffff;
  --ink: #1c2a33;
  --muted: #59696f;
  --table: #2260a8;
  --table-deep: #1a4d89;
  --table-edge: rgba(255, 255, 255, 0.85);
  --ball: #ed6a2f;
  --rule: #dbe2e0;
  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body: "Instrument Sans", sans-serif;
  --space: clamp(1.25rem, 3vw, 2.5rem);
  --max: 1080px;
  --header-h: 4.25rem;
  --radius: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
}

.skip-link:focus {
  top: 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 246, 245, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.8rem var(--space);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}

.brand-mark__glyph,
.secret-trigger__glyph {
  width: 1.4rem;
  height: 0.9rem;
  background: var(--table);
  border-radius: 3px;
  position: relative;
  flex-shrink: 0;
}

.brand-mark__glyph::after,
.secret-trigger__glyph::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(-50%);
}

.nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

.nav__list {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__list a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}

.nav__list a:hover,
.nav__list a:focus-visible {
  color: var(--ink);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--card);
  cursor: pointer;
  padding: 0.55rem;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.nav-panel {
  border-top: 1px solid var(--rule);
  padding: 1rem var(--space) 1.25rem;
  background: var(--paper);
}

.nav-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.nav-panel__list a {
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
}

@media (min-width: 880px) {
  .nav {
    display: flex;
  }

  .nav-toggle,
  .nav-panel {
    display: none !important;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.3rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:focus-visible {
  outline: 2px solid var(--table);
  outline-offset: 3px;
}

.btn--small {
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
}

.btn--solid {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.btn--solid:hover {
  background: #101b22;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: #b9c4c1;
}

.btn--ghost:hover {
  border-color: var(--ink);
}

.btn--ghost-light {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

.btn--ghost-light:hover {
  border-color: #fff;
}

.btn--danger {
  background: transparent;
  color: #b03535;
  border-color: rgba(176, 53, 53, 0.4);
}

/* Hero — the table surface itself */
.hero {
  padding: clamp(1rem, 3vw, 2rem) var(--space) 0;
}

.hero__table {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  background: linear-gradient(160deg, var(--table) 0%, var(--table-deep) 100%);
  border-radius: calc(var(--radius) + 4px);
  padding: clamp(3rem, 8vw, 6rem) clamp(1.5rem, 5vw, 4.5rem);
  overflow: hidden;
  box-shadow: inset 0 0 0 2px var(--table-edge), inset 0 0 0 10px transparent, 0 18px 40px rgba(26, 77, 137, 0.22);
}

/* white edge line inset from the border, like a table's boundary line */
.hero__table::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px solid var(--table-edge);
  border-radius: var(--radius);
  pointer-events: none;
}

.hero__centreline {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 50%;
  width: 2px;
  background: var(--table-edge);
  transform: translateX(-50%);
  pointer-events: none;
}

.hero__ball {
  position: absolute;
  right: clamp(2rem, 8vw, 5rem);
  bottom: clamp(1.6rem, 5vw, 3rem);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ball);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  animation: ball-settle 1.1s var(--ease) 0.3s both;
}

@keyframes ball-settle {
  0% {
    transform: translateY(-36px);
    opacity: 0;
  }
  55% {
    transform: translateY(0);
    opacity: 1;
  }
  75% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0);
  }
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 34rem;
  color: #fff;
}

.hero__brand {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.hero__headline {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5.5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.hero__support {
  margin: 0 0 1.75rem;
  font-size: 1.08rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
  max-width: 32rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero .btn--solid {
  background: #fff;
  color: var(--table-deep);
  border-color: #fff;
}

.hero .btn--solid:hover {
  background: #eef2f6;
}

/* Sections */
.section {
  padding: clamp(3.5rem, 9vw, 6rem) 0;
}

.section + .section {
  border-top: 1px solid var(--rule);
}

.section__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space);
}

.section__inner--split {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 860px) {
  .section__inner--split {
    grid-template-columns: 1fr 1.1fr;
    align-items: center;
    gap: 3.5rem;
  }

  .section--sessions .section__inner--split {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: start;
  }
}

.section__header h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.section__header--narrow {
  max-width: 38rem;
}

.section__lead {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--table);
}

/* About cards */
.standard-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.25rem;
}

@media (min-width: 760px) {
  .standard-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.standard-item {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.5rem;
}

.standard-item h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.standard-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

/* Sessions */
.session-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.session-item {
  display: grid;
  gap: 0.2rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--table);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
}

.session-item__day {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}

.session-item__time {
  font-weight: 600;
  color: var(--table);
}

.session-item__note {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

/* League */
.stat-row {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.25rem;
}

@media (min-width: 700px) {
  .stat-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat {
  padding: 1.15rem 0 0;
  border-top: 2px solid var(--table);
}

.stat__value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.stat__label {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Hall — drawn table, top-down */
.hall__visual {
  display: grid;
  place-items: center;
  padding: 1rem 0;
}

.table-diagram {
  width: min(100%, 380px);
  aspect-ratio: 9 / 5;
  background: linear-gradient(150deg, var(--table), var(--table-deep));
  border-radius: 8px;
  border: 2px solid var(--table-edge);
  display: grid;
  grid-template-columns: 1fr 2px 1fr;
  padding: 10px;
  gap: 0;
  box-shadow: 0 14px 32px rgba(26, 77, 137, 0.2);
}

.table-diagram__half {
  border: 2px solid var(--table-edge);
  border-radius: 4px;
  position: relative;
}

.table-diagram__half::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.45);
}

.table-diagram__net {
  background: rgba(255, 255, 255, 0.9);
}

.detail-list {
  margin: 1.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.detail-list > div:not(.box-add-row) {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule);
}

.detail-list dt {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  align-self: center;
}

.detail-list dd {
  margin: 0;
  font-weight: 500;
}

/* News */
.news-list {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.25rem;
}

.news-item {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.5rem 1.65rem;
}

.news-item__date {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--table);
}

.news-item h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
}

.news-item p {
  margin: 0;
  color: var(--muted);
  max-width: 56rem;
}

.news-item__actions {
  display: none;
  gap: 0.5rem;
  margin-top: 1rem;
}

body.is-editing .news-item__actions {
  display: flex;
}

/* Find us */
.section--find {
  padding-bottom: clamp(4rem, 10vw, 7rem);
}

.section__inner--find {
  display: grid;
  gap: 2rem;
}

@media (min-width: 800px) {
  .section__inner--find {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
  }
}

.find-panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--table);
  border-radius: var(--radius);
  padding: 1.6rem 1.75rem 1.75rem;
}

.find-panel__address {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.find-panel__contact {
  margin: 0 0 1.4rem;
  color: var(--muted);
}

.find-panel__contact a {
  color: var(--table-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Footer + secret trigger */
.site-footer {
  background: var(--ink);
  color: #cfd8dc;
  padding: 1.75rem 0 2.25rem;
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.secret-trigger {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: default;
  opacity: 0.75;
  padding: 0;
}

.secret-trigger:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  opacity: 1;
}

.site-footer__copy {
  font-size: 0.92rem;
}

.site-footer__copy p {
  margin: 0.15rem 0;
}

/* CMS */
.cms-login,
.cms-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(28, 42, 51, 0.45);
  backdrop-filter: blur(4px);
}

.cms-login[hidden],
.cms-modal[hidden],
.cms-bar[hidden],
.cms-toast[hidden] {
  display: none !important;
}

.cms-login__dialog,
.cms-modal__dialog {
  width: min(430px, 100%);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: 0 24px 60px rgba(16, 27, 34, 0.25);
}

.cms-login__dialog h2,
.cms-modal__dialog h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.cms-login__dialog > p,
.cms-modal__note {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.cms-modal__note code {
  font-size: 0.9em;
  color: var(--ink);
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.field span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid #c4cecb;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--table);
  outline-offset: 1px;
}

.cms-login__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.cms-error {
  color: #b03535;
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

.cms-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  background: var(--ink);
  color: #eef2f4;
  border-top: 3px solid var(--table);
  padding: 0.85rem var(--space) 1rem;
  box-shadow: 0 -12px 40px rgba(16, 27, 34, 0.3);
}

.cms-bar .btn--solid {
  background: var(--table);
  border-color: var(--table);
}

.cms-bar .btn--solid:hover {
  background: var(--table-deep);
}

.cms-bar .btn--ghost {
  color: #eef2f4;
  border-color: rgba(255, 255, 255, 0.35);
}

.cms-bar .btn--ghost:hover {
  border-color: #fff;
}

.cms-bar__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.cms-bar__status {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 12rem;
}

.cms-bar__label {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.cms-bar__state {
  font-size: 0.78rem;
  color: #a9b8bf;
}

/* More menu */
.cms-more {
  position: relative;
}

.cms-more__menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(16, 27, 34, 0.3);
  padding: 0.4rem;
  z-index: 75;
}

.cms-more__menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.cms-more__menu button:hover,
.cms-more__menu button:focus-visible {
  background: var(--paper);
}

.cms-more__danger {
  color: #b03535 !important;
}

/* Versions dialog */
.versions-list {
  display: grid;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
}

.version-row__meta {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.version-row__meta strong {
  font-size: 0.95rem;
}

.version-row__meta span {
  font-size: 0.82rem;
  color: var(--muted);
}

.versions-empty {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.cms-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cms-bar__hint {
  max-width: var(--max);
  margin: 0.65rem auto 0;
  color: #a9b8bf;
  font-size: 0.85rem;
}

.cms-toast {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 90;
  padding: 0.85rem 1.1rem;
  background: #2c7a52;
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(16, 27, 34, 0.25);
}

.cms-toast.is-error {
  background: #b03535;
}

body.is-editing {
  padding-bottom: 8rem;
}

body.is-editing [data-key],
body.is-editing [data-editable] {
  outline: 1px dashed rgba(34, 96, 168, 0.6);
  outline-offset: 4px;
  cursor: text;
  min-width: 1ch;
}

body.is-editing [data-key]:focus,
body.is-editing [data-editable]:focus {
  outline: 2px solid var(--table);
  background: rgba(34, 96, 168, 0.06);
}

body.is-editing .hero [data-key]:focus {
  background: rgba(255, 255, 255, 0.12);
}

body.is-editing .btn[data-key] {
  cursor: text;
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* News pagination */
.news-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.75rem;
}

.news-pagination__status {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

/* Box management (edit mode only) */
.standard-item,
.session-item,
.stat,
.detail-list > div {
  position: relative;
}

.box-tools {
  display: none;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  gap: 0.25rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 7px;
  padding: 0.2rem;
  box-shadow: 0 4px 14px rgba(16, 27, 34, 0.12);
  z-index: 5;
}

body.is-editing .box-tools {
  display: flex;
}

.stat .box-tools {
  top: -0.75rem;
}

.detail-list > div .box-tools {
  top: 50%;
  transform: translateY(-50%);
}

.box-tool {
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.box-tool:hover:not(:disabled) {
  background: var(--paper);
}

.box-tool:disabled {
  opacity: 0.3;
  cursor: default;
}

.box-tool--del {
  color: #b03535;
  font-size: 0.85rem;
}

.box-tool:focus-visible {
  outline: 2px solid var(--table);
}

.box-add,
.box-add-row {
  display: none;
}

body.is-editing .box-add {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.9rem 1.2rem;
  border: 2px dashed #aebbc4;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

body.is-editing .box-add:hover {
  border-color: var(--table);
  color: var(--table);
}

body.is-editing .box-add-row {
  display: block;
}

body.is-editing .box-add-row .box-add {
  width: 100%;
}

/* Style target highlight */
body.is-editing .is-style-target {
  outline: 2px solid var(--table) !important;
}

/* Format toolbar */
.cms-format {
  max-width: var(--max);
  margin: 0.75rem auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.cms-format__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #a9b8bf;
  margin-right: 0.25rem;
  white-space: nowrap;
}

.cms-format.is-idle .cms-format__label {
  color: #e4b96a;
}

.cms-format__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.fmt-select {
  padding: 0.4rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: var(--ink);
  color: #eef2f4;
  font: inherit;
  font-size: 0.85rem;
}

.fmt-select:disabled {
  opacity: 0.45;
}

.fmt-toggle {
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: transparent;
  color: #eef2f4;
  font-size: 0.95rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.fmt-toggle:disabled {
  opacity: 0.45;
  cursor: default;
}

.fmt-toggle[aria-pressed="true"] {
  background: var(--table);
  border-color: var(--table);
}

.fmt-swatches {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
}

.fmt-swatch {
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
}

.fmt-swatch:disabled {
  opacity: 0.4;
  cursor: default;
}

.fmt-swatch:hover:not(:disabled),
.fmt-swatch:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

#fmt-color {
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

#fmt-color:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Drag to move */
.box-tool--drag {
  cursor: grab;
  touch-action: none;
  font-size: 0.85rem;
  letter-spacing: -1px;
}

.box-tool--drag:active {
  cursor: grabbing;
}

body.is-dragging-box,
body.is-dragging-box * {
  cursor: grabbing !important;
  user-select: none;
}

.drag-ghost {
  opacity: 0.9;
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(16, 27, 34, 0.28);
  transform: scale(1.02) rotate(0.5deg);
  background: var(--card);
}

.drag-ghost .box-tools,
.drag-ghost .box-resize {
  display: none !important;
}

.is-drag-origin {
  opacity: 0.4;
  outline: 2px dashed var(--table) !important;
  outline-offset: 3px;
}

/* Drag to resize (grid boxes only) */
.box-resize {
  display: none;
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 15px;
  height: 15px;
  cursor: ew-resize;
  touch-action: none;
  border-right: 3px solid #aebbc4;
  border-bottom: 3px solid #aebbc4;
  border-radius: 0 0 7px 0;
  z-index: 5;
}

body.is-editing .box-resize {
  display: block;
}

.box-resize:hover {
  border-color: var(--table);
}

body.is-resizing-box,
body.is-resizing-box * {
  cursor: ew-resize !important;
  user-select: none;
}

/* Box width spans (snap to grid columns; single-column layouts ignore them) */
@media (min-width: 760px) {
  .standard-item.span-2 {
    grid-column: span 2;
  }

  .standard-item.span-3 {
    grid-column: span 3;
  }
}

@media (min-width: 700px) {
  .stat.span-2 {
    grid-column: span 2;
  }

  .stat.span-3 {
    grid-column: span 3;
  }
}
