/* Visual rules: docs/BEHEER-STYLEGUIDE.md. Update the guide when these choices change.
   Layout and behavior stay in the modules; visual roles live here. */
@import url('style.css') layer(components);
@import url('analytics.css') layer(components);
@import url('ai-tools.css') layer(components);
@import url('compact.css') layer(components);
@import url('newsletter-photos.css') layer(components);

:root {
  --admin-font: 'Jost Variable', 'Avenir Next', Avenir, sans-serif;
  --admin-text-small: 13px;
  --admin-text-body: 16px;
  --admin-text-section: 20px;
  --admin-text-title: 30px;
  --admin-radius: 8px;
  --admin-card-radius: 12px;
  --paper: #fff;
  --chalk: #f7f5f1;
  --ink: #313731;
  --muted: #6b6c65;
  --line: #deded6;
  --slate: #536473;
  --clay: #bf815e;
  --peach: #f2ccb6;
  --admin-selected: #f0e4da;
  --admin-background: #faf9f6;
  --admin-sidebar-background: #f1eee8;
  --admin-primary-hover: #435462;
  --admin-hover-border: #c5b7a9;
  --admin-link-line: #c6ada0;
  --admin-dropzone-line: #c6b9ab;
  --admin-backdrop: #31373166;
  --admin-error: #a13f37;
  font-family: var(--admin-font);
  font-size: var(--admin-text-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--admin-background);
}
html {scrollbar-gutter: stable;}
html:has(dialog[open]) {overflow: hidden;}
body {font-family: var(--admin-font);font-size: var(--admin-text-body);font-weight: 400;line-height: 1.5;background: var(--admin-background);color: var(--ink);}
/* Prevent local components from introducing extra type or colour variants. */
body * {font-family: inherit;font-size: inherit;font-weight: inherit;letter-spacing: normal;text-transform: none;color: inherit;}
h1 {font-size: var(--admin-text-title);font-weight: 500;line-height: 1.2;letter-spacing: -.025em;}
h2 {font-size: var(--admin-text-section);font-weight: 500;line-height: 1.35;}
h3,h4,strong {font-weight: 500;}
p {line-height: 1.6;}
button {font-size: var(--admin-text-body);font-weight: 500;line-height: 1.4;min-height: 44px;}
input,select,textarea {font-size: var(--admin-text-body);font-weight: 400;line-height: 1.5;color: var(--ink);accent-color: var(--slate);}
:where(input:not([type=checkbox],[type=radio],[type=file]),select,textarea) {border: 1px solid var(--line);border-radius: var(--admin-radius);background: var(--paper);padding: 11px 12px;min-height: 44px;max-width: 100%;}
input[type=checkbox],input[type=radio] {width: 20px;height: 20px;flex: none;}
textarea {resize: vertical;}
:where(button,a,input,select,textarea,summary):focus-visible {outline: 2px solid var(--slate);outline-offset: 3px;}
button:disabled {cursor: default;opacity: .55;}
button[aria-busy=true] {cursor: wait;}
label,legend,th,dt {font-size: var(--admin-text-small);font-weight: 500;}
small,.count,.activity-sub,.date-countdown,.field-hint,.form-note,.source-note,.muted,.settings-feedback,.collection-card-meta,.scene-status,.scene-progress p,.scene-progress-count,.product-image-state,.header-image-status,.image-work-summary,.product-photo-caption,.product-photo-caption-title,.product-photo-select,.shop-product-link,.newsletter-editor-status,.newsletter-step,.cancelled-label,.cancellation-record,.analytics-note,.analytics-axis,.analytics-totals span,.newsletter-photo-option span,.admin-photo-footer,.inline-help,.inline-help p,.setting-state,.product-summary-state,.test-mode-badge,.info-number,.login-foot {font-size: var(--admin-text-small);font-weight: 400;color: var(--muted);line-height: 1.5;}
.scene-heartbeat {font-weight: 400;color: var(--muted);}
.overline,.side-label,.title-dot {display: none;}
.text-link,.quiet-link,.participant-email-link,.shop-product-link {color: var(--slate);border-bottom: 0;text-decoration: underline;text-decoration-color: var(--admin-link-line);text-underline-offset: 4px;}
.text-link {font-size: var(--admin-text-small);}
.error,.scene-progress-error,.scene-result-icon:has(+ .scene-progress-error) {color: var(--admin-error);}
.error:empty,.source-note:empty {display: none;}
.source-note {background: transparent;border: 0;padding: 0;margin-top: 12px;}

