/*
 * SupportDesk theme on top of Material Components for Web (Material Design 2).
 * 8dp grid, Roboto type scale, elevation via MDC cards, primary colour from settings.
 * Branding follows yoyokca.com: navy primary (the default primary colour), gold accent,
 * rounded system display face for headings, and the YOYOKCA mark (brand_logo() in ui.php).
 */
:root {
  --mdc-theme-secondary: #00897b;
  --sd-accent: #ffb300;
  --sd-on-accent: #2a1d00;
  --sd-display: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  --mdc-theme-background: #f5f5f5;
  --mdc-theme-surface: #fff;
  --mdc-theme-error: #b00020;
  --sd-text-secondary: rgba(0, 0, 0, .6);
  --sd-divider: rgba(0, 0, 0, .12);
  --sd-success: #2e7d32;
  --sd-drawer-width: 256px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--mdc-theme-background);
  color: rgba(0, 0, 0, .87);
  font-family: Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--mdc-theme-primary); }
code { font-family: 'Roboto Mono', monospace; font-size: 13px; background: rgba(0,0,0,.06); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
h1, h2, h3, h4, h5, h6 { margin: 0; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--sd-accent); outline-offset: 2px; }
.sd-logo { flex: none; display: block; border-radius: 8px; }

/* ---------- layout primitives ---------- */
.sd-container { max-width: 1280px; margin: 0 auto; padding: 24px; }
.sd-container--medium { max-width: 880px; }
.sd-container--narrow { max-width: 600px; }
.sd-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.sd-row > * { min-width: 0; }
.sd-grow { flex: 1 1 220px; }
.sd-w-120 { flex: 0 0 120px; }
.sd-w-160 { flex: 0 0 160px; }
.sd-inline { display: inline-flex; margin: 0; }
.sd-muted { color: var(--sd-text-secondary); }
.sd-ok { color: var(--sd-success); }
.sd-bad { color: var(--mdc-theme-error); }
.sd-cron { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.sd-nowrap { white-space: nowrap; }
.sd-inline-icon { font-size: 16px !important; vertical-align: -3px; margin-right: 2px; }
.sd-block { width: 100%; }
.sd-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.sd-page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.sd-page-header__title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sd-page-header__title h1 { overflow-wrap: anywhere; }
.sd-page-header p { margin: 4px 0 0; }

.sd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.sd-grid--compact { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: 24px; }

/* ---------- cards & forms ---------- */
.sd-card { padding: 24px; margin-bottom: 16px; border-radius: 4px; }
.sd-card--flush { padding: 0; overflow: hidden; }
.sd-card__title { margin-bottom: 16px; }
.sd-form .sd-field-wrap { margin-bottom: 16px; }
.sd-field-wrap { min-width: 0; }
.sd-field, .sd-field-wrap .mdc-select { width: 100%; }
.sd-row .mdc-select { min-width: 200px; }
.sd-field-wrap .mdc-text-field-helper-line { padding-left: 16px; }
.sd-form h2.mdc-typography--headline6 { margin: 8px 0 16px; }
.sd-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.sd-actions .sd-field-wrap { margin-bottom: 0; }
.sd-actions--end { margin: 8px 0 24px; }
.sd-actions--sticky { position: sticky; bottom: 0; padding: 16px 0; background: linear-gradient(transparent, var(--mdc-theme-background) 40%); }
.sd-checks-row { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.sd-checks-col { display: flex; flex-direction: column; margin: 4px 0 12px; }
.sd-checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.sd-checkbox label { cursor: pointer; }
.sd-checkbox-row { display: flex; flex-wrap: wrap; gap: 0 24px; }
.sd-group-title { margin: 24px 0 8px; }
.sd-template-list .mdc-deprecated-list-item__secondary-text { white-space: normal; }
.sd-template-list .mdc-deprecated-list-item { height: auto; min-height: 72px; padding-top: 8px; padding-bottom: 8px; }
.sd-placeholders { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; }
.sd-placeholders code { background: #f1f3f4; padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.sd-email-preview { width: 100%; height: 640px; border: 1px solid var(--sd-divider); border-radius: 4px; background: #f5f5f5; }
.mdc-text-field--textarea .mdc-text-field__input { font-family: inherit; line-height: 1.5; }
input[type=color].mdc-text-field__input { height: 32px; padding: 0; border: 0; background: none; cursor: pointer; }

.sd-banner { display: flex; gap: 16px; align-items: flex-start; padding: 16px; border-radius: 4px; margin-bottom: 16px; font-size: 14px; line-height: 20px; }
.sd-banner .material-icons { flex: none; }
.sd-banner--error { background: #fdecea; color: #611a15; }
.sd-banner--error .material-icons { color: var(--mdc-theme-error); }
.sd-banner--info { background: #e8f0fe; color: #174ea6; }

.sd-empty { text-align: center; padding: 48px 24px; }
.sd-empty__icon { font-size: 64px !important; color: rgba(0,0,0,.26); margin-bottom: 16px; }
.sd-empty h1, .sd-empty h2 { margin-bottom: 8px; }
.sd-empty p { margin: 0 0 24px; }
.sd-steps { text-align: left; margin: 0 auto 24px; max-width: 460px; line-height: 1.7; }

/* ---------- status chips & tags ---------- */
.sd-status {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px;
  font-size: 12px; font-weight: 500; letter-spacing: .0333em; white-space: nowrap;
}
.sd-status--open { background: #e3f2fd; color: #0d47a1; }
.sd-status--answered { background: #e8f5e9; color: #1b5e20; }
.sd-status--client_updated { background: #fff3e0; color: #e65100; }
.sd-status--on_hold { background: #ede7f6; color: #4527a0; }
.sd-status--closed { background: #eeeeee; color: #616161; }
.sd-tag {
  display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; padding: 0 8px; height: 20px; border-radius: 10px;
  background: rgba(0,0,0,.08); color: var(--sd-text-secondary); font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px;
}
.sd-tag .material-icons { font-size: 13px; }
.sd-tag--note { background: #fff8e1; color: #8d6e00; }
.sd-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--mdc-theme-primary);
  color: #fff; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center;
}
.sd-log { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.sd-log--ok { color: var(--sd-success); }
.sd-log--error { color: var(--mdc-theme-error); }
.sd-log--skipped { color: var(--sd-text-secondary); }
.sd-log--spam { color: #e65100; }

/* M2 filter chips */
.sd-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sd-chip {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 16px;
  background: #e0e0e0; color: rgba(0,0,0,.87); text-decoration: none; font-size: 14px; letter-spacing: .0178em;
  transition: background .15s, box-shadow .15s;
}
.sd-chip:hover { background: #d5d5d5; }
.sd-chip--selected { background: color-mix(in srgb, var(--mdc-theme-primary) 16%, white); color: var(--mdc-theme-primary); }
.sd-chip__icon { font-size: 18px !important; margin: 0 4px 0 -4px; }

.sd-filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 16px; }
.sd-filters .sd-field-wrap { flex: 0 1 240px; }

/* ---------- avatars & people ---------- */
.sd-avatar {
  --sd-avatar-hue: 210;
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: hsl(var(--sd-avatar-hue), 45%, 88%); color: hsl(var(--sd-avatar-hue), 55%, 28%);
  font-weight: 500; font-size: 15px; letter-spacing: .02em;
}
.sd-avatar--sm { width: 32px; height: 32px; font-size: 13px; }
.sd-avatar--staff { background: var(--mdc-theme-primary); color: #fff; }
.sd-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sd-person > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sd-person--lg { margin-bottom: 16px; }

/* ---------- top app bar ---------- */
.sd-appbar { background: var(--mdc-theme-primary); }
.sd-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding-left: 12px; border-radius: 6px; }
.sd-brand .mdc-top-app-bar__title { padding-left: 0; font: 700 20px var(--sd-display); letter-spacing: .02em; }
.sd-wordmark { display: block; height: 38px; width: auto; color: #fff; }
.sd-brand__label.mdc-top-app-bar__title { font: 500 18px var(--sd-display); opacity: .85; border-left: 1px solid rgba(255,255,255,.4); padding-left: 14px; }
.sd-staff-title { display: inline-flex; align-items: center; gap: 10px; font-family: var(--sd-display); font-weight: 700; }
.sd-appbar__btn.mdc-button { --mdc-text-button-label-text-color: #fff; color: #fff; }
.sd-appbar__icon { color: #fff; }
.sd-search {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; margin-right: 8px; border-radius: 4px;
  background: rgba(255,255,255,.15); color: #fff; width: min(360px, 40vw); transition: background .15s;
}
.sd-search:focus-within { background: #fff; color: rgba(0,0,0,.6); }
.sd-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: inherit; font: inherit; font-size: 16px; }
.sd-search input::placeholder { color: inherit; opacity: .8; }
.sd-search:focus-within input { color: rgba(0,0,0,.87); }

/* ---------- staff shell (dismissible drawer) ---------- */
.sd-staff .sd-drawer { position: fixed; top: 0; bottom: 0; height: 100vh; z-index: 7; }
.sd-drawer__user { display: flex; align-items: center; gap: 16px; padding: 16px 0 12px; }
.sd-drawer .mdc-drawer__header { border-bottom: 1px solid var(--sd-divider); min-height: 0; }
.sd-drawer .mdc-drawer__title { margin: 0; }
.sd-drawer .mdc-drawer__subtitle { margin: 0; }
.sd-drawer .mdc-deprecated-list-item { text-decoration: none; }
.sd-drawer .mdc-deprecated-list-item__meta { margin-left: auto; }
.sd-drawer .mdc-deprecated-list-group__subheader { margin: 12px 16px 4px; font-size: 12px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--sd-text-secondary); }
.sd-staff__content { min-height: 100vh; display: flex; flex-direction: column; }
.sd-staff #sd-appbar { position: sticky; top: 0; }
.sd-staff__main.mdc-top-app-bar--fixed-adjust { padding-top: 0; flex: 1; }
.sd-scrim { display: none; }
.sd-narrow .mdc-drawer--open:not(.mdc-drawer--closing) + .mdc-drawer-app-content { margin-left: 0; margin-right: 0; }
.sd-narrow.sd-drawer-open .sd-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 6; }
.sd-narrow .sd-drawer { box-shadow: 0 8px 10px -5px rgba(0,0,0,.2), 0 16px 24px 2px rgba(0,0,0,.14), 0 6px 30px 5px rgba(0,0,0,.12); }

/* ---------- data tables ---------- */
.sd-table { width: 100%; border-radius: 4px; background: #fff; }
.sd-table .mdc-data-table__table { min-width: 100%; }
.sd-row-link { cursor: pointer; }
.sd-subject { color: rgba(0,0,0,.87); text-decoration: none; font-weight: 500; }
.sd-row-link:hover .sd-subject { color: var(--mdc-theme-primary); }
.sd-unread .sd-subject::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mdc-theme-primary); margin-right: 8px; vertical-align: 1px; }
.sd-cell-subject { max-width: 420px; white-space: normal; padding-top: 10px !important; padding-bottom: 10px !important; }
.sd-cell-wrap { white-space: normal; max-width: 360px; overflow-wrap: anywhere; }
.sd-inactive { opacity: .6; }
.sd-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.sd-pagination a { text-decoration: none; color: rgba(0,0,0,.6); }
.sd-disabled { opacity: .3; pointer-events: none; }

/* ---------- ticket view ---------- */
.sd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.sd-layout__side { position: sticky; top: 88px; }
.sd-thread { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.sd-message { padding: 16px 24px 20px; border-radius: 4px; }
.sd-message--mine { border-left: 4px solid var(--mdc-theme-primary); }
.sd-message--note { background: #fffde7; border-left: 4px solid #fbc02d; }
.sd-message__header { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.sd-message__who { min-width: 0; }
.sd-message__body { overflow-wrap: anywhere; line-height: 1.6; font-size: 15px; }
.sd-event { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--sd-text-secondary); text-align: center; padding: 0 16px; }
.sd-event .material-icons { font-size: 16px; }
.sd-event + .sd-attachments { justify-content: center; margin-top: -8px; padding-top: 0; border-top: 0; }
.sd-closed { display: flex; flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap; }
.sd-closed .sd-grow { flex-basis: 260px; }
.sd-closed h2 { margin: 0 0 4px; }
.sd-closed p { margin: 0; }
.sd-closed__icon { color: var(--sd-text-secondary); font-size: 32px; }
.sd-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--sd-divider); }
.sd-attachment {
  display: inline-flex; align-items: center; gap: 8px; max-width: 280px; padding: 6px 12px 6px 6px; border: 1px solid var(--sd-divider);
  border-radius: 4px; color: rgba(0,0,0,.87); text-decoration: none; font-size: 13px; transition: background .15s;
}
.sd-attachment:hover { background: rgba(0,0,0,.04); }
.sd-attachment .material-icons { color: var(--mdc-theme-primary); margin-left: 4px; }
.sd-attachment__thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 2px; }
.sd-attachment__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-attachment__size { color: var(--sd-text-secondary); flex: none; }

.sd-reply { padding: 0; }
.sd-reply__body { padding: 16px 24px 24px; }
.sd-reply__hint { margin: 0 0 12px; }
.sd-note-hint { color: #8d6e00; }
.sd-reply--note { background: #fffde7; }
.sd-reply__footer { display: flex; gap: 16px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.sd-reply__footer .sd-field-wrap { flex: 0 1 240px; margin-bottom: 0; }
.sd-reply .mdc-tab-bar { border-bottom: 1px solid var(--sd-divider); }
.sd-upload { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.sd-upload__button { position: relative; overflow: hidden; cursor: pointer; }
.sd-upload__input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.sd-upload__list { color: var(--sd-text-secondary); overflow-wrap: anywhere; }
.sd-other-tickets { margin: 0 -16px; }
.sd-other-tickets a { text-decoration: none; }
.sd-layout__side .sd-form .sd-field-wrap { margin-bottom: 16px; }

/* ---------- department cards ---------- */
.sd-dept-card { padding: 0; text-decoration: none; color: inherit; }
.sd-dept-card__inner { padding: 20px 24px; height: 100%; }
.sd-dept-card__head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.sd-dept-card__icon { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--mdc-theme-primary) 12%, white); color: var(--mdc-theme-primary); }
.sd-dept-card__meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; color: var(--sd-text-secondary); margin-bottom: 8px; }
.sd-dept-card__meta .sd-tag { margin-left: 0; }
.sd-test-bar { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 24px; }
.sd-test-bar__buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.sd-mailbox { margin: 0; padding: 16px; }
.sd-mailbox > div { margin-bottom: 2px; overflow-wrap: anywhere; }

/* ---------- client portal ---------- */
.sd-client { display: flex; flex-direction: column; min-height: 100vh; }
.sd-client__main { flex: 1; }
/* The app bar and hero read as one navy band, like the top of yoyokca.com */
.sd-client .sd-appbar { box-shadow: none; }
.sd-client .sd-appbar__btn.mdc-button { border-radius: 6px; }
.sd-client h1, .sd-client h2 { font-family: var(--sd-display); }
.sd-hero { background: var(--mdc-theme-primary); color: #fff; padding: 56px 24px 104px; text-align: center; }
.sd-hero__inner { max-width: 720px; margin: 0 auto; }
.sd-hero h1 { font-family: var(--sd-display); font-weight: 700; font-size: clamp(30px, 4.2vw, 44px); line-height: 1.15; letter-spacing: 0; margin-bottom: 14px; }
.sd-hero p { color: #d3dfee; font-size: 18px; margin: 0; }
.sd-hero--compact { background: none; color: inherit; padding: 32px 0 16px; }
.sd-hero__icon { font-size: 56px !important; color: var(--mdc-theme-primary); }
.sd-overlap { margin-top: -80px; position: relative; }
.sd-panel { padding: 24px; }
.sd-welcome { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sd-ticket-list { padding: 8px 0; }
.sd-ticket-list a { text-decoration: none; }
.sd-ticket-list .mdc-deprecated-list-item__meta { margin-left: auto; }
.sd-ticket-list .mdc-deprecated-list-item__text { min-width: 0; }

/* ---------- plain pages (login / installer) ---------- */
.sd-plain__main { min-height: 100vh; }
.sd-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(160deg, var(--mdc-theme-primary) 0 45%, var(--mdc-theme-background) 45%); }
.sd-login__card { width: 100%; max-width: 400px; padding: 32px; }
.sd-login__brand { text-align: center; margin-bottom: 24px; }
.sd-login__brand .material-icons { font-size: 48px; color: var(--mdc-theme-primary); }
.sd-login__brand .sd-logo { margin: 0 auto 8px; border-radius: 14px; }
.sd-login__brand h1 { font-family: var(--sd-display); font-weight: 700; }
.sd-login__brand p { color: var(--sd-text-secondary); margin: 4px 0 0; }
.sd-checks .mdc-deprecated-list-item { height: 36px; }

/* ---------- snackbar ---------- */
.sd-snackbar--error .mdc-snackbar__surface { background-color: #b00020; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .sd-layout { grid-template-columns: 1fr; }
  .sd-layout__side { position: static; order: -1; }
}
@media (max-width: 720px) {
  .sd-container { padding: 16px; }
  .sd-card { padding: 16px; }
  .sd-message { padding: 16px; }
  .sd-reply__body { padding: 16px; }
  .sd-panel { padding: 16px; }
  .sd-hero { padding: 32px 16px 96px; }
  .sd-hero h1 { font-size: 2.25rem; line-height: 2.75rem; }
  .sd-search { width: auto; flex: 1; background: none; padding: 0 4px; }
  .sd-search input { width: 0; }
  .sd-search:focus-within input { width: auto; }
  .sd-staff .mdc-top-app-bar__title { display: none; }
  .sd-brand .mdc-top-app-bar__title { max-width: 50vw; overflow: hidden; text-overflow: ellipsis; }
  .sd-wordmark { height: 30px; }
  .sd-brand__label.mdc-top-app-bar__title { display: none; }
  .sd-appbar__btn .mdc-button__label { display: none; }
  .sd-w-120, .sd-w-160 { flex: 1 1 100px; }

  /* Tables become stacked cards */
  .sd-table .mdc-data-table__header-row { display: none; }
  .sd-table .mdc-data-table__table, .sd-table tbody, .sd-table tr, .sd-table td { display: block; width: 100%; }
  .sd-table .mdc-data-table__row { height: auto; padding: 12px 16px; border-top: 1px solid var(--sd-divider); }
  .sd-table .mdc-data-table__cell { height: auto; padding: 4px 0 !important; border: 0; text-align: left; white-space: normal; max-width: none; }
  .sd-table .mdc-data-table__cell[data-label]:not(.sd-cell-subject)::before {
    content: attr(data-label); display: inline-block; min-width: 104px; color: var(--sd-text-secondary); font-size: 12px;
  }
  .sd-table .sd-person { display: inline-flex; vertical-align: middle; }
}

/* ---------- MDC colours that don't follow --mdc-theme-primary out of the box ---------- */
.mdc-text-field--focused:not(.mdc-text-field--disabled) .mdc-floating-label,
.mdc-select:not(.mdc-select--disabled).mdc-select--focused .mdc-floating-label { color: var(--mdc-theme-primary); }
.mdc-select:not(.mdc-select--disabled).mdc-select--focused .mdc-select__dropdown-icon { fill: var(--mdc-theme-primary); }
.mdc-deprecated-list-item--activated,
.mdc-deprecated-list-item--activated .mdc-deprecated-list-item__graphic,
.mdc-drawer .mdc-deprecated-list-item--activated,
.mdc-drawer .mdc-deprecated-list-item--activated .mdc-deprecated-list-item__graphic,
.mdc-deprecated-list-item--selected .mdc-deprecated-list-item__text { color: var(--mdc-theme-primary); }
.mdc-deprecated-list-item--activated .mdc-deprecated-list-item__ripple::before,
.mdc-deprecated-list-item--selected .mdc-deprecated-list-item__ripple::before { background-color: var(--mdc-theme-primary); }
.mdc-tab--active .mdc-tab__text-label, .mdc-tab--active .mdc-tab__icon { color: var(--mdc-theme-primary); }
.mdc-tab-indicator .mdc-tab-indicator__content--underline { border-color: var(--mdc-theme-primary); }
.mdc-tab .mdc-tab__ripple::before, .mdc-tab .mdc-tab__ripple::after { background-color: var(--mdc-theme-primary); }
.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__leading,
.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__notch,
.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__trailing { border-color: var(--mdc-theme-primary); }
.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__input { caret-color: var(--mdc-theme-primary); }
.mdc-card.sd-test-bar, .mdc-card.sd-welcome { flex-direction: row; }

/* ---------- back office ---------- */
.sd-crm--lead, .sd-crm--draft, .sd-crm--pending { background: #eceff1; color: #37474f; }
.sd-crm--qualified, .sd-crm--upcoming { background: #e3f2fd; color: #0d47a1; }
.sd-crm--quote_sent, .sd-crm--sent { background: #ede7f6; color: #4527a0; }
.sd-crm--po_received, .sd-crm--accepted, .sd-crm--partial { background: #e0f7fa; color: #006064; }
.sd-crm--won, .sd-crm--active, .sd-crm--paid, .sd-crm--ok { background: #e8f5e9; color: #1b5e20; }
.sd-crm--renewal, .sd-crm--expired { background: #fff3e0; color: #e65100; }
.sd-crm--lost, .sd-crm--ended, .sd-crm--cancelled, .sd-crm--void, .sd-crm--declined, .sd-crm--gone { background: #eeeeee; color: #616161; }
.sd-crm--overdue, .sd-crm--error { background: #fdecea; color: #b00020; }
.sd-crm--approved { background: #e8f5e9; color: #1b5e20; }

.sd-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.sd-stat { padding: 16px 20px; border-radius: 4px; text-decoration: none; color: inherit; display: block; }
.sd-stat__value { font-size: 28px; line-height: 36px; font-weight: 400; }
.sd-stat__label { color: var(--sd-text-secondary); font-size: 13px; letter-spacing: .02em; }
.sd-stat--warn .sd-stat__value { color: #e65100; }
.sd-stat--bad .sd-stat__value { color: var(--mdc-theme-error); }
.sd-pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.sd-pipeline a { display: block; padding: 12px 16px; border-radius: 4px; background: rgba(0,0,0,.04); text-decoration: none; color: inherit; }
.sd-pipeline a:hover { background: rgba(0,0,0,.08); }
.sd-pipeline strong { display: block; font-size: 20px; font-weight: 500; }

.sd-dl { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 16px; margin: 0 0 8px; font-size: 14px; }
.sd-dl dt { color: var(--sd-text-secondary); }
.sd-dl dd { margin: 0; overflow-wrap: anywhere; }
.sd-card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.sd-card__head h2 { margin: 0; }
.sd-list-plain { list-style: none; margin: 0; padding: 0; }
.sd-list-plain > li { padding: 10px 0; border-top: 1px solid var(--sd-divider); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sd-list-plain > li:first-child { border-top: 0; }
.sd-list-plain a { text-decoration: none; }

.sd-input {
  font: inherit; font-size: 14px; height: 40px; padding: 0 10px; border: 1px solid rgba(0,0,0,.38); border-radius: 4px;
  background: #fff; color: rgba(0,0,0,.87); width: 100%; min-width: 0;
}
.sd-input:focus { outline: 2px solid var(--mdc-theme-primary); outline-offset: -1px; border-color: transparent; }
.sd-lines { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.sd-lines th { text-align: left; font-size: 12px; font-weight: 500; color: var(--sd-text-secondary); padding: 4px 6px; }
.sd-lines td { padding: 4px 6px; vertical-align: middle; }
.sd-lines .sd-num { width: 140px; text-align: right; }
.sd-lines .sd-qty { width: 80px; }
.sd-lines tfoot td { font-weight: 500; text-align: right; padding-top: 12px; }
.sd-amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.sd-timeline { list-style: none; margin: 0; padding: 0; }
.sd-timeline__item { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--sd-divider); }
.sd-timeline__item:first-child { border-top: 0; }
.sd-timeline__item > .material-icons { color: var(--sd-text-secondary); font-size: 20px; margin-top: 2px; }
.sd-timeline__item--note > .material-icons { color: #f9a825; }
.sd-timeline__body { font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.sd-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sd-inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sd-inline-form .sd-field-wrap { margin-bottom: 0 !important; flex: 1 1 200px; }
.sd-danger.mdc-button { --mdc-text-button-label-text-color: var(--mdc-theme-error); color: var(--mdc-theme-error); }
details.sd-details > summary { cursor: pointer; color: var(--mdc-theme-primary); font-size: 14px; margin: 8px 0; }

/* ---------- printable quotes and invoices ---------- */
.sd-doc { background: #fff; max-width: 820px; margin: 24px auto; padding: 48px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.2); color: #000; }
.sd-doc__top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.sd-doc__title { font-size: 28px; font-weight: 300; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 8px; }
.sd-doc__from { white-space: pre-line; font-size: 14px; line-height: 20px; }
.sd-doc__meta { font-size: 14px; }
.sd-doc__meta td { padding: 2px 0 2px 16px; }
.sd-doc__meta td:first-child { color: #555; padding-left: 0; }
.sd-doc__to { white-space: pre-line; font-size: 14px; line-height: 20px; margin-bottom: 24px; }
.sd-doc table.sd-doc__lines { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 24px; }
.sd-doc__lines th { text-align: left; border-bottom: 2px solid #000; padding: 8px 6px; font-weight: 500; }
.sd-doc__lines td { border-bottom: 1px solid #ddd; padding: 8px 6px; vertical-align: top; }
.sd-doc__lines tfoot td { border: 0; font-weight: 500; }
.sd-doc__notes { white-space: pre-line; font-size: 13px; line-height: 19px; color: #333; border-top: 1px solid #ddd; padding-top: 16px; margin-top: 16px; }
.sd-doc__toolbar { max-width: 820px; margin: 16px auto 0; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 0 16px; }
.sd-doc__stamp { display: inline-block; border: 2px solid currentColor; padding: 2px 10px; border-radius: 4px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.sd-doc__stamp--paid { color: #1b5e20; }
.sd-doc__stamp--void, .sd-doc__stamp--overdue { color: #b00020; }
@media print {
  body { background: #fff; }
  .sd-doc__toolbar, .sd-snackbar, .mdc-snackbar { display: none !important; }
  .sd-doc { box-shadow: none; margin: 0; padding: 0; max-width: none; }
}
@media (max-width: 720px) {
  .sd-doc { padding: 24px 16px; margin: 0; }
  .sd-lines thead { display: none; }
  .sd-lines tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px 0; border-top: 1px solid var(--sd-divider); }
  .sd-lines td { padding: 2px 0; }
  .sd-lines td:first-child { grid-column: 1 / -1; }
  .sd-lines .sd-num, .sd-lines .sd-qty { width: auto; }
}

/* School Edition: file pickers for staff lists, lead details */
.sd-file { display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.sd-file input[type=file] { font: inherit; font-size: 14px; }
.sd-pre { white-space: pre-wrap; font-size: 14px; line-height: 20px; margin: 0; }
.sd-checklist { margin: 8px 0 0; padding-left: 20px; font-size: 14px; line-height: 22px; }

/* ---------- deal board ---------- */
.sd-container--wide { max-width: none; }
.sd-board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)) minmax(200px, .8fr); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 16px; }
.sd-board__col { background: rgba(0,0,0,.04); border-radius: 4px; padding: 8px; min-height: 240px; transition: background .15s, box-shadow .15s; }
.sd-board__head { display: flex; flex-direction: column; gap: 4px; padding: 4px 4px 8px; }
.sd-board__cards { display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.sd-drop-over { background: color-mix(in srgb, var(--mdc-theme-primary) 14%, white); box-shadow: inset 0 0 0 2px var(--mdc-theme-primary); }
.sd-deal-card { background: #fff; border-radius: 4px; padding: 10px 12px 4px; box-shadow: 0 1px 3px rgba(0,0,0,.2); cursor: grab; border-left: 3px solid transparent; }
.sd-deal-card--stale { border-left-color: var(--mdc-theme-error); }
.sd-deal-card--dragging { opacity: .5; }
.sd-deal-card--saving { opacity: .6; pointer-events: none; }
.sd-deal-card__title { display: block; color: rgba(0,0,0,.87); text-decoration: none; font-weight: 500; font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.sd-deal-card__title:hover { color: var(--mdc-theme-primary); }
.sd-deal-card__row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-top: 4px; font-size: 14px; }
.sd-deal-card__moves { display: flex; justify-content: flex-end; margin-right: -8px; }
.sd-icon-sm.mdc-icon-button { width: 32px; height: 32px; padding: 4px; font-size: 20px; }
.sd-board__col--closed { display: flex; flex-direction: column; gap: 8px; }
.sd-board__drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 96px; border: 2px dashed rgba(0,0,0,.2); border-radius: 4px; font-weight: 500; text-align: center; }
.sd-board__drop .material-icons { font-size: 28px; }
.sd-board__drop--won { color: #1b5e20; }
.sd-board__drop--lost { color: #616161; }
@media (max-width: 1100px) { .sd-board { grid-template-columns: repeat(5, 260px); } }

.sd-card--focus { box-shadow: 0 0 0 2px var(--mdc-theme-primary); }
.sd-stage-history { list-style: none; margin: 0; padding: 0; }
.sd-stage-history li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--sd-divider); }
.sd-stage-history li:first-child { border-top: 0; }

/* ---------- reports ---------- */
.sd-report { width: 100%; border-collapse: collapse; font-size: 14px; }
.sd-report th { text-align: left; font-weight: 500; color: var(--sd-text-secondary); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--sd-divider); white-space: nowrap; }
.sd-report td { padding: 8px; border-bottom: 1px solid var(--sd-divider); vertical-align: top; }
.sd-report .sd-num, .sd-report th.sd-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sd-report tfoot td { font-weight: 500; border-bottom: 0; }
.sd-report-wrap { overflow-x: auto; }
.sd-bar { display: block; height: 6px; border-radius: 3px; background: var(--mdc-theme-primary); min-width: 2px; margin-top: 4px; }
.sd-bar--muted { background: rgba(0,0,0,.2); }
.sd-health { display: flex; align-items: center; gap: 12px; }
.sd-health__score { font-size: 32px; line-height: 40px; font-weight: 400; }
.sd-reasons { margin: 8px 0 0; padding-left: 18px; font-size: 13px; line-height: 20px; color: var(--sd-text-secondary); }
.sd-tabs-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sd-statement td.sd-num, .sd-statement th.sd-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sd-actions--start { justify-content: flex-start; }

/* Reported search result (ClassroomSearch) card on a ticket */
.sd-search-report__title { margin: 0 0 2px; overflow-wrap: anywhere; }
.sd-search-report__title a { text-decoration: none; }
.sd-search-report__url { margin: 0 0 4px; font: 12px/1.4 'Roboto Mono', monospace; color: var(--sd-text-secondary); overflow-wrap: anywhere; }
.sd-search-report__reports .sd-tag { margin-left: 0; margin-right: 6px; }
.sd-search-report__actions { margin-top: 8px; }
.sd-break { overflow-wrap: anywhere; word-break: break-all; }

/* Reported deck (FlipCardFox) card on a ticket: shares the search-report card's styles */
.sd-deck-report__cards td { vertical-align: top; overflow-wrap: anywhere; }

/* Two-step verification */
.sd-login__alt { text-align: center; margin: 16px 0 0; }
.sd-mfa-secret { display: inline-block; font: 500 18px/1.6 'Roboto Mono', monospace; letter-spacing: 1px; padding: 8px 12px; background: rgba(0,0,0,.06); border-radius: 4px; user-select: all; overflow-wrap: anywhere; }
.sd-mfa-steps { margin: 0 0 16px; padding-left: 20px; }
.sd-mfa-steps li { margin-bottom: 12px; }
.sd-mfa-codes { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 8px 32px; margin: 16px 0; padding: 16px; list-style: none; font: 500 16px/1.5 'Roboto Mono', monospace; background: rgba(0,0,0,.04); border-radius: 4px; user-select: all; }
.sd-login__card--wide { max-width: 640px; padding: 0; }
.sd-login__card--wide > .sd-page-header h1 { color: var(--mdc-theme-on-primary, #fff); }

/* ---------- knowledge base (help center at /help, managed under Knowledge base) ---------- */
/* Search box: a white pill on the navy hero, like the staff search field */
.sd-kb-search { display: flex; align-items: center; gap: 8px; margin: 28px auto 0; max-width: 640px; height: 56px; padding: 0 6px 0 18px; border-radius: 28px; background: #fff; color: rgba(0,0,0,.54); box-shadow: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px 0 rgba(0,0,0,.14), 0 1px 18px 0 rgba(0,0,0,.12); }
.sd-kb-search:focus-within { outline: 3px solid var(--sd-accent); outline-offset: 2px; }
.sd-kb-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; color: rgba(0,0,0,.87); }
.sd-kb-search input::placeholder { color: rgba(0,0,0,.5); }
.sd-kb-search__go.mdc-button { height: 44px; border-radius: 22px; padding: 0 20px; }
.sd-kb-hero { padding-bottom: 112px; }

/* Compact header on category, article and search pages */
.sd-kb-subhero { padding: 20px 24px 76px; text-align: left; }
.sd-kb-subhero__inner { max-width: 1232px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.sd-kb-subhero .sd-kb-search { margin: 0; flex: 0 1 460px; height: 48px; box-shadow: none; }
.sd-kb-subhero .sd-kb-search__go.mdc-button { height: 38px; }
.sd-kb-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; color: #d3dfee; min-width: 0; }
.sd-kb-crumbs a { color: #fff; text-decoration: none; font-weight: 500; }
.sd-kb-crumbs a:hover { text-decoration: underline; }
.sd-kb-crumbs .material-icons { font-size: 18px; opacity: .7; }
.sd-kb-crumbs [aria-current] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 48ch; }
.sd-kb-page { margin-top: -60px; position: relative; }
/* On narrow screens the article comes first; related links and categories follow it */
.sd-kb-page .sd-layout__side { order: 0; }

/* Category cards on the help center home */
.sd-kb-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 16px; }
.sd-kb-cat-card { text-decoration: none; color: inherit; border-radius: 8px; transition: box-shadow .2s; }
.sd-kb-cat-card:hover { box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12); }
.sd-kb-cat-card__inner { padding: 24px; height: 100%; display: flex; flex-direction: column; gap: 8px; border-radius: 8px; }
.sd-kb-cat-card h2 { margin-top: 8px; }
.sd-kb-cat-card p { margin: 0; flex: 1; }
.sd-kb-cat-card__count { display: inline-flex; align-items: center; gap: 4px; color: var(--mdc-theme-primary); font-weight: 500; margin-top: 8px; }
.sd-kb-cat-card__count .material-icons { font-size: 16px; transition: transform .2s; }
.sd-kb-cat-card:hover .sd-kb-cat-card__count .material-icons { transform: translateX(3px); }

/* Article lists (home, category, search results) */
.sd-kb-list { list-style: none; margin: 0; padding: 0; }
.sd-kb-list > li + li { border-top: 1px solid var(--sd-divider); }
.sd-kb-list__link { display: flex; align-items: center; gap: 16px; padding: 14px 8px; margin: 0 -8px; border-radius: 6px; color: inherit; text-decoration: none; }
.sd-kb-list__link:hover { background: color-mix(in srgb, var(--mdc-theme-primary) 6%, white); }
.sd-kb-list__link .sd-grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sd-kb-list__title { font-size: 16px; font-weight: 500; color: rgba(0,0,0,.87); }
.sd-kb-list__link:hover .sd-kb-list__title { color: var(--mdc-theme-primary); }
.sd-kb-list__chevron { color: rgba(0,0,0,.38); }
.sd-kb-type-icon { color: var(--mdc-theme-primary); flex: none; }
.sd-kb-type-label { flex: none; color: var(--sd-text-secondary); }
.sd-kb-results mark { background: color-mix(in srgb, var(--sd-accent) 35%, white); color: inherit; border-radius: 2px; padding: 0 1px; }
.sd-kb-section { margin: 24px 0 4px; color: var(--sd-text-secondary); text-transform: uppercase; letter-spacing: .07em; font-size: 12px; }
.sd-kb-cat-head { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.sd-kb-cat-head p { margin: 4px 0 0; }
.sd-kb-cat-head .sd-dept-card__icon, .sd-kb-cats .sd-dept-card__icon { flex: none; }

/* FAQs: questions that open in place */
.sd-kb-faqs { border: 1px solid var(--sd-divider); border-radius: 8px; overflow: hidden; margin-top: 8px; }
.sd-kb-faq + .sd-kb-faq { border-top: 1px solid var(--sd-divider); }
.sd-kb-faq > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; font-size: 16px; font-weight: 500; }
.sd-kb-faq > summary::-webkit-details-marker { display: none; }
.sd-kb-faq > summary:hover { background: color-mix(in srgb, var(--mdc-theme-primary) 5%, white); }
.sd-kb-faq > summary .material-icons { color: var(--sd-text-secondary); transition: transform .2s; }
.sd-kb-faq[open] > summary { color: var(--mdc-theme-primary); }
.sd-kb-faq[open] > summary .material-icons { transform: rotate(180deg); }
.sd-kb-faq:target > summary { background: color-mix(in srgb, var(--sd-accent) 18%, white); }
.sd-kb-faq .sd-kb-body { padding: 0 20px 12px; }
.sd-kb-faq__link a { color: var(--sd-text-secondary); text-decoration: none; }
.sd-kb-faq__link a:hover { color: var(--mdc-theme-primary); }

/* Article text (Services\Markdown output) */
.sd-kb-article { padding: 32px 40px; }
.sd-kb-article__meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sd-kb-type-pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 12px; font-weight: 500; background: color-mix(in srgb, var(--mdc-theme-primary) 10%, white); color: var(--mdc-theme-primary); }
.sd-kb-type-pill .material-icons { font-size: 16px; }
.sd-kb-article__title { font-family: var(--sd-display); font-weight: 700; font-size: clamp(26px, 3vw, 34px); line-height: 1.2; letter-spacing: 0; overflow-wrap: anywhere; }
.sd-kb-article__lead { font-size: 18px; line-height: 1.6; color: var(--sd-text-secondary); margin: 12px 0 0; }
.sd-kb-body { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; margin-top: 16px; }
.sd-kb-body > :first-child { margin-top: 0; }
.sd-kb-body p, .sd-kb-body ul, .sd-kb-body ol, .sd-kb-body pre, .sd-kb-body blockquote { margin: 0 0 16px; }
.sd-kb-body h2, .sd-kb-body h3, .sd-kb-body h4, .sd-kb-body h5 { font-family: var(--sd-display); margin: 28px 0 8px; line-height: 1.3; }
.sd-kb-body h2 { font-size: 22px; }
.sd-kb-body h3 { font-size: 19px; }
.sd-kb-body h4, .sd-kb-body h5 { font-size: 16px; }
.sd-kb-body ul, .sd-kb-body ol { padding-left: 24px; }
.sd-kb-body li + li { margin-top: 4px; }
.sd-kb-body blockquote { padding: 12px 16px; border-left: 4px solid var(--sd-accent); background: #fff8e1; border-radius: 0 6px 6px 0; }
.sd-kb-body blockquote > :last-child { margin-bottom: 0; }
.sd-kb-body pre { background: #f5f5f5; border: 1px solid var(--sd-divider); border-radius: 6px; padding: 12px 16px; overflow-x: auto; }
.sd-kb-body pre code { background: none; padding: 0; word-break: normal; white-space: pre; }
.sd-kb-body hr { border: 0; border-top: 1px solid var(--sd-divider); margin: 24px 0; }

/* "Was this helpful?" */
.sd-kb-feedback { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--sd-divider); }
.sd-kb-feedback p { margin: 0; }
.sd-kb-feedback__buttons { display: flex; gap: 8px; }
.sd-kb-feedback--chosen.mdc-button--outlined { background: color-mix(in srgb, var(--mdc-theme-primary) 12%, white); }

/* Side navigation, contact card, home page teaser */
.sd-kb-nav ul { list-style: none; margin: 0 -8px; padding: 0; }
.sd-kb-nav li a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 6px; color: rgba(0,0,0,.87); text-decoration: none; font-size: 14px; line-height: 1.4; }
.sd-kb-nav li a:hover { background: color-mix(in srgb, var(--mdc-theme-primary) 6%, white); }
.sd-kb-nav li .material-icons { font-size: 20px; color: var(--sd-text-secondary); }
.sd-kb-nav li a.sd-kb-nav--current { background: color-mix(in srgb, var(--mdc-theme-primary) 12%, white); color: var(--mdc-theme-primary); font-weight: 500; }
.sd-kb-nav li a.sd-kb-nav--current .material-icons { color: var(--mdc-theme-primary); }
.sd-kb-nav__all { display: inline-block; margin-top: 12px; text-decoration: none; font-weight: 500; }
.mdc-card.sd-kb-contact { display: flex; flex-direction: row; align-items: center; gap: 16px 20px; flex-wrap: wrap; border-left: 4px solid var(--sd-accent); }
.sd-kb-contact h2 { margin: 0 0 2px; }
.sd-kb-contact p { margin: 0; }
.sd-kb-contact__icon { font-size: 40px !important; color: var(--mdc-theme-primary); }
.sd-kb-teaser__head { display: flex; gap: 16px; align-items: flex-start; }
.sd-kb-teaser__head > .material-icons { color: var(--mdc-theme-primary); font-size: 32px; }
.sd-kb-teaser__head p { margin: 2px 0 0; }
.sd-kb-teaser .sd-kb-search { margin: 16px 0 12px; max-width: none; height: 48px; box-shadow: none; border: 1px solid rgba(0,0,0,.38); }
.sd-kb-teaser .sd-kb-search__go.mdc-button { height: 38px; }
.sd-kb-teaser__chips { margin-bottom: 0; }

/* Staff: article list, editor and categories */
.sd-kb-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sd-kb-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.mdc-card.sd-kb-stat { flex-direction: row; align-items: center; gap: 16px; padding: 16px 20px; }
.sd-kb-stat > .material-icons { color: var(--mdc-theme-primary); }
.sd-kb-stat strong { display: block; font-size: 24px; font-weight: 500; line-height: 1.2; }
.sd-kb-stat span { font-size: 13px; color: var(--sd-text-secondary); }
.sd-kb-chip-count { margin-left: 6px; font-size: 12px; opacity: .7; }
.sd-kb-title-cell { display: flex; gap: 12px; align-items: flex-start; }
.sd-kb-title-cell .sd-kb-type-icon { margin-top: 1px; font-size: 20px; }
.sd-kb-help { margin-top: -4px; }
.sd-kb-help__grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; align-items: baseline; margin: 8px 0; }
.sd-kb-type-hints { margin: -8px 0 12px; padding-left: 18px; line-height: 1.5; }
.sd-kb-featured { margin: 0 0 20px -10px; }
.sd-kb-featured .mdc-form-field { align-items: center; }
.sd-kb-icons { margin: -8px 0 20px; }
.sd-kb-delete.mdc-button { --mdc-text-button-label-text-color: var(--mdc-theme-error); color: var(--mdc-theme-error); margin-right: auto; }
.sd-kb-cats { list-style: none; margin: 0; padding: 0; }
.sd-kb-cats__item { display: flex; align-items: center; gap: 16px; padding: 16px 16px 16px 24px; }
.sd-kb-cats__item + .sd-kb-cats__item { border-top: 1px solid var(--sd-divider); }
.sd-kb-cats__item--editing { background: color-mix(in srgb, var(--mdc-theme-primary) 6%, white); }
.sd-kb-cats__text { min-width: 0; }
.sd-kb-cats__text .mdc-typography--caption a { text-decoration: none; }
.sd-kb-cats__actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sd-kb-icon-legend { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 12px; }
.sd-kb-icon-legend li { display: flex; align-items: center; gap: 8px; }
.sd-kb-icon-legend .material-icons { font-size: 20px; color: var(--mdc-theme-primary); }

@media (max-width: 720px) {
  .sd-kb-search { height: 48px; padding-left: 14px; }
  .sd-kb-search__go.mdc-button { padding: 0 14px; }
  .sd-kb-subhero { padding: 16px 16px 72px; }
  .sd-kb-subhero .sd-kb-search { flex-basis: 100%; }
  .sd-kb-article { padding: 20px 16px; }
  .sd-kb-type-label { display: none; }
  .sd-kb-cats__item { flex-wrap: wrap; padding: 16px; }
  .sd-kb-cats__actions { width: 100%; }
}
@media print {
  .sd-kb-subhero, .sd-kb-feedback, .sd-kb-contact, .sd-kb-page .sd-layout__side { display: none !important; }
  .sd-kb-page { margin-top: 0; }
}

/* Canned replies: picker in the staff reply box, list and form */
.sd-canned { position: relative; display: flex; justify-content: flex-end; margin: -4px 0 8px; }
.sd-canned__panel {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 8; width: min(520px, 100%);
  background: var(--mdc-theme-surface, #fff); border-radius: 4px; overflow: hidden;
}
.sd-canned__panel[hidden] { display: none; }
.sd-canned__search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--sd-divider); }
.sd-canned__search .material-icons { color: var(--sd-text-secondary); font-size: 20px; }
.sd-canned__search input { flex: 1; border: 0; outline: 0; height: 44px; font: inherit; font-size: 15px; background: transparent; }
.sd-canned__list { list-style: none; margin: 0; padding: 4px 0; max-height: 320px; overflow-y: auto; }
.sd-canned__list[hidden] { display: none; }
.sd-canned__item { display: flex; flex-direction: column; gap: 2px; padding: 8px 16px; cursor: pointer; }
.sd-canned__item--active { background: color-mix(in srgb, var(--mdc-theme-primary) 10%, transparent); }
.sd-canned__title { font-size: 14px; font-weight: 500; }
.sd-canned__preview { font-size: 12px; color: var(--sd-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-canned__empty { margin: 0; padding: 16px; }
.sd-canned__footer { display: flex; justify-content: space-between; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--sd-divider); background: rgba(0,0,0,.02); }
.sd-canned__footer a { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.sd-reply--note .sd-canned__panel { background: #fff; }
.sd-canned-preview { max-width: 640px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-canned-scope { margin-left: 0; }
.sd-canned-body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; margin: 0; padding: 16px 24px; }
.sd-canned-ph { border: 0; background: none; padding: 0; cursor: pointer; color: var(--mdc-theme-primary); }
.sd-canned-ph:hover code { text-decoration: underline; }
