:root {
      --bg: #f3f4f1;
      --paper: #ffffff;
      --ink: #2f3130;
      --muted: #6f7370;
      --line: #dde1d8;
      --accent: #c8ef3a;
      --accent-dark: #b4db28;
      --accent-deeper: #8fb512;
      --accent-soft: #f3fccc;
      --header: #3a3d3b;
      --header-2: #2c2f2d;
      --warn: #b45309;
      --warn-soft: #ffedd5;
      --danger: #b91c1c;
      --ok: #4d7c0f;
      --ok-soft: #ecfccb;
      --shadow: 0 1px 2px rgba(47,49,48,.06), 0 10px 28px rgba(47,49,48,.07);
      --radius: 12px;
      font-family: Poppins, system-ui, -apple-system, sans-serif;
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      font-family: Poppins, system-ui, -apple-system, sans-serif;
      background:
        radial-gradient(900px 380px at 8% -8%, #c8ef3a40, transparent),
        radial-gradient(700px 320px at 100% 0%, #3a3d3b12, transparent),
        var(--bg);
      color: var(--ink);
      min-height: 100vh;
    }
    header {
      position: sticky; top: 0; z-index: 10;
      background: linear-gradient(180deg, var(--header-2) 0%, var(--header) 100%);
      border-bottom: 3px solid var(--accent);
      padding: 14px 22px;
      display: flex; gap: 16px; align-items: center; justify-content: space-between;
      flex-wrap: wrap;
      color: #fff;
    }
    .brand { display: flex; gap: 14px; align-items: center; }
    .logo {
      height: 44px; width: auto; display: block;
      background: transparent;
      padding: 0;
      filter: drop-shadow(0 1px 0 rgba(0,0,0,.25));
    }
    .brand-text {
      border-left: 1px solid rgba(255,255,255,.18);
      padding-left: 14px;
    }
    h1 { font-size: 1.08rem; margin: 0; letter-spacing: -.01em; color: #fff; }
    .sub { color: #b7bbb8; font-size: .82rem; margin-top: 3px; }
    .pill {
      font-size: .75rem; padding: 7px 12px; border-radius: 999px;
      background: var(--accent); color: #1f2418; border: none;
      font-weight: 800; letter-spacing: .01em;
    }
    main { max-width: 1100px; margin: 0 auto; padding: 22px 18px 60px; }
    .stats {
      display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px;
    }
    @media (max-width: 800px) { .stats { grid-template-columns: repeat(2, 1fr); } }
    .stat {
      background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
      padding: 14px 16px; box-shadow: var(--shadow);
      border-top: 3px solid var(--accent);
    }
    .stat .label { color: var(--muted); font-size: .78rem; }
    .stat .value { font-size: 1.45rem; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
    .toolbar {
      display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
      margin-bottom: 14px; justify-content: space-between;
    }
    .filters { display: flex; gap: 8px; flex-wrap: wrap; }
    select, input, button, textarea {
      font: inherit; border-radius: 10px; border: 1px solid var(--line);
      background: var(--paper); color: var(--ink); padding: 8px 11px;
    }
    button {
      cursor: pointer; background: var(--accent); color: var(--header); border-color: transparent;
      font-weight: 700;
    }
    button:hover { background: var(--accent-dark); }
    button.secondary { background: #f7f8f5; color: var(--ink); border-color: #c9cfc4; font-weight: 600; }
    button.secondary:hover { border-color: var(--accent-deeper); }
    button.ghost { background: transparent; color: var(--ink); border-color: transparent; font-weight: 700; }
    button.ghost:hover { color: var(--accent-deeper); }
    button:disabled { opacity: .5; cursor: not-allowed; }
    .grid {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px;
    }
    .card {
      background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
      padding: 0; overflow: hidden; box-shadow: var(--shadow); cursor: pointer; text-align: left;
      transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
    }
    .card-body { padding: 14px 15px 15px; }
    .card-theme-art {
      width: 100%;
      height: 132px;
      object-fit: cover;
      object-position: center 60%;
      border-radius: 0;
      margin: 0;
      display: block;
      background: #2f3130;
      border: 0;
    }
    .card-theme-fallback {
      width: 100%;
      height: 132px;
      border-radius: 0;
      margin: 0;
      display: grid;
      place-items: center;
      background: linear-gradient(135deg, #3a3d3b, #708228 55%, #c8ef3a);
      color: #fff;
      font-weight: 700;
      font-size: .95rem;
      text-align: center;
      padding: 10px;
      border: 0;
    }
    .title-link {
      background: none; border: 0; padding: 0; margin: 0 0 6px; font: inherit; font-size: 1.25rem;
      font-weight: 700; color: var(--ink); cursor: pointer; text-align: left;
      display: inline-flex; align-items: center; gap: 8px;
    }
    .title-link:hover { color: var(--accent-ink, #4a5c12); text-decoration: underline; }
    .title-link .edit-hint {
      font-size: .75rem; font-weight: 600; color: var(--muted); text-decoration: none;
      background: #eef0ea; border-radius: 999px; padding: 2px 8px;
    }
    .settings-preview {
      width: 100%; max-width: 520px; height: 160px; object-fit: cover; border-radius: 12px;
      background: #2f3130; display: block; margin-top: 8px;
    }
    .theme-editor {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: flex-end;
      margin-top: 12px;
      width: 100%;
    }
    .theme-editor .field { min-width: 180px; flex: 1; }
    .theme-editor .theme-preview {
      width: 72px;
      height: 72px;
      border-radius: 10px;
      object-fit: cover;
      background: #d6d9d2;
      box-shadow: inset 0 0 0 1px rgba(47,49,48,.08);
    }
    .card:hover {
      transform: translateY(-2px);
      border-color: #cfd6c4;
      border-top-color: var(--accent);
      box-shadow: 0 8px 24px rgba(47,49,48,.1);
    }
    .card h3 { margin: 0 0 4px; font-size: 1rem; }
    .meta { color: var(--muted); font-size: .8rem; margin-bottom: 10px; }
    .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
    .badge {
      font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
      padding: 3px 8px; border-radius: 999px; background: #e7e5e4; color: #44403c;
    }
    .badge.planning { background: #e7e5e4; }
    .badge.booking { background: #fef3c7; color: #92400e; }
    .badge.confirmed { background: var(--ok-soft); color: var(--ok); }
    .badge.complete { background: var(--accent); color: #1f2418; }
    .badge.booking { background: #fef3c7; color: #92400e; }
    .mini { font-size: .8rem; color: var(--muted); }
    .mini strong { color: var(--ink); }
    .panel {
      background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
      box-shadow: var(--shadow); overflow: hidden;
    }
    .panel-head {
      padding: 16px 18px; border-bottom: 1px solid var(--line);
      display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; align-items: flex-start;
      border-left: 4px solid var(--accent);
    }
    .panel-body { padding: 16px 18px; }
    table { width: 100%; border-collapse: collapse; font-size: .9rem; }
    th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
    th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
    tr:last-child td { border-bottom: none; }
    .money { font-variant-numeric: tabular-nums; white-space: nowrap; }
    .pay-unpaid, .book-enquiry { color: var(--warn); font-weight: 600; }
    .pay-paid, .book-confirmed { color: var(--ok); font-weight: 600; }
    .pay-invoiced, .book-pencilled { color: #0369a1; font-weight: 600; }
    .book-cancelled { color: var(--danger); font-weight: 600; text-decoration: line-through; }
    .hidden { display: none !important; }
    .form-grid {
      display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px;
    }
    @media (max-width: 700px) {
      .form-grid { grid-template-columns: 1fr; }
      table { display: block; overflow-x: auto; }
    }
    label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
    .field { display: flex; flex-direction: column; }
    .totals {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px;
    }
    @media (max-width: 700px) { .totals { grid-template-columns: 1fr; } }
    .note {
      margin-top: 18px; padding: 14px 16px; border-radius: var(--radius);
      background: linear-gradient(90deg, var(--accent-soft), #fff);
      border: 1px solid #d7e98a; color: #2f3130; font-size: .9rem;
    }
    .empty { color: var(--muted); padding: 18px 0; text-align: center; }
    footer {
      margin-top: 28px; color: var(--muted); font-size: .8rem; text-align: center;
    }

    .day-stack { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
    .day-block {
      border: 1px solid var(--line);
      border-radius: 12px;
      overflow: hidden;
      background: #fffefb;
    }
    .day-block.friday { border-left: 5px solid var(--accent-deeper); }
    .day-block.saturday { border-left: 5px solid var(--accent); }
    .day-block.sunday { border-left: 5px solid #5a5e5c; }
    .day-block.other { border-left: 5px solid #9aa09c; }
    .day-head {
      display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
      padding: 12px 14px;
      background: linear-gradient(90deg, #f7fae8 0%, #f5f6f4 55%);
      border-bottom: 1px solid var(--line);
    }
    .day-head h3 { margin: 0; font-size: 1rem; letter-spacing: -.01em; }
    .day-head .day-sub { color: var(--muted); font-size: .8rem; margin-top: 2px; }
    .day-body { padding: 0 6px 6px; }
    .day-empty { color: var(--muted); font-size: .88rem; padding: 14px 10px; }

    a.who-link, button.who-link {
      background: none; border: none; padding: 0; margin: 0;
      color: var(--accent-deeper); font-weight: 700; cursor: pointer;
      text-decoration: underline; text-underline-offset: 2px;
      font: inherit; text-align: left;
    }
    a.who-link:hover, button.who-link:hover { color: #1f2418; }
    .contact-grid {
      display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px;
    }
    @media (max-width: 700px) { .contact-grid { grid-template-columns: 1fr; } }
    .contact-card {
      background: #f7f8f5; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
    }
    .contact-card .label { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
    .contact-card .value { margin-top: 4px; font-size: .95rem; word-break: break-word; }
    .useful-box {
      background: var(--accent-soft); border: 1px solid #d7e98a; border-radius: 10px;
      padding: 12px 14px; margin-bottom: 16px; font-size: .92rem;
    }

    .thumb {
      width: 64px; height: 64px; border-radius: 12px;
      display: block;
      flex-shrink: 0;
      overflow: hidden;
      object-fit: cover;
      box-shadow: inset 0 0 0 1px rgba(47,49,48,.08);
      background: #d6d9d2;
    }
    td.thumb-cell {
      width: 80px;
      padding: 12px 12px 12px 10px;
      vertical-align: middle;
    }
    /* Programme rows: roomier now that times are stacked */
    .day-block table th,
    .day-block table td {
      padding: 12px 10px;
      vertical-align: middle;
    }
    .day-block table td .mini {
      margin-top: 4px;
      line-height: 1.35;
    }
    .day-block table td strong {
      font-size: .95rem;
    }
    .time-range {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 3px;
      width: 6.6rem;
      min-width: 6.6rem;
    }
    .time-range .sep {
      display: none;
    }
    .time-range table.bookings th.col-times, table.bookings td.col-times {
      width: 7rem;
      max-width: 7rem;
    }
    input.time-edit[type="time"] {
      width: 100%;
      min-width: 0;
      font-size: .78rem;
      padding: 3px 4px;
    }
    /* Add-booking / wider forms can keep a horizontal layout when marked */
    .time-range.time-range-inline {
      flex-direction: row;
      align-items: center;
      width: auto;
      min-width: 0;
      gap: 6px;
    }
    .time-range.time-range-inline .sep {
      display: inline;
      color: var(--muted);
      font-size: .8rem;
    }
    input.time-edit[type="time"] {
      width: 7.2rem;
      min-width: 6.5rem;
      color: var(--ink);
    }
    input.time-edit {
      font: inherit;
      font-size: .82rem;
      color: var(--muted);
      width: 9.5rem;
      max-width: 100%;
      padding: 5px 7px;
      border-radius: 8px;
      border: 1px solid var(--line);
      background: #fff;
    }
    .format-thumb {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .format-thumb img {
      width: 56px;
      height: 56px;
      border-radius: 10px;
      object-fit: cover;
      box-shadow: inset 0 0 0 1px rgba(47,49,48,.08);
    }
    .format-thumb input[type="file"] {
      font-size: .72rem;
      width: 7.5rem;
    }
    #format-rows input, #format-rows select {
      font: inherit;
      font-size: .85rem;
      padding: 6px 8px;
      border-radius: 8px;
      border: 1px solid var(--line);
      background: #fff;
      min-width: 0;
      width: 100%;
    }
    input.time-edit:focus {
      outline: none;
      border-color: var(--accent-deeper);
      color: var(--ink);
      box-shadow: 0 0 0 2px rgba(200,239,58,.35);
    }

    .hero-band {
      position: relative;
      height: auto;
      overflow: hidden;
      border-bottom: 3px solid var(--accent);
      background: #1a1c1a;
    }
    .hero-band img {
      width: 100%;
      height: auto;
      object-fit: contain;
      object-position: center;
      display: block;
      filter: none;
    }
    .hero-band::after {
      content: "";
      position: absolute; inset: 0;
      background: linear-gradient(90deg, rgba(42,45,43,.42) 0%, rgba(42,45,43,.08) 50%, rgba(42,45,43,.28) 100%),
                  linear-gradient(180deg, rgba(26,28,26,.12) 0%, transparent 35%, rgba(26,28,26,.22) 100%);
      pointer-events: none;
    }
    @media (max-width: 700px) {
      .hero-band { height: auto; }
    }

    .site-footer {
      margin-top: 36px;
      background: #3a3d3b;
      color: #d7dbd6;
      border-top: 3px solid var(--accent);
      padding: 16px 20px;
    }
    .site-footer-inner {
      max-width: 1100px;
      margin: 0 auto;
      display: flex;
      flex-wrap: wrap;
      gap: 12px 28px;
      align-items: center;
      justify-content: space-between;
    }
    .site-footer a {
      color: #fff;
      text-decoration: none;
      font-weight: 400;
      font-size: .8rem;
    }
    .site-footer a:hover { text-decoration: underline; color: #fff; }
    .site-footer .links { display: flex; flex-wrap: wrap; gap: 14px 22px; }
    .site-footer .copy { color: #fff; font-size: .8rem; }
    footer.legacy-note { display: none; }