/* Shared shell and hierarchy. */
.main-column,.content,.topbar {background: var(--admin-background);}
.content {max-width: 1280px;padding: 32px 36px 64px;}
.sidebar {background: var(--admin-sidebar-background);border-right: 0;}
.brand img {width: 44px;height: 44px;}
.brand strong {font-size: var(--admin-text-body);font-weight: 500;}
.brand small {font-size: var(--admin-text-small);font-weight: 400;color: var(--muted);}
.sidebar nav a,.sidebar-bottom>a {font-size: var(--admin-text-body);font-weight: 400;border-radius: var(--admin-radius);min-height: 48px;padding: 12px;}
.sidebar a.active {background: var(--admin-selected);color: var(--ink);box-shadow: none;font-weight: 500;}
.sidebar nav a:hover,.sidebar-bottom>a:hover {background: var(--admin-selected);}
.account strong,.avatar {font-size: var(--admin-text-small);font-weight: 500;}
.topbar {font-size: var(--admin-text-small);border: 0;min-height: 60px;height: auto;padding-block: 12px;}
.topbar .slash {color: var(--muted);margin-inline: 10px;}
.test-mode-badge {border: 0;background: var(--admin-selected);border-radius: var(--admin-radius);padding: 7px 10px;}
.test-mode-badge::before {display: none;}
.page-head {margin-bottom: 28px;}
.page-head h1 {font-size: var(--admin-text-title);font-weight: 500;}
.section-heading {gap: 16px;margin-top: 32px;margin-bottom: 16px;}
.section-heading h2,.connection-card h2,.empty h2 {font-size: var(--admin-text-section);font-weight: 500;}
.section-actions {gap: 12px;}
.stats {gap: 0;margin-bottom: 24px;background: var(--paper);border: 1px solid var(--line);border-radius: var(--admin-card-radius);overflow: hidden;}
.stats article {padding: 24px;border: 0;border-radius: 0;background: transparent;}
.stats article+article {border-left: 1px solid var(--line);}
.stats small {font-size: var(--admin-text-small);font-weight: 400;}
.stats article strong,.stats #stat-revenue,.analytics-summary strong,.analytics-totals strong {font-size: var(--admin-text-title);font-weight: 500;line-height: 1.2;font-variant-numeric: tabular-nums;margin: 8px 0;white-space: normal;overflow-wrap: anywhere;}
.stats article>span:last-child {font-size: var(--admin-text-small);}
.stat-icon,.empty-icon,.collection-drop-icon {display: none;}
.table-wrap,.settings-card,.shop-product-item,.connection-card,.empty,.newsletter-compose,.enrollment-card,.analytics-panel {background: var(--paper);border-color: var(--line);border-radius: var(--admin-card-radius);box-shadow: none;}
.table-wrap {overflow: auto;}
th {font-size: var(--admin-text-small);font-weight: 500;background: var(--paper);color: var(--muted);}
td {font-size: var(--admin-text-body);font-weight: 400;padding: 18px;border-bottom-color: var(--line);}
.activity,.orders-table .order-number,.order-toggle,.orders-table td strong,.newsletter-title-button {font-weight: 500;}
.badge,.badge.weekend,.product-summary-state {font-size: var(--admin-text-small);font-weight: 400;padding: 0;border: 0;background: transparent;color: var(--muted);border-radius: 0;white-space: normal;}
.availability,.availability.full,.agenda-past td:not(.agenda-actions),.agenda-past .activity,.agenda-past .activity-sub {color: var(--muted);font-weight: 400;}
.agenda-past {background: var(--chalk);}
.sort-column {font-size: var(--admin-text-small);font-weight: 500;color: var(--muted);}
.sort-indicator {font-size: var(--admin-text-small);color: var(--muted);}
.activity-toggle,.order-toggle,.newsletter-title-button {min-height: 44px;}
.activity-sub,.date-countdown {margin-top: 4px;}

