:root {
  color-scheme: light;
  --ink: #51465d;
  --muted: #8d8297;
  --line: #eadff0;
  --panel: rgba(255,255,255,.9);
  --accent: #e78fb2;
  --accent-dark: #cf7096;
  --pink: #f3a9c6;
  --cream: #fff7e8;
  --danger: #cf6f89;
  --layer-sidebar-width: 280px;
  --font-body: "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", sans-serif;
  --font-cute: "HGS創英角ﾎﾟｯﾌﾟ体", "HG丸ｺﾞｼｯｸM-PRO", "Hiragino Maru Gothic ProN", "Yu Gothic UI", sans-serif;
  --closed-lock-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7.25 9V7a4.75 4.75 0 0 1 9.5 0v2H18a2 2 0 0 1 2 2v8.5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V11a2 2 0 0 1 2-2h1.25Zm2.5 0h4.5V7a2.25 2.25 0 0 0-4.5 0v2Z'/%3E%3C/svg%3E");
  --open-lock-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M16.75 9V7a4.75 4.75 0 0 0-9.3-1.37l2.4.7A2.25 2.25 0 0 1 14.25 7v2H6a2 2 0 0 0-2 2v8.5a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V11a2 2 0 0 0-2-2h-1.25Z'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: #f8f3fa;
  background-attachment: fixed;
  -webkit-user-select: none;
  user-select: none;
}
input:is([type="text"], [type="number"]), textarea, [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}
html.desktop-app, html.desktop-app body { height: 100%; overflow: hidden; }
html.browser-fixed-layout { overflow-x: hidden; }
html.browser-fixed-layout body { min-width: 1600px; transform-origin: top left; }
body::before, body::after { position: fixed; z-index: -1; color: rgba(231,143,178,.17); font-size: 110px; line-height: 1; pointer-events: none; }
body::before { content: "✦"; top: 125px; left: 3vw; transform: rotate(-12deg); }
body::after { content: "♡"; right: 2vw; bottom: 18px; transform: rotate(12deg); }
button, input { font: inherit; }
button { cursor: pointer; }
.header-actions { position: relative; display: flex; align-items: center; gap: 8px; margin-top: 0; padding-bottom: 0; }
.header-tab-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.header-tab-bar { display: flex; align-items: center; gap: 7px; }
.header-menu { position: relative; z-index: 310; }
.header-menu > summary, .header-tab-button { display: grid; place-items: center; min-width: 116px; height: 34px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--accent-dark); background: white; box-shadow: 0 3px 10px rgba(207,112,150,.12); font-size: 11px; font-weight: 900; cursor: pointer; list-style: none; transition: border-color .15s,background .15s,box-shadow .15s,transform .15s; }
.header-menu > summary { grid-auto-flow: column; grid-auto-columns: max-content; justify-content: center; gap: 4px; }
.round-heart-icon { width: 14px; height: 14px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.header-menu > summary::-webkit-details-marker { display: none; }
.header-menu > summary:hover, .header-menu[open] > summary, .header-tab-button:hover, .header-tab-button.active { border-color: var(--accent); color: white; background: var(--accent); box-shadow: 0 5px 14px rgba(207,112,150,.22); transform: translateY(-1px); }
.header-menu-panel { position: absolute; z-index: 320; top: calc(100% + 7px); right: 0; display: grid; width: 230px; gap: 4px; padding: 9px; border: 1px solid var(--line); border-radius: 17px; background: #fffafd; box-shadow: 0 14px 32px rgba(92,65,105,.24); isolation: isolate; }
.header-menu-panel button { display: grid; grid-template-columns: 24px 1fr; align-items: center; min-height: 35px; padding: 6px 10px; border: 0; border-radius: 11px; color: var(--ink); background: transparent; font-size: 11px; font-weight: 800; text-align: left; }
.header-menu-panel button > span:first-child { color: var(--accent); font-size: 14px; text-align: center; }
.header-menu-panel button:hover { color: var(--accent-dark); background: #fff0f7; }
.header-menu-separator { height: 1px; margin: 3px 5px; background: repeating-linear-gradient(90deg,var(--line) 0 4px,transparent 4px 8px); }
.header-meta { display: flex; align-items: center; justify-content: flex-end; gap: 9px; width: max-content; color: var(--muted); white-space: nowrap; }
.export-note, .copyright-line { position: static; width: auto; margin: 0; color: inherit; font-size: 7px; line-height: 1.2; text-align: right; white-space: nowrap; }
.settings-dialog { width: min(340px, calc(100vw - 32px)); max-width: none; padding: 0; border: 0; border-radius: 22px; outline: none; color: var(--ink); background: transparent; overflow: visible; }
.settings-dialog::backdrop { background: rgba(80,63,91,.24); backdrop-filter: blur(3px); }
.settings-panel { position: relative; width: 100%; padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,250,252,.98); box-shadow: 0 18px 46px rgba(92,65,105,.24); }
.settings-close { position: absolute; top: 12px; right: 13px; display: grid; place-items: center; width: 29px; height: 29px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: 20px; font-weight: 700; line-height: 1; }
.settings-close:hover { color: white; background: var(--accent); }
.settings-panel-title { display: flex; align-items: center; gap: 5px; margin: 0 38px 15px 0; color: var(--accent-dark); font-size: 15px; font-weight: 900; letter-spacing: .04em; }
.settings-section + .settings-section { margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--line); }
.settings-heading { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.settings-option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.settings-option-grid button { min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; font-size: 11px; font-weight: 800; }
.settings-option-grid button:hover { border-color: var(--accent); color: var(--accent-dark); background: #fff7fb; }
.settings-option-grid button.active { border-color: var(--accent); color: white; background: var(--accent); box-shadow: 0 3px 8px rgba(207,112,150,.2); }
.settings-option-grid button span { margin-right: 2px; }
.settings-check-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 13px; background: white; cursor: pointer; }
.settings-check-option:hover { border-color: var(--accent); background: #fff7fb; }
.settings-check-copy { display: grid; gap: 2px; }
.settings-check-copy strong { color: var(--ink); font-size: 11px; }
.settings-check-copy small { color: var(--muted); font-size: 8px; line-height: 1.35; }
.settings-check-option input { flex: 0 0 auto; width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
header {
  position: relative;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 20px 6px 10px;
  background: rgba(255,255,255,.76);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand-block { display: flex; align-items: center; gap: 10px; }
.brand-block > div { display: flex; min-height: 38px; flex-direction: column; justify-content: center; }
.brand-mark { display: block; flex: 0 0 auto; width: 38px; height: 38px; margin-top: 0; border: 2px solid rgba(255,255,255,.8); border-radius: 12px; object-fit: cover; background: var(--accent); box-shadow: 0 2px 7px rgba(207,112,150,.16),inset 0 1px rgba(255,255,255,.5); transform: rotate(-4deg); transform-origin: center; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 1px; color: #4c4058; font-family: var(--font-cute); font-size: clamp(21px, 2vw, 27px); font-weight: 700; letter-spacing: .05em; text-shadow: 0 2px 0 white; }
.title-sparkle { margin-left: 8px; color: var(--pink); font-size: .72em; }
h2 { margin-bottom: 14px; font-size: 18px; }
.eyebrow, .section-label { margin-bottom: 2px; font-family: "Arial Rounded MT Bold", var(--font-body); font-size: 9px; font-weight: 800; letter-spacing: .14em; color: var(--accent); }
.lead, .hint { margin-bottom: 0; color: var(--muted); font-size: 10px; }
.primary, .upload-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  color: white;
  background: var(--accent);
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow: 0 2px 7px rgba(207,112,150,.16);
}
.primary { position: relative; overflow: hidden; border: 2px solid rgba(255,255,255,.78); }
.primary span { margin-right: 4px; color: #fff4ad; }
.primary:hover, .upload-button:hover { background: var(--accent-dark); }
main {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) var(--layer-sidebar-width);
  gap: 18px;
  width: 100%;
  max-width: 1880px;
  margin: 0 auto;
  padding: 16px clamp(16px, 1.35vw, 24px) 12px;
  transition: grid-template-columns .42s cubic-bezier(.22,1,.36,1);
}
main[hidden] { display: none !important; }
body.sns-mode #fileMenu { visibility: hidden; pointer-events: none; }
body.sns-mode header { padding-top: 6px; padding-bottom: 6px; }
body.sns-mode .brand-mark { width: 36px; height: 36px; }
body.sns-mode h1 { font-size: 24px; }
body.sns-mode .eyebrow { margin-bottom: 2px; }
.sns-split-mode { grid-template-columns: 250px minmax(0,1fr); align-items: start; max-width: 1880px; gap: 22px; padding: 18px clamp(18px,1.5vw,28px); }
.sns-split-controls, .sns-preview-panel { border: 1px solid white; border-radius: 22px; background: var(--panel); box-shadow: 0 8px 20px rgba(93,70,112,.08); }
.sns-split-controls { display: grid; align-content: start; gap: 12px; padding: 16px; }
.sns-back-button { justify-self: start; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--accent-dark); background: white; font-size: 11px; font-weight: 800; }
.sns-back-button:hover { border-color: var(--accent); background: rgba(231,143,178,.08); }
.sns-split-controls h2, .sns-preview-heading h2 { margin: 0; }
.sns-split-intro { margin: -5px 0 2px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.sns-upload-button { display: grid; place-items: center; min-height: 74px; border: 2px dashed var(--pink); border-radius: 17px; color: var(--accent-dark); background: rgba(255,255,255,.74); font-size: 14px; font-weight: 800; cursor: pointer; transition: border-color .15s,background .15s,transform .15s; }
.sns-upload-button:hover { border-color: var(--accent-dark); background: rgba(231,143,178,.08); transform: translateY(-1px); }
.sns-image-info { min-height: 18px; color: var(--muted); font-size: 11px; text-align: center; }
.sns-count-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.sns-count-setting > div:first-child { display: grid; gap: 2px; }
.sns-count-setting strong { font-size: 13px; }
.sns-count-setting small { color: var(--muted); font-size: 10px; }
.sns-stepper { display: grid; grid-template-columns: 34px 46px 34px; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 999px; }
.sns-stepper button { height: 32px; padding: 0; border: 0; color: var(--accent-dark); background: white; font-weight: 900; }
.sns-stepper button:hover:not(:disabled) { color: white; background: var(--accent); }
.sns-stepper button:disabled { color: var(--line); cursor: default; }
.sns-stepper output { font-size: 14px; font-weight: 900; text-align: center; }
.sns-count-presets { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.sns-count-presets button { min-height: 32px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; font-size: 11px; font-weight: 800; }
.sns-count-presets button:hover { border-color: var(--accent); color: var(--accent-dark); }
.sns-count-presets button.active { border-color: var(--accent); color: white; background: var(--accent); }
.sns-output-summary { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; padding: 12px 14px; border-radius: 14px; background: rgba(231,143,178,.08); }
.sns-output-summary span { color: var(--muted); font-size: 11px; }
.sns-output-summary strong { color: var(--accent-dark); font-size: 12px; }
.sns-output-summary small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }
.sns-download-button { width: 100%; min-height: 46px; }
.sns-download-button:disabled { opacity: .45; cursor: not-allowed; }
.sns-preview-panel { display: flex; min-width: 0; min-height: 0; padding: 16px; flex-direction: column; }
.sns-preview-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.sns-preview-heading > span { padding: 6px 12px; border-radius: 999px; color: var(--accent-dark); background: rgba(231,143,178,.1); font-size: 11px; font-weight: 800; }
.sns-preview-stage { position: relative; display: grid; flex: 0 0 auto; width: 100%; aspect-ratio: 16 / 9; place-items: center; min-height: 0; overflow: auto; border: 2px solid var(--line); background-color: white; background-image: linear-gradient(45deg,#eee9f0 25%,transparent 25%),linear-gradient(-45deg,#eee9f0 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#eee9f0 75%),linear-gradient(-45deg,transparent 75%,#eee9f0 75%); background-position: 0 0,0 8px,8px -8px,-8px 0; background-size: 16px 16px; }
.sns-preview-stage canvas { display: block; max-width: 100%; max-height: 70vh; object-fit: contain; }
.sns-preview-placeholder { position: absolute; inset: 0; display: none; place-content: center; gap: 5px; color: var(--muted); text-align: center; pointer-events: none; }
.sns-preview-placeholder strong { color: var(--ink); font-size: 15px; }
.sns-preview-placeholder span { font-size: 11px; }
.sns-preview-stage.empty .sns-preview-placeholder { display: grid; }
.sns-drop-message { position: absolute; inset: 12px; display: none; place-items: center; border: 3px dashed var(--accent); border-radius: 18px; color: var(--accent-dark); background: rgba(255,255,255,.9); font-size: 18px; font-weight: 900; pointer-events: none; }
.sns-preview-stage.drag-over .sns-drop-message { display: grid; }
.sns-preview-stage.drag-over canvas, .sns-preview-stage.drag-over .sns-preview-placeholder { opacity: .2; }
.sns-preview-help { margin: 10px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
html.desktop-app .sns-split-mode { height: calc(100vh - var(--app-header-height,0px)); overflow: auto; }
html[data-theme="dark"] .sns-back-button, html[data-theme="dark"] .sns-count-setting, html[data-theme="dark"] .sns-count-presets button, html[data-theme="dark"] .sns-upload-button { background: #17202b; }
html.desktop-app main { height: calc(100vh - var(--app-header-height, 0px)); overflow: visible; }
html.desktop-app .workspace-column { max-height: none; overflow: visible; padding: 0 6px 0 0; }
html.desktop-app .workspace-column::-webkit-scrollbar { width: 8px; }
html.desktop-app .workspace-column::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: var(--accent); background-clip: padding-box; }
.design-sidebar { align-self: start; width: 100%; min-height: 0; padding: 12px 5px 12px 14px; border: 1px solid white; border-radius: 18px; background: var(--panel); box-shadow: 0 8px 20px rgba(93,70,112,.08); }
.design-sidebar { position: relative; transition: padding .36s cubic-bezier(.22,1,.36,1),width .36s cubic-bezier(.22,1,.36,1),min-height .3s ease; }
#designSidebarContent { opacity: 1; transform: translateX(0); transform-origin: left center; transition: opacity .28s ease .08s,transform .42s cubic-bezier(.22,1,.36,1); }
#designSidebarContent, .sidebar { scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
#designSidebarContent { padding-right: 2px; }
#designSidebarContent::-webkit-scrollbar, .sidebar::-webkit-scrollbar { width: 8px; }
#designSidebarContent::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: var(--accent); background-clip: padding-box; }
.design-sidebar-toggle { position: absolute; z-index: 4; top: 10px; right: -17px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 2px solid white; border-radius: 999px; outline: none; color: transparent; background: var(--accent); box-shadow: 0 2px 6px rgba(207,112,150,.18); font-size: 0; transition: transform .2s,background .15s; }
.design-sidebar-toggle::before { content: ""; position: relative; top: 3px; width: 19px; height: 19px; background: url("assets/sidebar-arrow.png") center / contain no-repeat; filter: invert(1); mix-blend-mode: screen; transition: transform .2s; }
.design-sidebar-toggle:hover { background: var(--accent-dark); }
.design-sidebar-toggle:focus-visible { box-shadow: 0 2px 6px rgba(207,112,150,.18),0 0 0 3px rgba(231,143,178,.22); }
body.layout-sidebar-collapsed main { grid-template-columns: 28px minmax(0,1fr) var(--layer-sidebar-width); }
body.layout-sidebar-collapsed .design-sidebar { min-width: 0; min-height: 54px; padding: 0; overflow: visible; border-radius: 14px; }
body.layout-sidebar-collapsed #designSidebarContent { max-height: 0 !important; height: 0; overflow: hidden !important; opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(-28px); transition: opacity .18s ease,transform .3s ease,visibility 0s linear .3s; }
body.layout-sidebar-collapsed .design-sidebar-toggle { top: 10px; right: auto; left: 50%; transform: translateX(-50%); }
body.layout-sidebar-collapsed .design-sidebar-toggle::before { transform: rotate(180deg); }
.design-picker-heading { margin-bottom: 12px; }
.design-picker-heading h2 { margin: 2px 0 3px; font-size: 16px; }
.design-picker-heading > p:last-child { color: var(--muted); font-size: 10px; }
.design-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 7px; padding: 0 5px; }
.design-filter-panel { position: sticky; z-index: 20; top: 0; grid-column: 1 / -1; width: 100%; padding: 4px 5px 6px; background: var(--panel); }
.people-filter { position: relative; z-index: 20; width: 100%; padding: 0; background: transparent; }
.people-filter summary { position: relative; display: grid; place-items: center; width: 100%; min-height: 32px; padding: 6px 30px; border: 1px solid var(--line); border-radius: 999px; outline: none; color: var(--ink); background: white; box-shadow: 0 2px 7px rgba(207,112,150,.09); list-style: none; font-size: 10px; font-weight: 800; cursor: pointer; }
.people-filter summary:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(231,143,178,.18); }
.people-filter summary::-webkit-details-marker { display: none; }
.people-filter summary::after { content: "▾"; position: absolute; right: 12px; color: var(--accent); font-size: 11px; }
.people-filter[open] summary { border-color: var(--accent); color: var(--accent-dark); }
.people-filter[open] summary::after { content: "▴"; }
.people-filter-options { position: absolute; z-index: 12; top: calc(100% + 5px); left: 0; right: 0; display: grid; gap: 7px; padding: 8px; border: 2px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 14px 28px rgba(79,54,97,.18); }
.people-filter-buttons { display: grid; grid-template-columns: 1fr; gap: 3px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.people-filter-options button { min-height: 27px; padding: 5px 10px; border: 0; border-radius: 8px; color: var(--ink); background: transparent; font-size: 10px; font-weight: 800; text-align: center; }
.people-filter-options button:hover { color: var(--accent-dark); background: color-mix(in srgb,var(--panel) 78%,var(--accent) 22%); }
.people-filter-options button.active { color: white; background: var(--accent); }
.design-filter-checks { display: grid; grid-template-columns: 1fr; gap: 4px; }
.design-filter-checks label { display: flex; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 27px; padding: 4px 2px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); background: white; font-size: 10px; font-weight: 800; cursor: pointer; }
.design-filter-checks label:has(input:checked) { border-color: var(--accent); color: white; background: var(--accent); }
.design-filter-checks input { width: 12px; height: 12px; margin: 0; accent-color: var(--accent); }
.design-option-group[hidden] { display: none; }
.design-category-title { grid-column: 1 / -1; margin: 0 3px -2px; color: var(--accent); font-family: var(--font-cute); font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.design-section-divider { grid-column: 1 / -1; width: calc(100% - 8px); height: 3px; margin: 2px 4px; border: 0; background-image: radial-gradient(circle,var(--line) 1.4px,transparent 1.5px); background-repeat: repeat-x; background-position: left center; background-size: 7px 3px; }
.design-option-group { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.design-option-group:not(:last-child) { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.design-option { position: relative; display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 7px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: transparent; text-align: left; }
.design-option:hover, .design-option.active { border-color: var(--accent); background: #fff8fb; box-shadow: 0 3px 12px rgba(90,60,110,.09); }
.free-edition:not(.public-trial) .design-option:not([data-layout-preset="free"])::after { content: ""; position: absolute; top: 6px; right: 6px; display: block; width: 21px; height: 21px; border: 5px solid var(--panel); border-radius: 50%; background: var(--accent); box-shadow: 0 2px 5px rgba(90,60,110,.08); -webkit-mask: var(--closed-lock-mask) center / contain no-repeat; mask: var(--closed-lock-mask) center / contain no-repeat; }
.design-option strong { padding-right: .5em; font-size: 11px; text-align: right; }
.design-option small { display: none; color: var(--accent-dark); font-size: 9px; font-weight: 700; line-height: 1.35; }
.design-option small::before { content: "✦ "; color: var(--pink); }
.design-preview { display: grid; width: calc(100% - 6px); margin-inline: auto; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--canvas-base); }
.design-preview i { display: block; border: 1px solid var(--ink); }
.free-preview { position: relative; display: block; }
.free-preview i { position: absolute; width: 48%; height: 65%; border-radius: 5px; }
.sns-split-preview { grid-template-columns: repeat(4,1fr); gap: 3px; padding: 5px; }
.sns-split-preview i { border: 1px solid var(--ink); border-radius: 2px; }
.free-preview i:first-child { top: 12%; left: 10%; }
.free-preview i:last-child { right: 9%; bottom: 10%; }
.split6-preview { position: relative; grid-template-columns: repeat(3,1fr); grid-template-rows: repeat(2,1fr); padding: 5px; }
.split6-preview::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--ink); border-radius: 2px; pointer-events: none; }
.split6-preview i { border-width: 0 1px 1px 0; }
.split-count-controls { display: grid; grid-template-columns: 28px minmax(0,1fr) 28px; align-items: center; gap: 3px; }
.design-option-group > .split-count-controls { width: 100%; min-height: 26px; margin: 0; }
.split-count-controls:not(.diagonal-direction-controls):not(.wide-split-controls) { display: flex; flex-wrap: nowrap; align-items: center; }
.split-count-controls:not(.diagonal-direction-controls):not(.wide-split-controls) button { flex: 0 0 32px; }
.split-count-controls:not(.diagonal-direction-controls):not(.wide-split-controls) output { display: flex; flex: 1 1 auto; min-width: 0; align-items: center; justify-content: center; white-space: nowrap; line-height: 1; }
.split-count-controls:not(.diagonal-direction-controls):not(.wide-split-controls) output span { display: block; max-width: 100%; }
.split-count-controls:not(.diagonal-direction-controls):not(.wide-split-controls) output span:last-child { display: none; }
.split-count-controls button { height: 26px; min-height: 26px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent-dark); background: var(--panel); font-size: 9px; font-weight: 800; }
.split-count-controls button.active { border-color: var(--accent); color: white; background: var(--accent); }
.split-count-controls button:disabled { opacity: .35; cursor: not-allowed; }
.split-count-controls output { text-align: center; color: var(--muted); font-size: 9px; font-weight: 800; }
.split3-preview { grid-template-columns: repeat(3,1fr); }
.split3-preview i { border-width: 0 1px 0 0; }
.diagonal3-preview { position: relative; display: block; }
.diagonal3-preview i { position: absolute; top: -15%; width: 1px; height: 135%; background: var(--ink); transform: rotate(19deg); transform-origin: top; }
.diagonal3-preview i:first-child { left: 39%; }
.diagonal3-preview i:last-child { left: 76%; }
.diagonal3-preview::after { content: none; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--ink); }
.diagonal3-preview.middle-on::after { content: ""; }
.diagonal-direction-controls { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.diagonal-direction-controls.single-control { grid-template-columns: 1fr; }
.design-list > .design-option-group .diagonal-direction-controls { grid-template-columns: 1fr; }
.design-list > .design-option-group .diagonal-direction-controls button {
  height: auto;
  min-height: 26px;
  padding: 3px 2px;
  line-height: 1.15;
  white-space: normal;
}
html[lang="en"] .diagonal-direction-controls button {
  min-width: 0;
  height: 36px;
  padding: 2px 4px;
  white-space: normal;
  font-size: 10px;
  line-height: 1.15;
  overflow-wrap: normal;
}
html[lang="en"] #flipDiagonalButton { white-space: normal; }
#flipDiagonalButton { width: 100%; white-space: nowrap; }
.diagonal3-preview.flipped { transform: scaleX(-1); }
.gap-diagonal-preview, .gap-vertical-preview { display: flex; align-items: stretch; gap: 4px; padding: 5px; }
.gap-diagonal-preview { gap: 5px; padding: 6px 13px; }
.gap-diagonal-preview i, .gap-vertical-preview i { display: block; border: 1px solid var(--ink); background: transparent; }
.gap-diagonal-preview i { flex: 1; transform: skewX(-10deg); }
.gap-vertical-preview i { flex: 1; }
.arch-row-preview { display: flex; align-items: stretch; gap: 4px; padding: 5px; }
.arch-row-preview i { flex: 1; border: 1px solid var(--ink); border-radius: 999px 999px 2px 2px; background: transparent; }
.cross-card-preview { display: block; padding: 4px; }
.cross-card-preview svg { display: block; width: 100%; height: 100%; color: var(--ink); }
.cross-card-preview polygon { fill: none; stroke: currentColor; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.x-split-preview { display: block; }
.x-split-preview svg { display: block; width: 100%; height: 100%; color: var(--ink); }
.x-split-preview line { stroke: currentColor; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.center-wide-card-preview, .one-two-split-preview { display: block; padding: 4px; }
.center-wide-card-preview { --flip-y: 1; transform: scaleY(var(--flip-y)); transition: transform .18s ease; }
.center-wide-card-preview.flipped-y { --flip-y: -1; }
.center-wide-card-preview svg, .one-two-split-preview svg { display: block; width: 100%; height: 100%; color: var(--ink); }
.center-wide-card-preview path { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.one-two-split-preview line { stroke: currentColor; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.wide-split-preview { display: block; padding: 4px; }
.wide-split-preview svg { display: block; width: 100%; height: 100%; color: var(--ink); }
.wide-split-preview line { stroke: currentColor; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.wide-split-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wide-split-controls button { width: 100%; }
.asymmetric-split-preview { --flip-x: 1; --flip-y: 1; display: block; padding: 4px; transition: transform .18s ease; transform: scale(var(--flip-x), var(--flip-y)); }
.asymmetric-split-preview.flipped { --flip-x: -1; }
.asymmetric-split-preview.flipped-y { --flip-y: -1; }
.asymmetric-split-preview svg { display: block; width: 100%; height: 100%; color: var(--ink); }
.asymmetric-split-preview line { stroke: currentColor; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.preset-option-button { width: 100%; min-height: 30px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--accent); background: var(--panel); font-size: 11px; font-weight: 700; }
.preset-option-button:hover { border-color: var(--accent); background: var(--soft); }
.preset-option-button.active { border-color: var(--accent); color: white; background: var(--accent); box-shadow: 0 3px 8px color-mix(in srgb, var(--accent) 28%, transparent); }
.preset-flip-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.preset-flip-controls .preset-option-button { min-width: 0; padding-inline: 3px; font-size: 10px; }
.preset-flip-controls.single-control { grid-template-columns: minmax(0, 1fr); }
.preset-flip-controls.single-control .preset-option-button { padding-inline: 8px; font-size: 11px; }
.layout-svg-preview, .one-two-split-preview { --flip-x: 1; --flip-y: 1; transform: scale(var(--flip-x), var(--flip-y)); }
.layout-svg-preview.flipped-x, .one-two-split-preview.flipped-x { --flip-x: -1; }
.layout-svg-preview.flipped-y { --flip-y: -1; }
.layout-svg-preview { display: block; padding: 4px; }
.layout-svg-preview svg { display: block; width: 100%; height: 100%; color: var(--ink); }
.layout-svg-preview line, .layout-svg-preview rect, .layout-svg-preview polygon,
.layout-svg-preview path, .layout-svg-preview ellipse, .layout-svg-preview circle {
  fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; vector-effect: non-scaling-stroke;
}
.layout-svg-preview use { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.layout-svg-preview.flower-thumbnail-preview path {
  stroke: var(--ink);
  stroke-width: 2;
  stroke-opacity: 1;
}
.workspace-column { position: relative; z-index: 12; display: flex; min-width: 0; min-height: 0; flex-direction: column; gap: 8px; overflow: visible; transform: none; }
.workspace-column #editCard { width: 100%; }
body.fixed-layout-mode:not(.card-layout-mode) .global-layer-card { display: none; }
body.fixed-layout-mode:not(.card-layout-mode) #frameEditModeButton,
body.fixed-layout-mode:not(.card-layout-mode) #snapButton,
body.fixed-layout-mode:not(.card-layout-mode) #resetLayoutButton,
body.fixed-layout-mode:not(.card-layout-mode) .arrange-settings { opacity: .42; cursor: not-allowed; }
body.fixed-layout-mode:not(.card-layout-mode) .arrange-settings { pointer-events: none; }
body.frame-settings-only-mode #resetWorkspaceButton { opacity: .42; cursor: not-allowed; }
body.background-only-mode .frame-settings-panel > label:not(:has(#fillFrameInterior)):not(#frameFillColorLabel),
body.background-only-mode .frame-settings-panel > hr { opacity: .35; pointer-events: none; }
.stage-panel, .card {
  background: var(--panel);
  border: 1px solid rgba(222,217,226,.9);
  border-radius: 24px;
  box-shadow: 0 14px 38px rgba(93,70,112,.1);
}
.stage-panel { position: relative; z-index: 20; container-type: inline-size; width: 100%; margin-top: 14px; padding: 13px 16px; align-self: start; overflow: visible; isolation: isolate; border: 2px solid rgba(255,255,255,.88); }
.panel-ribbon { position: absolute; z-index: 30; top: 0; left: 18px; display: block; width: max-content; margin: 0; padding: 6px 19px; border: 2px solid white; border-radius: 999px; color: white; background: var(--pink); box-shadow: 0 5px 12px rgba(210,120,165,.2); font-family: "Comic Sans MS", "Arial Rounded MT Bold", cursive; font-size: 14px; font-weight: 700; letter-spacing: .06em; pointer-events: none; transform: translateY(calc(-50% - 3px)) rotate(-2deg); }
.stage-toolbar { position: relative; z-index: 7; display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 32px; margin-bottom: 9px; padding-top: 4px; overflow: visible; font-size: 13px; color: var(--muted); }
.stage-toolbar::-webkit-scrollbar { display: none; }
.frame-controls { display: flex; flex: 0 0 auto; min-width: max-content; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 8px; }
.frame-controls > * { flex: 0 0 auto; }
.tool-button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--ink); font-size: 12px; font-weight: 700; }
.tool-button:hover { border-color: var(--accent); }
.tool-button.active { border-color: var(--accent); color: white; background: var(--accent); }
.reset-workspace-button { color: var(--danger); }
.reset-workspace-button:hover { border-color: var(--danger); background: rgba(207,111,137,.07); }
.color-control { display: inline-flex; align-items: center; gap: 7px; }
.color-control input[type="color"] { width: 34px; height: 25px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: white; cursor: pointer; }
.thickness-control { display: inline-flex; align-items: center; gap: 7px; }
.thickness-control input[type="range"] { width: 90px; margin: 0; }
.thickness-control output { min-width: 34px; color: var(--ink); font-size: 11px; font-weight: 700; }
.frame-settings, .arrange-settings { position: relative; }
.frame-settings summary, .arrange-settings summary { list-style: none; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.frame-settings summary::-webkit-details-marker, .arrange-settings summary::-webkit-details-marker { display: none; }
.frame-settings summary::after, .arrange-settings summary::after { content: " ▾"; color: var(--accent); }
.frame-settings[open] summary, .arrange-settings[open] summary { border-color: var(--accent); }
.frame-settings[open] summary::after, .arrange-settings[open] summary::after { content: " ▴"; }
.frame-settings-panel { position: absolute; z-index: 5; top: calc(100% + 8px); right: 0; display: flex; flex-direction: column; align-items: stretch; gap: 13px; width: 300px; max-height: min(610px,75vh); overflow-y: auto; padding: 18px; border: 2px solid #efe5f3; border-radius: 18px; background: #fff; box-shadow: 0 18px 38px rgba(79,54,97,.2); color: var(--ink); }
.frame-settings-panel > label { display: flex; align-items: center; gap: 8px; min-height: 31px; padding: 5px 7px; border-radius: 8px; }
.frame-settings-panel > label:hover { background: var(--panel); }
.frame-settings-panel .sub-setting { margin-left: 22px; color: var(--muted); font-size: 12px; }
.frame-settings-panel .sub-setting.disabled { opacity: .45; }
.frame-settings-panel .linked-hidden { display: none; }
.frame-settings-panel .color-control, .frame-settings-panel .thickness-control { justify-content: space-between; }
.frame-settings-panel > .frame-apply-all-control { justify-content: flex-start; border: 1px solid var(--line); color: var(--accent-dark); background: var(--panel); font-size: 11px; font-weight: 800; }
.frame-settings-panel > .frame-apply-all-control:has(input:checked) { border-color: var(--accent); color: white; background: var(--accent); }
.frame-settings-panel > .frame-apply-all-control:has(input:disabled) { cursor: not-allowed; opacity: .42; }
.frame-settings-panel > .corner-setting-disabled { cursor: not-allowed; opacity: .42; }
.arrange-settings-panel { position: absolute; z-index: 6; top: calc(100% + 8px); right: 0; display: flex; flex-direction: column; gap: 11px; width: 280px; padding: 17px; border: 2px solid var(--line); border-radius: 18px; color: var(--ink); background: #fff; box-shadow: 0 18px 38px rgba(79,54,97,.2); }
.arrange-settings-panel label { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 7px; border-radius: 8px; background: var(--panel); font-size: 12px; }
.spacing-axis-control { display: grid; gap: 7px; color: var(--ink); font-size: 12px; }
.spacing-axis-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.spacing-axis-buttons button { padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--panel); font-size: 11px; font-weight: 700; }
.spacing-axis-buttons button.active { border-color: var(--accent); color: white; background: var(--accent); }
.arrange-settings-panel select, .arrange-settings-panel input { border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--panel); }
.arrange-settings-panel select { padding: 6px 8px; }
.paid-feature-dialog { width: min(440px,calc(100vw - 32px)); padding: 26px; border: 2px solid white; border-radius: 22px; color: var(--ink); background: #fffafd; box-shadow: 0 18px 50px rgba(79,54,97,.24); }
.paid-feature-dialog::backdrop { background: rgba(48,35,58,.42); backdrop-filter: blur(3px); }
.paid-feature-dialog h2 { margin-bottom: 10px; }
.paid-feature-dialog > p:not(.section-label) { margin-bottom: 12px; line-height: 1.75; }
.paid-feature-dialog > a { color: var(--accent-dark); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.paid-dialog-close { position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: 20px; }
.paid-dialog-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 9px; margin-top: 22px; }
.paid-dialog-actions > button { border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: white; font-weight: 700; }
.paid-dialog-actions .primary { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 11px 15px; text-align: center; text-decoration: none; }
.paid-dialog-actions .primary span { flex: 0 0 auto; margin: 0; }
.trial-welcome-dialog { width: min(500px,calc(100vw - 32px)); }
.trial-welcome-dialog h2 { color: var(--accent-dark); }
.canvas-size-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.canvas-size-actions > button { width: auto; min-width: 96px; min-height: 38px; padding: 7px 18px; }
body.free-edition:not(.public-trial) .arrange-settings summary::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; background: var(--accent); -webkit-mask: var(--closed-lock-mask) center / contain no-repeat; mask: var(--closed-lock-mask) center / contain no-repeat; }
.arrange-settings-panel input { width: 70px; padding: 6px; }
.settings-title { margin: 3px 0 0; color: var(--accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.settings-title:not(:first-child) { margin-top: 5px; padding-top: 13px; border-top: 1px solid var(--line); }
.settings-divider { width: 100%; height: 0; margin: 1px 0; border: 0; border-top: 1px solid var(--line); }
.number-with-unit { white-space: nowrap; }
.settings-primary { padding: 9px; border: 0; border-radius: 10px; color: white; background: var(--accent); font-weight: 700; }
.realtime-note { margin: -4px 0 2px; color: var(--muted); font-size: 10px; text-align: center; }
.align-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.align-grid button { padding: 8px 4px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--panel); font-size: 11px; font-weight: 700; }
.canvas-wrap {
  position: relative;
  overflow: hidden;
  border: 3px solid #f1eaf5;
  border-radius: 0;
  background-color: #fff;
  background-image: linear-gradient(45deg,#e9e7eb 25%,transparent 25%),linear-gradient(-45deg,#e9e7eb 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e9e7eb 75%),linear-gradient(-45deg,transparent 75%,#e9e7eb 75%);
  background-size: 28px 28px;
  background-position: 0 0,0 14px,14px -14px,-14px 0;
}
html.desktop-app .canvas-wrap { width: 100%; max-width: 1160px; margin-inline: auto; }
canvas { display: block; width: 100%; aspect-ratio: var(--canvas-ratio, 16 / 9); touch-action: none; backface-visibility: hidden; }
.canvas-wrap.file-drop-active, .canvas-wrap.file-drop-active canvas { cursor: default; }
.canvas-wrap.project-file-drop-active::after { content: "♡ Mchiプロジェクトを開く"; position: absolute; z-index: 60; inset: 14px; display: grid; place-items: center; border: 3px dashed var(--accent); border-radius: 18px; color: var(--accent-dark); background: rgba(255,250,252,.94); box-shadow: inset 0 0 0 3px rgba(255,255,255,.7); font-size: 17px; font-weight: 900; pointer-events: none; }
html[data-theme="dark"] .canvas-wrap.project-file-drop-active::after { color: var(--accent); background: rgba(18,23,31,.94); box-shadow: inset 0 0 0 3px rgba(0,0,0,.18); }
canvas:focus { outline: none; }
canvas.layout-mode { cursor: default; }
canvas.resize-mode { cursor: default; }
canvas.frame-edit-mode { cursor: default; }
.canvas-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 7px; }
.canvas-meta-row .hint { min-width: 0; padding: 0 3px 1px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.resolution-picker { flex: 0 0 auto; }
.resolution-picker select { min-width: 174px; padding: 5px 28px 5px 10px; border: 1px solid rgba(231,143,178,.28); border-radius: 999px; outline: none; color: var(--accent-dark); background: rgba(253,235,242,.72); font-family: "Arial Rounded MT Bold", var(--font-body); font-size: 10px; font-weight: 800; letter-spacing: .02em; cursor: pointer; }
.resolution-picker select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(231,143,178,.13); }
.canvas-size-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.canvas-size-fields label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.canvas-size-fields label > span { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.canvas-size-fields input { min-width: 0; width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--panel); }
.canvas-size-help { margin: 10px 0 0; color: var(--muted); font-size: 10px; }
.sidebar { display: flex; min-height: 0; height: 100%; flex-direction: column; gap: 10px; }
.slot-manager { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 7px; }
.slot-manager button { padding: 9px 7px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--panel); font-size: 12px; font-weight: 700; }
.slot-manager button:hover { border-color: var(--accent); }
.slot-manager button:first-child { color: white; background: var(--accent); }
.slot-manager .danger { color: var(--danger); }
.slot-manager button:disabled { opacity: .4; cursor: not-allowed; }
.slot-layer-panel, .layer-section-card { padding: 14px; border: 1px solid white; border-radius: 18px; background: #fff; box-shadow: 0 8px 20px rgba(93,70,112,.08); }
.global-layer-card { position: relative; transition: border-color .15s,background .15s,box-shadow .15s; }
.global-layer-card.file-drop-active { border-color: var(--accent); background: #fff7fb; box-shadow: 0 0 0 3px rgba(231,143,178,.16),0 8px 20px rgba(93,70,112,.08); }
.global-layer-card.file-drop-active::after { content: "ここに画像をドロップ"; position: absolute; z-index: 8; inset: 7px; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 13px; color: var(--accent-dark); background: rgba(255,255,255,.92); font-size: 12px; font-weight: 900; pointer-events: none; }
.slot-layer-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin: 0 3px 10px; }
.slot-layer-heading h2 { margin-top: 2px; font-size: 15px; }
.slot-layer-help { color: var(--muted); font-size: 10px; white-space: nowrap; }
.global-layer-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 8px; }
.global-layer-group { display: flex; flex-direction: column; gap: 6px; }
.global-layer-folder { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 1px solid rgba(231,143,178,.35); border-radius: 12px; color: var(--ink); background: rgba(255,255,255,.62); text-align: left; font-size: 12px; font-weight: 700; }
.global-layer-folder:hover { border-color: var(--accent); box-shadow: 0 2px 5px rgba(90,60,110,.07); }
.global-layer-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: white; background: var(--accent); font-size: 11px; }
.global-layer-state { color: var(--muted); font-size: 10px; font-weight: 600; }
.global-layer-children { display: grid; gap: 7px; margin: 0 6px 3px 40px; }
.global-image-list { display: flex; flex-direction: column; gap: 6px; }
.global-image-item { display: grid; grid-template-columns: 15px 28px minmax(0,1fr) auto auto; align-items: center; gap: 6px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.global-image-item.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(231,143,178,.16); }
.global-image-item[draggable="true"] { cursor: grab; }
.global-image-item.dragging { opacity: .45; }
.global-image-item img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
.global-image-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; }
.global-rotation-target { display: grid; place-items: center; width: 15px; height: 15px; color: var(--muted); cursor: pointer; }
.global-rotation-target input { position: relative; width: 15px; height: 15px; margin: 0; appearance: none; -webkit-appearance: none; border: 1px solid var(--line); border-radius: 3px; background: white; cursor: pointer; }
.global-rotation-target input:checked { border-color: var(--accent); background: var(--accent); }
.global-rotation-target input:checked::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.global-rotation-target input:focus-visible { outline: 2px solid color-mix(in srgb,var(--accent) 35%,transparent); outline-offset: 2px; }
.global-image-remove { width: 25px; height: 25px; border: 0; border-radius: 7px; color: var(--danger); background: transparent; font-weight: 800; }
.slot-tabs { display: flex; flex-direction: column; gap: 7px; max-height: 264px; overflow-y: auto; padding-right: 3px; }
.slot-layer-group { display: flex; flex-direction: column; gap: 6px; }
.slot-tab { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 1px solid rgba(231,143,178,.28); border-radius: 12px; background: #fff7fa; color: var(--muted); text-align: left; transition: border-color .15s,background .15s,transform .15s,box-shadow .15s; }
.slot-tab:hover { border-color: var(--accent); box-shadow: 0 2px 5px rgba(90,60,110,.07); }
.slot-tab.selected { border-color: rgba(231,143,178,.45); background: rgba(255,255,255,.72); }
.slot-tab.active { border-color: #fff; background: var(--accent); color: white; box-shadow: 0 2px 6px rgba(207,112,150,.18),0 0 0 2px rgba(231,143,178,.18); }
.slot-layer-index { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--accent-dark); background: #fdebf2; font-size: 11px; font-weight: 800; }
.slot-layer-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-cute); font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.slot-layer-name-input { min-width: 0; width: 100%; padding: 5px 7px; border: 1px solid var(--accent); border-radius: 7px; outline: none; color: var(--ink); background: var(--panel); font-family: var(--font-cute); font-size: 13px; font-weight: 700; box-shadow: 0 0 0 3px rgba(231,143,178,.14); }
.slot-layer-count { padding: 3px 7px; border-radius: 999px; background: rgba(255,255,255,.72); color: var(--muted); font-size: 10px; font-weight: 700; }
.slot-tab.active .slot-layer-index { color: var(--accent-dark); background: white; }
.slot-tab.active .slot-layer-count { color: var(--accent-dark); background: white; }
.slot-layer-children { --guide-line-bottom: 18.5px; position: relative; margin: 0 6px 4px 40px; padding: 2px 0 4px; }
.slot-layer-children::before { content: ""; position: absolute; left: -23px; top: 4px; bottom: var(--guide-line-bottom); width: 3px; border-radius: 999px 999px 0 0; background: var(--accent); pointer-events: none; }
.slot-layer-children::after { content: ""; position: absolute; left: -23px; bottom: var(--guide-line-bottom); width: 18px; height: 3px; border-radius: 0 999px 999px 0; background: var(--accent); pointer-events: none; }
.slot-layer-children .layer-list { margin-bottom: 7px; }
.slot-layer-children .upload-button { padding: 9px; font-size: 12px; }
.layer-context-menu { position: fixed; z-index: 1000; min-width: 156px; padding: 6px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); box-shadow: 0 12px 32px rgba(66,44,80,.2); }
.layer-context-menu[hidden] { display: none; }
.layer-context-menu button { display: block; width: 100%; padding: 9px 11px; border: 0; border-radius: 9px; color: var(--ink); background: transparent; text-align: left; font-size: 12px; font-weight: 700; }
.layer-context-menu button:hover { background: #fdebf2; }
.layer-context-menu button.danger { color: var(--danger); }
.card { position: relative; padding: 20px; overflow: visible; }
#editCard { padding: 10px 14px 9px; }
#editCard .section-label { margin-bottom: 7px; }
#editCard h2 { margin-bottom: 8px; font-size: 16px; }
#editControls { display: grid; gap: 5px; }
#editControls[hidden] { display: none; }
.adjustment-sliders { display: grid; grid-template-columns: auto minmax(120px,230px) 72px auto minmax(120px,230px) 72px; align-items: center; justify-content: center; gap: 7px 10px; width: 100%; }
.adjustment-sliders > input[type="range"] { width: 100%; min-width: 0; height: 12px; margin: 0; }
.number-control { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.number-control input { width: 54px; min-width: 0; padding: 5px 4px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--panel); text-align: center; font: inherit; }
.number-control input:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.number-control input:disabled { cursor: not-allowed; opacity: .5; }
#editCard .empty { padding: 8px 12px; }
#editCard .button-grid { gap: 6px; }
#editCard .button-grid button { padding: 7px 8px; }
#editControls .button-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.placement-rotation-controls { display: grid; grid-template-columns: minmax(190px,1fr) minmax(120px,180px) minmax(120px,180px); align-items: center; gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.placement-rotation-label { display: grid; gap: 1px; min-width: 0; }
.placement-rotation-label strong { color: var(--ink); font-size: 12px; }
.placement-rotation-label small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.placement-rotation-controls button { min-height: 31px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--accent-dark); background: #fffdfd; font-size: 11px; font-weight: 800; }
.placement-rotation-controls button:hover:not(:disabled) { border-color: var(--accent); background: #fff5f9; transform: translateY(-1px); }
.placement-rotation-controls button:disabled { opacity: .38; cursor: not-allowed; }
.card::after { content: "✦"; position: absolute; top: 15px; right: 17px; color: rgba(243,169,198,.34); font-size: 17px; pointer-events: none; }
.card-heading { display: flex; align-items: start; justify-content: space-between; }
.count { margin-right: 22px; padding: 4px 9px; border-radius: 999px; background: #fdebf2; color: var(--accent-dark); font-size: 12px; font-weight: 800; }
.layer-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.layer-help { margin: -5px 0 10px; color: var(--muted); font-size: 11px; }
.layer-item { display: grid; grid-template-columns: 38px minmax(0,1fr) auto auto; align-items: center; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fffdfd; text-align: left; transition: transform .15s,border-color .15s,box-shadow .15s; }
.layer-item.locked, .global-image-item.locked { background: color-mix(in srgb,var(--panel) 88%,var(--line)); }
.layer-lock { display: grid; place-items: center; width: 25px; height: 25px; padding: 0; border: 1px solid transparent; border-radius: 7px; color: var(--accent); background: transparent; line-height: 1; }
.layer-lock::before { content: ""; display: block; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--closed-lock-mask) center / contain no-repeat; mask: var(--closed-lock-mask) center / contain no-repeat; }
.layer-lock.is-unlocked::before { -webkit-mask-image: var(--open-lock-mask); mask-image: var(--open-lock-mask); }
.layer-lock:hover { border-color: var(--accent); background: rgba(231,143,178,.1); }
.locked .layer-lock { color: var(--accent-dark); background: rgba(231,143,178,.14); }
.layer-item:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(93,70,112,.07); }
.layer-item.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(231,143,178,.16); }
.layer-item[draggable="true"] { cursor: grab; }
.layer-item.dragging { opacity: .4; cursor: grabbing; }
.layer-item.drag-over { border-color: var(--accent); transform: translateY(2px); }
.layer-thumb { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; background: #eee; }
.layer-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
.layer-remove { display: grid; place-items: center; width: 27px; height: 27px; padding: 0; border: 0; border-radius: 8px; color: var(--danger); background: transparent; font-size: 17px; font-weight: 800; line-height: 1; }
.layer-remove:hover { background: rgba(207,111,137,.1); }
.upload-button { display: block; border: 2px solid rgba(255,255,255,.7); text-align: center; font-size: 13px; cursor: pointer; }
.upload-button.disabled { opacity: .4; pointer-events: none; }
.empty { padding: 12px; border: 1px dashed #dfd1e7; border-radius: 13px; background: #faf7fc; color: var(--muted); font-size: 12px; text-align: center; }
.control-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
input[type="range"] { width: 100%; margin: 12px 0 18px; accent-color: var(--accent); }
.button-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.button-grid button { padding: 10px 8px; border: 1px solid var(--line); border-radius: 12px; background: #fffdfd; color: var(--ink); font-size: 12px; font-weight: 700; transition: .15s; }
.button-grid button:hover { transform: translateY(-1px); background: #faf5ff; }
.button-grid button:hover { border-color: var(--accent); }
.button-grid .danger { color: var(--danger); }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%,20px); padding: 11px 18px; border-radius: 999px; background: #26212b; color: white; opacity: 0; pointer-events: none; transition: .2s; font-size: 13px; }
#toast.show { opacity: 1; transform: translate(-50%,0); }

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e7ebf0;
  --muted: #929dab;
  --line: #2a323d;
  --panel: rgba(18,23,31,.97);
  --accent: #72add3;
  --accent-dark: #4f86aa;
  --pink: #86b8d7;
  --cream: #1a212b;
  --danger: #ff8aa5;
}
html[data-theme="dark"] body { background: #090c11; }
html[data-theme="dark"] body::before, html[data-theme="dark"] body::after { color: rgba(114,173,211,.09); }
html[data-theme="dark"] header { background: rgba(11,15,21,.94); }
html[data-theme="dark"] h1 { color: #edf0f4; text-shadow: 0 2px 0 #090c11; }
html[data-theme="dark"] .title-sparkle { color: #86b8d7; }
html[data-theme="dark"] .brand-mark,
html[data-theme="dark"] .primary,
html[data-theme="dark"] .upload-button { background: var(--accent-dark); box-shadow: 0 2px 7px rgba(42,137,214,.16); }
html[data-theme="dark"] .stage-panel,
html[data-theme="dark"] .card { border-color: #29313c; }
html[data-theme="dark"] .panel-ribbon { background: #4f86aa; }
html[data-theme="dark"] .tool-button,
html[data-theme="dark"] .frame-settings summary,
html[data-theme="dark"] .arrange-settings summary,
html[data-theme="dark"] .slot-tab.active,
html[data-theme="dark"] .layer-item,
html[data-theme="dark"] .button-grid button,
html[data-theme="dark"] .placement-rotation-controls button,
html[data-theme="dark"] .slot-manager button { color: var(--ink); background: #1a2029; }
html[data-theme="dark"] .header-menu > summary, html[data-theme="dark"] .header-tab-button { border-color: #344052; color: var(--accent); background: #1a2029; box-shadow: 0 3px 10px rgba(0,0,0,.25); }
html[data-theme="dark"] .header-menu > summary:hover, html[data-theme="dark"] .header-menu[open] > summary, html[data-theme="dark"] .header-tab-button:hover, html[data-theme="dark"] .header-tab-button.active { border-color: var(--accent); color: #081018; background: var(--accent); }
html[data-theme="dark"] .header-menu-panel { border-color: #303947; background: #12171f; box-shadow: 0 14px 32px rgba(0,0,0,.48); }
html[data-theme="dark"] .header-menu-panel button { color: #cbd2db; }
html[data-theme="dark"] .header-menu-panel button:hover { color: white; background: #222a35; }
html[data-theme="dark"] .slot-manager button:first-child { color: #0b1117; background: var(--accent); }
html[data-theme="dark"] .tool-button.active { color: #0b1117; background: var(--accent); }
html[data-theme="dark"] .split-count-controls button.active { color: #0b1117; background: var(--accent); }
html[data-theme="dark"] .frame-settings-panel { border-color: #2a323d; background: #12171f; }
html[data-theme="dark"] .arrange-settings-panel { border-color: #2a323d; background: #12171f; }
html[data-theme="dark"] .paid-feature-dialog { border-color: #2a323d; color: var(--ink); background: #12171f; }
html[data-theme="dark"] .paid-dialog-actions > button { color: var(--ink); background: #1a2029; }
html[data-theme="dark"] .spacing-axis-buttons button { color: var(--ink); background: #1a2029; }
html[data-theme="dark"] .spacing-axis-buttons button.active { color: #0b1117; background: var(--accent); }
html[data-theme="dark"] .slot-layer-panel, html[data-theme="dark"] .layer-section-card { border-color: #2a323d; background: #12171f; }
html[data-theme="dark"] .global-layer-card.file-drop-active { border-color: var(--accent); background: #17202b; }
html[data-theme="dark"] .global-layer-card.file-drop-active::after { color: var(--accent); background: rgba(12,17,24,.92); }
html[data-theme="dark"] .design-sidebar { border-color: #2a323d; background: #12171f; }
html[data-theme="dark"] .people-filter summary, html[data-theme="dark"] .people-filter-options { border-color: #2a323d; color: #e5eaf0; background: #151b24; }
html[data-theme="dark"] .design-filter-panel { background: #12171f; }
html[data-theme="dark"] .design-filter-checks label { border-color: #344052; color: #cbd2db; background: #111720; }
html[data-theme="dark"] .design-filter-checks label:has(input:checked) { border-color: var(--accent); color: #081018; background: var(--accent); }
html[data-theme="dark"] .people-filter-options button { color: #cbd2db; }
html[data-theme="dark"] .people-filter-options button:hover { color: white; background: #222a35; }
html[data-theme="dark"] .people-filter-options button.active { color: #0b1117; background: var(--accent); }
html[data-theme="dark"] .language-menu summary { color: var(--ink); background: linear-gradient(135deg, #1a2029, #151b24); box-shadow: 0 3px 10px rgba(0,0,0,.28), inset 0 0 0 1px #344052; }
html[data-theme="dark"] .settings-panel { border-color: #303947; background: rgba(18,23,31,.98); box-shadow: 0 14px 32px rgba(0,0,0,.42); }
html[data-theme="dark"] .settings-option-grid button { border-color: #303947; color: #cbd2db; background: #1a2029; }
html[data-theme="dark"] .settings-option-grid button:hover { border-color: var(--accent); color: white; background: #222a35; }
html[data-theme="dark"] .settings-option-grid button.active { border-color: var(--accent); color: #081018; background: var(--accent); }
html[data-theme="dark"] .settings-check-option { border-color: #303947; background: #1a2029; }
html[data-theme="dark"] .settings-check-option:hover { border-color: var(--accent); background: #222a35; }
html[data-theme="dark"] .design-sidebar-toggle { border-color: #b6d6e9; color: #0b1117; background: var(--accent); box-shadow: 0 2px 6px rgba(47,91,122,.2); }
html[data-theme="dark"] .design-sidebar-toggle::before { filter: invert(1); }
html[data-theme="dark"] .design-option.active, html[data-theme="dark"] .design-option:hover { background: #1a2029; }
html[data-theme="dark"] .slot-tab { border-color: #2a323d; color: var(--muted); background: rgba(25,31,40,.82); }
html[data-theme="dark"] .slot-tab:not(.active):not(.selected) .slot-layer-count { color: #8995a3; background: #12171f; }
html[data-theme="dark"] .slot-tab.selected { border-color: #3d566c; background: #1a2029; }
html[data-theme="dark"] .slot-tab.active { border-color: #b6d6e9; color: #0b1117; background: var(--accent); box-shadow: 0 2px 6px rgba(47,91,122,.2),0 0 0 2px rgba(114,173,211,.13); }
html[data-theme="dark"] .slot-layer-index { color: #a7cae0; background: #202b36; }
html[data-theme="dark"] .slot-layer-count { background: #12171f; }
html[data-theme="dark"] .resolution-picker select { border-color: #2a323d; color: #9fc5dd; background: rgba(29,38,49,.85); }
html[data-theme="dark"] .slot-tab.active .slot-layer-index,
html[data-theme="dark"] .slot-tab.active .slot-layer-count { color: #365f79; background: #edf3f7; }
html[data-theme="dark"] .slot-layer-children::before,
html[data-theme="dark"] .slot-layer-children::after { background: var(--accent); }
html[data-theme="dark"] .global-layer-folder { border-color: #2a323d; background: #1a2029; }
html[data-theme="dark"] .count { color: #a7cae0; background: #202b36; }
html[data-theme="dark"] .layer-context-menu { border-color: #2a323d; background: #12171f; }
html[data-theme="dark"] .layer-context-menu button:hover { background: #202833; }
html[data-theme="dark"] .empty { border-color: #333d49; background: #10151c; }
html[data-theme="dark"] .canvas-wrap { border-color: #252d37; }
html[data-theme="dark"] .card::after { color: rgba(114,173,211,.18); }
html[data-theme="dark"] #toast { color: #edf0f4; background: #1a2029; }
@media (max-width: 1200px) {
  html:not(.browser-fixed-layout) .sns-split-mode { grid-template-columns: 1fr; }
  html:not(.browser-fixed-layout) main { grid-template-columns: minmax(0,1fr) var(--layer-sidebar-width); }
  html:not(.browser-fixed-layout) body.layout-sidebar-collapsed main { grid-template-columns: minmax(0,1fr) var(--layer-sidebar-width); }
  html:not(.browser-fixed-layout) .design-sidebar { grid-column: 1 / -1; }
  html:not(.browser-fixed-layout) .design-list { grid-template-columns: repeat(2,minmax(130px,190px)); }
  html:not(.browser-fixed-layout) .people-filter { grid-column: 1 / -1; }
  html:not(.browser-fixed-layout) .design-category-title { grid-column: 1 / -1; }
  html:not(.browser-fixed-layout) .design-section-divider { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  html:not(.browser-fixed-layout) header { align-items: flex-start; }
  html:not(.browser-fixed-layout) main { grid-template-columns: 1fr; }
  html:not(.browser-fixed-layout) body.layout-sidebar-collapsed main { grid-template-columns: 1fr; }
  html:not(.browser-fixed-layout) .sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  html:not(.browser-fixed-layout) .slot-layer-panel,
  html:not(.browser-fixed-layout) .layer-section-card { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  html:not(.browser-fixed-layout) header { flex-direction: column; }
  html:not(.browser-fixed-layout) .header-actions { width: 100%; }
  html:not(.browser-fixed-layout) .header-actions .primary { flex: 1; }
  html:not(.browser-fixed-layout) .primary { width: 100%; }
  html:not(.browser-fixed-layout) main { padding: 12px; }
  html:not(.browser-fixed-layout) .sidebar { display: flex; }
  html:not(.browser-fixed-layout) .stage-toolbar { align-items: flex-start; }
  html:not(.browser-fixed-layout) .frame-controls { align-items: flex-end; flex-direction: column; gap: 7px; }
}
@container (max-width: 900px) {
  .stage-toolbar { gap: 4px; }
  .frame-controls { width: 100%; gap: 4px; }
  .tool-button, .frame-settings summary, .arrange-settings summary {
    min-width: 0;
    padding: 6px 7px;
    font-size: 10px;
    white-space: nowrap;
  }
}
@container (max-width: 700px) {
  .stage-panel { padding-inline: 10px; }
  .stage-toolbar, .frame-controls { gap: 3px; }
  .tool-button, .frame-settings summary, .arrange-settings summary {
    padding-inline: 5px;
    font-size: 9px;
    letter-spacing: -.02em;
  }
}
