/* Shared layout for both themes. Only the colour tokens change by theme. */
.image-save-dialog {
  width: min(720px, calc(100vw - 40px)) !important;
  max-width: 720px !important;
  border-radius: 22px !important;
}

.image-save-header { align-items: flex-start; padding: 24px 28px 16px; border-bottom: 0; }
.image-save-heading { display: flex; min-width: 0; align-items: center; gap: 16px; }
.image-save-hero { display: grid; width: 86px; height: 86px; flex: 0 0 86px; place-items: center; border-radius: 23px; background: color-mix(in srgb, var(--save-accent) 15%, var(--save-alt)); color: var(--save-accent); }
.image-save-hero svg { width: 54px; height: 54px; }
.image-save-header h2 { font-size: 34px; line-height: 1.05; letter-spacing: -1px; }
.image-save-header p { margin-top: 6px; font-size: 16px; line-height: 1.45; }
.image-save-close { width: 30px; height: 30px; margin: -4px -6px 0 0; border-radius: 50%; color: var(--save-accent); font-size: 28px; }

.image-save-form { display: block; padding: 0 28px 14px; overflow: auto; }
.image-save-scope { display: grid; grid-template-columns: 34px minmax(0, 1fr) 226px; gap: 12px; align-items: center; min-height: 68px; padding: 0 16px; border: 0; border-radius: 16px; background: color-mix(in srgb, var(--save-accent) 10%, var(--save-alt)); }
.image-save-scope-icon { display: grid; width: 30px; height: 30px; place-items: center; color: var(--save-accent); }
.image-save-scope-icon svg { width: 27px; height: 27px; }
.image-save-scope > div { display: block; }
.image-save-scope strong { font-size: 15px; }
.image-save-scope select, .image-save-scope-value { display: flex; width: 100%; height: 44px; box-sizing: border-box; align-items: center; border: 1px solid var(--save-line); border-radius: 14px; background: var(--save-surface); color: var(--save-ink); padding: 0 16px; font: 650 14px/1 inherit; }
.image-save-scope select { padding-right: 12px; }

.image-save-compatibility { margin: 14px 0 0; }
.image-save-rows { margin-top: 12px; border-bottom: 1px solid var(--save-line); }
.image-save-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 14px; min-height: 78px; align-items: center; padding: 0 14px; border-top: 1px solid var(--save-line); cursor: text; }
label.image-save-row { display: grid !important; }
.image-save-row:first-child { border-top: 0; }
.image-save-row-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 14px; color: var(--save-accent); background: color-mix(in srgb, var(--save-accent) 11%, var(--save-alt)); }
.image-save-row-icon svg { width: 25px; height: 25px; }
.image-save-row-icon--clock, .image-save-row-icon--shield { color: var(--save-accent); }
.image-save-row-copy { display: grid; min-width: 0; gap: 5px; }
.image-save-row-copy h3, .image-save-row-copy strong { margin: 0; color: var(--save-ink); font-size: 16px; line-height: 1.3; }
.image-save-row-copy p, .image-save-row-copy small { margin: 0; color: var(--save-muted); font-size: 12px; line-height: 1.45; }

.image-save-segments { display: inline-flex; min-width: 230px; height: 44px; box-sizing: border-box; align-items: stretch; margin: 0; padding: 3px; border: 1px solid var(--save-line); border-radius: 22px; background: var(--save-surface); }
.image-save-segments button { min-width: 68px; border: 0; border-radius: 18px; background: transparent; color: var(--save-ink); padding: 0 11px; font: 650 13px/1 inherit; cursor: pointer; }
.image-save-segments button[aria-pressed="true"] { background: color-mix(in srgb, var(--save-accent) 21%, var(--save-surface)); }
.image-save-number { position: relative; display: grid; width: 136px; }
.image-save-number input { height: 44px; border-radius: 14px; background: var(--save-surface); padding: 7px 36px 7px 12px; font-size: 14px; }
.image-save-number em { right: 14px; font-size: 12px; }
.image-save-switch { cursor: pointer; }
.image-save-toggle { width: 62px; height: 36px; }
.image-save-toggle i { width: 62px; height: 36px; }
.image-save-toggle i::after { top: 4px; left: 4px; width: 28px; height: 28px; }
.image-save-toggle input:checked + i::after { transform: translateX(26px); }

.image-save-maintenance { display: block; margin: 11px 0 10px; padding: 9px 14px; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--save-accent) 12%, var(--save-surface)); color: var(--save-accent); font-size: 12px; line-height: 1.45; }
.image-save-maintenance > span:first-child { margin-right: 8px; }
.image-save-form footer { min-height: 54px; padding-top: 10px; border-top: 1px solid var(--save-line); }
.image-save-usage { margin-right: auto; color: var(--save-muted); font-size: 13px; line-height: 1.45; }
.image-save-status { max-width: 300px; color: var(--save-accent); }
.image-save-form footer button { min-height: 44px; border: 0; border-radius: 14px; padding: 8px 18px; background: color-mix(in srgb, var(--save-alt) 85%, var(--save-surface)); font-size: 14px; }
.image-save-form .image-save-submit { min-width: 104px; }
.image-save-reset { margin-left: auto; }
.image-save-usage + .image-save-status:empty + .image-save-reset { margin-left: auto; }

@media (max-width: 760px) {
  .image-save-dialog { width: calc(100vw - 20px) !important; border-radius: 22px !important; }
  .image-save-header { padding: 22px 20px 16px; }
  .image-save-hero { width: 72px; height: 72px; flex-basis: 72px; border-radius: 20px; }
  .image-save-hero svg { width: 48px; height: 48px; }
  .image-save-heading { gap: 14px; }
  .image-save-header h2 { font-size: 30px; }
  .image-save-header p { font-size: 15px; }
  .image-save-form { padding: 0 20px 14px; }
  .image-save-scope { grid-template-columns: 34px minmax(0, 1fr); padding: 13px 15px; }
  .image-save-scope label, .image-save-scope-value { grid-column: 1 / -1; }
  .image-save-row { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding: 14px 5px; }
  .image-save-row > :last-child { grid-column: 2; justify-self: start; }
  .image-save-row-icon { width: 48px; height: 48px; border-radius: 15px; }
  .image-save-row-icon svg { width: 27px; height: 27px; }
  .image-save-row-copy h3, .image-save-row-copy strong { font-size: 17px; }
  .image-save-row-copy p, .image-save-row-copy small { font-size: 13px; }
  .image-save-segments { min-width: 0; width: 100%; }
  .image-save-segments button { flex: 1; min-width: 0; padding: 0 7px; }
  .image-save-form footer { flex-wrap: wrap; }
  .image-save-usage, .image-save-status { width: 100%; max-width: none; }
  .image-save-reset { margin-left: 0; }
}

@media (max-width: 430px) {
  .image-save-number { width: 100%; }
  .image-save-number input { width: 100%; }
  .image-save-form footer button { flex: 1; padding: 8px 12px; }
}