/* Same controls on every page, with one treatment for each action role. */
.primary,.small-primary,.url-box button {font-size: var(--admin-text-body);font-weight: 500;border: 1px solid var(--slate);border-radius: var(--admin-radius);background: var(--slate);color: white;min-height: 44px;padding: 10px 16px;white-space: normal;text-align: center;}
.primary:hover,.small-primary:hover,.url-box button:hover {background: var(--admin-primary-hover);border-color: var(--admin-primary-hover);}
.quiet-button,.cancel-enrollment,.agenda-remove,.account .logout-button,.product-cutout-button,.newsletter-add-block {font-size: var(--admin-text-body);font-weight: 400;min-height: 44px;padding: 10px 14px;border: 1px solid var(--line);border-radius: var(--admin-radius);background: transparent;color: var(--slate);text-decoration: none;white-space: normal;}
.quiet-button:hover,.cancel-enrollment:hover,.agenda-remove:hover,.product-cutout-button:hover,.newsletter-add-block:hover {background: var(--admin-selected);}
.product-cutout-button {font-size: var(--admin-text-small);}
.icon-button,.product-photo-actions .icon-button,.collection-card .collection-card-actions .icon-button {width: 44px;height: 44px;min-height: 44px;min-width: 44px;flex: none;padding: 0;border: 1px solid var(--line);border-radius: var(--admin-radius);background: var(--paper);color: var(--slate);box-shadow: none;font-size: 0;}
.icon-button:hover {background: var(--admin-selected);border-color: var(--admin-hover-border);}
.icon-danger {color: var(--muted);}
.icon-danger:hover {color: var(--admin-error);}
[data-icon] svg,.icon-button svg {width: 20px;height: 20px;}
.filters,.section-tabs {padding: 0;gap: 8px;border: 0;border-radius: 0;background: transparent;box-shadow: none;}
.filters button,.section-tabs a,.section-tabs button {font-size: var(--admin-text-body);font-weight: 400;border: 0;border-radius: var(--admin-radius);background: transparent;min-height: 44px;padding: 10px 14px;color: var(--muted);box-shadow: none;}
.filters button.active,.section-tabs a[aria-current=page],.section-tabs button[aria-pressed=true],.section-tabs button[aria-selected=true] {background: var(--admin-selected);color: var(--ink);font-weight: 500;box-shadow: none;}
.filters button:hover,.section-tabs a:hover {background: var(--admin-selected);}
.overview-period-picker>summary {font-size: var(--admin-text-small);font-weight: 400;border-radius: var(--admin-radius);padding: 12px 14px;min-height: 44px;background: var(--paper);}
.overview-period-picker form {border-radius: var(--admin-card-radius);}
.overview-period-picker>summary::after {font-size: var(--admin-text-small);}

