/* One shared color is reflected in the interface and exported teaching documents. */
@media screen {
  .ui-palette { position: relative; flex: 0 0 auto; color: var(--workspace-ink); }
  .ui-palette > summary { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 7px 10px; box-sizing: border-box; border: 1px solid var(--workspace-line); border-radius: 9px; background: white; font: 500 12px/1.5 "Microsoft YaHei", "Segoe UI", sans-serif; list-style: none; cursor: pointer; user-select: none; }
  .ui-palette > summary::-webkit-details-marker { display: none; }
  .ui-palette > summary svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; }
  .ui-palette[open] > summary { color: var(--workspace-accent); background: var(--workspace-accent-soft); }
  .ui-palette[open] > summary svg { transform: rotate(180deg); }
  .ui-palette-current { width: 13px; height: 13px; border-radius: 50%; background: var(--studio-accent, #7547b8); box-shadow: inset 0 0 0 1px #00000010; }
  .ui-palette-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 65; box-sizing: border-box; width: 244px; max-width: calc(100vw - 32px); padding: 16px; border: 1px solid var(--workspace-line); border-radius: 14px; background: white; box-shadow: 0 14px 45px #32254420; }
  .ui-palette-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
  .ui-palette-heading strong { font-size: 13px; }
  .ui-palette-heading > span { color: var(--workspace-muted); }
  .ui-palette-options { display: flex; justify-content: space-between; gap: 6px; margin: 14px 0 12px; }
  .ui-palette-options button { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; margin: 0; padding: 3px; border: 2px solid transparent; border-radius: 50%; background: white; box-shadow: none; cursor: pointer; }
  .ui-palette-options button > span { width: 26px; height: 26px; border-radius: 50%; background: var(--palette-dot); }
  .ui-palette-options button[aria-pressed="true"] { border-color: var(--palette-dot); box-shadow: 0 2px 7px #32254415; }
  .ui-palette-options button:hover { background: #f5f3f8; }
  .ui-palette-panel p { margin: 0; color: var(--workspace-muted); font-size: 11px; line-height: 1.6; }
  .ui-palette-custom { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 12px; color: var(--workspace-ink); font-size: 12px; }
  .ui-palette-custom input { box-sizing: border-box; width: 44px; height: 30px; padding: 2px; border: 1px solid var(--workspace-line); border-radius: 6px; background: white; cursor: pointer; }
  .ui-palette summary:focus-visible, .ui-palette button:focus-visible { outline: 2px solid var(--workspace-accent); outline-offset: 3px; }
  [data-workspace="worksheet"] .workspace-toolbar { flex-wrap: wrap; gap: 10px 16px; height: auto; padding-block: 12px; }
  .paper-palette { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 14px; margin-left: auto; }
  .paper-palette > .color-picker { align-items: center; gap: 8px; margin: 0; }
  .paper-palette > .color-picker > span { margin-right: 3px; color: var(--workspace-muted); font-size: 11px; white-space: nowrap; }
  .paper-palette .color-dot { flex: 0 0 26px; width: 26px; height: 26px; padding: 0; }
  .paper-palette .color-dot:focus-visible { outline: 2px solid var(--workspace-ink); outline-offset: 4px; }
}
@media screen and (max-width: 1180px) {
  [data-workspace="home"] .workspace-header-end { display: flex; }
  [data-workspace="home"] .workspace-header-end .home-edition { display: none; }
  .workspace-header-end { gap: 12px; }
  .workspace-header-end > .ui-palette { margin-left: auto; }
}
@media screen and (max-width: 560px) {
  [data-workspace="home"] .workspace-header-end { display: contents; }
  [data-workspace="home"] .home-help { display: none; }
  .workspace-header-end > .ui-palette { grid-column: 2; grid-row: 1; margin-left: 0; justify-self: end; }
  .workspace-header-end > .workspace-draft { grid-column: 1 / -1; grid-row: 3; }
  .workspace-header-end > .workspace-actions { grid-row: 4; }
  .paper-palette { width: 100%; justify-content: space-between; gap: 10px; margin-left: 0; }
  .paper-palette > .color-picker { gap: 7px; }
  .paper-palette .zoom-control button { width: 27px; }
  .paper-palette .zoom-control span { width: 40px; }
}
