:root {
  color-scheme: light;
  font-family: "Yu Gothic UI", "Hiragino Sans", Meiryo, sans-serif;
  background: #f6f4ef;
  color: #242c27;
  --line: #deded4;
  --muted: #505d54;
  --green: #214e3a;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.masthead, .workspace { width: min(1320px, calc(100% - 56px)); margin: auto; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 27px 0; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: flex-start; gap: 13px; flex: 1 1 360px; min-width: 0; }
.brand img { border-radius: 12px; flex-shrink: 0; }
.brand-description { margin-top: 5px; color: var(--muted); font-size: .875rem; line-height: 1.55; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.16rem, 2.4vw, 1.65rem); letter-spacing: .035em; }
h2 { font-size: 1.05rem; }
.workspace { display: grid; grid-template-columns: minmax(265px, 330px) minmax(0, 1fr); gap: 22px; margin-block: 24px; align-items: start; }
.panel { background: #fffefa; border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.section-head, .preview-actions, .library-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head { min-height: 28px; margin-bottom: 14px; }
.section-head span, #filename, #status, .drop span { font-size: .875rem; color: var(--muted); }
.drop { border: 1px dashed #899e90; border-radius: 12px; padding: 23px 10px; background: #f3f7f2; display: grid; justify-items: center; gap: 10px; text-align: center; }
.drop.dragging { background: #dbece0; border-style: solid; }
button { border-radius: 8px; min-height: 42px; padding: 8px 13px; font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
button:focus-visible { outline: 2px solid #30764c; outline-offset: 2px; }
.primary { color: #fff; background: var(--green); border: 1px solid var(--green); flex: 1; }
.primary:not(:disabled):hover { background: #163b2b; }
.secondary { color: var(--green); background: #fffefa; border: 1px solid #a8b7aa; }
.secondary:not(:disabled):hover, .text-button:not(:disabled):hover { background: #e9f1e9; }
.text-button { border: 1px solid transparent; color: var(--muted); background: transparent; }
.queue { padding: 0; list-style: none; margin: 12px 0; max-height: 300px; overflow: auto; }
.queue li { display: flex; gap: 4px; align-items: center; }
.queue li + li { margin-top: 3px; }
.file { text-align: left; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: transparent; border: 1px solid transparent; color: inherit; }
.file[aria-pressed="true"] { background: #e7efe6; border-color: #cadbcb; color: var(--green); }
.remove { min-width: 38px; padding-inline: 6px; font-size: 1.1rem; }
.browser-notice { color: #a22222; font-size: .875rem; margin-top: 10px; }
progress { width: 100%; margin-top: 10px; accent-color: var(--green); }
#status:not(:empty) { margin-top: 10px; overflow-wrap: anywhere; }
.stage { min-height: clamp(260px, 57vh, 660px); border-radius: 10px; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; background: #eae9e2; padding: 20px; }
.stage p { color: var(--muted); text-align: center; }
#framed { position: relative; container-type: inline-size; box-shadow: 0 8px 28px #292b2426; }
#framed img { position: absolute; display: block; height: auto; }
#framed span { position: absolute; transform: translate(var(--shift), -50%) scaleX(var(--fit, 1)); transform-origin: var(--origin) center; white-space: pre; line-height: 1; }
.preview-column { display: grid; gap: 24px; min-width: 0; }
.ad-area { display: grid; gap: 12px; }
.ad-area h2 { color: var(--muted); font-size: .875rem; }
.ad-slot { min-width: 0; overflow-wrap: anywhere; }
.ad-slot img { max-width: 100%; height: auto; }

.preview-actions { margin-top: 14px; }
#filename { overflow-wrap: anywhere; }
#save { flex-shrink: 0; }
@media (max-width: 790px) {
  .masthead, .workspace { width: calc(100% - 28px); }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .panel { padding: 14px; }
  .stage { min-height: 250px; padding: 12px; }
}

.design { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.design summary { cursor: pointer; font-weight: 650; }
.settings { border: 0; padding: 0; margin: 12px 0 0; min-inline-size: 0; display: grid; gap: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .875rem; }
.setting-row > label { white-space: nowrap; }
.settings select { min-height: 38px; max-width: 100%; border: 1px solid #a8b7aa; border-radius: 8px; color: var(--green); background: #fffefa; font: inherit; padding: 5px 9px; }
.color-control, .logo-controls { display: flex; align-items: center; gap: 7px; }
.color-control input { width: 42px; height: 32px; padding: 2px; border: 1px solid #a8b7aa; border-radius: 6px; background: #fffefa; cursor: pointer; }
.color-control output { font: .8rem ui-monospace, monospace; }
.exif-choices { margin: 0; min-inline-size: 0; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px 9px; }
.exif-choices legend { font-size: .875rem; padding: 0 4px; }
.exif-choices > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 6px; }
.exif-choices label { display: flex; gap: 3px; align-items: center; font-size: .875rem; }
.exif-choices input { accent-color: var(--green); }
.setting-note { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.setting-note:empty { display: none; }
@media (min-width: 791px) {
  .preview-column:has(.ad-area[hidden]) { position: sticky; top: 16px; }
}

.scale-control { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.scale-control input { width: clamp(65px, 16vw, 110px); accent-color: var(--green); }
.scale-control output { width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }

.masthead { flex-wrap: wrap; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.help-dialog {
  width: min(520px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffefa;
  color: inherit;
  line-height: 1.65;
  box-shadow: 0 16px 52px #242c2733;
}
.help-dialog::backdrop { background: #242c2773; }
.help-dialog h3 { margin: 16px 0 6px; font-size: 1rem; }
.help-dialog ol { margin: 10px 0 0; padding-left: 1.5em; }
.help-dialog li + li, .help-dialog p + p { margin-top: 6px; }
.help-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

.site-footer { padding: 8px 16px 24px; text-align: center; color: var(--muted); }

.language-select { min-height: 42px; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: .875rem; cursor: pointer; }
.language-select:focus-visible { outline: 2px solid #30764c; outline-offset: 2px; }
.exif-choices label { min-width: 0; }
.exif-choices label span { overflow-wrap: anywhere; }

.font-picker { display: flex; justify-content: flex-end; gap: 6px; flex: 1; min-width: 0; }
.font-picker input { flex: 1; width: 0; min-width: 0; max-width: 180px; min-height: 38px; border: 1px solid #a8b7aa; border-radius: 8px; padding: 5px 8px; background: #fffefa; color: var(--green); font: inherit; }
.font-picker input:focus-visible { outline: 2px solid #30764c; outline-offset: 2px; }
.font-picker button { flex-shrink: 0; min-height: 38px; padding: 5px 9px; }