/* Form rows and disclosures share the same rhythm. */
.setting-panel>summary {padding: 20px;gap: 14px;min-height: 68px;}
.setting-title,.product-summary-copy strong,.collection-card-title {font-size: var(--admin-text-body);font-weight: 500;}
.setting-state {max-width: 45%;}
.setting-icon {width: 20px;height: 20px;background: transparent;border: 0;border-radius: 0;color: var(--muted);}
.setting-state.is-ready {color: var(--muted);}
.setting-body {padding: 24px;}
.setting-body p,.settings-card p,.connection-card p {font-size: var(--admin-text-body);font-weight: 400;color: var(--muted);line-height: 1.6;}
.setting-body .field-hint,.settings-card .settings-feedback,.setting-body .inline-help p,.settings-card .inline-help p {font-size: var(--admin-text-small);}
.settings-toggle {font-size: var(--admin-text-body);font-weight: 400;min-height: 44px;}
.settings-quick h2 {font-size: var(--admin-text-body);font-weight: 500;}
.settings-quick p {font-size: var(--admin-text-small);}
.test-mode-explanation,.test-mode-settings .settings-feedback {grid-column: 1/-1;margin: 0;}
.inline-help summary {min-height: 44px;display: flex;align-items: center;gap: 8px;color: var(--muted);}
.inline-help p {font-size: var(--admin-text-small);}
.admin-disclosure {margin-top: 24px;border: 1px solid var(--line);border-radius: var(--admin-card-radius);background: var(--paper);}
.admin-disclosure>summary {display: flex;align-items: center;gap: 12px;padding: 18px 20px;min-height: 60px;list-style: none;cursor: pointer;font-size: var(--admin-text-body);font-weight: 500;}
.admin-disclosure>summary::-webkit-details-marker {display: none;}
.admin-disclosure>summary::after {content: '';width: 7px;height: 7px;border-right: 1.5px solid var(--muted);border-bottom: 1.5px solid var(--muted);transform: rotate(45deg);margin-left: auto;flex: none;}
.admin-disclosure[open]>summary::after {transform: rotate(225deg);}
.admin-disclosure[open]>summary {border-bottom: 1px solid var(--line);}
.admin-disclosure>.info-grid {padding: 24px;margin: 0;max-width: none;}
.admin-disclosure>#newsletter-list {padding: 16px;}
.info-grid article {border: 0;background: transparent;padding: 0;}
.info-grid h3 {font-size: var(--admin-text-body);font-weight: 500;}
.info-grid p {font-size: var(--admin-text-small);color: var(--muted);}
.empty {padding: 32px 24px;}
.empty p {font-size: var(--admin-text-body);color: var(--muted);}
.connection-card {padding: 24px;max-width: 850px;}
.url-box {border: 0;border-radius: var(--admin-radius);background: var(--chalk);gap: 16px;padding: 12px;}
.url-box code {font-size: var(--admin-text-body);overflow-wrap: anywhere;white-space: normal;min-width: 0;}

