  /* Focal (Commercial Type) — uses locally installed fonts; add fonts/Focal-*.woff2 + @font-face if self-hosting */
  @font-face {
    font-family: 'Focal';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Focal Regular'), local('Focal-Regular'), local('Focal Roman'), local('Focal');
  }
  @font-face {
    font-family: 'Focal';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: local('Focal Bold'), local('Focal-Bold'), local('Focal Bold Roman');
  }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    background: #0a0a0a;
    color: #d4d4d4;
    font-family: 'Focal', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    display: flex;
    height: 100vh;
    overflow: hidden;
  }
  #sidebar {
    width: 270px;
    min-width: 270px;
    background: #111111;
    border-right: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    overflow-y: auto;
    gap: 8px;
  }
  h1 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #666666;
    padding-bottom: 10px;
    border-bottom: 1px solid #222222;
  }
  .sec {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: #888888;
    text-transform: none;
    margin-top: 4px;
  }
  .ctrl { display: flex; flex-direction: column; gap: 4px; }
  .ctrl label {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: #888888;
    display: flex;
    justify-content: space-between;
  }
  .ctrl label span { color: #c8c8c8; }
  .canvas-size-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .canvas-scale-hint {
    margin: -2px 0 10px;
    font-size: 10px;
    line-height: 1.35;
    color: #777;
  }
  #canvas-keep-symmetric-row.is-disabled {
    opacity: 0.45;
  }
  input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 2px;
    background: #2a2a2a;
    outline: none;
    cursor: pointer;
  }
  input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #b0b0b0;
    cursor: pointer;
  }
  select {
    background: #1a1a1a;
    color: #c8c8c8;
    border: 1px solid #333333;
    font-family: inherit;
    font-size: 10px;
    padding: 5px 7px;
    width: 100%;
    outline: none;
    cursor: pointer;
  }
  select:hover { border-color: #555555; }
  #sidebar input[type=number] {
    background: #1a1a1a;
    color: #c8c8c8;
    border: 1px solid #333333;
    font-family: inherit;
    font-size: 10px;
    padding: 5px 7px;
    width: 100%;
    outline: none;
  }
  #sidebar input[type=number]:hover,
  #sidebar input[type=number]:focus {
    border-color: #555555;
  }
  .toggle-row { flex-direction: row; align-items: center; justify-content: space-between; }
  .toggle-row label { color: #888888; }
  .switch { position: relative; display: inline-block; width: 32px; height: 16px; flex: none; }
  .switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
  }
  .switch .track { position: absolute; inset: 0; background: #2a2a2a; border-radius: 8px; cursor: pointer; transition: background 0.2s; pointer-events: none; }
  .switch .track::before { content: ''; position: absolute; width: 12px; height: 12px; left: 2px; top: 2px; background: #b0b0b0; border-radius: 50%; transition: transform 0.2s, background 0.2s; }
  .switch input:checked + .track { background: #4a4a4a; }
  .switch input:checked + .track::before { transform: translateX(16px); background: #e8e8e8; }
  hr { border: none; border-top: 1px solid #222222; }
  .btn-gen {
    background: #e8e8e8;
    color: #0a0a0a;
    border: none;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 11px;
    cursor: pointer;
    width: 100%;
  }
  .btn-gen:hover { background: #ffffff; }
  .btns { display: flex; flex-direction: column; gap: 7px; margin-top: auto; padding-top: 10px; }
  .btns button {
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 10px;
    cursor: pointer;
    border: 1px solid #333333;
    background: transparent;
    color: #777777;
  }
  .btns button:first-child {
    background: #e8e8e8;
    color: #0a0a0a;
    font-size: 11px;
    border-color: #e8e8e8;
  }
  .btns button:first-child:hover { background: #ffffff; border-color: #ffffff; }
  .btns button:not(:first-child):hover { color: #bbbbbb; border-color: #555555; }
  .preset-btn {
    font-family: inherit;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 7px 10px;
    cursor: pointer;
    border: 1px solid #333333;
    background: transparent;
    color: #777777;
    flex: 1;
  }
  .preset-btn:hover { color: #cccccc; border-color: #555555; }
  .preset-item {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #2a2a2a;
  }
  .preset-item.active { border-color: #666666; }
  .preset-item-load {
    flex: 1;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 9px;
    letter-spacing: 0.08em;
    color: #666666;
    text-align: left;
    padding: 6px 8px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .preset-item.active .preset-item-load { color: #e0e0e0; }
  .preset-item-load:hover { color: #bbbbbb; }
  .preset-item-del {
    background: transparent;
    border: none;
    border-left: 1px solid #2a2a2a;
    font-family: inherit;
    font-size: 10px;
    color: #444444;
    padding: 6px 8px;
    cursor: pointer;
    line-height: 1;
  }
  .preset-item-del:hover { color: #999999; border-left-color: #555555; }
  #canvas-area {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    overflow: hidden;
  }
  #canvas-osc-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 10px;
    width: min(168px, calc(100% - 20px));
    max-height: min(72vh, calc(100% - 20px));
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
    pointer-events: auto;
  }
  #canvas-osc-controls .canvas-hud-title {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: none;
    color: #888888;
    margin: 0;
  }
  #canvas-osc-controls .osc-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  }
  #canvas-osc-controls .osc-group:last-child {
    padding-bottom: 0;
    border-bottom: none;
  }
  #canvas-osc-controls .osc-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  #canvas-osc-controls .osc-toggle-row label:first-child {
    font-size: 9px;
    letter-spacing: 0.04em;
    color: #444444;
    font-weight: 600;
    cursor: pointer;
  }
  #canvas-osc-controls .osc-slider {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  #canvas-osc-controls .osc-slider label {
    font-size: 8px;
    letter-spacing: 0.04em;
    color: #777777;
    display: flex;
    justify-content: space-between;
  }
  #canvas-osc-controls .osc-slider label span {
    color: #333333;
    font-variant-numeric: tabular-nums;
  }
  #canvas-osc-controls .osc-hint {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.35;
    color: #666;
  }
  #canvas-osc-controls .osc-hint[hidden] {
    display: none;
  }
  #canvas-osc-controls input[type=range] {
    height: 2px;
    background: #d0d0d0;
  }
  #canvas-osc-controls input[type=range]::-webkit-slider-thumb {
    width: 8px;
    height: 8px;
    background: #666666;
  }
  #canvas-osc-controls .switch .track { background: #d8d8d8; }
  #canvas-osc-controls .switch input:checked + .track { background: #b8b8b8; }
  #canvas-action-controls {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    min-width: 148px;
    max-width: min(180px, calc(100% - 20px));
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
    pointer-events: auto;
  }
  #canvas-action-controls .canvas-action-btn {
    font-family: inherit;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 6px 8px;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: transparent;
    color: #555555;
    border-radius: 4px;
    width: 100%;
  }
  #canvas-action-controls .canvas-action-btn:hover {
    color: #111111;
    border-color: rgba(0, 0, 0, 0.22);
    background: rgba(0, 0, 0, 0.03);
  }
  #canvas-action-controls .canvas-action-btn.primary {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
  }
  #canvas-action-controls .canvas-action-btn.primary:hover {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
  }
  #canvas-action-controls .video-export-options label[hidden],
  #canvas-action-controls #video-custom-wrap[hidden] {
    display: none !important;
  }
  #canvas-action-controls .video-export-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding-top: 2px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }
  #canvas-action-controls .video-export-options .video-export-span {
    grid-column: 1 / -1;
  }
  #canvas-action-controls .video-export-options label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: none;
    color: #888888;
  }
  #canvas-action-controls .video-export-options input,
  #canvas-action-controls .video-export-options select {
    width: 100%;
    min-width: 0;
    padding: 4px 5px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    background: #f5f5f5;
    color: #222222;
    font-family: inherit;
    font-size: 9px;
  }
  #canvas-action-controls .video-export-options select {
    cursor: pointer;
  }
  #canvas-action-controls .video-export-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    width: 100%;
  }
  #canvas-action-controls .video-export-actions .canvas-action-btn {
    width: 100%;
  }
  #canvas-action-controls #video-export-progress {
    width: 100%;
    max-width: 168px;
    height: 4px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 2px;
  }
  #canvas-action-controls #video-export-progress[hidden] {
    display: none !important;
  }
  #canvas-action-controls #video-export-progress-bar {
    height: 100%;
    width: 0%;
    background: #5718C0;
    transition: width 0.12s ease;
  }
  #canvas-action-controls #video-export-progress.is-encoding #video-export-progress-bar {
    animation: video-export-progress-pulse 1.15s ease-in-out infinite;
  }
  @keyframes video-export-progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
  }
  #canvas-action-controls #video-export-status {
    max-width: 168px;
    min-height: 0;
    font-size: 9px;
    line-height: 1.35;
    color: #777777;
  }
  #canvas-action-controls .canvas-action-btn:disabled,
  #canvas-action-controls input:disabled,
  #canvas-action-controls select:disabled {
    cursor: wait;
    opacity: 0.45;
  }
  #canvas-preset-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    width: min(188px, calc(100% - 20px));
    max-height: min(52vh, calc(100% - 20px));
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
    pointer-events: auto;
  }
  #canvas-preset-controls .canvas-hud-title {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: none;
    color: #888888;
    margin: 0;
  }
  #preset-name-input {
    width: 100%;
    background: #f5f5f5;
    color: #222222;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-family: inherit;
    font-size: 9px;
    padding: 7px 8px;
    outline: none;
  }
  #preset-name-input:focus {
    border-color: rgba(0, 0, 0, 0.22);
    background: #ffffff;
  }
  #canvas-preset-controls .preset-actions-row {
    display: flex;
    gap: 4px;
  }
  #canvas-preset-controls .canvas-preset-btn {
    flex: 1;
    font-family: inherit;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 7px 6px;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: transparent;
    color: #555555;
    border-radius: 4px;
  }
  #canvas-preset-controls .canvas-preset-btn:hover {
    color: #111111;
    border-color: rgba(0, 0, 0, 0.22);
    background: rgba(0, 0, 0, 0.03);
  }
  #canvas-preset-controls .canvas-preset-btn.primary {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
  }
  #canvas-preset-controls .canvas-preset-btn.primary:hover {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
  }
  #canvas-preset-controls #preset-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    min-height: 0;
    flex: 1;
    margin-top: 2px;
  }
  #canvas-preset-controls .preset-empty {
    font-size: 8px;
    letter-spacing: 0.06em;
    color: #999999;
  }
  #canvas-preset-controls .preset-item {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
    overflow: hidden;
  }
  #canvas-preset-controls .preset-item.active {
    border-color: rgba(0, 0, 0, 0.28);
    background: rgba(0, 0, 0, 0.05);
  }
  #canvas-preset-controls .preset-item-load {
    color: #555555;
    font-size: 8px;
  }
  #canvas-preset-controls .preset-item.active .preset-item-load {
    color: #111111;
    font-weight: 600;
  }
  #canvas-preset-controls .preset-item-del {
    border-left-color: rgba(0, 0, 0, 0.1);
    color: #888888;
  }
  #canvas-preset-controls .preset-msg {
    font-size: 8px;
    letter-spacing: 0.04em;
    color: #777777;
    min-height: 1.2em;
    margin: 0;
  }
  canvas { display: block; max-width: 100%; max-height: 100%; }

  /* Live embed player — hide chrome, fill the frame */
  html.gmc-2d-embed,
  html.gmc-2d-embed body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: transparent;
  }
  html.gmc-2d-embed.gmc-2d-embed-loading #canvas-area {
    visibility: hidden;
  }
  html.gmc-2d-embed.gmc-2d-embed-ready #canvas-area {
    visibility: visible;
  }
  html.gmc-2d-embed #sidebar,
  html.gmc-2d-embed #canvas-osc-controls,
  html.gmc-2d-embed #canvas-preset-controls,
  html.gmc-2d-embed #canvas-action-controls,
  html.gmc-2d-embed #embed-modal,
  html.gmc-2d-embed #import-modal,
  html.gmc-2d-embed #export-modal {
    display: none !important;
  }
  html.gmc-2d-embed #canvas-area {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  /* Never stretch: keep intrinsic aspect (circles stay circles on mobile). */
  html.gmc-2d-embed canvas {
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
  }
  /* Fullscreen fill: sized in JS to design aspect (cover), never CSS-stretched. */
  html.gmc-2d-embed.gmc-2d-embed-fill canvas {
    width: auto !important;
    height: auto !important;
    max-width: none;
    max-height: none;
    object-fit: fill;
  }

  #embed-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.72);
  }
  #embed-modal.is-open { display: flex; }
  #embed-modal .embed-modal-panel {
    background: #141414;
    border: 1px solid #333333;
    padding: 16px;
    width: min(480px, 100%);
    max-height: min(88vh, 640px);
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  #embed-modal .embed-modal-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #888888;
  }
  #embed-modal .embed-modal-hint {
    font-size: 9px;
    line-height: 1.45;
    color: #777777;
    margin: 0;
  }
  #embed-modal .embed-modal-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  #embed-modal .embed-modal-field label {
    font-size: 10px;
    letter-spacing: 0.06em;
    color: #888888;
  }
  #embed-modal .embed-modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  #embed-modal .embed-mode-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
  }
  #embed-modal .embed-mode-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #cccccc;
    cursor: pointer;
  }
  #embed-modal .embed-toggle-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 10px;
    letter-spacing: 0.06em;
    color: #cccccc;
    cursor: pointer;
  }
  #embed-modal .embed-toggle-row input {
    width: auto;
    accent-color: #5718C0;
  }
  #embed-modal .embed-modal-row label {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  #embed-modal input[type="url"],
  #embed-modal input[type="number"] {
    width: 100%;
    padding: 7px 8px;
    border: 1px solid #333333;
    background: #0a0a0a;
    color: #cccccc;
    font-family: inherit;
    font-size: 10px;
    outline: none;
  }
  #embed-modal textarea {
    width: 100%;
    min-height: 160px;
    padding: 8px;
    border: 1px solid #333333;
    background: #0a0a0a;
    color: #cccccc;
    font-family: ui-monospace, monospace;
    font-size: 10px;
    resize: vertical;
    outline: none;
  }
  #embed-modal .embed-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  #embed-modal .embed-modal-actions .canvas-action-btn {
    flex: 1;
    min-width: 0;
  }
  #embed-modal .embed-modal-actions .canvas-action-btn.primary {
    background: #e8e8e8;
    color: #0a0a0a;
    border-color: #e8e8e8;
  }
  #embed-modal .embed-modal-actions .canvas-action-btn.primary:hover {
    background: #ffffff;
    border-color: #ffffff;
  }
