/* Mobile first: one application, fluid layout and touch targets at every size. */
:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #24352f;
  background: #f5f7f5;
  font-synthesis: none;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, select { font: inherit; }
a, button, summary, select { touch-action: manipulation; }
a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible {
  outline: 3px solid #b36518;
  outline-offset: 3px;
}
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 10; background: white; padding: 12px; }
.skip-link:focus { top: 12px; }
.sidebar { position: relative; background: #183e33; color: #eef5f0; padding: 20px; }
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; font-size: 19px; font-weight: 600; width: fit-content; }
.brand-mark { display: grid; place-items: center; border: 1px solid #73968a; border-radius: 12px; width: 48px; height: 48px; letter-spacing: -2px; font-size: 24px; }
.brand small { display: block; font-size: 12px; letter-spacing: 2px; color: #b4c9bf; }
.menu-toggle { display: block; width: 100%; min-height: 48px; margin-top: 20px; border: 1px solid #73968a; border-radius: 7px; background: #295143; color: white; cursor: pointer; }
.nav-label, .sidebar-footer { display: none; }
nav { display: none; margin-top: 12px; }
.is-open nav { display: block; }
nav a, summary { min-height: 48px; padding: 12px; display: flex; align-items: center; gap: 10px; border-radius: 7px; text-decoration: none; font-size: 15px; overflow-wrap: normal; word-break: normal; hyphens: none; }
summary { cursor: pointer; list-style: none; }
summary > span:first-child, summary::after { flex-shrink: 0; }
.nav-title { flex: 1; min-width: 0; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '⌄'; margin-left: auto; }
details[open] summary::after { content: '⌃'; }
details > a { margin: 3px 0 3px 20px; color: #d7e5dd; }
.active { background: #365d4f; color: white; }
.workspace { min-width: 0; }
.topbar { min-height: 82px; border-bottom: 1px solid #dfe6df; background: #fff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 16px 20px; font-size: 14px; gap: 12px; }
.version { color: #708078; margin-left: 10px; font-size: 12px; }
.role-control[hidden] { display: none; }
.role-control { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: #5d6e64; font-size: 14px; max-width: 100%; }
select { min-height: 48px; max-width: 100%; font-size: 16px; background: #f5f7f5; border: 1px solid #ccd7ce; border-radius: 6px; padding: 10px; color: #24352f; }
main { max-width: 1450px; margin: auto; padding: 30px 20px; min-height: calc(100vh - 150px); overflow-wrap: anywhere; }
main:focus { outline: none; }
.eyebrow { color: #577765; font-size: 12px; font-weight: 700; letter-spacing: 2px; margin: 0 0 10px; }
h1 { font-size: clamp(28px, 3vw, 40px); font-weight: 550; letter-spacing: -1px; margin: 0 0 12px; line-height: 1.2; }
.intro { color: #6a786e; font-size: 16px; margin: 0 0 28px; }
.section-heading { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 18px; }
h2 { font-size: 18px; font-weight: 600; margin: 0; }
.section-heading > span { font-size: 14px; color: #64746a; }
.module-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.module-card { min-width: 0; background: white; border: 1px solid #dfe6df; border-radius: 12px; padding: 22px; box-shadow: 0 3px 8px #1d382b03; }
.card-top { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.module-icon { display: grid; place-items: center; width: 40px; height: 40px; background: #edf3ed; border-radius: 10px; color: #365d45; font-size: 23px; }
.module-code { font-size: 12px; color: #627368; border: 1px solid #e0e7df; padding: 3px 8px; border-radius: 4px; }
h3 { font-size: 19px; line-height: 1.4; margin: 0 0 10px; font-weight: 600; }
.module-card > p { font-size: 15px; color: #68766d; margin: 0 0 20px; }
.module-links { list-style: none; margin: 0; padding: 0; }
.module-links li + li { border-top: 1px solid #eef1ec; }
.module-links a { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-decoration: none; font-size: 16px; padding: 12px 0; }
.module-links a span { color: #6c8976; }
.external-note { display: block; font-size: 13px; color: #6a776e; padding-top: 12px; }
.demo-note { margin-top: 30px; border: 1px solid #dfe5dc; border-radius: 8px; background: #eef2eb; padding: 14px 18px; color: #5b6b5d; font-size: 14px; }
.back-link, main > a { display: inline-flex; align-items: center; min-height: 48px; font-size: 16px; }
.back-link { margin-bottom: 24px; text-decoration: none; }
.placeholder { background: white; border: 1px solid #dfe6df; border-radius: 12px; padding: 24px; margin-top: 30px; max-width: 800px; }
.badge { display: inline-block; background: #f4eddb; color: #79591b; padding: 4px 10px; border-radius: 4px; font-size: 14px; margin-bottom: 24px; }
.placeholder p { font-size: 16px; color: #65746a; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 18px 20px; color: #738075; font-size: 13px; border-top: 1px solid #e0e6df; }
/* Tablet: navigation stays collapsible to preserve workspace in portrait. */
@media (min-width: 700px) {
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding: 36px 28px; }
  .topbar { padding: 18px 28px; }
  .placeholder { padding: 36px; }
}
/* Large tablet / desktop: persistent sidebar, with independently scrollable menu. */
@media (min-width: 1100px) {
  .sidebar { width: 320px; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 34px 20px; overflow: auto; }
  .brand { padding: 0 8px 38px; }
  .menu-toggle { display: none; }
  .nav-label { display: block; font-size: 12px; letter-spacing: 1.8px; color: #a6bfb3; margin: 0 12px 16px; }
  nav, .is-open nav { display: block; margin-top: 0; }
  .sidebar-footer { display: block; margin-top: auto; padding: 40px 12px 0; font-size: 13px; color: #d0e0d7; }
  .sidebar-footer small { display: block; padding: 8px 0 0 14px; color: #a6bfb3; font-size: 12px; }
  .status-dot { display: inline-block; width: 6px; height: 6px; background: #a6d2af; border-radius: 50%; margin-right: 5px; }
  .workspace { margin-left: 320px; }
  main { padding: 48px 36px 30px; }
  .intro { margin-bottom: 42px; }
  footer { padding: 20px 36px; }
}
@media (min-width: 1400px) { .module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .module-card { padding: 30px; } }
@media (hover: hover) {
  nav a:hover, summary:hover, .menu-toggle:hover { background: #295143; }
  .module-links a:hover { color: #246743; text-decoration: underline; }
}
@media (prefers-reduced-motion: no-preference) { .module-card { transition: box-shadow .15s; } }

/* Club demo only: no layout changes to other workspaces. */
.club-management { min-width: 0; }
.club-demo-banner { margin: 24px 0; padding: 18px; background: #fff4db; border: 1px solid #dac58e; border-radius: 10px; color: #59471f; }
.club-demo-banner p { margin: 8px 0 0; font-size: 14px; }
.club-workspace { min-width: 0; background: white; border: 1px solid #dfe6df; border-radius: 12px; padding: 18px; }
.club-toolbar, .club-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.club-toolbar { justify-content: space-between; margin-bottom: 20px; }
.club-button { min-height: 48px; max-width: 100%; padding: 12px 16px; border: 1px solid #295143; border-radius: 7px; background: #295143; color: white; cursor: pointer; white-space: normal; overflow-wrap: anywhere; }
.club-secondary { background: white; color: #295143; }
.club-button:disabled { opacity: .6; cursor: wait; }
.club-search { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 20px 0; }
.club-search label { flex-basis: 100%; }
.club-search input { flex: 1; width: 100%; }
.club-management input, .club-management textarea { font: inherit; font-size: 16px; color: #24352f; padding: 12px; min-height: 48px; min-width: 0; max-width: 100%; border: 1px solid #8c9e92; border-radius: 6px; background: white; }
.club-management input:focus-visible, .club-management textarea:focus-visible { outline: 3px solid #b36518; outline-offset: 2px; }
.club-form { display: grid; gap: 12px; margin-top: 20px; max-width: 700px; }
.club-form label { font-weight: 600; }
.club-form textarea { resize: vertical; }
.club-field-help { margin: 0 0 12px; font-size: 14px; color: #526557; }
.club-status { background: #edf3ed; padding: 12px; border-radius: 6px; }
.club-error { color: #852c22; border-left: 4px solid #a54431; padding: 12px; background: #fff1ee; }
.club-details dt { font-weight: 600; margin-top: 18px; }
.club-details dd { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.club-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.club-table caption { text-align: left; font-size: 14px; padding: 12px 0; }
.club-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.club-table tbody, .club-table tr, .club-table td { display: block; }
.club-table tr { border: 1px solid #dfe6df; border-radius: 8px; padding: 12px; margin-bottom: 14px; }
.club-table td { padding: 8px 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.club-table td::before { content: attr(data-label); display: block; font-weight: 600; margin-bottom: 4px; }
@media (min-width: 900px) {
  .club-workspace { padding: 24px; }
  .club-table thead { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .club-table tbody { display: table-row-group; }
  .club-table tr { display: table-row; }
  .club-table td { display: table-cell; }
  .club-table th, .club-table td { padding: 14px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid #dfe6df; }
  .club-table td::before { display: none; }
}
.club-form select { width: 100%; min-width: 0; }
.club-search select { flex-basis: 100%; width: 100%; }
.condition-preview { padding: 18px; border: 2px solid #577765; border-radius: 8px; background: #f5f8f3; }
.condition-change { border-bottom: 1px solid #ccd7ce; padding-bottom: 16px; margin-bottom: 16px; }
.condition-change h4 { overflow-wrap: anywhere; }
.condition-confirmation { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 0; }
.condition-confirmation input { flex-shrink: 0; width: 24px; min-height: 24px; padding: 0; }
.condition-audit { margin-top: 20px; border-top: 1px solid #dfe6df; padding-top: 12px; }
.condition-audit summary { color: #24352f; }

.condition-confirmation span { min-width: 0; overflow-wrap: anywhere; }