/* Photo editing, order details and newsletter editor use the same type roles. */
.shop-product-item>summary {padding: 18px 20px;}
.product-summary-copy small {font-size: var(--admin-text-small);}
.collection-dropzone,.newsletter-photo-dropzone,.product-extra-dropzone,.newsletter-photo-pick {border-color: var(--admin-dropzone-line);border-radius: var(--admin-radius);background: var(--chalk);}
.collection-dropzone {padding: 20px;min-height: 120px;gap: 6px;}
.collection-dropzone strong,.newsletter-photo-dropzone strong {font-size: var(--admin-text-body);font-weight: 500;}
.collection-dropzone>span:not(.collection-drop-icon),.newsletter-photo-dropzone span {font-size: var(--admin-text-small);color: var(--muted);}
.collection-card,.collection-card img,.product-photo-tile,.product-summary-image {border-radius: var(--admin-radius);}
.collection-card-title {line-height: 1.4;}
.product-photo-options {flex-wrap: wrap;gap: 6px;}
.product-photo-select {min-height: 44px;}
.product-photo-caption,.product-photo-caption-title,.product-photo-tile:first-child .product-photo-caption {font-size: var(--admin-text-small);font-weight: 400;color: var(--muted);}
.product-photo-rebuild>summary {font-size: var(--admin-text-small);min-height: 44px;display: flex;align-items: center;}
.product-scene-selection {font-size: var(--admin-text-small);}
.product-order-status {font-size: var(--admin-text-small);color: var(--muted);}
.product-order-ghost {border-radius: var(--admin-card-radius);}
.scene-progress {border-color: var(--line);border-radius: var(--admin-radius);background: var(--chalk);}
.scene-progress-heading strong {font-size: var(--admin-text-small);font-weight: 500;}
.shop-field,.course-field label,.writing-style-form label,.ai-settings-form label,.newsletter-editor label,.newsletter-block label {font-size: var(--admin-text-small);font-weight: 500;}
.enrollment-card h3,.order-detail-heading,.detail-extra h4 {font-size: var(--admin-text-body);font-weight: 500;}
.detail-line dt {color: var(--muted);}
.detail-line dd {font-size: var(--admin-text-body);overflow-wrap: anywhere;}
.enrollment-details {gap: 16px 24px;}
.order-detail-inner,.activity-detail-inner {background: var(--chalk);}
.order-search-label {font-size: var(--admin-text-small);}
.order-search-label input {font-size: var(--admin-text-body);}
.newsletter-step {font-weight: 500;color: var(--muted);}
.newsletter-block-header h3 {font-size: var(--admin-text-body);font-weight: 500;}
.newsletter-block-heading>p:last-child,.newsletter-photo-label {font-size: var(--admin-text-small);color: var(--muted);}
.newsletter-photo-pick span {font-size: var(--admin-text-body);}
.newsletter-editor-heading h2 {font-size: var(--admin-text-section);font-weight: 500;}
#newsletter-send {background: transparent;color: var(--slate);border-color: var(--line);}
.admin-row-title {display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;overflow-wrap: anywhere;line-height: 1.5;}
.admin-date-cell time {white-space: nowrap;font-size: var(--admin-text-small);color: var(--muted);}
.admin-row-actions {display: inline-block;max-width: 100%;}
.admin-row-actions>summary {display: flex;align-items: center;gap: 10px;list-style: none;cursor: pointer;font-size: var(--admin-text-body);font-weight: 400;min-height: 44px;padding: 10px 12px;white-space: nowrap;}
.admin-row-actions>summary::-webkit-details-marker {display: none;}
.admin-row-actions>summary::after {content: '';width: 7px;height: 7px;border-right: 1.5px solid currentColor;border-bottom: 1.5px solid currentColor;transform: rotate(45deg);margin-top: -4px;}
.admin-row-actions[open]>summary::after {transform: rotate(225deg);margin-top: 4px;}
.admin-actions-menu {position: fixed;z-index: 90;visibility: hidden;overflow-y: auto;overscroll-behavior: contain;padding: 8px;border: 1px solid var(--line);border-radius: var(--admin-radius);background: var(--paper);box-shadow: 0 8px 24px var(--admin-backdrop);}
.admin-actions-menu[data-positioned=true] {visibility: visible;}
.admin-action-option {display: block;width: 100%;min-height: 44px;padding: 10px 12px;border: 0;border-radius: var(--admin-radius);background: transparent;color: var(--ink);text-align: left;font-size: var(--admin-text-body);font-weight: 400;cursor: pointer;}
.admin-action-option:hover:not(:disabled),.admin-action-option:focus-visible {background: var(--chalk);}
.admin-action-option:disabled {opacity: .5;cursor: default;}
.admin-action-reason {font-size: var(--admin-text-small);color: var(--muted);line-height: 1.5;margin: 0;padding: 0 12px 10px;}
@media(min-width:1251px) {
  .newsletter-table {table-layout: fixed;width: 100%;}
  .newsletter-table th,.newsletter-table td {padding: 16px 12px;vertical-align: middle;}
  .newsletter-table th:first-child {width: 32%;}
  .newsletter-table th:nth-child(2) {width: 11%;}
  .newsletter-table th:nth-child(3) {width: 18%;}
  .newsletter-table th:nth-child(4),.newsletter-table th:nth-child(5),.newsletter-table th:last-child {width: 13%;}
  .newsletter-table .activity {min-width: 0;}
  .newsletter-title-button {width: 100%;}
}
.newsletter-actions {display: flex;gap: 12px;flex-wrap: wrap;}
#newsletter-overview>.newsletter-list-heading {display: none;}
.analytics-panel {padding: 24px;margin: 24px 0;}
.analytics-heading h2,.analytics-unlinked .analytics-heading h2 {font-size: var(--admin-text-section);font-weight: 500;}
.analytics-panel.analytics-unlinked {padding: 12px 0;border: 0;background: transparent;gap: 16px;}
.analytics-unlinked .analytics-heading h2 {font-size: var(--admin-text-body);font-weight: 400;}
.analytics-unlinked #analytics-chart .text-link {font-size: var(--admin-text-small);}
.analytics-section h3 {font-size: var(--admin-text-section);font-weight: 500;}
.analytics-totals>div {border-radius: var(--admin-radius);}
.analytics-table-wrap {border: 0;border-radius: var(--admin-radius);}
.analytics-table-wrap td {font-size: var(--admin-text-body);}
.analytics-table-wrap th {font-size: var(--admin-text-small);}

