/* Shared identity and preparation foundations. */
:root {
  color-scheme: light;
  --surface-0: #f7f8fb; --surface-1: #f2f4f8;
  --surface-2: #fff; --surface-3: #fff;
  --ink: #202738; --muted: #677083; --line: #e2e6ee;
  --control-border: #c6cdda; --accent: #3f4f99;
  --accent-hover: #34427f; --accent-soft: #eef0f8; --accent-line: #d6ddef;
  --focus-ring: #596bb0; --on-accent: #fff;
  --good: #326b51; --good-soft: #edf5f0; --good-line: #cbded3;
  --warn: #855e24; --warn-soft: #faf3e5; --warn-line: #e5d5b5;
  --danger: #a43844; --danger-soft: #f8eaed; --danger-line: #e6c9cf;
  --shadow-soft: 0 3px 18px hsl(228 24% 28% / .035);
  --backdrop: hsl(228 24% 18% / .46);
  --weight-regular: 400; --weight-book: 450; --weight-medium: 500;
  --weight-nav: 550; --weight-label: 600; --weight-semibold: 650;
  --weight-bold: 700; --weight-brand: 750;
  --bg: var(--surface-0); --paper: var(--surface-2); --soft: var(--surface-1);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px; font-weight: var(--weight-regular); line-height: 1.6;
  color: var(--ink); background: var(--bg); font-synthesis: none;
  font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: hsl(228 16% 10%); --surface-1: hsl(228 16% 12%);
  --surface-2: hsl(228 16% 14%); --surface-3: hsl(228 16% 16%);
  --ink: #e0e4ef; --muted: #a3adc2; --line: hsl(228 28% 72% / .13);
  --control-border: hsl(228 28% 72% / .2); --accent: #a5b4f4;
  --accent-hover: #bcc8ff; --accent-soft: #29324c; --accent-line: #3a476b;
  --focus-ring: #9aaef1; --on-accent: #202a4b;
  --good: #a1ceb3; --good-soft: #22382f; --good-line: #385748;
  --warn: #dcc198; --warn-soft: #383125; --warn-line: #554833;
  --danger: #eba5b0; --danger-soft: #3b2831; --danger-line: #60404a;
  --shadow-soft: 0 3px 18px hsl(228 30% 7% / .14);
  --backdrop: hsl(228 24% 7% / .6);
  --weight-regular: 360; --weight-book: 410; --weight-medium: 460;
  --weight-nav: 510; --weight-label: 560; --weight-semibold: 610;
  --weight-bold: 660; --weight-brand: 710;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  color-scheme: dark;
  --surface-0: hsl(228 16% 10%); --surface-1: hsl(228 16% 12%);
  --surface-2: hsl(228 16% 14%); --surface-3: hsl(228 16% 16%);
  --ink: #e0e4ef; --muted: #a3adc2; --line: hsl(228 28% 72% / .13);
  --control-border: hsl(228 28% 72% / .2); --accent: #a5b4f4;
  --accent-hover: #bcc8ff; --accent-soft: #29324c; --accent-line: #3a476b;
  --focus-ring: #9aaef1; --on-accent: #202a4b;
  --good: #a1ceb3; --good-soft: #22382f; --good-line: #385748;
  --warn: #dcc198; --warn-soft: #383125; --warn-line: #554833;
  --danger: #eba5b0; --danger-soft: #3b2831; --danger-line: #60404a;
  --shadow-soft: 0 3px 18px hsl(228 30% 7% / .14);
  --backdrop: hsl(228 24% 7% / .6);
  --weight-regular: 360; --weight-book: 410; --weight-medium: 460;
  --weight-nav: 510; --weight-label: 560; --weight-semibold: 610;
  --weight-bold: 660; --weight-brand: 710;
  }
}
html { -webkit-text-size-adjust: 100%; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, summary, a { -webkit-tap-highlight-color: transparent; }
button, summary, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--accent); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--surface-3), 0 0 0 4px var(--focus-ring); }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
h1, h2, h3, h4, h5, h6, strong, b, th { font-weight: var(--weight-bold); }
p, li, dd, .message-content { text-wrap: pretty; }
h1 { font-size: clamp(1.6rem, 3vw, 2rem); line-height: 1.35; letter-spacing: -.035em; }
h2 { font-size: 1.15rem; line-height: 1.4; }
h3 { font-size: 1rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
label { display: block; font-size: .88rem; font-weight: var(--weight-label); }
input:not([type="checkbox"]), select, textarea { display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 44px; padding: .65rem .8rem; color: var(--ink); background: var(--surface-3); border: 1px solid transparent; border-radius: 11px; box-shadow: inset 0 0 0 1px var(--control-border); outline: none; transition: box-shadow .15s ease, background .15s ease; }
input:not([type="checkbox"]):hover, select:hover, textarea:hover { background: var(--surface-3); }
input:not([type="checkbox"]):focus, select:focus, textarea:focus { outline: none; border-color: transparent; box-shadow: 0 0 0 2px var(--surface-3), 0 0 0 4px var(--focus-ring); }
input[readonly] { background: var(--soft); }
textarea { resize: vertical; line-height: 1.6; }
input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--accent); margin: 3px 0 0; }
input[type="date"] { appearance: none; min-height: 46px; }
summary { cursor: pointer; min-height: 44px; display: list-item; align-content: center; padding: .6rem 0; font-size: .86rem; font-weight: var(--weight-label); }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { width: min(1440px, calc(100% - 3rem)); min-height: 84px; margin-inline: auto; padding-block: 1rem; display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.5rem; }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; text-decoration: none; color: var(--ink); font-size: 24px; font-weight: var(--weight-brand); line-height: 1.2; letter-spacing: -.7px; }
.brand::before { content: ""; width: 13px; height: 21px; margin-right: 10px; flex-shrink: 0; background: var(--accent); transform: skewX(-15deg); border-radius: 2px; }
.brand-caption { color: var(--muted); font-size: 13px; letter-spacing: 0; font-weight: var(--weight-book); margin-left: 17px; padding-left: 17px; border-left: 1px solid var(--line); }
.primary-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; margin-left: auto; }
.primary-nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: var(--weight-nav); white-space: nowrap; }
.primary-nav a:hover, .primary-nav a[aria-current] { color: var(--accent); }
.primary-nav a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--accent); }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: .35rem; min-width: 0; max-width: 320px; flex-wrap: wrap; }
.account-name { font-size: .85rem; max-width: 15rem; overflow-wrap: anywhere; margin-right: .6rem; }
.page { width: min(1440px, calc(100% - 3rem)); margin: 2rem auto 3rem; }
.card { background: var(--paper); border: 0; box-shadow: var(--shadow-soft); border-radius: 12px; padding: 1.4rem; min-width: 0; }
.eyebrow { display: block; font-size: .7rem; letter-spacing: .09em; color: var(--muted); font-weight: var(--weight-semibold); margin-bottom: .35rem; }
.muted { color: var(--muted); }
.small { font-size: .83rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; border: 1px solid transparent; border-radius: 9px; padding: .6rem 1rem; font-size: .88rem; font-weight: var(--weight-semibold); line-height: 1.4; text-align: center; text-decoration: none; overflow-wrap: anywhere; }
.primary { background: var(--accent); color: var(--on-accent); }
.primary:hover { background: var(--accent-hover); }
.secondary { background: var(--surface-1); color: var(--accent); }
.secondary:hover { background: var(--accent-soft); }
.quiet { background: transparent; color: var(--muted); }
.quiet:hover { background: var(--soft); color: var(--ink); }
.danger { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); }
.full-width { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: .5rem; }
/* Feedback stack: fixed above the bottom safe area. Confirmations auto-hide; failures stay
   in this stack until dismissed or cleared. Both live outside the document flow, so feedback
   never pushes the page content (the previous in-flow banner made the whole page jump). */
.feedback { position: fixed; z-index: 100; right: 0; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); left: 0;
  display: flex; flex-direction: column; align-items: center; gap: .5rem; padding-inline: 1rem; pointer-events: none; }
.toast { --toast-bg: var(--good-soft); --toast-line: var(--good-line); --toast-ink: var(--good);
  width: fit-content; max-width: 100%; padding: .8rem 1rem;
  border: 1px solid var(--toast-line); border-radius: 8px; background: var(--toast-bg); color: var(--toast-ink);
  font-size: .9rem; font-weight: var(--weight-medium); line-height: 1.6; overflow-wrap: anywhere;
  box-shadow: var(--shadow-soft), 0 8px 28px var(--backdrop); pointer-events: none; }
.toast[data-tone="neutral"] { --toast-bg: var(--surface-3); --toast-line: var(--line); --toast-ink: var(--ink); }
.toast[data-tone="error"] { --toast-bg: var(--danger-soft); --toast-line: var(--danger-line); --toast-ink: var(--danger); }
/* A workspace failure stays visible until closed; it is an overlay, not a layout block. */
.alert { width: fit-content; max-width: 100%; display: flex; align-items: flex-start; gap: .6rem;
  padding: .7rem .9rem; border: 1px solid var(--danger-line); border-radius: 8px;
  background: var(--danger-soft); color: var(--danger); font-size: .9rem; font-weight: var(--weight-medium);
  line-height: 1.6; overflow-wrap: anywhere; box-shadow: var(--shadow-soft), 0 8px 28px var(--backdrop); pointer-events: auto; }
.alert-close { flex: none; margin: -.2rem -.3rem -.2rem 0; min-width: 1.9rem; min-height: 1.9rem;
  border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit;
  font-size: 1.15rem; line-height: 1; cursor: pointer; }
.alert-close:hover { opacity: .7; }
@media (prefers-reduced-motion: no-preference) {
  .toast:not([hidden]), .alert:not([hidden]) { animation: toast-in 180ms ease-out; }
}
@keyframes toast-in { from { opacity: 0; transform: translateY(.6rem); } to { opacity: 1; transform: none; } }
.loading-note { text-align: center; color: var(--muted); margin: 4rem 0; }
.invite-panel { margin-bottom: 1.3rem; background: var(--accent-soft); border-color: var(--accent-line); display: flex; gap: 1.3rem; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.invite-panel h1 { font-size: 1.25rem; margin-bottom: .4rem; }
.invite-panel p { overflow-wrap: anywhere; }
#signed-in-accept p { font-size: .85rem; margin-bottom: .6rem; }
#invite-help { flex-basis: 100%; }
.auth-layout { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: clamp(2rem, 8vw, 8rem); max-width: 1000px; margin: 4rem auto; }
.welcome-copy h1 { font-size: clamp(2.2rem, 4.2vw, 3.4rem); line-height: 1.4; letter-spacing: -.055em; margin: 1.1rem 0 1.4rem; }
.welcome-copy > p { max-width: 27rem; font-size: 1rem; color: var(--muted); line-height: 1.9; }
.welcome-note { font-size: .8rem; margin-top: 2rem; color: var(--muted); display: flex; align-items: center; gap: .5rem; }
.status-dot { height: 7px; width: 7px; background: var(--accent); border-radius: 50%; }
.auth-card { padding: 2rem; }
.auth-card form > p { margin-top: .5rem; margin-bottom: 1.4rem; }
.auth-card label { margin: 1rem 0 .35rem; }
.auth-card button[type="submit"] { margin-top: 1.5rem; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; padding: .3rem; background: var(--soft); border-radius: 12px; margin-bottom: 1.5rem; }
.auth-switch .button { background: transparent; color: var(--muted); }
.auth-switch .active { background: var(--surface-3); color: var(--accent); box-shadow: var(--shadow-soft); }
.auth-help { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--line);
  /* Reserve two message lines (sized for the default hint at the narrowest card width) so an
     error/notice never changes the card height and never moves the page. */
  min-height: calc(2 * 1.6 * .83rem + 1.1rem + 1px); }
