:root {
  --ink: #17363c;
  --muted: #718085;
  --brand: #0a3e4b;
  --brand-2: #126071;
  --gold: #bd985d;
  --canvas: #f4f6f4;
  --paper: #ffffff;
  --line: #dde4e1;
  --danger: #aa4741;
  --success: #337c64;
  --shadow: 0 18px 48px rgba(17, 49, 55, .08);
  --radius: 20px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100vh; margin: 0; background: var(--canvas); color: var(--ink); }
a { color: var(--brand-2); text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.35rem); font-weight: 500; letter-spacing: -.04em; line-height: 1.02; color: #153b42; }
h2 { margin-bottom: 8px; font-size: 1.15rem; }
p { color: var(--muted); line-height: 1.55; }
small { color: var(--muted); }

.app-shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; z-index: 40; display: flex; flex-direction: column; height: 100vh; padding: 26px 18px 20px; border-right: 1px solid rgba(255,255,255,.08); color: #eaf1ee; background: linear-gradient(175deg, #0b3f4b 0%, #082f38 70%, #072831 100%); }
.brand { display: inline-flex; width: 124px; height: 50px; align-items: center; overflow: hidden; }
.brand img { width: 124px; filter: brightness(0) invert(1); }
.workspace-switcher { display: flex; flex-direction: column; gap: 4px; margin: 22px 0 20px; padding: 13px 14px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(255,255,255,.06); }
.workspace-switcher span { color: #a9c0c1; font-size: .66rem; letter-spacing: .13em; text-transform: uppercase; }
.workspace-switcher strong { overflow: hidden; font-size: .89rem; text-overflow: ellipsis; white-space: nowrap; }
.main-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link { display: flex; width: 100%; align-items: center; gap: 11px; padding: 10px 12px; border: 0; border-radius: 10px; color: #bad0d0; background: transparent; font-size: .88rem; font-weight: 600; text-align: left; transition: .18s ease; }
.nav-link > span { display: grid; width: 24px; height: 24px; place-items: center; color: #a8c4c3; font-size: 1rem; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-link.active { box-shadow: inset 3px 0 #cfaa6d; }
.sidebar-footer { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.profile-chip { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 9px; margin-top: 12px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,.1); }
.profile-chip > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.profile-chip strong { overflow: hidden; color: white; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.profile-chip small { color: #8eb0b0; font-size: .66rem; }
.avatar { display: inline-grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: white; background: #be9660; font-size: .77rem; font-weight: 800; }
.avatar.small { width: 30px; height: 30px; font-size: .65rem; }
.avatar.large { width: 48px; height: 48px; font-size: 1rem; }
.icon-button { border: 0; color: #9ebbbb; background: transparent; font-size: 1.1rem; }
.mobile-header { display: none; }
.main-area { min-width: 0; }
.page-content { width: min(1480px, 100%); margin: 0 auto; padding: 48px clamp(24px, 4vw, 68px) 90px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 32px; }
.page-header p { max-width: 700px; margin-bottom: 0; }
.eyebrow { display: block; margin-bottom: 10px; color: var(--gold); font-size: .67rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }

.primary-button, .secondary-button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 18px; padding: 11px 18px; border: 1px solid var(--brand); border-radius: 10px; font-weight: 750; transition: .18s ease; }
.primary-button { color: #fff; background: var(--brand); box-shadow: 0 8px 20px rgba(10,62,75,.15); }
.primary-button:hover { background: var(--brand-2); transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .58; }
.secondary-button { color: var(--brand); background: transparent; }
.secondary-button:hover { background: #e7efed; }
.primary-button.fit, .secondary-button.fit { width: fit-content; }
.text-button, .close-link { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); }
.close-link { font-size: 2rem; font-weight: 200; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 10px 34px rgba(32,58,61,.045); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-header h2, .panel-header p { margin: 0; }
.panel-header > a { font-size: .8rem; font-weight: 700; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.quick-card { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px; min-height: 92px; padding: 17px; border: 1px solid rgba(20,58,64,.07); border-radius: 16px; color: var(--ink); transition: .2s ease; }
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.quick-card.mint { background: #e7f0ec; }
.quick-card.gold { background: #f4ecdd; }
.quick-card.sky { background: #e6eef0; }
.quick-card.rose { background: #f2e8e4; }
.quick-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 12px; color: white; background: var(--brand); font-size: 1.25rem; }
.quick-card > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.quick-card small { margin-bottom: 4px; font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; }
.quick-card strong { font-family: Georgia, serif; font-size: 1.05rem; font-weight: 500; }
.quick-card b { font-weight: 400; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr); gap: 20px; }
.dashboard-columns > .panel { padding: 24px; }
.timeline { display: flex; flex-direction: column; }
.timeline-row { display: grid; grid-template-columns: 76px 12px 1fr auto; align-items: start; gap: 14px; padding: 15px 0; border-top: 1px solid #edf0ef; }
.timeline-row time { padding-top: 3px; color: var(--muted); font-size: .72rem; }
.timeline-row i { width: 9px; height: 9px; margin-top: 5px; border: 2px solid white; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px #decaa9; }
.timeline-row div { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.timeline-row strong { font-size: .9rem; }
.timeline-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-flex; width: fit-content; align-items: center; padding: 5px 9px; border-radius: 999px; color: #526b6e; background: #e9efed; font-size: .65rem; font-weight: 800; }
.badge.paid { color: #276d56; background: #def1e7; }
.activity-list { display: flex; flex-direction: column; }
.activity-list > div { display: flex; gap: 11px; padding: 13px 0; border-top: 1px solid #edf0ef; }
.activity-list p { margin: 0; color: #52676b; font-size: .77rem; line-height: 1.4; }
.activity-list p strong { color: var(--ink); }
.activity-list small { display: block; margin-top: 4px; font-size: .66rem; }
.empty-state { display: flex; min-height: 250px; align-items: center; justify-content: center; flex-direction: column; padding: 36px; text-align: center; }
.empty-state > span { display: grid; width: 52px; height: 52px; margin-bottom: 15px; place-items: center; border-radius: 50%; color: var(--brand); background: #e7efed; font-size: 1.35rem; }
.empty-state h2, .empty-state h3 { margin-bottom: 5px; }
.empty-state p { max-width: 420px; margin-bottom: 0; }
.empty-state.compact { min-height: 110px; padding: 20px; }

.toast, .form-error { margin-bottom: 20px; padding: 13px 16px; border: 1px solid; border-radius: 10px; font-size: .85rem; }
.toast.success { color: #24624e; border-color: #b8dacc; background: #e5f3ec; }
.toast.error, .form-error { color: #8b3f3b; border-color: #e5beb8; background: #fae9e6; }
.editor-panel { margin-bottom: 26px; padding: 26px; border-color: #cddbd7; box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 7px; color: #3d555a; font-size: .75rem; font-weight: 700; }
label small { font-weight: 500; }
input, textarea, select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #ced8d5; border-radius: 9px; outline: 0; color: var(--ink); background: #fbfcfb; transition: border .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(18,96,113,.11); }
.check-label { min-height: 44px; align-items: center; flex-direction: row; align-self: end; padding: 10px 12px; border: 1px solid #d5dddb; border-radius: 9px; }
.check-label input, .module-checks input { width: 17px; min-height: 17px; accent-color: var(--brand); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; margin-top: 22px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 10px 0 18px; color: var(--muted); font-size: .78rem; }
.list-toolbar form { width: min(390px, 100%); }
.search-box { position: relative; display: block; }
.search-box span { position: absolute; top: 9px; left: 13px; z-index: 1; font-size: 1.1rem; }
.search-box input { padding-left: 40px; border-radius: 999px; background: white; }
.record-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.record-grid.notes-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.record-card { display: flex; min-height: 230px; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 8px 25px rgba(27,55,59,.035); transition: .18s ease; }
.record-card:hover { border-color: #c4d2ce; box-shadow: var(--shadow); transform: translateY(-2px); }
.record-card-top { display: flex; min-height: 28px; align-items: center; justify-content: space-between; gap: 10px; }
.record-card time { color: #879396; font-size: .67rem; }
.record-card h2 { margin: 14px 0 8px; font-family: Georgia, serif; font-size: 1.18rem; font-weight: 500; }
.record-card > p { display: -webkit-box; overflow: hidden; margin-bottom: 18px; color: #68787c; font-size: .8rem; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.meta-row { display: flex; gap: 12px; margin-top: auto; padding-top: 12px; border-top: 1px solid #edf0ef; color: var(--muted); font-size: .68rem; }
.record-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; margin-top: auto; padding-top: 14px; }
.record-actions a, .record-actions button { padding: 0; border: 0; color: var(--brand-2); background: none; font-size: .7rem; font-weight: 750; }
.record-actions form { display: inline-flex; }
.record-actions button.danger-link, .danger-link { color: var(--danger); }

.three-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; margin-bottom: 24px; }
.action-details { padding: 0; overflow: hidden; }
.action-details summary { padding: 18px 20px; color: var(--brand); font-size: .86rem; font-weight: 800; cursor: pointer; list-style: none; }
.action-details summary::-webkit-details-marker { display: none; }
.action-details[open] summary { border-bottom: 1px solid var(--line); background: #f7f9f8; }
.action-details form { display: flex; flex-direction: column; gap: 13px; padding: 19px; }
.session-columns { grid-template-columns: minmax(0, 1.8fr) minmax(260px, .7fr); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .76rem; }
th { padding: 10px 12px; color: #899597; font-size: .62rem; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 13px 12px; border-top: 1px solid #e8eceb; color: #526569; white-space: nowrap; }
td strong, td small { display: block; }
td strong { color: var(--ink); }
td a { font-weight: 700; }
.client-list { display: flex; flex-direction: column; }
.client-list article { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; padding: 13px 0; border-top: 1px solid #e8eceb; }
.client-list article > div { display: flex; min-width: 0; flex-direction: column; }
.client-list strong { font-size: .78rem; }
.client-list small { margin-top: 3px; font-size: .65rem; }
.client-list a { font-size: .67rem; font-weight: 700; }
.metric-grid { display: grid; gap: 14px; margin-bottom: 23px; }
.metric-grid.three { grid-template-columns: repeat(3, 1fr); }
.metric-card { display: flex; min-height: 100px; justify-content: center; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.metric-card small { margin-bottom: 8px; font-size: .68rem; text-transform: uppercase; }
.metric-card strong { font-family: Georgia, serif; font-size: 1.5rem; font-weight: 500; }
.positive { color: var(--success); }
.negative { color: var(--danger); }
.notice { margin-bottom: 20px; padding: 22px; border-color: #e0c99e; background: #fbf5e9; }
.notice p { margin: 5px 0 0; }
.simple-list > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 0; border-top: 1px solid #e8eceb; }
.simple-list span { display: flex; flex-direction: column; }
.simple-list strong { font-size: .8rem; }
.simple-list small { margin-top: 3px; font-size: .65rem; }
.simple-list b { font-family: Georgia, serif; font-weight: 500; }
.back-link { display: block; margin-bottom: 20px; color: var(--muted); font-size: .76rem; }

.upload-zone { margin-bottom: 24px; padding: 24px; }
.upload-zone form { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; }
.drop-label { display: grid; width: 100%; grid-template-columns: 54px 1fr; align-items: center; padding: 0; border: 0; color: inherit; background: transparent; column-gap: 15px; cursor: pointer; text-align: left; }
.drop-label strong, .drop-label small { grid-column: 2; }
.drop-label small { font-weight: 400; }
.media-file-input { position: fixed; left: -10000px; width: 1px; height: 1px; min-height: 1px; padding: 0; opacity: 0; pointer-events: none; }
.upload-icon { grid-row: 1 / span 2; display: grid; width: 52px; height: 52px; place-items: center; border: 1px dashed var(--brand-2); border-radius: 50%; color: var(--brand); background: #edf4f2; font-size: 1.3rem; }
.drop-label.has-selection .upload-icon { border-style: solid; color: #fff; background: var(--brand); }
.file-selection-status { grid-column: 1 / -1; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 10px; padding: 14px; border: 1px solid #b9d8ce; border-radius: 11px; color: var(--brand); background: #edf7f3; font-size: .76rem; }
.file-selection-status[hidden] { display: none; }
.file-selection-status > span { display: grid; flex: 0 0 24px; width: 24px; height: 24px; place-items: center; border-radius: 50%; color: #fff; background: var(--brand); font-weight: 900; }
.file-selection-status > div { min-width: 0; }
.selected-media-list { display: grid; max-height: 260px; gap: 6px; margin: 11px 0 0; padding: 0; overflow-y: auto; list-style: none; }
.selected-media-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) 30px; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid rgba(10,62,75,.09); border-radius: 9px; background: rgba(255,255,255,.72); }
.selected-media-item > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.selected-media-item strong, .selected-media-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-media-item strong { color: var(--ink); font-size: .72rem; }
.selected-media-item small { font-size: .63rem; font-weight: 500; }
.selected-media-marker { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: #fff; background: #8ba6a2; font-weight: 900; }
.selected-media-item.is-uploading .selected-media-marker { background: var(--gold); }
.selected-media-item.is-complete .selected-media-marker { background: var(--success); }
.selected-media-item.is-error .selected-media-marker { background: var(--danger); }
.selected-media-item > button { width: 30px; height: 30px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 1.15rem; }
.selection-actions { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 11px; }
.selection-actions button { padding: 0; border: 0; color: var(--brand-2); background: transparent; font-size: .68rem; font-weight: 800; }
.selection-actions button:last-child { color: var(--danger); }
.upload-progress { grid-column: 1 / -1; }
.upload-progress > div { height: 6px; overflow: hidden; border-radius: 9px; background: #e5e9e7; }
.upload-progress > div > span { display: block; width: 0; height: 100%; background: var(--brand); transition: width .15s; }
.upload-progress p { margin: 7px 0 0; font-size: .72rem; }
.upload-progress.has-error > div { display: none; }
.upload-progress.has-error p { color: var(--danger); font-weight: 700; }
.media-picker-open { overflow: hidden; }
.media-source-sheet { position: fixed; inset: 0; z-index: 100; display: grid; align-items: end; justify-items: center; padding: 18px; }
.media-source-sheet[hidden] { display: none; }
.media-source-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(6,31,37,.55); backdrop-filter: blur(3px); }
.media-source-panel { position: relative; display: grid; width: min(520px, 100%); gap: 8px; padding: 13px 16px 16px; border: 1px solid rgba(255,255,255,.75); border-radius: 22px; background: #fff; box-shadow: 0 28px 80px rgba(3,30,36,.28); }
.sheet-handle { display: block; width: 42px; height: 5px; margin: 0 auto 5px; border-radius: 999px; background: #d7dfdd; }
.media-source-panel header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 2px 4px 9px; }
.media-source-panel header small { color: var(--gold); font-size: .58rem; font-weight: 900; letter-spacing: .12em; }
.media-source-panel h2 { margin: 2px 0 0; font-family: Georgia, serif; font-size: 1.38rem; font-weight: 500; }
.sheet-close { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: #eef2f1; font-size: 1.35rem; }
.media-source-option { display: grid; width: 100%; grid-template-columns: 42px minmax(0, 1fr) 20px; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #fbfcfb; text-align: left; }
.media-source-option > span:first-child { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 11px; color: #fff; background: var(--brand); font-size: 1.05rem; }
.media-source-option > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.media-source-option strong { font-size: .8rem; }
.media-source-option small { font-size: .65rem; font-weight: 500; }
.media-source-option b { color: #9bacaa; font-size: 1.4rem; font-weight: 400; }
.media-source-cancel { min-height: 44px; margin-top: 3px; border: 0; border-radius: 11px; color: var(--brand); background: #edf3f1; font-weight: 800; }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.media-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: white; }
.media-preview { display: grid; aspect-ratio: 16 / 10; place-items: center; overflow: hidden; color: #fff; background: linear-gradient(140deg, #234f58, #0b3038); font-family: Georgia, serif; font-size: 1.3rem; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; transition: .25s ease; }
.media-card:hover img { transform: scale(1.03); }
.media-card > div { padding: 14px; }
.media-card > div > strong, .media-card > div > small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card > div > strong { font-size: .78rem; }
.media-card > div > small { margin-top: 5px; font-size: .64rem; }
.media-view-header { align-items: flex-end; }
.media-view-header h1 { overflow-wrap: anywhere; }
.media-view-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.media-view-actions .primary-button, .media-view-actions .secondary-button { white-space: nowrap; }
.media-viewer { display: grid; min-height: min(68vh, 760px); padding: 16px; place-items: center; overflow: hidden; background: #102f36; }
.media-viewer img, .media-viewer video { display: block; max-width: 100%; max-height: 72vh; border-radius: 10px; object-fit: contain; }
.media-viewer video { width: 100%; }
.media-viewer iframe { width: 100%; min-height: 72vh; border: 0; border-radius: 10px; background: #fff; }
.media-viewer .empty-state { color: #fff; }
.media-viewer .empty-state p { color: #c8d5d3; }
.audio-viewer { display: grid; width: min(620px, 100%); gap: 24px; place-items: center; }
.audio-viewer > span { color: #fff; font: 500 4rem Georgia, serif; }
.audio-viewer audio { width: 100%; }
.is-saving { opacity: .7; pointer-events: none; }

.team-create { margin-bottom: 22px; }
.module-checks { display: flex; flex-wrap: wrap; gap: 11px 19px; padding: 14px; border: 1px solid #d6dedc; border-radius: 10px; }
.module-checks legend { padding: 0 6px; color: var(--muted); font-size: .67rem; font-weight: 800; text-transform: uppercase; }
.module-checks label { align-items: center; flex-direction: row; font-size: .72rem; }
.member-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.member-card { padding: 22px; }
.member-identity { display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 13px; }
.member-identity h2, .member-identity p { margin: 0; }
.member-identity h2 { font-family: Georgia, serif; font-size: 1.1rem; font-weight: 500; }
.member-identity p { margin-top: 4px; font-size: .7rem; }
.role-badge { padding: 5px 9px; border-radius: 999px; color: var(--brand); background: #e3efec; font-size: .65rem; font-weight: 800; }
.owner-note { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.member-controls { display: grid; grid-template-columns: 120px 1fr auto; align-items: end; gap: 14px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.member-controls .module-checks { min-width: 0; }
.profile-columns { grid-template-columns: minmax(260px,.7fr) minmax(0,1.3fr); }
.profile-summary { align-content: start; display: grid; grid-template-columns: 52px 1fr; gap: 14px; }
.profile-summary h2, .profile-summary p { margin: 0; }
.profile-summary dl { grid-column: 1 / -1; margin: 20px 0 0; }
.profile-summary dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.profile-summary dt { color: var(--muted); font-size: .72rem; }
.profile-summary dd { margin: 0; font-size: .75rem; font-weight: 800; }
.password-panel form { display: flex; flex-direction: column; gap: 14px; }

.error-page { width: min(580px, 100%); margin: 10vh auto; text-align: center; }
.error-page > span { display: grid; width: 64px; height: 64px; margin: 0 auto 18px; place-items: center; border-radius: 50%; color: var(--danger); background: #f8e9e6; font: 500 2rem Georgia,serif; }
.error-page .primary-button { margin: 20px auto 0; }

.auth-body { display: grid; min-height: 100vh; place-items: center; padding: 30px; background: radial-gradient(circle at 12% 9%, rgba(198,164,109,.19), transparent 25%), linear-gradient(120deg, #082f38 0 48%, #eef1ed 48%); }
.auth-shell { width: min(1080px, 100%); }
.auth-card { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 650px; overflow: hidden; border: 1px solid rgba(255,255,255,.16); border-radius: 26px; background: rgba(7,44,52,.94); box-shadow: 0 30px 90px rgba(5,32,37,.27); }
.auth-brand { position: absolute; z-index: 2; padding: 34px 38px; }
.auth-brand img { width: 118px; filter: brightness(0) invert(1); }
.auth-copy { display: flex; justify-content: center; flex-direction: column; padding: 120px 60px 60px; color: white; background: linear-gradient(rgba(8,50,59,.55), rgba(8,50,59,.95)), radial-gradient(circle at 30% 20%, #1e6873, transparent 50%); }
.auth-copy h1 { color: white; font-size: clamp(2.3rem, 4vw, 3.45rem); }
.auth-copy p { max-width: 430px; color: #b6ccca; }
.auth-points { display: flex; flex-direction: column; gap: 11px; margin-top: 25px; color: #d7e4e1; font-size: .78rem; }
.auth-points span::first-letter { color: var(--gold); }
.auth-form { display: flex; justify-content: center; flex-direction: column; gap: 18px; padding: 70px 58px; background: #fff; }
.auth-form h2 { margin-bottom: 6px; font: 500 2rem Georgia,serif; }
.auth-form > div > p { margin: 0; font-size: .82rem; }
.auth-form .primary-button { width: 100%; justify-content: space-between; margin-top: 6px; }
.auth-form > small { text-align: center; font-size: .68rem; }
.setup-card { position: relative; overflow: hidden; border-radius: 26px; background: #fff; box-shadow: 0 30px 90px rgba(5,32,37,.27); }
.setup-card .auth-brand { position: static; padding-bottom: 0; background: var(--brand); }
.setup-card .setup-form { padding-top: 40px; }

@media (max-width: 1180px) {
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .record-grid, .record-grid.notes-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .media-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .member-list { grid-template-columns: 1fr; }
  .member-controls { grid-template-columns: 120px 1fr; }
  .member-controls button { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; width: 280px; transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 35; display: none; background: rgba(8,29,33,.5); }
  .sidebar-open .sidebar-scrim { display: block; }
  .mobile-header { position: sticky; top: 0; z-index: 30; display: flex; height: 64px; align-items: center; justify-content: space-between; padding: 10px 18px; border-bottom: 1px solid var(--line); background: rgba(244,246,244,.94); backdrop-filter: blur(14px); }
  .mobile-header img { width: 80px; }
  .menu-button { width: 38px; height: 38px; border: 0; color: var(--brand); background: transparent; font-size: 1.25rem; }
  .page-content { padding: 30px 18px 80px; }
  .dashboard-columns, .session-columns { grid-template-columns: 1fr; }
  .profile-columns { grid-template-columns: 1fr; }
  .three-form-grid { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .auth-body { padding: 0; background: var(--brand); }
  .auth-card { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .auth-copy { min-height: 350px; padding: 110px 32px 46px; }
  .auth-form { padding: 48px 32px; }
  .setup-card { min-height: 100vh; border-radius: 0; }
}

@media (max-width: 600px) {
  h1 { font-size: 2.1rem; }
  .page-header { align-items: flex-start; flex-direction: column; margin-bottom: 24px; }
  .page-header .primary-button { width: 100%; }
  .quick-grid { grid-template-columns: 1fr; }
  .quick-card { min-height: 80px; }
  .dashboard-columns > .panel, .editor-panel { padding: 18px; }
  .form-grid, .form-grid.two { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .record-grid, .record-grid.notes-grid, .media-grid { grid-template-columns: 1fr; }
  .record-card { min-height: 205px; }
  .list-toolbar { align-items: stretch; flex-direction: column; }
  .timeline-row { grid-template-columns: 62px 10px 1fr; gap: 9px; }
  .timeline-row .badge { display: none; }
  .metric-grid.three { grid-template-columns: 1fr; }
  .upload-zone form { grid-template-columns: 1fr; }
  .upload-zone .primary-button { width: 100%; }
  .media-view-actions { display: grid; width: 100%; grid-template-columns: 1fr 1fr; }
  .media-view-actions .primary-button, .media-view-actions .secondary-button { justify-content: center; }
  .media-viewer { min-height: 55vh; padding: 8px; }
  .media-viewer iframe { min-height: 68vh; }
  .member-identity { grid-template-columns: 48px 1fr; }
  .role-badge { grid-column: 2; width: fit-content; }
  .member-controls { grid-template-columns: 1fr; }
  .member-controls button { grid-column: auto; }
  .module-checks { gap: 10px; }
  .auth-copy { min-height: 310px; }
  .auth-copy h1 { font-size: 2.45rem; }
  .auth-points { display: none; }
  .auth-form { padding: 42px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
