/* Shared workspace surfaces. Native controls keep their form semantics.
   Pattern references: docs/design/fluid-workspace.md. */
:root {
  --r-xs: 8px; --r-sm: 14px; --r-md: 20px;
  --r-lg: 26px; --r-xl: 32px; --r-2xl: 36px;
  --fluid-ease: cubic-bezier(.22, 1, .36, 1);
  --fluid-gap: clamp(16px, 2vw, 28px);
  --fluid-shadow: 0 8px 32px -20px color-mix(in srgb, var(--text-primary) 22%, transparent);
}
body {
  --ipd-radius-sm: var(--r-sm);
  --ipd-radius-md: var(--r-md);
  --ipd-radius-lg: var(--r-lg);
}
body.has-side {
  background-image: radial-gradient(ellipse at 90% 0%, var(--accent-soft), transparent 55%);
}
body :is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
body :is(.btn-primary, .btn-secondary, .ipd-btn, .ipui-btn, .learning-primary, .command-chat__btn) {
  border-radius: var(--r-sm);
  transition: background-color .2s, border-color .2s, box-shadow .2s, transform .2s var(--fluid-ease);
}
body :is(.btn-primary, .btn-secondary, .ipd-btn, .ipui-btn):active:not(:disabled) { transform: scale(.98); }
body :is(input:not([type]), input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="search"], input[type="url"], input[type="date"],
  input[type="time"], select:not([multiple]):not([size]), textarea) {
  border-radius: var(--r-sm);
  font: inherit;
  line-height: 1.5;
  min-width: 0;
  max-width: 100%;
}
body :is(.form-input, .settings-section input:not([type="checkbox"]):not([type="range"]),
  .learning-hub input:not([type="checkbox"]), .learning-hub select, .learning-hub textarea) {
  min-height: 46px;
  padding: 11px 14px;
}
/* Keep native pickers on older browsers and phones. Modern desktop browsers
   render a rounded, top-layer picker: it cannot be clipped by a card. */
body select:not([multiple]):not([size]) {
  min-height: 44px;
  padding: 10px 36px 10px 14px;
  color: var(--text-primary);
  background-color: var(--bg-card);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  text-overflow: ellipsis;
}
body select option { color: var(--text-primary); background: var(--bg-card); }
@supports (appearance: base-select) {
  @media (hover: hover) and (pointer: fine) {
    body select:not([multiple]):not([size]),
    body select:not([multiple]):not([size])::picker(select) { appearance: base-select; }
    body select:not([multiple]):not([size]) {
      align-items: center;
      gap: 12px;
      padding-right: 14px;
      background-image: none;
    }
    body select::picker-icon { color: var(--text-muted); transition: rotate .22s var(--fluid-ease); }
    body select:open::picker-icon { rotate: 180deg; }
    body select::picker(select) {
      padding: 6px;
      margin-block: 7px;
      border: 1px solid var(--border-strong);
      border-radius: 18px;
      background: var(--bg-card);
      color: var(--text-primary);
      box-shadow: 0 16px 44px -16px color-mix(in srgb, var(--text-primary) 30%, transparent);
      max-height: min(360px, 55dvh);
      overflow: auto;
    }
    body select option { padding: 10px 12px; gap: 12px; border-radius: 11px; white-space: normal; }
    body select option:is(:hover, :focus-visible, :checked) { background: var(--accent-soft); color: var(--text-primary); }
    body select option:disabled { color: var(--text-muted); }
    body select option::checkmark { color: var(--accent); }
  }
}
body :is(.nav-more-menu, .cmd-dialog, .ipui-popover, .modal-content, .modal-card, .tutor-panel) {
  border-radius: var(--r-lg);
  box-shadow: var(--fluid-shadow);
}
body.has-side :is(.ipd-card, .ipd-stat, .ipd-upcoming-card, .ipd-sched-card, .ipd-grade-card,
  .scheduler-panel, .day-card, .iv-day-card, .overview-card, .settings-section,
  .learning-panel, .learning-organization, .course-card, .focus-card, .library-card) {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--fluid-shadow);
  min-width: 0;
}
body.has-side :is(.ipd-card, .scheduler-panel, .settings-section, .learning-panel) { padding: clamp(18px, 2.3vw, 30px); }
body.has-side :is(.ipd-columns, .scheduler-grid, .learning-admin-layout, .learning-workspace) { gap: var(--fluid-gap); }
body.has-side .learning-policy-panel { grid-row: auto; }
.learning-admin-secondary { display: grid; align-content: start; gap: var(--fluid-gap); min-width: 0; }
body.has-side :is(.stat-card, .assignment-card, .test-card, .mem-card, .focus-task-card,
  .focus-log-card, .gp-panel, .cc-card, .sp-card, .fb-box, .fc-card) { border-radius: var(--r-lg); }