.auth-feedback { margin: 0; font-size: .78rem; line-height: 1.6; overflow-wrap: anywhere; }
.auth-feedback.error { color: var(--danger); }
.auth-feedback.good { color: var(--good); }
.password-dialog { box-shadow: 0 20px 80px var(--backdrop); width: min(460px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; padding: 1.5rem; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--paper); }
.password-dialog::backdrop { background: var(--backdrop); }
.password-dialog h2 + p { margin-top: .6rem; }
.password-dialog label { margin: 1rem 0 .35rem; }
.password-dialog .button-row { margin-top: 1.25rem; }
.password-dialog .button-row .button { flex: 1 1 auto; }
/* Fixed-height dialog error slot: the modal keeps its size when the message appears. */
.password-feedback { margin: .6rem 0 0; min-height: 2.6rem; }
.password-feedback-message { margin: 0; color: var(--danger); font-size: .8rem; line-height: 1.6; overflow-wrap: anywhere; }
.password-feedback + .button-row { margin-top: .6rem; }
.field-help { color: var(--muted); font-size: .75rem; margin-top: .4rem; line-height: 1.6; overflow-wrap: anywhere; }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.pill { flex-shrink: 0; display: inline-flex; align-items: center; border: 1px solid var(--accent-line); border-radius: 99px; background: var(--accent-soft); color: var(--accent); padding: .3rem .7rem; font-size: .74rem; font-weight: var(--weight-label); }
.context-bar { display: grid; grid-template-columns: 1fr 1.3fr auto; align-items: end; gap: 1rem; margin-bottom: 1.3rem; padding: 1rem 1.3rem; }
.context-field { min-width: 0; }
.context-field label { margin-bottom: .35rem; font-size: .75rem; color: var(--muted); }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, 1fr); align-items: start; gap: 1.3rem; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.panel-heading h2 { overflow-wrap: anywhere; }
.chat-panel { padding: 1.3rem 0 0; overflow: hidden; }
.chat-panel > .panel-heading, .history-details, .chat-context { margin-left: 1.3rem; margin-right: 1.3rem; }
.history-details { border-bottom: 1px solid var(--line); }
.conversation-list { display: grid; gap: .4rem; max-height: 240px; overflow-y: auto; padding: .4rem 0 .8rem; }
.conversation-item { width: 100%; text-align: left; justify-content: flex-start; background: var(--soft); color: var(--ink); font-weight: var(--weight-medium); }
.conversation-item.current { background: var(--accent-soft); border-color: var(--accent-line); }
.conversation-item > span { min-width: 0; overflow-wrap: anywhere; }
.conversation-item small { display: block; font-size: .7rem; color: var(--muted); margin-top: .15rem; }
.chat-context { display: flex; flex-direction: column; gap: .15rem; margin-top: 1rem; font-size: .85rem; font-weight: var(--weight-label); overflow-wrap: anywhere; }
.messages-region { position: relative; }
.messages { display: flex; flex-direction: column; gap: 1.2rem; min-height: 290px; max-height: 570px; overflow-y: auto; padding: 1.4rem 1.3rem; scroll-behavior: auto; overflow-anchor: none; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
.messages > * { flex-shrink: 0; }
.jump-latest { position: absolute; right: 1.3rem; bottom: .65rem; box-shadow: 0 2px 12px var(--backdrop); background: var(--surface-3); font-size: .78rem; z-index: 1; }
.message { max-width: 95%; min-width: 0; }
.message.user { align-self: flex-end; }
.message-label { font-size: .71rem; color: var(--muted); margin: 0 .2rem .35rem; }
.user .message-label { text-align: right; }
.message-content { padding: .9rem 1rem; background: var(--surface-3); border: 0; border-radius: 12px 12px 12px 3px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; font-size: .91rem; }
.action-note { font-size: .73rem; color: var(--good); margin-top: -.6rem; padding-left: .2rem; }
.user .message-content { background: var(--accent-soft); border-radius: 12px 12px 3px 12px; }
.chat-empty { margin: auto 0; padding: 1rem .3rem; }
.chat-empty h3 { font-size: 1.1rem; margin-bottom: .65rem; }
.chat-empty p { font-size: .86rem; color: var(--muted); max-width: 28rem; line-height: 1.8; }
.starter-button { margin-top: 1.1rem; text-align: left; justify-content: flex-start; }
.task-controls { display: flex; align-items: center; gap: .65rem; margin: 0 1.3rem; }
.task-controls:has(.turn-status[hidden]):has(.stop-button[hidden]) { display: none; }
.turn-status { flex: 1; min-width: 0; margin: 0 0 1rem; font-size: .83rem; color: var(--muted); overflow-wrap: anywhere; }
.stop-button { align-self: flex-start; margin: -.35rem 0 .65rem; min-height: 40px; flex-shrink: 0; }
.task-activity { display: flex; align-items: baseline; gap: .4rem; margin: -.15rem 0; font-size: .75rem; color: var(--muted); overflow-wrap: anywhere; }
.task-activity-icon { flex: 0 0 .8rem; text-align: center; }
.task-activity[data-status="completed"] .task-activity-icon { color: var(--good); }
.answer-sources { min-width: 0; max-width: 100%; font-size: .78rem; color: var(--muted); }
.answer-sources > summary { display: list-item; cursor: pointer; padding: .25rem 0; min-height: 32px; }
.source-list { list-style: none; padding: .4rem 0 0; margin: 0; display: grid; gap: .8rem; }
.source-item { min-width: 0; overflow-wrap: anywhere; }
.source-title { display: block; line-height: 1.6; }
.source-meta { display: block; margin-top: .15rem; font-size: .7rem; line-height: 1.6; }
.source-excerpt { margin: .25rem 0 0; line-height: 1.6; white-space: pre-wrap; }
.source-note { margin: .75rem 0 0; font-size: .7rem; }
.markdown-body .source-reference { font-size: .76em; vertical-align: super; text-decoration: none; padding: 0 .1em; }
.resume-actions { margin: 0 1.3rem 1rem; padding: .9rem; background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 8px; font-size: .83rem; }
.resume-actions p { margin-bottom: .6rem; }
.composer { padding: 1rem 1.3rem 1.3rem; border-top: 1px solid var(--line); background: var(--surface-1); }
.composer textarea { min-height: 100px; background: var(--surface-3); }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .8rem; }
.checkbox-label { display: flex; gap: .5rem; font-size: .76rem; font-weight: var(--weight-medium); align-items: flex-start; line-height: 1.7; }
.composer-footer .button { flex-shrink: 0; min-width: 76px; }
.event-panel { display: grid; gap: 1rem; }
.readiness-panel > p { line-height: 1.8; }
.readiness-list { padding: 0; margin: .8rem 0 0; list-style: none; display: grid; gap: .35rem; }
.readiness-list li { font-size: .8rem; color: var(--muted); display: flex; gap: .5rem; }
.readiness-list li::before { content: "○"; color: var(--accent); flex-shrink: 0; }
#section-forms { display: grid; gap: 1rem; }
.section-card { padding: 0 1.2rem; }
.section-card > summary { padding: 1rem 0; font-size: .94rem; }
.section-card > summary .section-state { margin-left: .6rem; font-size: .72rem; color: var(--muted); font-weight: var(--weight-regular); }
.section-card form { padding-bottom: 1.2rem; }
.field { margin-bottom: .9rem; min-width: 0; }
.field label { margin-bottom: .35rem; font-size: .8rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.section-footer { display: flex; gap: .65rem; align-items: center; flex-wrap: wrap; margin-top: .9rem; }
.section-footer .field-help { margin: 0; }
.section-error { color: var(--danger); font-size: .8rem; margin: .7rem 0; overflow-wrap: anywhere; }
.conflict-panel { padding: .9rem; border: 1px solid var(--warn-line); background: var(--warn-soft); border-radius: 9px; font-size: .8rem; margin-top: .9rem; }
.latest-data { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; max-height: 230px; overflow-y: auto; padding: .6rem; background: var(--surface-3); border-radius: 6px; }
.conflict-panel .button-row { margin-top: .5rem; }
.conflict-panel .button { padding: .55rem .6rem; font-size: .75rem; }
.court-list { display: grid; gap: .6rem; margin: .7rem 0; }
.court-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: end; }
.court-row label { font-size: .75rem; margin-bottom: .3rem; }
.court-row .button { padding-left: .6rem; padding-right: .6rem; }
.invite-buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.invite-buttons .button { flex: 1 1 150px; }
.new-invite-link { padding: 1rem; margin-top: 1rem; border-radius: 8px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.new-invite-link label { margin-bottom: .4rem; }
.new-invite-link .button-row { margin-top: .7rem; }
#invitations-details { margin-top: .8rem; }
.invitation-list { display: grid; gap: .6rem; }
.invitation-item { padding: .8rem; background: var(--soft); border-radius: 9px; font-size: .8rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.invitation-item > div { min-width: 0; overflow-wrap: anywhere; }
.invitation-item small { display: block; color: var(--muted); margin-top: .15rem; }
.empty-state { color: var(--muted); font-size: .88rem; padding: 1.4rem; }
.text-link { font-size: .78rem; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.mobile-jump { display: none; }
.page-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; width: min(1440px, calc(100% - 3rem)); margin-inline: auto; padding: 1rem 0 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.page-footer a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 2; padding: .7rem 1rem; background: var(--surface-3); }
.skip-link:focus { top: .5rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon, .button > svg, .text-link > svg { display: inline-block; width: 1em; height: 1em; flex: 0 0 auto; transform: translateY(.125em); }
.theme-toggle { margin-left: .25rem; padding-inline: .65rem; font-size: .78rem; flex-shrink: 0; }
.theme-toggle .icon { font-size: 1.1rem; line-height: 1; }
.button[data-copy-state="done"] { color: var(--good); background: var(--good-soft); }
.copy-check { stroke: currentColor; fill: none; stroke-width: 2; }

/* Native details keep their summary and keyboard behavior; only the body animates. */
.disclosure-grid { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 180ms ease; }
.disclosure-grid[data-expanded="true"] { grid-template-rows: 1fr; }
.disclosure-inner { min-height: 0; overflow: hidden; }
.disclosure-inner > :last-child { margin-bottom: .8rem; }
.disclosure-grid[inert] { pointer-events: none; }

.message-content.markdown, .message-content.markdown-body, .message-content:has(> p), .message-content:has(> h1), .message-content:has(> ul), .message-content:has(> ol), .message-content:has(> .markdown-table-wrap) { white-space: normal; }
.message-content[aria-busy="true"]:not(.markdown-body) { white-space: pre-wrap; }
.message-content > :first-child { margin-top: 0; }
.message-content > :last-child { margin-bottom: 0; }
.message-content p { margin: .65em 0; }
.message-content h1, .message-content h2, .message-content h3, .message-content h4, .message-content h5, .message-content h6 { margin: 1.15em 0 .45em; font-size: 1.04em; line-height: 1.5; letter-spacing: -.015em; }
.message-content h1, .message-content h2 { font-size: 1.12em; }
.message-content ul, .message-content ol { padding-left: 1.45em; margin: .65em 0; }
.message-content li { padding-left: .12em; margin: .3em 0; }
.message-content li > p { margin: .25em 0; }
.message-content li > ul, .message-content li > ol { margin: .35em 0; }
.message-content li::marker { color: var(--muted); }
.message-content a { text-decoration-thickness: 1px; text-underline-offset: .2em; overflow-wrap: anywhere; }
.message-content blockquote { padding: .45rem .85rem; margin: .8rem 0; border-left: 3px solid var(--accent-line); border-radius: 0 8px 8px 0; background: var(--surface-1); color: var(--muted); }
.message-content hr { border: 0; height: 1px; background: var(--line); margin: 1rem 0; }
.message-content code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .88em; padding: .1em .35em; border-radius: 5px; background: var(--surface-1); }
.message-content pre { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; white-space: pre; padding: .9rem; margin: .8rem 0; background: var(--surface-1); border-radius: 8px; font-size: .82rem; line-height: 1.65; }
.message-content pre code { background: transparent; padding: 0; font-size: inherit; }
.markdown-table-wrap { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; margin: .85rem 0; border-radius: 8px; background: var(--surface-1); -webkit-overflow-scrolling: touch; }
.markdown-table-wrap table { width: 100%; border-collapse: collapse; font-size: .84em; line-height: 1.6; }
.markdown-table-wrap th, .markdown-table-wrap td { padding: .6rem .75rem; min-width: 6rem; max-width: 22rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: normal; }
.markdown-table-wrap th { background: var(--surface-0); color: var(--ink); white-space: nowrap; }
.markdown-table-wrap tbody tr:last-child td { border-bottom: 0; }
.markdown-table-wrap [data-align="center"] { text-align: center; }
.markdown-table-wrap [data-align="right"] { text-align: right; }
.stream-character { display: inline; animation: stream-appear 120ms ease-out both; animation-delay: var(--stream-delay, 0ms); }
@keyframes stream-appear { from { filter: blur(6px); opacity: 0; } to { filter: blur(0); opacity: 1; } }
.message-actions { display: flex; gap: .4rem; margin-top: .3rem; }
.message-actions .button, .copy-response-button { min-height: 36px; padding: .35rem .6rem; font-size: .74rem; }

/* Small requested-information forms and the shared event overview. */
.ui-form { padding: 1rem; margin: .4rem 0; border: 0; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--accent-line); min-width: 0; }
.ui-form > p, .ui-form > header { margin-bottom: .8rem; font-size: .87rem; font-weight: var(--weight-label); }
.ui-form > h3 { margin-bottom: .5rem; font-size: .94rem; }
.ui-form > h3 + form { margin-top: .8rem; }
.ui-form form, .ui-form fieldset { min-width: 0; }
.ui-form .field { margin-bottom: 1rem; }
.ui-form .field:last-child { margin-bottom: 0; }
.ui-form input, .ui-form select, .ui-form textarea { background: var(--surface-3); }
.ui-form-pending { margin-top: .5rem; }
.ui-form-pending label, label.ui-form-pending { display: flex; align-items: flex-start; gap: .45rem; font-size: .77rem; color: var(--muted); font-weight: var(--weight-regular); }
.ui-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .8rem; }
.ui-form-status { color: var(--muted); font-size: .78rem; line-height: 1.65; margin-top: .7rem; overflow-wrap: anywhere; }
.ui-form [aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--danger); }
.ui-form [role="alert"] { color: var(--danger); font-size: .77rem; margin-top: .3rem; }
.event-overview { display: grid; gap: .8rem; min-width: 0; }
.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; min-width: 0; }
.visual-card { min-width: 0; border: 0; border-radius: 14px; padding: 1.1rem; background: var(--surface-2); box-shadow: var(--shadow-soft); }
.visual-card h3 { font-size: .88rem; margin-bottom: .7rem; font-weight: var(--weight-label); }
.visual-card > p { font-size: .83rem; color: var(--muted); }
.overview-grid > .visual-card:first-child, .overview-grid > .visual-card:last-child { grid-column: 1 / -1; }
.overview-facts { display: grid; gap: 0; margin: 0; font-size: .8rem; }
.overview-fact { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); align-items: baseline; gap: .35rem .7rem; padding-block: .5rem; border-bottom: 1px solid var(--line); }
.overview-fact:last-child { border-bottom: 0; }
.overview-facts dt { color: var(--muted); }
.overview-facts dd { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .3rem; margin: 0; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.overview-fact.pending dd { color: var(--warn); }
.overview-filters { display: flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; border-radius: 9px; background: var(--surface-1); margin: .8rem 0 .5rem; }
.overview-filters .button { flex: 1 1 auto; padding: .4rem .5rem; font-size: .74rem; }
.overview-filters .button[aria-pressed="true"] { background: var(--surface-3); color: var(--accent); }
.overview-fill { margin-block: -.35rem; min-height: 36px; padding: .25rem .45rem; font-size: .73rem; }
.overview-progress { display: grid; gap: .5rem; }
.overview-progress progress, progress.overview-progress { width: 100%; height: 7px; appearance: none; overflow: hidden; border: 0; border-radius: 99px; background: var(--surface-0); accent-color: var(--accent); }
.overview-progress progress::-webkit-progress-bar, progress.overview-progress::-webkit-progress-bar { background: var(--surface-0); border-radius: 99px; }
.overview-progress progress::-webkit-progress-value, progress.overview-progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
.overview-progress progress::-moz-progress-bar, progress.overview-progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.overview-progress span, .overview-progress p { font-size: .77rem; color: var(--muted); }
.overview-courts { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: 0; list-style: none; }
.overview-courts > * { padding: .4rem .65rem; border-radius: 7px; background: var(--surface-0); font-size: .78rem; overflow-wrap: anywhere; }
.overview-timeline { display: grid; gap: .8rem; margin: 0; padding: 0; list-style: none; }
.overview-timeline > * { padding-left: .9rem; border-left: 2px solid var(--accent-line); font-size: .8rem; }
.overview-timeline strong { display: block; font-size: .86rem; font-weight: var(--weight-label); overflow-wrap: anywhere; }
.visual-card > .pill + p { margin-top: .7rem; }
.overview-timeline time { display: block; color: var(--muted); font-size: .74rem; }
@media (max-width: 1100px) { .brand-caption { display: none; } }
@media (max-width: 950px) { .header-inner { gap: .5rem 1rem; } .header-actions { margin-left: auto; } .primary-nav { order: 3; flex-basis: 100%; justify-content: flex-end; } .workspace-grid { grid-template-columns: minmax(0, 1.15fr) minmax(310px, 1fr); gap: 1rem; } .page { width: calc(100% - 2rem); } .card { padding: 1.1rem; } .chat-panel { padding: 1.1rem 0 0; } .section-card { padding: 0 1rem; } .auth-layout { gap: 2.5rem; } }
@media (max-width: 760px) { .header-inner, .page-footer { width: calc(100% - 2rem); } .header-inner { padding-block: .75rem .4rem; } .primary-nav { justify-content: space-between; gap: 8px; } input:not([type="checkbox"]), select, textarea { font-size: 16px; } .page { margin-top: 1.3rem; } .workspace-grid { grid-template-columns: minmax(0, 1fr); } .context-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .8rem; } .context-bar > .button { grid-column: 1 / -1; } .mobile-jump { display: inline-flex; } .messages { min-height: 250px; max-height: 54vh; } .auth-layout { grid-template-columns: minmax(0, 1fr); max-width: 470px; margin: 2rem auto; gap: 1.8rem; } .welcome-copy h1 { font-size: 2.3rem; margin: .65rem 0 .9rem; } .welcome-copy h1 br { display: none; } .welcome-note { margin-top: 1rem; } .auth-card { padding: 1.5rem; } .event-panel { scroll-margin-top: 1rem; } .invite-panel { display: block; } #signed-in-accept { margin-top: 1rem; } #invite-help { margin-top: .8rem; } .account-name { max-width: 8rem; margin-right: 0; } }
@media (max-width: 420px) { .header-inner { align-items: center; gap: .4rem .5rem; } .brand { font-size: 23px; } .header-actions { width: 132px; max-width: 100%; gap: .1rem; } .header-actions .button { padding: .5rem .55rem; font-size: .78rem; } .account-name { flex-basis: 100%; max-width: 9rem; text-align: right; font-size: .7rem; } .page { width: calc(100% - 1.5rem); } .context-bar { grid-template-columns: minmax(0, 1fr); } .workspace-heading { gap: .5rem; } .workspace-heading .pill { padding: .25rem .5rem; font-size: .67rem; } .chat-panel > .panel-heading, .history-details, .chat-context { margin-left: 1rem; margin-right: 1rem; } .messages { padding: 1.2rem 1rem; } .composer { padding: 1rem; } .composer-footer { align-items: flex-start; gap: .5rem; } .composer-footer .button { min-width: 66px; padding-left: .8rem; padding-right: .8rem; } .checkbox-label { font-size: .72rem; } .message { max-width: 100%; } .field-grid { grid-template-columns: minmax(0, 1fr); gap: 0; } .auth-card { padding: 1.2rem; } .welcome-copy h1 { font-size: 2rem; } }
@media (pointer: coarse) { .primary-nav a { min-height: 48px; font-size: 16px; } }
@media (pointer: coarse) { .copy-response-button, .overview-fill { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media (max-width: 420px) { .theme-toggle { margin-left: auto; padding-inline: .55rem; } .overview-grid { grid-template-columns: minmax(0, 1fr); } .ui-form { padding: .85rem; } .ui-form-actions .button { flex: 1 1 auto; } .markdown-table-wrap th, .markdown-table-wrap td { padding: .55rem .6rem; } }

/* Existing registration materials and the shared roster draft. */
.composer-attachments { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .6rem; margin-top: .35rem; }
.composer-attachments .button { min-height: 36px; padding: .3rem .55rem; font-size: .78rem; }
.composer-attachments .field-help { font-size: .72rem; }
.roster-panel { min-width: 0; }
.roster-panel > summary { font-weight: var(--weight-label); cursor: pointer; overflow-wrap: anywhere; }
.roster-content { display: grid; gap: .85rem; margin-top: 1rem; min-width: 0; }
.roster-content > *, .roster-content form, .roster-source, .roster-current, .roster-preview, .roster-editor { min-width: 0; }
.roster-content .field { margin: 0; display: grid; gap: .3rem; }
.roster-content input[type="file"] { font-size: .8rem; padding: .55rem; }
.roster-content input[type="file"]::file-selector-button { max-width: 100%; margin-right: .4rem; padding: .35rem .45rem; color: var(--ink); background: var(--surface-1); border: 0; border-radius: 5px; font: inherit; }
.roster-content .button-row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .65rem; }
.roster-content .button { font-size: .78rem; min-height: 40px; padding: .45rem .65rem; max-width: 100%; white-space: normal; }
.roster-content summary { cursor: pointer; font-size: .84rem; overflow-wrap: anywhere; }
.roster-paste textarea { margin: .65rem 0; }
.roster-status { padding: .5rem .65rem; background: var(--surface-1); border-radius: 8px; font-size: .82rem; overflow-wrap: anywhere; }
.roster-status.error { color: var(--danger); background: var(--danger-soft); }
.roster-source-options, .roster-mapping { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: .65rem 0; }
.roster-source-options > *, .roster-mapping > * { min-width: 0; }
.roster-mapping label { font-size: .8rem; }
.roster-mapping select, .roster-mapping input { font-size: .82rem; padding: .55rem; }
.roster-mapping-details { margin: .8rem 0; }
.roster-preview:empty, .roster-editor:empty { display: none; }
.roster-preview, .roster-editor { padding: .85rem; background: var(--surface-1); border-radius: 8px; }
.roster-preview > h3, .roster-editor h3 { margin-bottom: .5rem; }
.roster-issues-count { margin: .55rem 0 .25rem; color: var(--warn); font-size: .84rem; font-weight: var(--weight-label); }
.roster-issues { padding-left: 1.2rem; font-size: .78rem; max-height: 11rem; overflow-y: auto; margin: 0 0 .6rem; overflow-wrap: anywhere; }
.roster-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; margin: .6rem 0; border-radius: 8px; border: 1px solid var(--line); }
.roster-source > .roster-table-wrap { max-height: 20rem; overflow: auto; }
.roster-table-wrap table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.roster-table-wrap th, .roster-table-wrap td { padding: .5rem .6rem; min-width: 4rem; max-width: 20rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.roster-table-wrap th { white-space: nowrap; background: var(--surface-1); }
.roster-table-wrap td:last-child { min-width: 4rem; }
.roster-assets, .material-filters, .material-list, .material-heading, .material-edit { display: grid; gap: .6rem; min-width: 0; }
.material-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.material-filters > *, .material-item > *, .material-heading > * { min-width: 0; }
.material-list { gap: 0; }
.material-item { display: grid; gap: 4px; padding: 12px 8px; border-bottom: 1px solid var(--line); background: transparent; }
.material-item.selected { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.material-title { display: block; min-height: 44px; width: 100%; border: 0; border-radius: 8px; padding: 4px 0; color: var(--ink); background: transparent; text-align: left; font: inherit; font-weight: var(--weight-label); overflow-wrap: anywhere; cursor: pointer; }
.material-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.material-heading { padding-top: .65rem; border-top: 1px solid var(--line); }
.material-heading h3, .material-heading p, .material-description { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.material-heading h3 { font-size: 1rem; }
.material-edit > .field { margin-top: .65rem; }
.material-edit > .button { margin: .65rem .3rem 0 0; }
.material-image-viewport { width: 100%; min-width: 0; max-height: 28rem; max-height: min(28rem, 60vh); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 8px; margin: .65rem 0; background: var(--surface-1); }
.material-image-viewport > p { padding: .65rem; }
.material-image { display: block; width: 100%; max-width: 100%; height: auto; }
.material-image-viewport.expanded .material-image { width: 200%; max-width: none; }
.material-page-text { max-height: 20rem; overflow: auto; overscroll-behavior: contain; padding: .65rem; background: var(--surface-1); border-radius: 8px; font-size: .82rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.roster-source > h4 { margin: .85rem 0 .35rem; font-size: .85rem; }
.roster-drafts { padding-top: .75rem; border-top: 1px solid var(--line); }
@media (max-width: 360px) {
  .roster-source-options, .roster-mapping { grid-template-columns: minmax(0, 1fr); }
  .composer-attachments .field-help { flex-basis: 100%; }
}

/* Staff can act on a shared preparation stage without starting a conversation. */
.create-event-panel, .preparation-progress { margin-bottom: 1.3rem; }
.create-event-panel > p { margin: .5rem 0 1rem; }
.create-event-panel .button-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.create-event-panel label.field { display: grid; gap: .35rem; margin-bottom: .8rem; }
.preparation-current { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.preparation-current > div { min-width: 0; }
.preparation-current h2 { font-size: 1.12rem; overflow-wrap: anywhere; }
.preparation-current p { margin-top: .45rem; }
.preparation-current > .button { flex-shrink: 0; }
.preparation-stages { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; margin: 1rem 0 .75rem; }
.preparation-stage { display: flex; flex-direction: column; align-items: start; gap: .25rem; padding: .7rem .6rem; min-width: 0; min-height: 64px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface-1); text-align: left; cursor: pointer; font: inherit; }
.preparation-stage[aria-current="step"] { border-color: var(--accent); background: var(--accent-soft); }
.preparation-step-name { font-size: .8rem; font-weight: var(--weight-label); overflow-wrap: anywhere; }
.preparation-step-status { font-size: .7rem; color: var(--muted); }
.preparation-stage.complete .preparation-step-status { color: var(--good); }
.preparation-stage.stale .preparation-step-status { color: var(--warn); }
.preparation-progress > .button { font-size: .78rem; min-height: 40px; }
.preparation-blockers { border-top: 1px solid var(--line); padding-top: .7rem; margin-bottom: .6rem; }
.preparation-blockers summary { cursor: pointer; font-size: .85rem; }
.preparation-blockers ul { list-style: none; padding: 0; display: grid; gap: .35rem; margin: .65rem 0; }
.preparation-blockers .button, .preparation-issue-link { text-align: left; justify-content: start; white-space: normal; font-size: .8rem; min-height: 40px; max-width: 100%; }
.preparation-panel { display: grid; gap: 1rem; min-width: 0; }
.preparation-panel > *, .preparation-panel fieldset, .preparation-panel form { min-width: 0; }
.preparation-panel h2 { font-size: 1.05rem; }
.preparation-panel h3 { font-size: .9rem; margin: 1rem 0 .65rem; }
.preparation-rules > summary { display: flex; align-items: center; justify-content: space-between; gap: .7rem; cursor: pointer; font-weight: var(--weight-label); }
.preparation-rules > p { margin: .8rem 0; }
.preparation-rules .field { display: grid; gap: .35rem; margin: .8rem 0; font-size: .83rem; }
.preparation-rules input, .preparation-rules textarea, .preparation-rules select { min-width: 0; width: 100%; }
.preparation-rule-list { display: grid; gap: .5rem; margin: .8rem 0; }
.preparation-list-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, .7fr) auto; align-items: end; gap: .5rem; padding: .65rem; background: var(--surface-1); border-radius: 9px; }
.preparation-list-row:has(> :nth-child(2):last-child) { grid-template-columns: minmax(0, 1fr) auto; }
.preparation-list-row .field { margin: 0; }
.preparation-list-row .button { padding: .4rem .6rem; font-size: .76rem; white-space: normal; }
.preparation-rule-list > .button { justify-self: start; font-size: .8rem; }
.preparation-required-fields { display: flex; flex-wrap: wrap; gap: .8rem; margin: .75rem 0; }
.preparation-required-fields input { width: auto; }
.preparation-panel .button-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.preparation-panel .button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.preparation-confirmation { margin-top: 1rem; padding: .9rem; border: 1px solid var(--accent-line); background: var(--surface-1); border-radius: 8px; }
.preparation-confirmation:empty { display: none; }
.preparation-confirmation > .button { margin: .5rem .5rem 0 0; }
.preparation-rule-summary { display: grid; gap: .6rem; margin: .8rem 0; font-size: .8rem; }
.preparation-rule-summary > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: .5rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.preparation-rule-summary dt { color: var(--muted); }
.preparation-rule-summary dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.preparation-rule-gaps { color: var(--warn); padding-left: 1.2rem; font-size: .8rem; }
.preparation-adoption > p, .preparation-future > p { margin: .65rem 0; }
.preparation-adoption .preparation-confirmation > ul { display: grid; gap: .4rem; list-style: none; padding: 0; }
.preparation-adoption .preparation-confirmation > ul .button { font-size: .8rem; text-align: left; justify-content: start; }
.preparation-roster-preview, .preparation-version-rows { max-height: 22rem; overflow: auto; font-size: .8rem; padding-left: 1.3rem; overflow-wrap: anywhere; }
.preparation-history summary { cursor: pointer; }
.preparation-history > p, .preparation-history > details, .preparation-history > ul { margin-top: .7rem; font-size: .82rem; }
.preparation-version { margin-top: .7rem; border-top: 1px solid var(--line); padding-top: .7rem; font-size: .8rem; }
.preparation-version .button { margin-top: .4rem; font-size: .78rem; }
.preparation-future .pill { margin-top: .6rem; }
.preparation-error { padding: .7rem; border: 1px solid var(--line); border-radius: 9px; }
.preparation-error ul { display: grid; gap: .4rem; list-style: none; padding: 0; margin: .5rem 0 0; }
.preparation-error .button { font-size: .8rem; text-align: left; justify-content: start; }
.roster-review-status, .roster-review-summary, .roster-row-issues, .roster-conflict { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.roster-review-summary, .roster-row-issues { font-size: .8rem; margin: .5rem 0; }
.roster-review-actions { display: grid; gap: .5rem; min-width: 0; }
.roster-review-actions > * { min-width: 0; max-width: 100%; }
.roster-review-actions .button { min-height: 40px; white-space: normal; }
.roster-row-issues .button { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; justify-content: start; }
.roster-event-choices { display: flex; flex-wrap: wrap; gap: .65rem; min-width: 0; }
.roster-event-choices > label { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.roster-conflict { border: 1px solid var(--accent-line); padding: .75rem; border-radius: 9px; margin: .75rem 0; }
@media (max-width: 950px) { .preparation-stages { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .preparation-current { display: block; }
  .preparation-current > .button { width: 100%; margin-top: .65rem; }
  .preparation-panel { gap: .8rem; }
  .workspace-heading > .button { font-size: .8rem; padding: .55rem .65rem; }
  .preparation-stages { gap: .35rem; }
  .preparation-stage { min-height: 62px; padding: .55rem .35rem; }
  .preparation-step-name { font-size: .73rem; }
  .preparation-step-status { font-size: .67rem; }
  .preparation-list-row { grid-template-columns: minmax(0, 1fr) minmax(90px, .75fr); }
  .preparation-list-row > .button { grid-column: 1 / -1; justify-self: start; }
  .preparation-list-row:has(> :nth-child(2):last-child) { grid-template-columns: minmax(0, 1fr); }
  .preparation-rule-summary > div { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .preparation-confirmation { padding: .7rem; }
}

/* Drawing and scheduling share one full-width workspace above the conversation. */
.draw-schedule-workspace { margin: 0 0 1.3rem; scroll-margin-top: 1rem; min-width: 0; }
.draw-workspace-heading, .draw-workspace-tabs, .draw-schedule-workspace .button-row, .workflow-card .button-row { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.draw-workspace-heading { align-items: start; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.draw-workspace-heading > div { flex: 1; min-width: 10rem; }
.draw-workspace-heading h2 { margin-top: .3rem; font-size: 1.35rem; }
.draw-workspace-tabs { margin: 1rem 0 1.25rem; }
.draw-workspace-tabs > .button, .schedule-view-tabs > .button { min-height: 44px; }
.draw-workspace-tabs [aria-pressed="true"], .schedule-view-tabs [aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.draw-schedule-workspace .button, .workflow-card .button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.draw-schedule-workspace .field { display: grid; gap: .4rem; min-width: 0; font-size: .84rem; }
.draw-structure, .draw-stage, .draw-import, .draw-schedule { display: grid; gap: 1rem; min-width: 0; }
.draw-schedule-workspace .section-error, .draw-status, .draw-config-status { padding: .65rem .85rem; border-radius: 9px; overflow-wrap: anywhere; }
.draw-schedule-workspace .section-error { background: var(--danger-soft); }
.draw-status { color: var(--good); background: var(--good-soft); margin-top: .75rem; }
.draw-config-status { color: var(--muted); background: var(--surface-1); font-size: .82rem; }
.draw-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; min-width: 0; }
.draw-form-grid > *, .draw-editor-row > * { min-width: 0; }
.draw-list-editor { display: grid; gap: .7rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.draw-list-editor > .button { justify-self: start; }
.draw-editor-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); align-items: end; gap: .65rem; padding: .85rem; background: var(--surface-1); border-radius: 8px; }
.draw-editor-row > .button { justify-self: start; }
.draw-entry-choices { display: flex; flex-wrap: wrap; align-items: start; gap: .6rem 1rem; grid-column: 1 / -1; }
.draw-entry-choices .field { display: flex; flex-direction: row-reverse; align-items: center; justify-content: start; gap: .4rem; max-width: 100%; overflow-wrap: anywhere; }
.draw-entry-choices input { flex: 0 0 auto; }
.draw-advanced, .draw-void { padding: .9rem; border: 1px solid var(--line); border-radius: 8px; }
.draw-advanced > summary, .draw-void > summary { cursor: pointer; font-weight: var(--weight-label); }
.draw-advanced > .draw-list-editor { margin-top: .85rem; }
.draw-void > .field, .draw-void > .button { margin-top: .75rem; }
.draw-issues { display: grid; gap: .5rem; min-width: 0; }
.draw-issues:empty { display: none; }
.draw-issues .button { color: var(--warn); background: var(--warn-soft); text-align: left; justify-content: start; }
.draw-entry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.draw-entry { display: flex; flex-direction: column; gap: .6rem; align-items: start; min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-1); }
.draw-entry h4 { overflow-wrap: anywhere; font-size: .95rem; }
.draw-entry.revealed { border-color: var(--accent-line); background: var(--accent-soft); }
.draw-number { font-size: 1.2rem; font-weight: var(--weight-semibold); color: var(--muted); }
.draw-entry.revealed .draw-number { color: var(--accent); font-size: 1.5rem; }
.draw-entry > .button { margin-top: auto; }
.draw-session-status { font-size: .9rem; color: var(--accent); font-weight: var(--weight-label); }
.draw-public-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; padding: 1rem; background: var(--surface-1); border-radius: 12px; }
.draw-public-controls > h3, .draw-public-controls > p, .draw-public-controls > input { flex-basis: 100%; }
.draw-qr { display: block; width: 160px; height: 160px; max-width: 100%; image-rendering: pixelated; border-radius: 8px; }
.draw-import-rows { display: grid; gap: .55rem; max-height: 26rem; overflow: auto; padding: .75rem; background: var(--surface-1); border-radius: 8px; }
.draw-import-rows p { font-size: .85rem; padding-bottom: .45rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.schedule-editor { display: grid; gap: .75rem; padding: 1rem; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 12px; }
.schedule-editor > .button { justify-self: start; }
.schedule-view { min-width: 0; }
.schedule-view-controls { display: grid; gap: .8rem; }
.schedule-view-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.schedule-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.schedule-draft-status { margin: .9rem 0; padding: .65rem .8rem; font-size: .82rem; color: var(--muted); background: var(--surface-1); border-radius: 9px; }
.schedule-issues { margin: .8rem 0; padding: .8rem; background: var(--warn-soft); border-radius: 8px; color: var(--warn); }
.schedule-issues > summary { cursor: pointer; font-size: .88rem; font-weight: var(--weight-label); }
.schedule-issues > .button, .schedule-issues > p { display: block; margin-top: .5rem; font-size: .8rem; }
.schedule-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: .85rem; }
.schedule-match { display: grid; align-content: start; gap: .4rem; min-width: 0; padding: .85rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-3); overflow-wrap: anywhere; }
.schedule-match.has-issues { border-color: var(--warn-line); }
.schedule-match.selected { outline: 2px solid var(--accent); outline-offset: 2px; }
.schedule-match-heading { display: flex; align-items: start; justify-content: space-between; gap: .5rem; font-size: .85rem; }
.schedule-match-heading > strong { min-width: 0; }
.schedule-match-heading .pill { flex: 0 0 auto; white-space: nowrap; font-size: .65rem; }
.schedule-opponents { font-size: .95rem; font-weight: var(--weight-label); }
.schedule-match-time { font-size: .8rem; color: var(--accent); }
.schedule-match > .button { justify-self: start; min-height: 44px; padding: .3rem .5rem; font-size: .78rem; }
.schedule-match-issue { color: var(--warn); font-size: .78rem; }
.schedule-dependencies { font-size: .75rem; color: var(--muted); }
.schedule-dependencies > .button { padding: .2rem .4rem; min-height: 36px; font-size: .75rem; }
.schedule-timeline-wrap { max-height: 650px; width: 100%; max-width: 100%; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 12px; }
.schedule-timeline { display: grid; grid-template-columns: 64px repeat(var(--schedule-courts), minmax(230px, 1fr)); min-width: max-content; background: var(--surface-1); }
.schedule-time-header, .schedule-court-header { position: sticky; top: 0; z-index: 3; padding: .7rem; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .85rem; font-weight: var(--weight-label); }
.schedule-time-header { left: 0; z-index: 4; }
.schedule-time-scale { position: sticky; left: 0; z-index: 2; background: var(--surface-2); }
.schedule-time-scale > span { position: absolute; left: 6px; font-size: .72rem; color: var(--muted); transform: translateY(-50%); }
.schedule-time-scale > span:first-child { transform: none; }
.schedule-court-lane { position: relative; min-width: 230px; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--schedule-tick, 120px) - 1px), var(--line) calc(var(--schedule-tick, 120px) - 1px), var(--line) var(--schedule-tick, 120px)); }
.schedule-court-lane > .schedule-match { position: absolute; left: 5px; right: 5px; z-index: 1; gap: .25rem; padding: .65rem; box-shadow: var(--shadow-soft); }
.schedule-match.compact .schedule-dependencies { display: none; }
.schedule-match.compact .schedule-opponents { font-size: .8rem; }
.schedule-match.compact .small, .schedule-match.compact .schedule-match-time { font-size: .7rem; }
.schedule-timeline-match { position: absolute; left: 5px; right: 5px; display: flex; flex-direction: column; align-items: start; justify-content: start; gap: .25rem; min-width: 0; padding: .55rem; border: 1px solid var(--accent-line); border-radius: 9px; background: var(--surface-3); color: var(--ink); text-align: left; overflow: auto; overscroll-behavior: contain; }
.schedule-timeline-match > strong { font-size: .75rem; }
.schedule-timeline-match .schedule-opponents { font-size: .8rem; overflow-wrap: anywhere; }
.schedule-timeline-match .schedule-match-time { margin-top: auto; font-size: .7rem; }
.schedule-timeline-match.has-issues { border-color: var(--warn-line); background: var(--warn-soft); }
.schedule-groups { display: grid; gap: 1rem; min-width: 0; }
.schedule-group > h3 { margin: .6rem 0; }
.schedule-rounds { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: .75rem; overflow-x: auto; overscroll-behavior-inline: contain; padding: 4px; }
.schedule-round { display: grid; align-content: start; gap: .65rem; min-width: 0; }
.schedule-round > h4 { font-size: .85rem; color: var(--muted); }
.workflow-card { display: grid; gap: .7rem; padding: 1rem; border: 1px solid var(--accent-line); border-radius: 12px; background: var(--surface-2); min-width: 0; }
.workflow-card > .button { justify-self: start; }
.workflow-return-status:empty { display: none; }
.workflow-return-item { padding: .65rem .8rem; margin: .5rem 0; border: 1px solid var(--accent-line); border-radius: 8px; background: var(--accent-soft); }
.workflow-return-item > .button { margin-top: .5rem; min-height: 40px; }
.material-upload { display: grid; gap: .55rem; min-width: 0; padding: .65rem 0; }
.material-upload-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.material-upload-actions > .button { min-height: 44px; white-space: normal; }
.material-upload-pending { display: grid; gap: .4rem; list-style: none; margin: 0; padding: 0; max-height: 13rem; overflow: auto; }
.material-upload-pending > li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .5rem; border-radius: 8px; background: var(--surface-1); }
.material-upload-pending > li > span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .78rem; }
.material-upload-pending .button { min-height: 44px; max-width: 100%; font-size: .75rem; }
.material-upload-quota, .material-upload-status { font-size: .75rem; color: var(--muted); overflow-wrap: anywhere; }
.material-upload-status.error { color: var(--danger); }
.draw-public-page { min-height: 100vh; background: var(--surface-0); }
.draw-public-main { width: min(1500px, calc(100% - 3rem)); margin: 0 auto; padding: 2rem 0 3rem; }
.draw-public-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 1rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.draw-public-heading .button-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.draw-public-heading h1 { margin-top: .4rem; font-size: clamp(1.6rem, 3vw, 3.2rem); overflow-wrap: anywhere; }
.draw-public-status { margin: 1.1rem 0; color: var(--muted); font-size: .9rem; }
#public-draw > h2 { font-size: clamp(1.2rem, 2vw, 1.8rem); }
.draw-public-phase { color: var(--accent); margin: .6rem 0 1.5rem; font-weight: var(--weight-label); }
.draw-public-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.draw-public-slot { display: flex; align-items: center; gap: 1rem; min-width: 0; padding: 1.25rem; border: 1px solid var(--accent-line); border-radius: 15px; background: var(--surface-3); }
.draw-public-number { color: var(--accent); font-size: clamp(2.25rem, 4vw, 4.25rem); font-weight: var(--weight-bold); line-height: 1.1; overflow-wrap: anywhere; }
.draw-public-slot h3 { min-width: 0; overflow-wrap: anywhere; font-size: clamp(1rem, 1.6vw, 1.35rem); }
.draw-public-note { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
@media (max-width: 760px) {
  .draw-workspace-heading > div { flex-basis: 100%; }
  .draw-workspace-heading h2 { font-size: 1.15rem; }
  .draw-workspace-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
  .draw-workspace-tabs .button { padding: .55rem .4rem; font-size: .8rem; }
  .draw-form-grid, .draw-editor-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .draw-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .draw-entry { padding: .75rem; }
  .draw-entry .button { width: 100%; padding: .4rem; font-size: .75rem; }
  .draw-entry h4 { font-size: .85rem; }
  .draw-number { font-size: 1rem; }
  .draw-entry.revealed .draw-number { font-size: 1.2rem; }
  .draw-public-controls { padding: .8rem; }
  .schedule-filters { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .schedule-view-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; }
  .schedule-view-tabs .button { padding: .5rem .3rem; font-size: .75rem; }
  .schedule-cards { grid-template-columns: minmax(0, 1fr); }
  .schedule-rounds { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; }
  .draw-public-main { width: calc(100% - 1.5rem); padding: 1.25rem 0 2rem; }
  .draw-public-grid { grid-template-columns: minmax(0, 1fr); gap: .7rem; }
  .draw-public-slot { padding: 1rem; }
}
@media (max-width: 380px) {
  .draw-form-grid, .draw-editor-row { grid-template-columns: minmax(0, 1fr); }
  .draw-entry-grid { grid-template-columns: minmax(0, 1fr); }
  .draw-schedule-workspace .button-row > .button { width: 100%; }
}

/* Shared workspace: restrained local icons, a quiet business shell, and a persistent assistant. */
:root { --workspace-radius: 12px; --workspace-radius-inner: calc(var(--workspace-radius) - 4px); --workspace-accent: var(--accent); --surface: var(--surface-3); --workspace-focus-soft: #a6afd2; --workspace-focus-halo: #4355a214; --workspace-border: color-mix(in srgb, currentColor 12%, transparent); }
:root[data-theme="dark"] { --accent: #a7b6ff; --muted: #a7b0c2; --workspace-focus-soft: #7faeff; --workspace-focus-halo: #7faeff32; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent: #a7b6ff; --muted: #a7b0c2; --workspace-focus-soft: #7faeff; --workspace-focus-halo: #7faeff32; } }

button svg, a svg { flex: 0 0 auto; vertical-align: middle; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; border-radius: var(--workspace-radius); }
.button:focus-visible, .assistant-launcher:focus-visible, .reference-option:focus-visible, .conversation-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }
.icon-button { width: 40px; height: 40px; padding: 8px; flex: 0 0 auto; }
.workspace-grid { display: block; }
.event-panel { max-width: 1120px; margin-inline: auto; }
.business-tabs { display: flex; gap: 4px; margin-left: auto; align-self: end; }
.business-tabs .active { background: color-mix(in srgb, var(--workspace-accent) 12%, transparent); }
.materials-workspace { max-width: 1120px; margin-inline: auto; }
.materials-workspace .workspace-heading { align-items: center; margin: 0 0 12px; }
.materials-library > summary { display: none; }
.materials-library .roster-content { margin: 0; padding: 0; }
.materials-library .roster-drafts, .materials-library .roster-preview, .materials-library .roster-paste { display: none; }
#business-material-upload .material-upload-actions .button:not(.primary), #chat-material-upload .material-upload-actions .button:not(.primary) { display: none; }
#business-material-upload .material-upload-quota { margin-bottom: 16px; }
.assistant-launcher { position: fixed; z-index: 70; right: 28px; bottom: 24px; display: flex; align-items: center; gap: 10px; min-height: 48px; height: 48px; padding: 8px 20px; background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); border-radius: 24px; box-shadow: 0 4px 24px #25325226; font: inherit; font-weight: 600; cursor: pointer; }
.assistant-launcher[hidden], .assistant-workspace[hidden] { display: none !important; }
.assistant-launcher.is-busy::after { content: ''; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; opacity: .8; }
.task-process { margin: .3rem 0; color: var(--ink); font-size: .85rem; }
.task-process-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: .45rem .75rem; padding-block: .5rem; cursor: pointer; }
.task-process-heading::before { content: ''; width: 6px; height: 6px; flex-shrink: 0; align-self: center; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(-45deg); }
.task-process[open] > .task-process-heading::before { transform: rotate(45deg); }
.task-process-label { font-weight: 600; }
.task-process-summary { color: var(--muted); font-size: .8rem; }
.task-process-list { list-style: none; padding: .2rem 0 .25rem .8rem; margin: 0; border-left: 1px solid var(--line); }
.roster-text-preview { margin: .5rem 0 1rem; padding: 1rem 0; border-block: 1px solid var(--line); min-width: 0; }
.roster-text-preview h4 { margin: .35rem 0 .75rem; overflow-wrap: anywhere; }
.roster-text-preview .button-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.roster-text-table-scroll { max-width: 100%; max-height: 20rem; overflow: auto; overscroll-behavior: contain; }
.roster-text-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.roster-text-table th, .roster-text-table td { padding: .45rem .6rem; border-bottom: 1px solid var(--line); text-align: left; min-width: 4.5rem; max-width: 14rem; overflow-wrap: anywhere; }
.roster-text-table th { white-space: nowrap; color: var(--muted); font-weight: 500; }
.task-process-item { display: flex; gap: .75rem; justify-content: space-between; align-items: baseline; padding: .35rem 0; overflow-wrap: anywhere; }
.task-process-text { min-width: 0; white-space: pre-wrap; }
.task-process-status { flex-shrink: 0; color: var(--muted); font-size: .75rem; }
.task-process-note { color: var(--muted); line-height: 1.65; }
.task-process-item[data-status="running"] .task-process-status { color: var(--accent); }
.task-process-item[data-status="failed"] .task-process-status { color: var(--danger); }
.assistant-open { overflow: hidden; }
.assistant-open .assistant-launcher { visibility: hidden; }
.assistant-workspace { position: fixed; z-index: 100; margin: 0; padding: 0; overflow: hidden; border-radius: var(--workspace-radius); background: var(--surface); border: 1px solid var(--workspace-border); box-shadow: 0 24px 100px #101b2a40; }
.assistant-layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); height: 100%; min-height: 0; transition: opacity .12s ease; }
.assistant-sidebar { min-height: 0; display: flex; flex-direction: column; gap: 20px; padding: 24px 16px 16px; background: color-mix(in srgb, var(--workspace-accent) 5%, var(--surface)); border-right: 1px solid var(--workspace-border); overflow: auto; overscroll-behavior: contain; }
.assistant-sidebar-brand { display: flex; align-items: baseline; gap: 8px; padding: 0 8px; }
.assistant-sidebar-brand .brand { font-size: 22px; }
.conversation-search { display: flex; padding: 8px; border: 1px solid transparent; border-radius: var(--workspace-radius); background: var(--soft); }
.conversation-search input { width: 100%; padding: 0; border: 0; background: transparent; }
.conversation-search input:focus, .conversation-search input:focus-visible { outline: none; box-shadow: none; }
.conversation-search:focus-within { box-shadow: inset 0 0 0 1px var(--workspace-focus-soft), 0 0 0 2px var(--workspace-focus-halo); }
body[data-focus-mode="keyboard"] .conversation-search:has(input:focus-visible) { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }
.assistant-sidebar .history-details { margin: 0; padding: 0; border: 0; }
.assistant-sidebar .history-details > summary { display: none; }
.assistant-sidebar .conversation-list { display: grid; gap: 4px; max-height: none; padding: 0; }
.history-group-label { padding: 12px 8px 4px; margin: 0; font-size: 12px; color: var(--muted); }
.conversation-row { min-width: 0; border-radius: var(--workspace-radius-inner); position: relative; display: flex; align-items: stretch; }
.conversation-row.current { background: color-mix(in srgb, var(--workspace-accent) 12%, transparent); }
.conversation-open { min-width: 0; flex: 1; text-align: left; border: 0; background: none; padding: 10px 8px; color: inherit; cursor: pointer; }
.conversation-open span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-open small { display: block; font-size: 11px; margin-top: 4px; color: var(--muted); }
.conversation-menu { position: relative; align-self: center; }
.conversation-menu summary { list-style: none; display: grid; place-items: center; width: 32px; height: 40px; cursor: pointer; border-radius: var(--workspace-radius-inner); }
.conversation-menu summary::-webkit-details-marker { display: none; }
.conversation-menu[open] { z-index: 2; }
.conversation-menu-actions { position: absolute; right: 0; top: 40px; width: 150px; padding: 3px; display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--workspace-border); border-radius: var(--workspace-radius); box-shadow: 0 8px 24px #0002; }
.conversation-menu-actions button { justify-content: flex-start; }
.assistant-workspace .chat-panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 0; gap: 0; border: 0; border-radius: 0; background: var(--surface); }
.assistant-topbar { min-height: 64px; padding: 8px 24px; border-bottom: 1px solid var(--workspace-border); display: flex; align-items: center; gap: 12px; }
.assistant-topbar h2 { margin: 0; font-size: 17px; }
.assistant-topbar p { margin: 4px 0 0; }
.assistant-topbar .icon-button { display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 12px; border: 0; background: transparent; box-shadow: none; color: var(--muted); }
.assistant-topbar .icon-button:hover { background: transparent; color: var(--ink); }
.assistant-topbar .icon-button svg { width: 18px; height: 18px; stroke-width: 1.6; }
#assistant-close { margin-left: auto; }
#assistant-sidebar-toggle { display: none; }
.assistant-workspace .messages-region { flex: 1; min-height: 0; height: auto; overflow: hidden; }
.assistant-workspace .messages { height: 100%; max-height: none; min-height: 0; padding: 24px max(24px, calc((100% - 960px)/2)); overflow-y: auto; }
.assistant-workspace .message { max-width: 100%; }
.assistant-workspace .chat-empty { display: grid; align-content: center; gap: 8px; min-height: 160px; max-width: 640px; margin: auto; padding: 16px 0; background: transparent; border: 0; }
.assistant-workspace .chat-empty h3 { font-size: 22px; line-height: 1.5; letter-spacing: -.02em; margin: 0; }
.assistant-workspace .chat-empty .button { justify-self: start; }
.assistant-workspace .task-controls, .assistant-workspace .resume-actions { margin-inline: 24px; }
.assistant-workspace .composer { position: relative; flex: 0 0 auto; width: min(960px, calc(100% - 48px)); margin: 8px auto 16px; padding: 12px; border: 1px solid var(--workspace-border); border-radius: var(--workspace-radius); background: var(--surface); box-shadow: none; }
.assistant-workspace .composer textarea { border: 0; border-radius: var(--workspace-radius-inner); box-shadow: none; background: transparent; min-height: 56px; max-height: 160px; resize: vertical; padding: 4px; font-size: 16px; }
.assistant-workspace .composer textarea:focus, .assistant-workspace .composer textarea:focus-visible { outline: none; box-shadow: none; }
.assistant-workspace .composer:focus-within { box-shadow: inset 0 0 0 1px var(--workspace-focus-soft), 0 0 0 2px var(--workspace-focus-halo); }
body[data-focus-mode="keyboard"] .assistant-workspace .composer:has(textarea:focus-visible) { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }
.assistant-workspace .composer-attachments { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 0; }
.assistant-workspace .composer-footer { gap: 12px; border: 0; padding-top: 4px; margin-top: 4px; }
.assistant-workspace .composer .field-help { font-size: 11px; margin: 8px 0 0; }
#chat-material-upload .material-upload-quota { display: none; }
#chat-material-upload .material-upload { padding: 0; border: 0; background: none; }
#chat-material-upload .material-upload-status { font-size: 11px; }
#chat-material-upload .material-upload-actions:has(.primary[hidden]) { display: none; }
.draft-attachments { display: flex; gap: 8px; flex-wrap: wrap; max-height: 128px; overflow-y: auto; overscroll-behavior: contain; }
.draft-attachments:not(:empty) { margin-bottom: 8px; }
.draft-attachment { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; padding: 0 0 0 8px; border: 1px solid var(--workspace-border); border-radius: var(--workspace-radius-inner); font-size: 12px; }
.draft-attachment > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 320px; }
.draft-attachment .icon-button { flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; padding: 12px; border: 0; background: transparent; box-shadow: none; }
.reference-picker { position: absolute; z-index: 5; bottom: calc(100% + 8px); left: 0; width: min(440px, 100%); padding: 16px; border: 1px solid var(--workspace-border); border-radius: var(--workspace-radius); background: var(--surface); box-shadow: 0 4px 24px #25325226; }
.reference-picker .panel-heading { margin-bottom: 12px; }
.reference-picker h3 { margin: 0; }
.reference-picker input { width: 100%; }
.reference-list { max-height: min(280px, 35vh); overflow: auto; margin-top: 8px; }
.reference-option { display: flex; gap: 12px; align-items: center; padding: 12px 8px; border: 0; width: 100%; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: var(--workspace-radius-inner); }
.reference-option:hover { background: color-mix(in srgb, var(--workspace-accent) 9%, transparent); }
.reference-option span { overflow-wrap: anywhere; }
.conversation-undo { position: absolute; z-index: 150; left: 50%; top: 80px; bottom: auto; transform: translateX(-50%); display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: var(--surface); border: 1px solid var(--workspace-border); border-radius: var(--workspace-radius); box-shadow: 0 8px 32px #0003; max-width: calc(100% - 32px); }
.conversation-undo[hidden] { display: none; }
body[data-workspace-view="materials"] #workspace-grid, body[data-workspace-view="materials"] #preparation-progress, body[data-workspace-view="materials"] #draw-schedule-workspace { display: none !important; }
@media (max-width: 900px) { .assistant-layout { grid-template-columns: 220px minmax(0, 1fr); } .assistant-workspace .messages { padding: 24px; } }

.assistant-workspace[data-motion] { min-height: 0; min-width: 0; }
.assistant-title { min-width: 0; }
.assistant-title h2, .assistant-title p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-workspace svg { width: 20px; height: 20px; }
.assistant-workspace #send-button { width: 40px; height: 40px; min-width: 40px; padding: 8px; border-radius: 50%; }
.conversation-menu-actions.conversation-editor { width: 248px; padding: 12px; }
.conversation-editor input { width: 100%; min-width: 0; border-radius: var(--workspace-radius-inner); margin-top: 8px; }
.conversation-editor-actions { display: flex; gap: 8px; margin-top: 12px; }
.conversation-editor-actions .button { flex: 1; justify-content: center; }
.conversation-confirm-title { font-weight: 500; margin-bottom: 8px; }
.conversation-editor .danger { color: var(--danger); }
.sent-references { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.sent-reference { max-width: 100%; font-size: 12px; background: var(--surface-3); overflow-wrap: anywhere; text-align: left; }
.conversation-draft-state { color: var(--accent) !important; }
.input-draft-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.input-draft-feedback > span { min-width: 0; overflow-wrap: anywhere; }
.input-draft-feedback .button { min-height: 44px; padding: 8px; font-size: 12px; }
.input-draft-feedback[data-phase="error"], .input-draft-feedback[data-phase="conflict"] { color: var(--danger, #a22f42); }
.input-draft-comparison { max-height: 160px; overflow: auto; border-top: 1px solid var(--line); margin-top: 8px; }
.input-draft-other { font: inherit; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 680px) {
  .assistant-workspace { border-radius: 0; border: 0; }
  .assistant-launcher { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); min-height: 48px; }
  .assistant-layout { display: block; }
  .assistant-workspace .chat-panel { height: 100%; }
  .assistant-sidebar { position: absolute; inset: 0 auto 0 0; width: min(280px, calc(100% - 56px)); z-index: 8; display: none; box-shadow: 12px 0 32px #0002; padding-top: 76px; background: var(--surface); }
  .sidebar-visible .assistant-sidebar { display: flex; }
  #assistant-sidebar-toggle { display: inline-flex; position: relative; z-index: 9; }
  .assistant-topbar { padding: 8px 12px; min-height: 64px; }
  .assistant-workspace .messages { padding: 16px; }
  .assistant-workspace .chat-empty { min-height: 120px; }
  .assistant-workspace .chat-empty h3 { font-size: 20px; }
  .assistant-workspace .composer { width: calc(100% - 24px); margin: 4px 12px max(12px, env(safe-area-inset-bottom)); padding: 8px; }
  .assistant-workspace .composer textarea { min-height: 48px; max-height: min(120px, 20dvh); }
  .assistant-workspace .composer-footer { flex-wrap: wrap; }
  .assistant-workspace .checkbox-label { font-size: 11px; flex: 1; }
  .business-tabs { margin-left: 0; width: 100%; }
  .materials-workspace .workspace-heading { gap: 12px; }
  .materials-workspace .workspace-heading .button { flex-shrink: 0; }
  .conversation-menu-actions.conversation-editor { width: min(248px, calc(100vw - 56px)); }
}

@media (max-width: 680px), (pointer: coarse) {
  .assistant-workspace .button, .conversation-menu summary, .conversation-open, .reference-option { min-height: 44px; }
  .icon-button, .conversation-menu summary, .draft-attachment .icon-button { min-width: 44px; min-height: 44px; }
  .assistant-workspace #send-button { min-width: 44px; width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .assistant-layout { transition: none; } }

/* One action position: sending and stopping share the same aligned box. */
.assistant-workspace .composer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.assistant-workspace .composer-toolbar .composer-attachments { margin: 0; min-width: 0; }
.assistant-workspace .composer-actions { display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; }
.assistant-workspace .composer-actions #send-button, .assistant-workspace .composer-actions #stop-button { grid-area: 1 / 1; display: grid; place-items: center; width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0; margin: 0; align-self: center; border-radius: 50%; color: var(--on-accent, #fff); background: var(--accent); }
.assistant-workspace .composer-actions [hidden] { display: none !important; }
.assistant-workspace .composer-actions svg { width: 20px; height: 20px; stroke-width: 2; transform: none; }
.assistant-workspace .composer-footer { margin-top: 6px; padding-top: 0; align-items: center; }
.assistant-workspace .composer-footer .checkbox-label { min-height: 28px; line-height: 1.5; align-items: center; margin: 0; }
.assistant-workspace .task-controls:has(.turn-status[hidden]) { display: none; }
.conversation-wait { width: 100%; margin: 12px 0 20px; padding: 0; color: var(--muted); font-size: .86rem; animation: conversation-wait-enter 180ms ease-out; }
.conversation-wait-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.conversation-wait-glyph { position: relative; display: inline-grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; color: var(--accent); }
.conversation-wait-glyph > svg { position: absolute; inset: 0; width: 24px; height: 24px; }
.conversation-wait-page { transform-origin: 50% 50%; fill: currentColor; fill-opacity: .18; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; animation: conversation-page-turn 1.8s ease-in-out infinite; }
.conversation-wait-elapsed { font-size: .74rem; font-variant-numeric: tabular-nums; }
.conversation-wait-hint { display: block; margin: 6px 0 0 32px; font-size: .75rem; line-height: 1.6; }
.conversation-wait [hidden] { display: none; }
@keyframes conversation-page-turn { 0%,8% { opacity: 0; transform: scaleX(1); } 22% { opacity: .75; transform: scaleX(1); } 70% { opacity: .75; transform: scaleX(-1); } 84% { opacity: 0; transform: scaleX(-1); } 100% { opacity: 0; transform: scaleX(1); } }
@keyframes conversation-wait-enter { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 680px), (pointer: coarse) { .assistant-workspace .composer-actions #send-button, .assistant-workspace .composer-actions #stop-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .conversation-wait, .conversation-wait-page { animation: none; } }
.clarification-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 4px 12px; }
.clarification-option { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font-weight: 400; cursor: pointer; }
.clarification-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.clarification-option input { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; }
.clarification-option span { min-width: 0; overflow-wrap: anywhere; }
.clarification-field > label { display: block; margin-bottom: 6px; }
.clarification-field .ui-form-pending { display: flex; margin-top: 8px; }
.revision-editor { margin: 8px 0 20px; padding: 16px; border: 1px solid var(--workspace-border); border-radius: 12px; background: var(--surface-2); }
.revision-editor fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.revision-editor textarea { width: 100%; min-height: 100px; resize: vertical; }
.revision-editor .checkbox-label { margin: 10px 0; }
.revision-editor .message-actions { justify-content: flex-end; flex-wrap: wrap; }
.revision-history { margin: 12px 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.revision-history > summary { min-height: 36px; padding: 8px 0; color: var(--muted); font-size: .78rem; cursor: pointer; }
.revision-history .message { margin: 12px 0; }
.message .turn-action { display: inline-flex; align-items: center; gap: 5px; }
.message .turn-action svg { width: 15px; height: 15px; }
.message.user .edit-message-button { margin-top: 4px; color: var(--muted); font-size: .74rem; }

/* A competition is chosen before entering its fixed-context workspace. */
.management-filter { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin: 0 0 1.25rem; }
.management-filter label { margin: 0; color: var(--muted); font-size: .85rem; }
.management-filter select { width: min(100%, 320px); }
.competition-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.competition-card { display: flex; flex-direction: column; align-items: stretch; gap: .7rem; min-width: 0; min-height: 170px; padding: 1.3rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-1); color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.competition-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.competition-card-title { font-weight: 650; font-size: 1.15rem; line-height: 1.5; overflow-wrap: anywhere; }
.competition-card-meta { color: var(--muted); font-size: .85rem; line-height: 1.6; overflow-wrap: anywhere; }
.competition-card-action { margin-top: auto; color: var(--accent); font-size: .83rem; }
.event-breadcrumbs { display: flex; align-items: center; gap: .25rem; margin: -.6rem 0 1rem; flex-wrap: wrap; }
.event-breadcrumbs .button { padding: .45rem .6rem; }
.event-navigation .workspace-heading { align-items: center; }
.event-navigation h1 { max-width: 44ch; overflow-wrap: anywhere; }
.event-navigation .business-tabs { width: fit-content; max-width: 100%; margin: 0 0 1.4rem; flex-wrap: wrap; }
.preparation-stages { grid-template-columns: repeat(8, minmax(0, 1fr)); }
body[data-page-view="management"] #assistant-launcher,
body:not([data-page-view="workspace"]) #preparation-progress,
body:not([data-page-view="workspace"]) #preparation-panel,
body:not([data-page-view="workspace"]) #section-forms,
body:not([data-page-view="workspace"]) #roster-panel,
body:not([data-page-view="workspace"]) #draw-schedule-workspace,
body:not([data-page-view="workspace"]) #materials-workspace,
body[data-page-view="management"] .readiness-panel,
body[data-page-view="management"] #event-overview,
body[data-page-view="workspace"] .readiness-panel,
body[data-page-view="workspace"] #event-overview { display: none !important; }
body[data-page-view="workspace"]:not([data-preparation-step="basics"]) #section-forms,
body[data-page-view="workspace"]:not([data-preparation-step="roster"]) #roster-panel,
body[data-page-view="workspace"]:not([data-preparation-step="rules"]):not([data-preparation-step="adoption"]):not([data-preparation-step="publication"]):not([data-preparation-step="start"]) #preparation-panel,
body[data-page-view="workspace"]:not([data-preparation-step="arrangement"]):not([data-preparation-step="schedule"]) #draw-schedule-workspace,
body[data-page-view="workspace"]:not([data-preparation-step="collaboration"]) .collaboration-panel,
body[data-preparation-step="materials"] #preparation-progress,
body[data-preparation-step="collaboration"] #preparation-progress { display: none !important; }
@media (max-width: 1050px) { .preparation-stages { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  .management-filter select { flex: 1; min-width: 0; }
  .competition-card { min-height: 150px; }
  .event-navigation .workspace-heading { align-items: flex-start; flex-direction: column; gap: .75rem; }
  .event-navigation .business-tabs { width: 100%; }
  .event-navigation .business-tabs .button { flex: 1; padding-inline: .65rem; }
  .preparation-stage { min-height: 72px; }
  .preparation-step-name { line-height: 1.5; }
}

/* Recording occupies the existing composer; release restores it immediately. */
.assistant-workspace .chat-panel { position: relative; }
.assistant-workspace .voice-button { min-height: 44px; padding: 8px 13px; gap: 6px; border-radius: 999px; color: var(--on-accent); background: var(--accent); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; white-space: nowrap; font-size: 13px; font-weight: var(--weight-medium); }
.assistant-workspace .voice-button:hover { color: var(--on-accent); background: var(--accent-hover); }
.assistant-workspace .voice-button svg { width: 16px; height: 16px; }
.assistant-workspace .composer[data-voice-capturing="true"] { touch-action: none; }
.assistant-workspace .composer[data-voice-capturing="true"] .composer-content { opacity: 0; pointer-events: none; }
.voice-recording { position: absolute; inset: -1px; z-index: 6; display: flex; flex-direction: column; justify-content: flex-end; gap: 18px; padding: 16px 16px 12px; border: 1px solid var(--workspace-border); border-radius: var(--workspace-radius); background: var(--soft); touch-action: none; user-select: none; -webkit-user-select: none; }
.voice-directions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 6px; }
.voice-directions .button { min-width: 0; min-height: 48px; padding: 8px 4px; border-radius: 12px; color: var(--muted); background: transparent; font-size: 14px; font-weight: var(--weight-medium); }
.voice-directions .voice-cancel { font-size: 12px; font-weight: var(--weight-regular); white-space: nowrap; }
.voice-directions [data-selected="true"] { color: var(--on-accent); background: var(--accent); }
.voice-directions .voice-cancel[data-selected="true"] { color: var(--danger); background: var(--danger-soft); }
.voice-capture-feedback { display: grid; justify-items: center; gap: 3px; }
.voice-wave { height: 20px; display: flex; align-items: center; gap: 3px; color: var(--accent); }
.voice-wave i { display: block; width: 3px; height: 4px; border-radius: 2px; background: currentColor; }
.voice-release-label { color: var(--muted); font-size: 12px; font-weight: var(--weight-regular); }
.voice-recording[data-intent="send"] .voice-release-label { color: var(--accent); }
.voice-recording[data-intent="cancel"] .voice-release-label { color: var(--danger); }
.voice-preserve-note { color: var(--muted); font-size: 11px; font-weight: var(--weight-regular); }
.voice-panel { position: absolute; z-index: 7; top: 60%; left: max(24px, calc((100% - 800px) / 2)); right: max(24px, calc((100% - 800px) / 2)); padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-soft); }
.voice-transcript { min-height: 54px; max-height: min(140px, 23dvh); overflow-y: auto; overscroll-behavior: contain; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; line-height: 1.7; }
.voice-transcript[data-empty="true"] { color: var(--muted); }
.voice-heading { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; margin-top: 7px; color: var(--muted); font-size: 11px; font-weight: var(--weight-regular); }
#voice-status { min-width: 0; overflow-wrap: anywhere; }
#voice-time { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.voice-feedback { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0 8px; width: min(840px, calc(100% - 48px)); margin: 4px auto 0; color: var(--muted); font-size: 12px; text-align: center; }
.voice-feedback > span { min-width: 0; overflow-wrap: anywhere; }
.voice-feedback .button { min-height: 36px; padding: 4px 6px; font-size: 12px; font-weight: var(--weight-medium); }
.voice-feedback[data-kind="success"] > span { color: var(--good); }
.voice-feedback[data-kind="error"] > span { color: var(--danger); }
@media (max-width: 680px) {
  .assistant-workspace .composer-toolbar { gap: 4px; }
  .assistant-workspace .composer-toolbar .composer-attachments { gap: 2px; }
  .assistant-workspace .voice-button { padding-inline: 10px; }
  .voice-recording { gap: 14px; padding-inline: 12px; }
  .voice-panel { left: 18px; right: 18px; }
  .voice-feedback { width: calc(100% - 24px); }
  .voice-feedback .button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .voice-wave i { height: 8px !important; } }

/* The same personal workspace continues into event preparation. */
.identity-brand-caption, .identity-workspace-context { display: none; }
.account-menu { position: relative; flex: 0 0 auto; }
.account-menu > summary { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px; list-style: none; font-size: 13px; border-radius: 8px; color: var(--muted); }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu-actions { display: grid; gap: 4px; padding: 4px; min-width: 144px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow-soft); }
.account-menu > .account-menu-actions, .account-menu > .disclosure-grid { position: absolute; z-index: 80; top: calc(100% + 4px); right: 0; width: 152px; }
.account-menu-actions .button { justify-content: flex-start; }
.account-menu-name { display: none; }
.identity-mode { --workspace-sidebar-width: 208px; padding-left: var(--workspace-sidebar-width); }
.identity-mode .site-header { position: fixed; z-index: 60; inset: 0 auto 0 0; width: var(--workspace-sidebar-width); border: 0; border-right: 1px solid var(--line); }
.identity-mode .header-inner { display: flex; align-items: stretch; flex-direction: column; flex-wrap: nowrap; gap: 0; width: 100%; height: 100%; min-height: 0; padding: 24px 16px; }
.identity-mode #site-brand { position: relative; min-height: 44px; padding-left: 40px; font-size: 20px; letter-spacing: -.5px; }
.identity-mode #site-brand::before, .identity-mode #site-brand::after { content: ''; position: absolute; width: 17px; height: 6px; border-radius: 0; background: var(--accent); transform: skewX(-24deg); }
.identity-mode #site-brand::before { top: 15px; left: 9px; margin: 0; }
.identity-mode #site-brand::after { top: 24px; left: 14px; }
.identity-mode #site-brand .brand-caption { display: none; }
.identity-mode .identity-brand-caption { display: block; padding: 0 8px 24px; color: var(--muted); font-size: 12px; }
.identity-mode #identity-navigation { display: grid; gap: 4px; width: 100%; margin: 0; order: 0; flex-basis: auto; }
.identity-mode #identity-navigation a { display: flex; gap: 12px; min-height: 44px; padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; font-size: 14px; font-weight: 400; white-space: normal; }
.identity-mode #identity-navigation a span { min-width: 0; overflow-wrap: anywhere; }
.identity-mode #identity-navigation a[aria-current="page"] { border-color: var(--accent-line); background: var(--accent-soft); font-weight: 600; }
.identity-mode #identity-navigation a[aria-current]::after { display: none; }
#identity-navigation svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.identity-mode #theme-toggle { align-self: flex-start; margin: auto 0 0; padding-inline: 8px; }
.identity-mode .header-actions { position: fixed; top: 0; left: var(--workspace-sidebar-width); right: 0; justify-content: flex-end; flex-wrap: nowrap; gap: 12px; width: auto; min-height: 72px; max-width: none; padding: 12px 32px; border-bottom: 1px solid var(--line); background: var(--paper); }
.identity-mode .identity-workspace-context { display: inline-flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; margin-right: auto; color: var(--muted); font-size: 13px; text-decoration: none; }
.identity-workspace-context strong { color: var(--ink); font-weight: 600; }
.identity-mode .account-name { flex: 0 1 auto; max-width: 160px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-mode .page { width: 100%; max-width: 1200px; margin: 72px auto 0; padding: 24px 32px 48px; }
.identity-mode .page-footer { width: 100%; max-width: 1200px; margin: 0 auto; padding: 16px 32px 80px; border: 0; }
.identity-mode .page-footer > p { margin: 0; }
.identity-mode .event-panel, .identity-mode .materials-workspace { max-width: none; }
.workspace-heading { gap: 16px; margin-bottom: 16px; }
.event-navigation .workspace-heading { gap: 8px; margin-bottom: 12px; }
.event-navigation h1 { font-size: 24px; line-height: 1.4; }
.event-navigation .business-tabs { margin-bottom: 16px; }
.event-breadcrumbs { margin: -8px 0 4px; }
body[data-page-view="workspace"] #fixed-event-description { display: none; }
.card { padding: 20px; border: 1px solid var(--line); box-shadow: none; }
.materials-library { padding: 0; border: 0; background: transparent; }
.materials-library .roster-assets { gap: 8px; }
.material-toolbar { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; gap: 8px; min-width: 0; }
.material-search { min-width: 0; }
.material-search input { min-height: 44px; padding: 8px 12px; font-size: 16px; }
.material-filter-disclosure { position: relative; }
.material-filter-disclosure > summary { min-width: 64px; min-height: 44px; padding: 8px; border-radius: 8px; background: var(--paper); font-size: 13px; }
.material-filter-disclosure .material-filters { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow-soft); }
.material-filter-disclosure > .material-filters, .material-filter-disclosure > .disclosure-grid { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; width: min(320px, calc(100vw - 64px)); }
.material-filter-disclosure .field { gap: 8px; font-size: 12px; }
.material-filter-disclosure select { min-height: 44px; padding-inline: 8px; font-size: 16px; }
.material-toolbar .material-refresh { min-width: 44px; min-height: 44px; padding: 8px; }
.materials-library .material-item { padding: 8px 12px; background: var(--paper); }
.materials-library .material-item.selected { background: var(--accent-soft); }
.materials-library .material-item:first-child { border-top: 1px solid var(--line); }
.materials-library .material-description { -webkit-line-clamp: 2; }
.materials-library .roster-source:not(:empty) { margin-top: 16px; }
.materials-library:has(.roster-source:not(:empty)) .roster-assets { display: none; }
.materials-library .roster-source:not(:empty) { margin-top: 0; }
.materials-library .material-heading { border-top: 0; padding-top: 0; }
.roster-content .button { min-height: 44px; }
.preparation-progress { padding: 8px 16px; margin-bottom: 16px; }
.preparation-step-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; min-height: 44px; padding: 4px 0; list-style: none; }
.preparation-step-summary::-webkit-details-marker { display: none; }
.preparation-current-title { font-size: 17px; font-weight: 600; }
.preparation-step-summary > .small { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.preparation-step-summary > .small::after { content: ''; width: 6px; height: 6px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); }
.preparation-step-menu[open] .preparation-step-summary > .small::after { transform: rotate(225deg); }
.preparation-current-note { margin: 4px 0 8px; }
.preparation-stages { margin: 12px 0; gap: 8px; }
.preparation-stage { min-height: 64px; padding: 8px; }
.preparation-blockers { padding-top: 4px; margin-bottom: 4px; }
.preparation-blockers summary { min-height: 44px; }
#chat-material-upload .material-upload { margin: 0; }
#chat-material-upload .material-upload-pending { max-height: 120px; overflow-y: auto; margin: 0 0 8px; padding: 0; }
#chat-material-upload .material-upload-pending li { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 0 0 8px; border: 0; border-radius: 8px; background: var(--soft); }
#chat-material-upload .material-upload-pending li > span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.attachment-remove { flex: 0 0 44px; min-width: 44px; min-height: 44px; border: 0; box-shadow: none; background: transparent; }
.composer-content > :empty { margin: 0; padding: 0; }
.voice-recording { gap: 8px; padding: 8px; }
.voice-directions .button { min-height: 44px; }
.voice-capture-feedback { gap: 0; }
.voice-wave { height: 16px; }
.message.confirmation-receipt { align-self: flex-end; width: min(100%, 640px); padding: 12px 16px; border: 1px solid var(--accent-line); border-radius: 12px; background: var(--accent-soft); }
.message.confirmation-receipt .message-content { padding: 0; background: transparent; }
.confirmation-receipt .confirmation-title, .confirmation-receipt .message-label { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--accent); font-size: 13px; font-weight: 600; }
.confirmation-fields, .confirmation-fields dl { display: grid; grid-template-columns: minmax(72px, .4fr) minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; }
.confirmation-fields:has(> dl) { display: block; }
.confirmation-fields dt { color: var(--muted); }
.confirmation-fields dd { min-width: 0; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.confirmation-receipt .message-actions { margin-top: 8px; }

@media (max-width: 1040px) and (min-width: 701px) {
  .identity-mode { --workspace-sidebar-width: 184px; }
  .identity-mode .header-inner { padding-inline: 12px; }
  .identity-mode .header-actions { padding-inline: 24px; }
  .identity-mode .page { padding-inline: 24px; }
}
@media (min-width: 1100px) {
  .materials-library:has(.roster-source:not(:empty)) .roster-content { grid-template-columns: minmax(240px, .75fr) minmax(0, 1.5fr); align-items: start; gap: 24px; }
  .materials-library:has(.roster-source:not(:empty)) .roster-assets { display: grid; }
  .materials-library:has(.roster-source:not(:empty)) .roster-status { grid-column: 1 / -1; }
  .materials-library:has(.roster-source:not(:empty)) .material-list { max-height: max(320px, calc(100dvh - 360px)); overflow-y: auto; overscroll-behavior: contain; }
}
@media (max-width: 700px) {
  .identity-mode { padding-left: 0; }
  .identity-mode .site-header { position: static; width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .identity-mode .header-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; padding: 12px 16px 0; }
  .identity-mode #site-brand { padding-left: 32px; font-size: 18px; }
  .identity-mode #site-brand::before { left: 1px; }
  .identity-mode #site-brand::after { left: 6px; }
  .identity-mode .identity-brand-caption { display: none; }
  .identity-mode #theme-toggle { grid-column: 2; grid-row: 1; align-self: center; margin: 0; }
  .identity-mode #identity-navigation { grid-column: 1 / -1; display: flex; flex-wrap: nowrap; gap: 4px; padding: 8px 0; }
  .identity-mode #identity-navigation a { flex: 1; justify-content: center; gap: 6px; min-width: 0; padding: 8px 4px; font-size: 13px; }
  .identity-mode #identity-navigation svg { width: 18px; height: 18px; flex-basis: 18px; }
  .identity-mode .header-actions { display: contents; }
  .identity-mode .identity-workspace-context, .identity-mode .account-name { display: none; }
  .identity-mode .account-menu { grid-column: 3; grid-row: 1; align-self: center; }
  .identity-mode .account-menu-name { display: block; padding: 8px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
  .identity-mode .page { margin: 0 auto; padding: 16px 16px 32px; }
  .identity-mode .page-footer { padding: 16px 16px 80px; }
  .event-navigation .workspace-heading { gap: 4px; }
  .event-navigation h1 { font-size: 20px; }
  body[data-page-view="workspace"] #fixed-event-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .event-navigation .business-tabs { margin-bottom: 16px; }
  .card { padding: 16px; }
  .materials-library { padding: 0; }
  .material-toolbar { gap: 4px; }
  .material-toolbar .material-refresh { padding-inline: 8px; font-size: 12px; }
  .material-filter-disclosure > summary { min-width: 56px; padding-inline: 8px; font-size: 12px; }
  .preparation-progress { padding: 8px 12px; }
  .preparation-stage { min-height: 64px; }
  .preparation-step-summary { gap: 4px 12px; }
  .preparation-current-title { font-size: 16px; }
  .assistant-workspace .draft-attachments { max-height: 112px; }
  .assistant-workspace .composer textarea { font-size: 16px; }
  .message.confirmation-receipt { padding: 12px; }
}
@media (max-width: 360px) {
  .identity-workspace-context > span:first-child, .identity-workspace-context > span[aria-hidden] { display: none; }
  .confirmation-fields, .confirmation-fields dl { grid-template-columns: minmax(56px, .35fr) minmax(0, 1fr); gap: 8px; }
}
