:root {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", sans-serif;
  color: #20242a;
  background: #f2f4f6;
  font-synthesis: none;
  --accent: #1769e8;
  --muted: #626b76;
  --line: #e0e4e9;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, label[for] { cursor: pointer; }
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: inherit;
  font-size: 13px;
}
button:hover:not(:disabled) { background: #f1f4f7; }
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { color: #102d54; background: #d4e6ff; }
[hidden] { display: none !important; }
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.primary:hover:not(:disabled) { background: #105ccf; }
.icon-button { width: 38px; padding: 8px; flex-shrink: 0; }
.small-button { min-height: 33px; padding: 6px 10px; font-size: 12px; }
.text-button { min-height: 30px; padding: 4px 0; border: 0; background: transparent; color: var(--accent); font-size: 12px; }
.text-button:hover:not(:disabled) { background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.brand { display: flex; align-items: center; gap: 9px; color: inherit; font-size: 17px; font-weight: 600; letter-spacing: -.4px; text-decoration: none; }
.brand span { display: flex; color: #6c8294; }
.brand svg { width: 27px; height: 27px; }
.draft-status { color: var(--muted); font-size: 11px; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.top-actions .desktop-undo { border: 0; }
.project-menu { position: absolute; top: 62px; right: 26px; z-index: 50; min-width: 220px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 10px 35px #142e4820; }
.project-menu button, .project-menu label { display: flex; width: 100%; align-items: center; justify-content: start; gap: 9px; min-height: 40px; padding: 10px; border: 0; border-radius: 7px; font-size: 13px; cursor: pointer; }
.project-menu label:hover { background: #f1f4f7; }
main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; max-width: 1600px; height: calc(100svh - 72px); margin: auto; }
.stage { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 17px; padding: 20px 24px; background: #edf0f3; }
.screens { display: flex; align-items: start; justify-content: center; gap: 24px; width: 100%; }
.screen-column { display: flex; flex-direction: column; align-items: center; min-width: 0; gap: 11px; }
.screen-caption { color: #5c6875; font-size: 11px; }
.phone-preview { position: relative; height: min(calc(100svh - 238px), 720px); aspect-ratio: 1206 / 2622; border-radius: 34px; box-shadow: 0 18px 45px #18384c1c; overflow: hidden; }
#preview { display: block; width: 100%; height: 100%; }
#reference { height: min(calc(100svh - 238px), 720px); width: auto; max-width: 100%; aspect-ratio: 1260 / 2736; border-radius: 34px; object-fit: contain; }
.screens.comparing .phone-preview, .screens.comparing #reference { height: min(calc(100svh - 238px), 590px); }
.preview-hits { position: absolute; inset: 0; pointer-events: none; }
.preview-hit { position: absolute; min-height: 0; padding: 0; border: 0; border-radius: 25px; background: transparent; pointer-events: auto; touch-action: pan-y; cursor: pointer; }
.preview-hit:hover, .preview-hit:active { background: transparent !important; }
.preview-hit:focus-visible { outline-offset: -3px; }
body.playing .preview-hits { visibility: hidden; }
.transport { display: flex; align-items: center; gap: 7px; width: min(100%, 450px); }
.transport button { border: 0; background: transparent; }
.transport input { flex: 1; min-width: 30px; accent-color: var(--accent); }
.transport output { min-width: 90px; font-size: 11px; font-variant-numeric: tabular-nums; color: #566573; white-space: nowrap; }
.preview-options { display: flex; align-items: center; gap: 18px; min-height: 28px; font-size: 11px; color: #566573; }
.preview-options label { display: flex; gap: 5px; align-items: center; cursor: pointer; }
.preview-options input { accent-color: var(--accent); }
.editor { overflow-y: auto; height: 100%; padding: 25px 26px 30px; border-left: 1px solid var(--line); background: #fff; scrollbar-width: thin; scrollbar-color: #b9c3ce transparent; }
.editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 19px; }
h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.6px; }
h2 { margin: 0; font-size: 20px; font-weight: 600; }
.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.list-heading > span { color: var(--muted); font-size: 12px; }
.notice-list { display: flex; flex-direction: column; gap: 6px; }
.notice-row { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.notice-row.selected { border-color: #8eb3e7; background: #f1f6fd; }
.notice-select { display: flex; justify-content: start; gap: 9px; flex: 1; min-width: 0; min-height: 59px; padding: 9px; border: 0; border-radius: 0; text-align: left; background: transparent; }
.notice-select img { width: 29px; height: 29px; border-radius: 8px; object-fit: contain; background: #fff; }
.notice-summary { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.notice-summary strong { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.notice-summary span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.notice-time { flex-shrink: 0; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.notice-row > .icon-button { width: 30px; padding: 6px; border: 0; background: transparent; color: #687682; }
.notice-row > .icon-button svg { width: 15px; height: 15px; }
form, fieldset { display: flex; flex-direction: column; gap: 15px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset:disabled { opacity: .55; }
form label { display: flex; flex-direction: column; gap: 7px; color: #555f6c; font-size: 12px; }
form input:not([type=checkbox]):not([type=range]):not([type=file]):not([type=color]), textarea, select { width: 100%; min-height: 40px; padding: 10px 11px; border: 1px solid #dce1e7; border-radius: 8px; color: #222830; background: #fafbfc; font-size: 14px; }
form input:focus, textarea:focus, select:focus { background: #fff; }
textarea { resize: vertical; line-height: 1.5; }
.optional { color: #626b76; font-size: 11px; }
label[for=subject] { display: block; }
label[for=subject] .optional { float: right; }
label[for=subject] input { margin-top: 7px; }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field-heading label { color: #555f6c; font-size: 12px; }
.quick-apps { display: flex; justify-content: space-between; gap: 6px; }
.quick-app img { background: #f0f3f6; width: 29px; height: 29px; border-radius: 8px; object-fit: contain; }
.quick-app[aria-pressed=true] { border-color: var(--accent); background: #edf4ff; }
.selected-app-name { margin: -8px 0 -2px; color: #5c6774; font-size: 11px; }
.visual-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.visual-field { display: flex; align-items: center; gap: 8px; min-width: 0; }
.visual-field > img, .avatar-placeholder { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 10px; background: #f0f3f6; object-fit: contain; }
.avatar-placeholder { border-radius: 50%; overflow: hidden; }
.avatar-placeholder img { width: 100%; height: 100%; object-fit: cover; }
.visual-field > div:not(.avatar-placeholder) { display: flex; flex-direction: column; align-items: start; gap: 1px; }
form .file-button { display: inline-block; color: var(--accent); font-size: 11px; white-space: nowrap; }
.visual-field .text-button { min-height: 24px; color: #616c78; font-size: 11px; }
input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; padding: 0; overflow: hidden; }
.file-button:focus-within, .wallpaper-upload:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.field-row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 11px; }
.unit-input { position: relative; }
form .unit-input input { padding-right: 36px !important; }
.unit-input > span { position: absolute; top: 12px; right: 11px; font-size: 11px; color: var(--muted); }
details { padding: 13px 0; border-top: 1px solid var(--line); }
details summary { color: #3f4b59; font-size: 12px; font-weight: 500; cursor: pointer; }
.details-content { display: flex; flex-direction: column; gap: 14px; padding-top: 17px; }
.details-content > .small-button, .details-content > .text-button { align-self: start; }
#sceneFields { gap: 0; }
#sceneFields > details:first-child { margin-top: 3px; }
.wallpaper-choices { display: flex; gap: 9px; align-items: center; }
.wallpaper-choices button { width: 43px; height: 62px; min-height: 62px; padding: 2px; border-radius: 9px; }
.wallpaper-choices button[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wallpaper-choices img { display: block; width: 100%; height: 100%; border-radius: 6px; object-fit: cover; }
form .wallpaper-upload { display: flex; align-items: center; justify-content: center; width: 66px; height: 62px; border: 1px dashed #a9b6c5; border-radius: 9px; font-size: 11px; color: #466482; }
#cropControls { display: flex; flex-direction: column; gap: 12px; }
input[type=range] { display: block; width: 100%; min-height: 27px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.glass-control { display: flex; flex-direction: column; gap: 2px; }
.glass-control output { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.range-labels { display: flex; justify-content: space-between; color: #687481; font-size: 11px; }
.checkbox-label { flex-direction: row; align-items: center; gap: 7px; }
.checkbox-label input { accent-color: var(--accent); }
input[type=color] { width: 100%; min-height: 40px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
#status { min-height: 20px; margin: 15px 0 0; color: #536c82; font-size: 12px; line-height: 1.6; }
#status.error { color: #a42d37; }
#emptyState { padding: 16px 0; color: var(--muted); font-size: 13px; }
.mobile-tabs, .mobile-history { display: none; }
dialog { width: min(450px, calc(100vw - 28px)); max-height: calc(100svh - 40px); padding: 23px; border: 1px solid var(--line); border-radius: 17px; background: #fff; color: inherit; box-shadow: 0 20px 90px #10284035; }
dialog::backdrop { background: #16283d70; backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.dialog-heading .icon-button { border: 0; }
.dialog-note, #resultDetails { color: var(--muted); font-size: 12px; line-height: 1.6; }
.search-box { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid #cfd8e3; border-radius: 9px; color: var(--muted); }
.search-box input { width: 100%; padding: 0; border: 0; outline-offset: 5px; color: #242a31; font-size: 14px; background: transparent; }
.app-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-height: 48svh; overflow-y: auto; padding: 15px 3px; margin: 0 -3px 10px; }
.app-choice { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 82px; padding: 8px 3px; border: 1px solid transparent; font-size: 11px; text-align: center; }
.app-choice img { width: 39px; height: 39px; border-radius: 10px; object-fit: contain; }
.app-choice span { max-width: 100%; overflow-wrap: anywhere; }
.app-choice[aria-pressed=true] { border-color: #9cbdea; background: #f0f6fd; }
.app-choice .preset-remove { position: absolute; top: -2px; right: -1px; min-height: 18px; width: 18px; padding: 1px; border: 0; background: #edf0f4; border-radius: 50%; }
#noApps { color: var(--muted); font-size: 13px; line-height: 1.6; }
.examples { display: flex; flex-direction: column; gap: 9px; }
.examples button { align-items: start; flex-direction: column; padding: 15px; gap: 7px; text-align: left; }
.examples strong { font-size: 14px; font-weight: 600; }
.examples span { color: var(--muted); font-size: 12px; }
#resultVideo, #resultImage { display: block; width: 100%; max-height: 57svh; border-radius: 10px; background: #edf1f4; object-fit: contain; }
.result-actions { display: flex; gap: 9px; }
.result-actions > * { flex: 1; }
#helpDialog p { font-size: 13px; line-height: 1.7; color: #566371; }
#helpDialog a { color: var(--accent); text-underline-offset: 3px; }
progress { width: 100%; margin-top: 23px; accent-color: var(--accent); }
#progressDialog p { color: var(--muted); font-size: 13px; }
body.exporting .notice-actions, body.exporting .list-heading { opacity: .5; pointer-events: none; }
@media (max-width: 1000px) and (min-width: 761px) {
  main { grid-template-columns: minmax(0, 1fr) 345px; }
  .editor { padding: 22px 18px; }
  .topbar { padding: 0 22px; gap: 12px; }
  .draft-status { display: none; }
  .stage { padding: 18px 14px; }
  .screens { gap: 12px; }
  .screens.comparing .screen-column { width: calc(50% - 6px); }
  .screens.comparing .phone-preview, .screens.comparing #reference { width: 100%; height: auto; max-height: calc(100svh - 238px); }
}
@media (max-width: 760px) {
  .topbar { height: 64px; gap: 10px; padding: 0 15px; }
  .brand { font-size: 15px; gap: 6px; }
  .brand svg { width: 23px; height: 23px; }
  .top-actions { gap: 5px; }
  .top-actions .primary { min-height: 38px; padding: 9px 11px; font-size: 12px; }
  .top-actions .primary svg { display: none; }
  #savePng { min-height: 38px; width: 36px; padding: 8px; }
  #savePng .button-text, .desktop-undo, .draft-status { display: none !important; }
  #moreButton { width: 29px; padding: 4px; border: 0; }
  .mobile-tabs { position: sticky; top: 64px; z-index: 20; display: flex; height: 46px; padding: 5px 18px; gap: 4px; border-bottom: 1px solid var(--line); background: #fff; }
  .mobile-tabs button { flex: 1; min-height: 34px; padding: 5px; border: 0; border-radius: 7px; background: transparent; color: #5c6978; font-size: 13px; }
  .mobile-tabs button[aria-pressed=true] { background: #edf3fb; color: #175cbe; font-weight: 600; }
  main { display: flex; flex-direction: column; height: auto; min-height: calc(100svh - 110px); }
  body[data-view=edit] .stage { display: none; }
  body[data-view=preview] .editor { display: none; }
  .editor { width: 100%; height: auto; min-height: calc(100svh - 110px); padding: 22px 22px 40px; overflow: visible; border: 0; }
  .editor-heading { margin-bottom: 18px; }
  h1 { font-size: 22px; }
  .mobile-history { display: flex; gap: 3px; margin-left: auto; }
  .mobile-history .icon-button { width: 32px; min-height: 33px; padding: 5px; border: 0; }
  .list-heading { gap: 6px; }
  .quick-app img { width: 31px; height: 31px; }
  .notice-row > .icon-button { min-width: 38px; min-height: 44px; }
  .stage { height: calc(100svh - 110px); min-height: 480px; padding: 14px 16px 20px; gap: 12px; }
  .phone-preview, #reference { height: min(calc(100svh - 275px), 700px); border-radius: 31px; }
  .screen-caption { font-size: 11px; }
  .screens { gap: 12px; }
  .screens.comparing .screen-column { width: calc(50% - 6px); }
  .screens.comparing .phone-preview, .screens.comparing #reference { width: 100%; height: auto; max-height: calc(100svh - 275px); border-radius: 20px; }
  .transport { gap: 4px; }
  .transport .icon-button { width: 32px; min-height: 38px; padding: 5px; }
  .transport output { min-width: 88px; font-size: 11px; }
  .preview-options { flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 11px; }
  .project-menu { top: 58px; right: 10px; }
  dialog { padding: 19px; }
  .app-grid { max-height: 45svh; }
  .visual-fields { gap: 12px; }
  .visual-field > img, .avatar-placeholder { width: 40px; height: 40px; }
}
@media (max-width: 360px) {
  .topbar { padding: 0 10px; }
  .brand { font-size: 14px; }
  .editor { padding-left: 16px; padding-right: 16px; }
  .quick-apps { gap: 3px; }
  .quick-app img { width: 28px; height: 28px; }
  .app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
.app-option { position: relative; min-width: 0; }
.app-option .preset-remove { position: absolute; right: -2px; top: -2px; width: 23px; min-height: 23px; padding: 3px; border-radius: 50%; background: #edf1f6; }
.app-option .preset-remove svg { width: 14px; height: 14px; }
.quick-app img { max-width: 100%; }
@media (max-width: 760px) { .top-actions .desktop-undo[data-action=undo] { display: inline-flex !important; width: 29px; min-height: 36px; padding: 5px; } }
.file-button, .wallpaper-upload, .project-menu label { position: relative; }
@media (min-width: 761px) {
  body { height: 100svh; overflow: hidden; }
  main, .stage, .editor { min-height: 0; }
}

#removeWatermark { display: block; margin: 10px auto 0; }
#exportWatermarkNote { margin: 8px 0 12px; }
#resultVideo, #resultImage { max-height: clamp(160px, calc(100svh - 400px), 52svh); }

.result-transport { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.result-transport .icon-button { border: 0; min-height: 40px; }
#resultSeek { flex: 1; min-width: 0; width: 100%; accent-color: var(--accent); }
#resultTime { flex-shrink: 0; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }
#resultVideo { cursor: pointer; max-height: clamp(140px, calc(100svh - 448px), 49svh); }
.result-player:fullscreen { display: flex; flex-direction: column; padding: 16px; background: #edf1f4; }
.result-player:fullscreen #resultVideo { flex: 1; min-height: 0; max-height: none; border-radius: 0; }
.result-player:fullscreen .result-transport { flex-shrink: 0; width: min(640px, 100%); margin: 8px auto 0; }
@media (max-width: 360px) { .result-transport { gap: 2px; } .result-transport .icon-button { width: 30px; padding: 5px; } #resultTime { font-size: 10px; } }

.top-actions > button { height: 40px; min-height: 40px; }
.top-actions [data-icon] { display: flex; align-items: center; line-height: 0; }
@media (max-width: 760px) { .top-actions > button, .top-actions .desktop-undo[data-action=undo] { height: 38px; min-height: 38px; } }
.top-actions > button { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 360px) { .brand > span { display: none; } }

.wallpaper-choices { max-width: 100%; gap: 6px; align-items: flex-start; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.wallpaper-choices button { display: flex; flex: 0 0 50px; align-items: center; justify-content: center; width: 50px; height: 68px; min-height: 68px; padding: 3px; }
.wallpaper-thumb { display: block; flex-shrink: 0; width: 42px; height: 60px; overflow: hidden; border-radius: 6px; }
form .wallpaper-upload { flex: 0 0 60px; flex-direction: column; gap: 6px; width: 60px; height: 68px; }

/* Keep per-notification editing separate from whole-scene controls. */
#sceneFields { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
#sceneFields > details:first-of-type { border-top: 0; padding-top: 0; }

.quick-apps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.quick-app { display: flex; align-items: center; justify-content: center; width: 100%; height: auto; min-height: 0; aspect-ratio: 1; padding: 3px; border: 1px solid transparent; border-radius: 10px; }
.quick-app img { display: block; width: 100%; height: 100%; aspect-ratio: 1; min-width: 0; border-radius: 7px; object-fit: contain; }
.scene-heading { margin: 0 0 16px; font-size: 16px; font-weight: 600; }
#noticeFields { padding-top: 20px; margin-top: 16px; border-top: 1px solid var(--line); }
#sceneFields > details { min-width: 0; width: 100%; }
#sceneFields summary { display: flex; align-items: center; gap: 7px; list-style: none; overflow-wrap: anywhere; }
#sceneFields summary::-webkit-details-marker { display: none; }
#sceneFields summary::before { content: ''; flex: 0 0 5px; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
#sceneFields details[open] > summary::before { transform: rotate(45deg); }
.field-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.field-row > label, .details-content { min-width: 0; }
form select { min-width: 0; }
.custom-app-fields { display: flex; flex-direction: column; gap: 18px; }
.custom-app-fields > label { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--muted); }
.custom-app-fields input:not([type=file]) { width: 100%; min-height: 40px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
@media (max-width: 360px) { .quick-apps { gap: 3px; } }

@media (max-width: 400px) { #videoSettings .field-row { grid-template-columns: minmax(0, 1fr); } }

form select, form select:focus {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%233f4b59' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}
#videoSettings .field-row { grid-template-columns: minmax(0, 1fr); }
#videoSettings #duration { padding-right: 62px !important; }

.notice-list { isolation: isolate; }
.notice-row { position: relative; }
.notice-drag { display: flex; align-items: center; justify-content: center; align-self: stretch; flex: 0 0 32px; min-height: 44px; padding: 4px; border: 0; border-radius: 0; background: transparent; color: #7b8794; touch-action: none; cursor: grab; }
.notice-drag svg { width: 18px; height: 18px; }
.notice-drag:active { cursor: grabbing; }
.notice-drag:focus-visible { outline-offset: -3px; }
.notice-row.dragging { z-index: 2; box-shadow: 0 8px 20px #18384c24; background: #f1f6fd; opacity: .94; }
.notice-row.drop-before { box-shadow: inset 0 3px var(--accent); }
.notice-row.drop-after { box-shadow: inset 0 -3px var(--accent); }
body.reordering { user-select: none; cursor: grabbing; }
@media (max-width: 760px) { .notice-drag { flex-basis: 44px; } }

/* Native range semantics with consistent blue tracks and round white thumbs. */
input[type=range] {
  --range-fill: 0%;
  --range-track-height: 6px;
  --range-thumb-size: 24px;
  --range-blue: #007aff;
  --range-rest: #dce1e7;
  appearance: none;
  -webkit-appearance: none;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  touch-action: pan-y;
}
input[type=range]:focus { background: transparent; }
input[type=range]::-webkit-slider-runnable-track {
  height: var(--range-track-height);
  border-radius: 999px;
  background: linear-gradient(to right, var(--range-blue) 0 var(--range-fill), var(--range-rest) var(--range-fill) 100%);
}
input[type=range]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: var(--range-thumb-size);
  height: var(--range-thumb-size);
  margin-top: calc((var(--range-track-height) - var(--range-thumb-size)) / 2);
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px #18263b30, 0 1px 2px #18263b1a;
  transition: transform 120ms ease-out;
}
input[type=range]::-moz-range-track {
  height: var(--range-track-height);
  border-radius: 999px;
  background: linear-gradient(to right, var(--range-blue) 0 var(--range-fill), var(--range-rest) var(--range-fill) 100%);
}
input[type=range]::-moz-range-thumb {
  width: var(--range-thumb-size);
  height: var(--range-thumb-size);
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px #18263b30, 0 1px 2px #18263b1a;
  transition: transform 120ms ease-out;
}
input[type=range]:active:not(:disabled)::-webkit-slider-thumb { transform: scale(1.12); }
input[type=range]:active:not(:disabled)::-moz-range-thumb { transform: scale(1.12); }
input[type=range]:disabled { --range-blue: #a9b4c2; opacity: .55; cursor: default; }
#timeline, #resultSeek { --range-track-height: 4px; --range-thumb-size: 18px; }
@media (prefers-reduced-motion: reduce) {
  input[type=range]::-webkit-slider-thumb { transition: none; }
  input[type=range]::-moz-range-thumb { transition: none; }
}
@media (forced-colors: active) {
  input[type=range] { --range-blue: Highlight; --range-rest: GrayText; }
  input[type=range]::-webkit-slider-thumb { background: ButtonText; }
  input[type=range]::-moz-range-thumb { background: ButtonText; }
}

.select-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-width: 0; min-height: 40px; padding: 10px 12px; border: 1px solid #dce1e7; border-radius: 8px; background: #fafbfc; color: #222830; font-size: 14px; font-weight: 400; text-align: left; }
.select-control > span { min-width: 0; }
.select-control > svg { flex-shrink: 0; width: 16px; height: 16px; color: #3f4b59; }
.select-control:hover:not(:disabled), .select-control[aria-expanded=true] { background: #fff; border-color: #8bb9f5; }
.select-control[aria-expanded=true] { box-shadow: 0 0 0 2px #007aff16; }
.select-menu { position: fixed; inset: auto; box-sizing: border-box; margin: 0; padding: 5px; max-width: calc(100vw - 16px); max-height: min(320px, 70svh); overflow-y: auto; border: 1px solid #e0e4e9; border-radius: 12px; background: #fff; color: #222830; box-shadow: 0 8px 28px #18263b24; }
.select-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 10px; border-radius: 7px; font-size: 14px; cursor: pointer; }
.select-option > svg { width: 17px; height: 17px; flex-shrink: 0; visibility: hidden; }
.select-option[aria-selected=true] { color: #0766d7; background: #edf5ff; }
.select-option[aria-selected=true] > svg { visibility: visible; }
.select-option.highlighted { color: #fff; background: #007aff; }
@media (max-width: 760px) { .select-option, .select-control { min-height: 44px; } }
@media (forced-colors: active) { .select-option.highlighted { color: HighlightText; background: Highlight; } }

/* Public editor keeps export actions in the header and edit history with the list. */
.compact-label { display: none; }
.editor-history { display: flex; gap: 3px; margin-left: auto; }
.editor-history .icon-button { width: 32px; min-height: 33px; padding: 5px; border: 0; }
#status:empty { display: none; }
.credits-button { display: block; margin-top: 20px; color: var(--muted); font-size: 11px; }
#resultImage { max-height: min(calc(100svh - 240px), 68svh); }
@media (max-width: 760px) {
  .top-actions .button-text { display: none; }
  .top-actions .compact-label { display: inline; }
  .top-actions #savePng { width: auto; padding: 8px 10px; font-size: 12px; }
  .top-actions .primary svg { display: block; }
  .top-actions [data-icon] svg { width: 18px; height: 18px; }
  .top-actions > button { gap: 6px; }
}

#status { position: fixed; z-index: 100; bottom: 16px; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(520px, calc(100vw - 32px)); min-height: 0; margin: 0; padding: 10px 14px; border-radius: 10px; background: #fff; box-shadow: 0 5px 22px #18263b26; color: #3f4b59; }
#status.error { color: #a42d37; }