/* Dialogs always keep their title and close action in view. */
dialog {background: var(--paper);color: var(--ink);border-color: var(--line);border-radius: var(--admin-card-radius);max-height: calc(100dvh - 32px);}
dialog::backdrop {background: var(--admin-backdrop);backdrop-filter: blur(2px);}
.course-dialog {padding: 0;width: min(720px,calc(100vw - 32px));max-width: 720px;overflow: auto;}
.course-dialog>form {padding: 0 24px 24px;}
.course-dialog:has(>.dialog-head) {padding: 0 24px 24px;}
.course-dialog .dialog-head {position: sticky;top: 0;z-index: 5;background: var(--paper);margin: 0 -24px 24px;padding: 16px 24px;border-bottom: 1px solid var(--line);align-items: center;}
.dialog-head h2,.newsletter-dialog-head h2,.admin-photo-header h2 {font-size: var(--admin-text-section);font-weight: 500;line-height: 1.35;}
.dialog-head>div {min-width: 0;}
.dialog-close,.newsletter-dialog-head>button,.admin-photo-button {font-size: var(--admin-text-title);font-weight: 400;display: grid;place-items: center;flex: none;width: 44px;height: 44px;min-width: 44px;padding: 0;border: 0;background: transparent;border-radius: var(--admin-radius);color: var(--muted);}
.dialog-close:hover,.newsletter-dialog-head>button:hover,.admin-photo-button:hover {background: var(--admin-selected);}
.dialog-actions {background: var(--paper);gap: 12px;flex-wrap: wrap;}
.newsletter-dialog {width: min(920px,calc(100vw - 32px));max-height: calc(100dvh - 32px);overflow: auto;}
.newsletter-dialog-head,.admin-photo-header {position: sticky;top: 0;z-index: 5;background: var(--paper);padding: 16px 24px;gap: 12px;min-height: 77px;}
.newsletter-photo-grid {max-height: none;}
.newsletter-photo-dialog .newsletter-photo-grid {max-height: none;min-height: 0;}
.newsletter-full-preview {height: calc(100dvh - 32px);overflow: hidden;}
.newsletter-full-preview iframe {height: 100%;min-height: 0;}
.newsletter-preview-text {background: var(--paper);color: var(--ink);font-size: var(--admin-text-body);font-weight: 400;line-height: 1.6;}
.admin-photo-button {border: 1px solid var(--line);background: var(--paper);}
.login-card {border-radius: var(--admin-card-radius);background: var(--paper);box-shadow: none;}
.login-card h1 {font-size: var(--admin-text-title);font-weight: 500;}
.login-card label {font-size: var(--admin-text-small);font-weight: 500;}