body.has-side :is(.ipd-card-title, .learning-context, .scheduler-inputs, .page-header) { gap: 14px; flex-wrap: wrap; }
body.has-side :is(.ipd-stat, .overview-card) { padding: 20px; }
body.has-side .settings-section + .settings-section { margin-top: 24px; }
body.has-side .learning-form-grid { gap: 20px; }
body.has-side .learning-hub fieldset { padding-block: 24px; }
body.has-side .learning-policy-grid { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
body.has-side .learning-policy-grid .learning-consent {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  align-items: center;
  font-size: .875rem;
}
body.has-side .learning-policy-grid .learning-consent:has(input:checked) { background: var(--accent-soft); }
.learning-policy-grid input[type="checkbox"] { accent-color: var(--accent); width: 20px; height: 20px; }
.policy-tool-copy { display: grid; gap: 3px; }
.policy-tool-copy small { color: var(--text-muted); font-size: .75rem; font-weight: 400; }
.policy-filter { display: block; margin-block: 12px 20px; }
.policy-filter input { width: 100%; }
.policy-summary { color: var(--text-secondary); margin-block: 14px; }
.policy-save-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding-top: 20px; }
.policy-save-row p { margin: 0; color: var(--text-muted); font-size: .85rem; max-width: 48ch; }
/* Sidebar floats within the same canvas, with an always-visible handle. */
@media (min-width: 769px) {
  :root { --side-rail-w: 72px; --side-peek-w: 256px; }
  html[data-side-rail] { --side-w: 92px; }
  body.has-side .app-side {
    inset: 12px auto 12px 12px;
    width: calc(var(--side-w) - 20px);
    padding: 16px 10px 12px;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: color-mix(in srgb, var(--bg-card) 80%, var(--bg));
    box-shadow: var(--fluid-shadow);
    scrollbar-width: thin;
  }
  body.has-side .app-side .side-link {
    padding: 11px 13px;
    min-height: 42px;
    border-radius: 14px;
    gap: 12px;
    transition: color .2s, background-color .2s;
  }
  body.has-side .app-side .side-link.active { box-shadow: inset 0 0 0 1px var(--border-accent); }
  body.has-side [data-extra-collapsed="true"] .side-extra-link:not(.active) { display: none !important; }
  body.has-side .side-extra-toggle { width: 100%; text-align: left; background: transparent; border: 0; font-family: var(--font-ui); cursor: pointer; }
  body.has-side .side-extra-toggle .side-icon { font-size: 24px; line-height: .5; }
  body.has-side .side-nav-list { flex: 1; min-height: 0; overflow-y: auto; }
  body.has-side .side-nav-list .side-link { flex-shrink: 0; }
  body.has-side .side-spacer { display: none; }
  body.has-side .side-foot { flex-shrink: 0; }
  body.has-side .side-logo, body.has-side .side-search { flex-shrink: 0; }
  body.has-side .side-search { border-radius: 14px; box-shadow: none; min-height: 44px; }
  body.has-side .side-collapse-btn { opacity: 1; width: 32px; height: 32px; top: 20px; right: 10px; border-radius: 10px; }
  html[data-side-rail] body.has-side .app-side {
    width: var(--side-peek-w);
    background-image: none;
    border: 1px solid var(--border);
    clip-path: inset(0 calc(var(--side-peek-w) - var(--side-rail-w)) 0 0 round 26px);
    transition: clip-path .28s var(--fluid-ease);
  }
  html[data-side-rail] body.has-side .app-side.is-peek { clip-path: inset(0 -40px 0 0 round 26px); border-radius: 26px; }
  html[data-side-rail] body.has-side .app-side:not(.is-peek) .side-logo { visibility: hidden; min-height: 48px; }
  html[data-side-rail] body.has-side .app-side:not(.is-peek) .side-collapse-btn { display: inline-grid; left: 19px; right: auto; }
  body.has-side main { padding-inline: clamp(20px, 3vw, 48px); }
  body.has-side:has(.tutor-shell) main { padding: 0 !important; margin: 0 !important; }
  body.has-side .tutor-shell { padding: 12px 12px 12px 0; gap: 12px; }
  body.has-side .tutor-side { border: 1px solid var(--border); border-radius: 26px; background: var(--bg-card); width: 248px; }
  body.has-side .tutor-main { border: 1px solid var(--border); border-radius: 30px; background: var(--bg-card); }
  body.has-side .tutor-side-head { padding: 18px; border-bottom: 0; }
  body.has-side .tutor-side-foot { padding: 18px; }
  body.has-side .tutor-empty { padding-top: 72px; }
  .fluid-history-toggle { position: absolute; top: 16px; left: 18px; z-index: 10; }
  .tutor-shell[data-panel-collapsed="true"] .tutor-side { display: none; }
  body.has-side .command-chat { inset: 12px 12px 12px var(--side-w); border: 1px solid var(--border); border-radius: 30px; background: var(--bg-card); overflow: hidden; }
}
.fluid-panel-toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
body .fluid-panel-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 9px 14px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary);
  font: 500 .825rem/1.4 var(--font-ui); cursor: pointer; box-shadow: none;
}
.fluid-panel-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.fluid-panel-toggle:hover { color: var(--text-primary); background: var(--accent-soft); }
[data-fluid-panel][hidden] { display: none !important; }
.ipd-columns[data-panel-collapsed="true"], .learning-workspace[data-panel-collapsed="true"] { grid-template-columns: minmax(0, 1fr) !important; }
body .command-chat__header { padding: 20px clamp(18px, 3vw, 36px); border-bottom-color: var(--border); }
body .command-chat__title { font-size: 1.05rem; }
body .command-chat__inner { max-width: 820px; padding-top: 36px; }
body .command-chat__intro h2 { font-size: clamp(1.9rem, 3.3vw, 2.7rem); letter-spacing: -.04em; }
body .command-chat__prompts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border: 0; margin-top: 28px; }
body .command-chat__prompts :is(button, a) { display: flex; align-items: flex-start; justify-content: center; flex-direction: column; gap: 8px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg); padding: 20px; min-height: 100px; }
body .command-chat__prompts :is(button, a):hover { background: var(--accent-soft); border-color: var(--border-accent); }
body .command-chat__composer { width: min(800px, calc(100% - 36px)); padding: 18px 18px 14px; margin-bottom: 20px; border-radius: 26px; background: var(--bg); box-shadow: var(--fluid-shadow); }
body .command-chat__composer textarea { border-radius: 0; }
body .command-chat__message--user { padding: 14px 18px; border-radius: 24px 24px 8px 24px; }
body :is(.tutor-input-row, .learning-composer) { border-radius: 24px; }
body .tutor-input-row { padding: 12px 14px; }
body .tutor-history-item { border-radius: 13px; padding: 12px; }
body .tutor-chip { border-radius: 999px; padding: 9px 14px; }
body .tutor-assignment-bar { flex-wrap: wrap; gap: 10px; }
body a[data-policy-disabled] { opacity: .65; cursor: not-allowed; text-decoration: none; }
body [data-policy-disabled][hidden], body [data-policy-search][hidden] { display: none !important; }
@media (max-width: 1000px) {
  body.has-side .learning-admin-layout { grid-template-columns: minmax(0, 1fr); }
  body.has-side .learning-policy-panel { grid-row: auto; }
}
@media (max-width: 768px) {
  .fluid-history-toggle { display: none !important; }
  body .command-chat__prompts { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 20px; }
  body .command-chat__prompts :is(button, a) { padding: 16px 18px; min-height: 78px; }
  body .command-chat__header { padding: 14px 16px; flex-wrap: wrap; }
  body .command-chat__actions { flex-wrap: wrap; gap: 8px; }
  body .command-chat__composer { margin-bottom: 10px; border-radius: 24px; padding: 14px; }
  body .command-chat__composer-footer { gap: 10px; }
  body.has-side :is(.ipd-card, .scheduler-panel, .settings-section, .learning-panel) { padding: 18px; border-radius: 24px; }
  body .learning-policy-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  body *, body *::before, body *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
html[data-a11y-motion="reduce"] body * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }

/* Workspace v2: one quiet canvas; depth belongs to chrome and controls. */
body.has-side {
  --workspace-edge: color-mix(in srgb, var(--text-primary) 9%, transparent);
  --workspace-glass: color-mix(in srgb, var(--bg-card) 88%, transparent);
  --workspace-raised: 0 4px 16px -10px color-mix(in srgb, var(--text-primary) 20%, transparent), inset 0 1px 0 color-mix(in srgb, var(--bg-card) 65%, transparent);
  --workspace-inset: inset 0 1px 3px color-mix(in srgb, var(--text-primary) 5%, transparent), 0 1px 0 color-mix(in srgb, var(--bg-card) 70%, transparent);
  --workspace-measure: 820px;
  background-image: radial-gradient(ellipse at 90% 0%, var(--accent-soft), transparent 70%);
}
html[data-theme="light"] body.has-side { --bg: #f3f5f8; --bg-elevated: #e9edf3; }
html[data-theme="dark"]:not([data-palette]) body.has-side { --bg: #15171b; --bg-elevated: #202329; }
body.has-side :is(.ipd-card, .day-card, .iv-day-card, .scheduler-panel, .overview-card,
  .tutor-artifact, .tutor-bubble, .tutor-side, .learning-panel, .gp-panel, .cc-card) {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
body.has-side :is(.ipd-card, .day-card, .iv-day-card, .scheduler-panel, .overview-card,
  .settings-section, .learning-panel, .gp-panel, .cc-card) {
  border-color: var(--workspace-edge) !important;
  box-shadow: var(--workspace-raised) !important;
}
body.has-side :is(h1,h2,h3,h4,h5,h6,p,li,th,td) { overflow-wrap: anywhere; }
body.has-side :is(h1,h2,h3,h4,h5,h6) { line-height: 1.25; text-wrap: pretty; }
body.has-side :is(.tutor-bubble, .command-chat__message) { word-break: normal; }
body .tutor-workspace-header {
  display: flex; flex: none; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 78px; padding: 18px clamp(18px, 3vw, 36px);
  background: transparent; border: 0; border-bottom: 1px solid var(--border);
  position: relative; z-index: 11; box-shadow: none;
}
.tutor-workspace-heading { min-width: 0; }
body .tutor-workspace-heading h1 { margin: 0; font-size: 1rem; letter-spacing: -.015em; }
.tutor-workspace-heading p { margin: 4px 0 0; color: var(--text-muted); font-size: .8rem; }
.tutor-workspace-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
body .tutor-tools-link { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--workspace-edge); border-radius: 14px; background: var(--workspace-glass); color: var(--text-secondary); font-size: .825rem; text-decoration: none; box-shadow: var(--workspace-raised); }
body .tutor-workspace-actions .fluid-history-toggle { position: static; }
body .tutor-main { background: var(--bg); }
body .tutor-empty { min-height: 0; padding-bottom: 24px; justify-content: safe center; }
body .tutor-empty > * { flex-shrink: 0; }
body .tutor-messages { padding-bottom: 20px; }
body .tutor-empty-title { font-size: clamp(1.8rem, 3vw, 2.7rem); letter-spacing: -.04em; line-height: 1.18; max-width: 22ch; }
body #tutorPlaniSvg { width: 72px; height: 82px; }
body #tutorPlaniWrap { margin-bottom: 22px; }
body .tutor-empty-sub { font-size: 1rem; line-height: 1.65; max-width: 52ch; }
body .tutor-chips { max-width: 680px; gap: 8px; }
body .tutor-chip { min-height: 36px; background: transparent; box-shadow: none; }
body .tutor-chip.active { box-shadow: var(--workspace-raised); }
body .tutor-suggestions { width: min(100%, 660px); gap: 10px; }
body .tutor-sug-card { min-height: 52px; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--workspace-edge); box-shadow: none; background: var(--workspace-glass); text-align: left; line-height: 1.6; -webkit-backdrop-filter: none; backdrop-filter: none; }
body .tutor-sug-label { font-family: var(--font-ui); font-size: .78rem; line-height: 1.6; text-transform: none; letter-spacing: 0; }
.tutor-capabilities { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 20px; }
body .tutor-capability { display: inline-flex; align-items: center; gap: 8px; border: 0; padding: 8px 12px; border-radius: 12px; color: var(--text-muted); background: transparent; font: 500 .8rem/1.5 var(--font-ui); cursor: pointer; }
body .tutor-capability:hover { background: var(--bg-elevated); color: var(--text-primary); }
body .tutor-msg-group { max-width: var(--workspace-measure); padding: 14px clamp(18px, 3vw, 32px); gap: 14px; min-width: 0; }
body .tutor-msg-group.bot .tutor-bubble { background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0; padding: 10px 0; max-width: 100%; font-size: 1rem; line-height: 1.8; }
body .tutor-msg-group.user .tutor-bubble { padding: 14px 20px; border-radius: 24px 24px 7px 24px; background: var(--bg-elevated); color: var(--text-primary); box-shadow: none; font-size: 1rem; line-height: 1.65; }
body .tutor-msg-group.bot .tutor-avatar { margin-top: 8px; }
body .tutor-sender { font: 600 .78rem/1.5 var(--font-ui); letter-spacing: 0; padding: 0; }
body :is(.tutor-bubble, .command-chat__message) :is(h1,h2,h3,h4,h5,h6) { margin: 1.5em 0 .6em; font-family: var(--font-ui); font-weight: 650; line-height: 1.4; letter-spacing: -.015em; }
body :is(.tutor-bubble, .command-chat__message) :is(h1,h2) { font-size: 1.35em; }
body :is(.tutor-bubble, .command-chat__message) :is(h3,h4,h5,h6) { font-size: 1.08em; }
body :is(.tutor-bubble, .command-chat__message) p { margin: .7em 0; }
body :is(.tutor-bubble, .command-chat__message) :is(ul,ol) { padding-left: 1.5em; margin: .8em 0; }
body :is(.tutor-bubble, .command-chat__message) li { margin: .4em 0; padding-left: .25em; }
body :is(.tutor-bubble, .command-chat__message) pre { max-width: 100%; overflow-x: auto; white-space: pre; font-size: .85em; padding: 18px; border: 1px solid var(--workspace-edge); border-radius: 16px; line-height: 1.65; background: var(--bg-card); }
body :is(.tutor-bubble, .command-chat__message) :not(pre) > code { font-size: .88em; padding: .15em .4em; border-radius: 6px; background: var(--bg-elevated); }
body :is(.tutor-bubble, .command-chat__message) pre code { font-size: inherit; }
body :is(.tutor-bubble, .command-chat__message) table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .9em; }
body :is(.tutor-bubble, .command-chat__message) :is(th,td) { padding: 12px 16px; border-bottom: 1px solid var(--workspace-edge); text-align: left; }
body :is(.tutor-bubble, .command-chat__message) blockquote { margin: 1em 0; padding-left: 18px; border-left: 3px solid var(--accent-mid); color: var(--text-secondary); }
body .tutor-artifact { border: 1px solid var(--workspace-edge); border-radius: 22px; margin: 22px 0; background: var(--bg-card); box-shadow: none; overflow: hidden; }
body .tutor-artifact-head { padding: 15px 20px; font-size: .85rem; font-weight: 600; background: transparent; border-bottom: 1px solid var(--border); }
body .tutor-artifact svg { max-height: 340px; contain: layout paint; }
body .tutor-artifact input[type="range"] { flex: 1; min-width: 0; height: 36px; accent-color: var(--accent); cursor: pointer; }
body .tutor-artifact label { margin-block: 8px; font-size: .85rem; }
body .tutor-read-reply { align-self: flex-start; color: var(--text-muted); font: 500 .75rem/1.5 var(--font-ui); padding: 6px 10px; background: transparent; border: 0; border-radius: 9px; cursor: pointer; }
body .tutor-read-reply:hover { background: var(--bg-elevated); color: var(--text-primary); }
.tutor-response-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
body .tutor-bubble .ip-math-display { display:block; max-width:100%; overflow-x:auto; overflow-y:hidden; padding-block:8px; }
body .tutor-bubble .katex { font-size:1.1em; text-indent:0; }
body .tutor-bubble .katex-display { margin:.7em 0; }
body .tutor-bubble .katex :is(span,annotation) { overflow-wrap:normal; word-break:normal; }
body .tutor-input-wrap { position: relative; flex: none; width: min(var(--workspace-measure), calc(100% - 36px)); left: auto; right: auto; transform: none !important; bottom: auto; margin: 0 auto 12px; padding: 0; background: transparent; }
body .tutor-input-wrap::before { display: none; }
body .tutor-input-inner { display: grid; grid-template-columns: minmax(0,1fr) repeat(4,38px); gap: 8px; align-items: center; padding: 14px; border: 1px solid var(--workspace-edge); border-radius: 26px; background: var(--bg-card); box-shadow: var(--workspace-raised); }
body .tutor-input-inner:focus-within { border-color: var(--border-accent); box-shadow: 0 0 0 2px var(--accent-soft), var(--workspace-raised); }
body #tutorInput { grid-column: 1 / -1; grid-row: 1; width: 100%; min-height: 44px; max-height: 180px; padding: 4px 8px; margin: 0; border: 0 !important; border-radius: 0; box-shadow: none !important; outline: none !important; background: transparent !important; font: 400 1rem/1.65 var(--font-ui); resize: none; letter-spacing: 0; transform: none !important; }
body #tutorInput:focus-visible { outline: none; }
body .tutor-subject-pill { grid-column: 1; grid-row: 2; justify-self: start; padding: 8px 10px; gap: 7px; border: 0; background: var(--bg-elevated); border-radius: 10px; font-size: .78rem; min-width: 0; }
body .tutor-input-inner > :is(.tutor-icon-btn, #tutorSendBtn) { grid-row: 2; width: 38px; height: 38px; border-radius: 12px; min-width: 0; box-shadow: none; }
body #snapBtn { grid-column: 2; } body #micBtn { grid-column: 3; } body #ttsBtn { grid-column: 4; } body #tutorSendBtn { grid-column: 5; }
body .tutor-input-hint { max-width: 65ch; margin: 10px auto 0; font-size: .72rem; line-height: 1.6; text-wrap: pretty; }
.tutor-practice-drawer { margin: 0 4px 12px; }
.tutor-practice-drawer summary { padding: 8px 4px; color: var(--text-secondary); font-size: .8rem; cursor: pointer; line-height: 1.6; }
.tutor-practice-drawer summary span { margin-left: 12px; color: var(--text-muted); font-size: .75rem; }
body .tutor-practice-drawer .tutor-assignment-bar { padding: 14px; margin-top: 4px; border: 1px solid var(--workspace-edge); border-radius: 18px; background: var(--bg-card); max-height: min(260px, 30dvh); overflow: auto; }
.tutor-audio-feedback { font-size: .75rem; line-height: 1.5; padding-inline: 12px; color: var(--text-muted); }
.tutor-audio-feedback:has(span:empty):not(:has(button:not([hidden]))) { display: none; }
body #tutorAudioPlay { color: var(--accent); background: transparent; border: 0; padding: 8px; font: inherit; cursor: pointer; }
body #tutorAudioPlay[hidden] { display: none; }
body.has-side.has-own-chat .ip-fb .ip-fb-trigger { display: none; }
@media (min-width: 769px) {
  body.has-side .app-side { background: var(--workspace-glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--workspace-raised); }
  body.has-side .tutor-shell { gap: 0; padding-left: 0; }
  body.has-side .tutor-side { width: 226px; background: transparent; border: 0; border-right: 1px solid var(--border); border-radius: 0; }
  body.has-side .tutor-main { border: 0; border-radius: 0; background: transparent; }
  body.has-side .tutor-empty { padding-top: 24px; }
}
@media (max-width: 1000px) { .tutor-workspace-heading p { display: none; } }
@media (max-width: 768px) {
  body .tutor-workspace-header { padding: 10px 16px; min-height: 52px; gap: 12px; }
  body .tutor-workspace-heading h1 { font-size: .9rem; }
  body .tutor-tools-link { padding: 8px 10px; font-size: .75rem; }
  body .tutor-workspace-actions .fluid-history-toggle { display: none; }
  body .tutor-mobile-bar { padding: 6px 12px; min-height: 44px; border-bottom: 0; background: transparent; }
  body .tutor-mobile-title { display: none; }
  body .tutor-input-wrap { width: calc(100% - 24px); bottom: auto; }
  body .tutor-input-inner { border-radius: 22px; padding: 10px; gap: 5px; grid-template-columns: minmax(0,1fr) repeat(4,34px); }
  body .tutor-input-inner > :is(.tutor-icon-btn, #tutorSendBtn) { width: 34px; height: 34px; border-radius: 10px; }
  .tutor-practice-drawer summary span { display: none; }
  body .tutor-empty-title { font-size: 1.75rem; }
  body .tutor-empty { padding-inline: 18px; padding-top: 12px; }
  body .tutor-msg-group { padding: 12px 16px; gap: 10px; }
  body .tutor-msg-group.bot .tutor-bubble { font-size: .95rem; }
}
/* Shared user preferences: choices affect layout only, never permissions. */
html[data-ui-width="wide"] body.has-side { --workspace-measure: 1080px; --page-max: 1440px; }
html[data-ui-density="compact"] body.has-side { --fluid-gap: 14px; }
html[data-ui-density="compact"] body.has-side :is(.ipd-card,.settings-section,.learning-panel,.scheduler-panel) { padding: 18px; }
html[data-ui-surface="solid"] body.has-side { --workspace-glass: var(--bg-card); }
html[data-ui-surface="solid"] body.has-side .app-side { -webkit-backdrop-filter: none; backdrop-filter: none; }
html[data-ui-mascot="hidden"] :is(#tutorPlaniWrap,#planiBot) { display: none !important; }
html[data-ui-motion="reduce"] *, html[data-ui-motion="reduce"] *::before, html[data-ui-motion="reduce"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html[data-ui-accent="emerald"] { --accent: #087d66; --accent-soft: rgba(8,125,102,.08); --accent-mid: rgba(8,125,102,.22); }
html[data-theme="dark"][data-ui-accent="emerald"] { --accent: #6ed9b3; --accent-soft: rgba(110,217,179,.09); }
html[data-ui-accent="violet"] { --accent: #6d48c6; --accent-soft: rgba(109,72,198,.08); --accent-mid: rgba(109,72,198,.22); }
html[data-theme="dark"][data-ui-accent="violet"] { --accent: #bb9afa; --accent-soft: rgba(187,154,250,.09); }
.workspace-appearance { width: min(520px,calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 28px; border: 1px solid var(--border-strong); border-radius: 28px; color: var(--text-primary); background: var(--bg-card); box-shadow: 0 24px 80px #0004; }
.workspace-appearance::backdrop { background: #10152260; backdrop-filter: blur(6px); }
.workspace-appearance header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.workspace-appearance h2 { margin: 0; font: 650 1.35rem/1.4 var(--font-ui); }
.workspace-appearance label { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.workspace-appearance select { width: 180px; }
.workspace-appearance > p { color: var(--text-muted); font-size: .8rem; line-height: 1.6; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation-duration: 120ms; }
  ::view-transition-new(root) { animation-duration: 200ms; }
  .workspace-appearance[open] { animation: workspace-dialog-in 180ms var(--fluid-ease); }
}
@keyframes workspace-dialog-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
html[data-ui-motion="reduce"]::view-transition-old(root),
html[data-ui-motion="reduce"]::view-transition-new(root) { animation: none !important; }

/* Reading preferences scale prose without enlarging the navigation chrome. */
body.has-side { --workspace-reading-size: 1rem; }
html[data-ui-text="large"] body.has-side { --workspace-reading-size: 1.125rem; }
html[data-ui-text="larger"] body.has-side { --workspace-reading-size: 1.25rem; }
body.has-side .tutor-msg-group .tutor-bubble,
body.has-side .command-chat__message { font-size: var(--workspace-reading-size); }
body.has-side :is(.tutor-bubble,.command-chat__message) > :first-child { margin-top: 0; }
body.has-side :is(.tutor-bubble,.command-chat__message) > :last-child { margin-bottom: 0; }
@media (min-width: 1001px) {
  body.has-side .tutor-suggestions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.has-side .tutor-suggestions .tutor-sug-label { grid-column: 1 / -1; }
  body.has-side .tutor-suggestions .tutor-sug-card:last-child { grid-column: 1 / -1; }
}
@media (max-height: 850px) and (min-width: 769px) {
  body.has-side .tutor-empty { padding-top: 18px; }
  body.has-side #tutorPlaniWrap { margin-bottom: 10px; }
  body.has-side #tutorPlaniSvg { height: 58px; }
  body.has-side .tutor-empty-title { margin-top: 12px; font-size: 2rem; }
}
