.swtd {
    --swtd-ink: #151515;
    --swtd-muted: #676767;
    --swtd-line: #e4e4e4;
    --swtd-red: #c51f2f;
    width: 100%;
    max-width: 1280px;
    margin: 24px auto;
    padding: clamp(16px, 3vw, 32px);
    box-sizing: border-box;
    border: 1px solid var(--swtd-line);
    border-radius: 16px;
    background: #fff;
    color: var(--swtd-ink);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    text-align: left;
}
.swtd *, .swtd *::before, .swtd *::after { box-sizing: border-box; }
.swtd [hidden], .swtd-booking-dock [hidden] { display: none !important; }
.swtd h2, .swtd h3, .swtd p { margin: 0; color: inherit; text-transform: none; }
.swtd h2 { font-family: inherit; font-size: clamp(28px, 3.6vw, 46px); line-height: 1.1; letter-spacing: -.025em; margin: 10px 0 12px; }
.swtd h3 { font-family: inherit; font-size: 17px; line-height: 1.3; margin-bottom: 14px; letter-spacing: normal; }
.swtd p { font-size: 14px; line-height: 1.6; }
.swtd-heading { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 24px; }
.swtd-heading p { max-width: 680px; color: var(--swtd-muted); }
.swtd-eyebrow { color: var(--swtd-red); font-size: 11px; letter-spacing: .14em; font-weight: 700; }
.swtd-version { flex: none; align-self: flex-start; padding: 6px 10px; border: 1px solid var(--swtd-line); border-radius: 5px; font-size: 10px; letter-spacing: .1em; }
.swtd button, .swtd-booking-dock button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
    width: auto; padding: 10px 13px; margin: 0; border: 1px solid #dedede; border-radius: 7px;
    background: #fff; color: #151515; font: inherit; font-size: 13px; font-weight: 600;
    line-height: 1.3; letter-spacing: normal; text-transform: none; text-decoration: none;
    cursor: pointer; box-shadow: none; white-space: normal;
}
.swtd button:hover, .swtd-booking-dock button:hover { border-color: #151515; background: #f6f6f6; color: #151515; }
.swtd button:disabled { opacity: .38; cursor: default; }
.swtd.is-busy { cursor: progress; }
.swtd.is-busy .swtd-workspace, .swtd.is-busy button, .swtd.is-busy input, .swtd.is-busy select { pointer-events: none; opacity: .7; }
.swtd button:focus-visible, .swtd input:focus-visible, .swtd select:focus-visible, .swtd canvas:focus-visible,
.swtd-booking-dock button:focus-visible, .swtd-inline-bar button:focus-visible { outline: 2px solid #c51f2f; outline-offset: 3px; }
.swtd-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--swtd-line); }
.swtd-tools, .swtd-history { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swtd-tools [aria-pressed="true"] { border-color: #151515; background: #151515; color: #fff; }
.swtd-tools button span { font-size: 20px; line-height: 1; }
.swtd-history button:not(.swtd-clear) { width: 44px; padding: 0; font-size: 24px; }
.swtd-ink-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 4px 0 18px; }
.swtd label { display: grid; gap: 5px; margin: 0 0 12px; font-size: 12px; font-weight: 500; color: #555; }
.swtd input[type="text"], .swtd select { display: block; width: 100%; height: 44px; padding: 8px 10px; margin: 0; border: 1px solid #d6d6d6; border-radius: 5px; background: #fff; color: #151515; font: inherit; font-size: 14px; line-height: 1.3; letter-spacing: normal; }
.swtd input[type="checkbox"] { appearance: auto; -webkit-appearance: checkbox; position: static; width: 18px; height: 18px; margin: 0 6px 0 0; accent-color: #151515; opacity: 1; }
.swtd input[type="color"] { appearance: auto; width: 34px; height: 34px; border: 1px solid #ddd; border-radius: 5px; padding: 2px; background: #fff; cursor: pointer; }
.swtd input[type="range"] { appearance: auto; -webkit-appearance: auto; width: 100%; height: 24px; padding: 0; margin: 0; border: 0; background: transparent; accent-color: #151515; }
.swtd .swtd-color-label { display: flex; align-items: center; gap: 8px; margin: 0; }
.swtd-swatches { display: flex; gap: 5px; }
.swtd .swtd-swatches button { width: 32px; min-height: 32px; padding: 0; border: 5px solid white; border-radius: 50%; background: var(--swtd-swatch); box-shadow: 0 0 0 1px #e2e2e2; }
.swtd .swtd-width { display: flex; align-items: center; gap: 8px; width: min(230px, 100%); margin: 0 0 0 auto; }
.swtd-width input { min-width: 60px; }
.swtd output { min-width: 27px; font-size: 12px; color: #151515; text-align: right; }
.swtd-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.swtd-main, .swtd-sidebar { min-width: 0; }
.swtd-stage-title { display: flex; flex-wrap: wrap; gap: 5px 10px; justify-content: space-between; margin-bottom: 10px; font-size: 12px; }
.swtd-stage-title span { color: #767676; font-size: 11px; }
.swtd-stage { position: relative; width: 100%; max-width: 680px; margin: 0 auto; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 9px 28px rgba(0,0,0,.04); }
.swtd-stage.is-transparent { background-image: conic-gradient(#ededed 25%, #fff 0 50%, #ededed 0 75%, #fff 0); background-size: 20px 20px; }
.swtd-canvas { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 1; touch-action: none; cursor: crosshair; outline-offset: -3px !important; }
.swtd-overlay { display: block; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.swtd-empty { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 5px; justify-content: center; align-items: center; padding: 20px; text-align: center; pointer-events: none; color: #8b8b8b; }
.swtd-empty > span { font-size: 44px; line-height: 1; margin-bottom: 15px; font-weight: 400; }
.swtd-empty strong { font-size: 17px; font-weight: 500; }
.swtd-empty small { font-size: 12px; }
.swtd-canvas-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; font-size: 11px; color: #737373; }
.swtd .swtd-canvas-foot label { display: flex; align-items: center; margin: 0; font-size: 11px; }
.swtd-panel { border: 1px solid var(--swtd-line); border-radius: 9px; padding: 16px; margin-bottom: 12px; background: #fff; }
.swtd-panel p { font-size: 12px; color: #676767; margin-bottom: 10px; }
.swtd-panel small { display: block; margin-top: 8px; font-size: 10px; color: #777; }
.swtd .swtd-button-wide { width: 100%; }
.swtd-shapes, .swtd-selection-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
.swtd-shapes button { font-size: 13px; padding: 8px 5px; }
.swtd-selection { border-color: #c51f2f; }
.swtd-status { min-height: 42px; margin: 16px 0 0; padding: 10px 12px; background: #f6f6f6; border-radius: 5px; color: #666; font-size: 12px; }
.swtd-status.is-error, .swtd-booking-message.is-error { color: #b21c2b; background: #fff4f4; }
.swtd-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-top: 16px; }
.swtd-project-actions, .swtd-export-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.swtd-png-hint { align-self: center; font-size: 11px; color: #767676; }
.swtd .swtd-primary { background: #151515; border-color: #151515; color: #fff; }
.swtd .swtd-primary:hover { background: #c51f2f; border-color: #c51f2f; color: #fff; }
.swtd .swtd-secondary { border-color: #151515; }
.swtd .swtd-note { font-size: 10px; color: #7a7a7a; margin-top: 14px; }
.swtd-booking-dock { box-sizing: border-box; grid-column: 1 / -1; margin: 12px 0 22px; padding: 20px; border: 1px solid #dedede; border-radius: 10px; background: #fff; color: #151515; text-align: left; }
.swtd-booking-dock > strong { display: block; font-size: 19px; line-height: 1.3; }
.swtd-booking-dock > p { font-size: 13px; line-height: 1.5; margin: 8px 0 12px; color: #666; }
.swtd-booking-dock .swtd-booking-open { background: #151515; color: #fff; border-color: #151515; margin-right: 7px; }
.swtd-booking-dock .swtd-booking-open:hover { background: #c51f2f; color: #fff; border-color: #c51f2f; }
.swtd-booking-dock > img { display: block; width: 150px; height: 150px; object-fit: contain; margin: 10px 0 14px; border: 1px solid #ddd; border-radius: 5px; background: #fff; }
.swtd-booking-dock .swtd-booking-message { margin: 10px 0 0; padding: 7px 0; }
.swtd-booking-banner { display: flex; align-items: center; gap: 14px; grid-column: 1 / -1; width: 100%; box-sizing: border-box; padding: 12px 16px; margin: 0 0 18px; border: 1px solid #d4dfd5; border-radius: 9px; background: #f4faf5; color: #23462b; }
.swtd-booking-banner[hidden], .swtd-booking-banner [hidden] { display: none !important; }
.swtd-booking-banner img { display: block; flex: 0 0 58px; width: 58px; height: 58px; object-fit: contain; border: 1px solid #dedede; background: #fff; }
.swtd-booking-banner p { margin: 0; font-size: 13px; line-height: 1.5; color: inherit; }
.swtd-booking-banner.is-error { background: #fff4f4; border-color: #e9c4c7; color: #a31c29; }
/* Inline editor: normal document flow; no fullscreen overlay or scroll lock. */
.swtd-inline-editor { box-sizing: border-box; display: block; grid-column: 1 / -1; width: 100%; min-width: 0; max-width: 100%; margin: 0 0 24px; border: 1px solid #dedede; border-radius: 10px; background: #fff; color: #151515; scroll-margin-top: 24px; }
.swtd-inline-editor[hidden] { display: none !important; }
.swtd-inline-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #e4e4e4; background: #fff; border-radius: 10px 10px 0 0; }
.swtd-inline-bar > strong { flex: 1; min-width: 160px; font-size: 11px; letter-spacing: .06em; }
.swtd-inline-bar button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 13px; border: 1px solid #dedede; border-radius: 7px; background: #fff; color: #151515; font: inherit; font-size: 13px; font-weight: 600; line-height: 1.3; text-transform: none; cursor: pointer; }
.swtd-inline-bar .swtd-inline-attach { background: #151515; color: #fff; border-color: #151515; }
.swtd-inline-bar button:focus-visible { outline: 2px solid #c51f2f; outline-offset: 3px; }
.swtd-inline-body > .swtd { border: 0; border-radius: 0; margin: 0; max-width: 100%; }
@media (max-width: 900px) {
    .swtd-workspace { grid-template-columns: minmax(0,1fr) 230px; gap: 16px; }
    .swtd-panel { padding: 13px; }
    .swtd-toolbar { gap: 8px; }
    .swtd-footer { align-items: stretch; }
    .swtd-project-actions, .swtd-export-actions { width: 100%; }
    .swtd-export-actions button { flex: 1; }
}
@media (max-width: 700px) {
    .swtd-inline-bar { padding: 10px; gap: 7px; }
    .swtd-inline-bar > strong { flex-basis: 100%; min-width: 0; }
    .swtd-inline-bar button { flex: 1; font-size: 12px; }
    .swtd { margin: 12px auto; padding: 14px; border-radius: 10px; }
    .swtd-heading { padding-bottom: 17px; }
    .swtd-heading p { font-size: 12px; }
    .swtd-version { display: none; }
    .swtd-tools { width: 100%; }
    .swtd-tools button { flex: 1; padding: 8px; font-size: 12px; }
    .swtd-history { width: 100%; }
    .swtd-clear { margin-left: auto !important; }
    .swtd .swtd-width { width: 100%; margin-left: 0; }
    .swtd-ink-row { gap: 10px; padding-bottom: 15px; }
    .swtd-workspace { grid-template-columns: minmax(0,1fr); }
    .swtd-sidebar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
    .swtd-panel { margin: 0; }
    .swtd-selection { grid-column: 1 / -1; }
    .swtd-stage-title span { display: block; width: 100%; }
    .swtd-canvas-foot { gap: 10px; }
    .swtd-booking-dock { padding: 15px; }
    .swtd-booking-dock > strong { font-size: 17px; }
}
@media (max-width: 390px) {
    .swtd-sidebar { grid-template-columns: minmax(0,1fr); }
    .swtd-export-actions { flex-direction: column; }
    .swtd-project-actions button { flex: 1; padding: 8px; font-size: 11px; }
    .swtd-canvas-foot label { font-size: 10px !important; }
}