@media(max-width:1250px) {
  .mobile-cards tbody>tr:not(.activity-detail):not(.order-detail) {border-color: var(--line);border-radius: var(--admin-card-radius);background: var(--paper);}
  .mobile-cards .mobile-cell {font-size: var(--admin-text-body);border-bottom: 0;padding: 8px 18px;}
  .mobile-cards .mobile-cell::before {font-size: var(--admin-text-small);font-weight: 400;color: var(--muted);line-height: 1.8;}
  .mobile-cards tr>.mobile-cell:first-child {padding: 16px 18px 10px;border-bottom: 0;}
  .mobile-cards tr>.mobile-cell:last-child {padding-bottom: 16px;}
  .mobile-cards .activity-detail,.mobile-cards .order-detail {background: var(--chalk);border-color: var(--line);border-radius: 0 0 var(--admin-card-radius) var(--admin-card-radius);}
  .sortable-table .sort-column,.newsletter-table .sort-column {font-size: var(--admin-text-small);min-height: 44px;border-radius: var(--admin-radius);padding: 10px 12px;border-color: var(--line);background: var(--paper);}
}
@media(max-width:900px) {
  .content {padding: 24px 20px 48px;}
  .topbar {padding: 10px 20px;min-height: 52px;}
  .sidebar {padding: 14px 20px;}
  .sidebar-header .brand {gap: 12px;}
  .sidebar[data-menu-open=true] {background: var(--chalk);}
  .sidebar[data-menu-open=true] nav a,.sidebar[data-menu-open=true] .sidebar-bottom>a {font-size: var(--admin-text-section);font-weight: 400;min-height: 60px;}
  .sidebar[data-menu-open=true] a.active {font-weight: 500;}
  .page-head {align-items: flex-start;gap: 16px;}
  .section-heading {align-items: flex-start;}
  .section-actions {width: 100%;}
  .filters,.section-tabs {max-width: 100%;flex-wrap: wrap;}
  .order-toolbar {align-items: stretch;}
  .order-search-label {display: grid;gap: 8px;width: 100%;white-space: normal;}
  .order-search-label input {width: 100%;}
  .analytics-unlinked .analytics-heading {flex: 1;}
  .analytics-panel.analytics-unlinked {flex-wrap: wrap;align-items: flex-start;}
  .analytics-unlinked #analytics-chart {flex: none;}
  .shop-product-item>summary {flex-wrap: wrap;gap: 10px;padding: 16px;}
  .product-summary-copy {flex-basis: 50%;}
  .product-image-state {max-width: 100%;}
  .shop-product-item>summary::after {margin-left: auto;}
  .product-summary-state {font-size: var(--admin-text-small);}
  .product-image-state:not([hidden]) {order: 4;flex-basis: 100%;}
  .setting-state {max-width: 38%;}
  .course-field-grid {grid-template-columns: 1fr;gap: 0;}
  .shop-order-form {grid-template-columns: 1fr;}
  .analytics-table-wrap {overflow: visible;}
  .analytics-table-wrap table,.analytics-table-wrap tbody,.analytics-table-wrap tr,.analytics-table-wrap td {display: block;width: 100%;min-width: 0;}
  .analytics-table-wrap thead {display: none;}
  .analytics-table-wrap tbody tr {border-bottom: 1px solid var(--line);padding: 12px 0;}
  .analytics-table-wrap td {padding: 4px 0;border: 0;overflow-wrap: anywhere;}
  .analytics-table-wrap td::before {content: attr(data-label);display: block;font-size: var(--admin-text-small);color: var(--muted);}
  .analytics-table-wrap td+td {font-size: var(--admin-text-small);color: var(--muted);}
}
@media(max-width:620px) {
  .stats {grid-template-columns: 1fr;}
  .stats article {padding: 20px;}
  .stats article+article {border-left: 0;border-top: 1px solid var(--line);}
  .page-head h1 {font-size: var(--admin-text-title);}
  .page-head .small-primary {font-size: var(--admin-text-body);min-height: 44px;}
  .settings-quick {padding: 20px;}
  .setting-panel>summary {padding: 16px;gap: 12px;}
  .setting-body {padding: 20px;}
  .setting-title {font-size: var(--admin-text-body);}
  .setting-state {font-size: var(--admin-text-small);}
  .setting-icon {width: 20px;height: 20px;}
  .analytics-totals {grid-template-columns: 1fr;gap: 12px;}
  .info-grid {grid-template-columns: 1fr;gap: 24px;}
  .newsletter-actions {display: grid;grid-template-columns: repeat(2,minmax(0,1fr));gap: 10px;}
  .newsletter-actions button {width: 100%;}
  .newsletter-head-actions {display: grid;grid-template-columns: 1fr;width: 100%;gap: 10px;}
  .newsletter-head-actions button {width: 100%;}
  .newsletter-editor-heading {padding: 20px;gap: 12px;}
  .newsletter-editor.settings-card {padding: 20px;}
  .newsletter-inline {grid-template-columns: 1fr;}
  .newsletter-dialog-head,.admin-photo-header {padding: 12px 20px;min-height: 77px;}
  .newsletter-photo-option span {font-size: var(--admin-text-small);}
  .dialog-actions>* {flex: 1;}
  .test-booking-row {gap: 12px;}
}
@media(prefers-reduced-motion:reduce) {
  .admin-menu-toggle span,.icon-button,.collection-dropzone {transition: none;}
}

.terms-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.setting-body #terms-form .terms-fields>label{display:flex;flex-direction:column;gap:6px;margin:0}.setting-body #terms-form .terms-fields input{width:100%;min-width:0}.terms-preview{white-space:pre-wrap;line-height:1.6;max-width:75ch;margin:20px 0}.setting-body #terms-form textarea{width:100%}.setting-body #terms-form label{display:block;margin:12px 0}.order-fulfillment form{display:grid;gap:10px}.order-fulfillment label{display:block}.order-fulfillment input[type=checkbox]{margin-right:8px}.order-fulfillment details{margin-top:20px}@media(max-width:700px){.terms-fields{grid-template-columns:1fr}}
