@font-face {
  font-family: "Alfa Slab One Local";
  src: url("./font/AlfaSlabOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Lato Local";
  src: url("./font/Lato-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Lato Local";
  src: url("./font/Lato-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

:root {
  color-scheme: light;
  --ink: #153044;
  --soft-ink: #476175;
  --muted: #6e8293;
  --line: #c9e7f8;
  --line-strong: #9bd4f0;
  --paper: #ffffff;
  --blue-50: #f3fbff;
  --blue-100: #e4f6ff;
  --blue-200: #c9ecff;
  --blue-500: #3b9ed8;
  --yellow-100: #fff7c9;
  --yellow-200: #ffed91;
  --yellow-500: #d5a900;
  --peach: #ffe4bc;
  --red-50: #fff7f5;
  --red-100: #ffe7e1;
  --red-200: #ffc7bd;
  --red-500: #d96d5c;
  --green: #2fa875;
  --shadow: 0 18px 60px rgba(38, 114, 150, 0.14);
  --shadow-small: 0 10px 26px rgba(38, 114, 150, 0.12);
  font-family: "Lato Local", Avenir, "Trebuchet MS", Verdana, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    linear-gradient(90deg, rgba(201, 236, 255, 0.34) 1px, transparent 1px),
    linear-gradient(180deg, rgba(201, 236, 255, 0.34) 1px, transparent 1px),
    linear-gradient(135deg, #ffffff 0%, #f7fcff 42%, #fff9d8 100%);
  background-size: 44px 44px, 44px 44px, 100% 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 247, 201, 0.92), transparent 34%),
    radial-gradient(circle at 86% 12%, rgba(228, 246, 255, 0.95), transparent 32%),
    transparent;
}

body,
button,
input,
select,
textarea {
  font: inherit;
}

button,
summary,
label,
input[type="file"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(59, 158, 216, 0.36);
  outline-offset: 3px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid rgba(155, 212, 240, 0.72);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  font-family: "Lato Local", Avenir, sans-serif;
  font-size: clamp(1.08rem, 2vw, 1.6rem);
  font-weight: 700;
  line-height: 1;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: 5px 5px 0 var(--ink);
}

.brand-mark::before {
  content: "";
  width: 26px;
  height: 17px;
  display: block;
  background: #111111;
}

.day-pass-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.day-pass-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background: linear-gradient(135deg, var(--yellow-200), var(--blue-200));
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.day-pass-activate-trigger {
  background: linear-gradient(135deg, var(--blue-100), #ffffff);
  box-shadow: 4px 4px 0 var(--blue-500);
}

.day-pass-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--ink);
}

.day-pass-button[hidden] {
  display: none;
}

.day-pass-status {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid rgba(47, 168, 117, 0.34);
  border-radius: 999px;
  color: #166243;
  background: linear-gradient(135deg, rgba(230, 255, 242, 0.92), rgba(228, 246, 255, 0.84));
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
}

.day-pass-status[hidden] {
  display: none;
}

.app-main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 4vw, 36px);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  gap: clamp(16px, 3vw, 28px);
  align-items: start;
}

.panel,
.render-panel,
.settings-menu {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.panel {
  padding: clamp(16px, 2.5vw, 24px);
}

.source-panel {
  min-height: 620px;
}

.right-rail {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Alfa Slab One Local", Georgia, serif;
  font-weight: 400;
  line-height: 1.06;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.3rem);
}

h2 {
  font-size: 1.38rem;
}

.dropzone {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 188px;
  gap: 8px;
  padding: 22px;
  border: 2px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(228, 246, 255, 0.78), rgba(255, 247, 201, 0.68)),
    var(--paper);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.dropzone:hover {
  border-color: var(--blue-500);
  box-shadow: var(--shadow-small);
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background: var(--yellow-200);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.drop-title {
  font-size: 1.18rem;
  font-weight: 900;
}

.drop-copy,
.muted {
  color: var(--muted);
}

.drop-copy {
  max-width: 420px;
  margin: 0;
  text-align: center;
  line-height: 1.45;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.photo-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-small);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: opacity 0.16s ease;
}

.photo-card:active {
  cursor: grabbing;
}

.photo-card:focus-visible {
  outline: 3px solid rgba(59, 158, 216, 0.36);
  outline-offset: 3px;
}

.photo-card.is-selected {
  border: 2px solid var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 158, 216, 0.22), var(--shadow-small);
  transition: none;
}

.photo-card.is-pointer-dragging {
  opacity: 0.24;
  cursor: grabbing;
}

.photo-strip.is-reordering .photo-card:not(.is-pointer-dragging) {
  transition: transform 110ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.16s ease, box-shadow 0.16s ease;
  will-change: transform;
}

.photo-strip.is-reordering .photo-card.is-pointer-dragging {
  transition: opacity 110ms ease;
}

.photo-strip.is-finalizing-reorder .photo-card {
  transition: none !important;
}

.photo-thumb-frame {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

.photo-thumb-frame.is-loading {
  background: linear-gradient(135deg, var(--blue-100), var(--yellow-100));
}

.thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
}

.photo-order {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(21, 48, 68, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background: var(--yellow-200);
  font-size: 0.82rem;
  font-weight: 900;
}

.photo-delete {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(21, 48, 68, 0.14);
  border-radius: 50%;
  color: #9d3f35;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 12px rgba(21, 48, 68, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.72);
  transition: opacity 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.photo-card.is-selected .photo-delete {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  transition: none;
}

.photo-delete:hover,
.photo-delete:focus-visible {
  color: #7c2b24;
  background: var(--red-100);
}

.photo-delete svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.photo-drag-proxy {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  overflow: hidden;
  border: 2px solid var(--blue-500);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 34px rgba(21, 48, 68, 0.24);
  opacity: 0.94;
  pointer-events: none;
  transition: none !important;
  transform-origin: center;
  will-change: transform;
}

.photo-drag-proxy .photo-name {
  display: none;
}

.photo-name {
  display: block;
  min-height: 36px;
  padding: 8px 9px;
  overflow: hidden;
  color: var(--soft-ink);
  font-size: 0.78rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trash-drop {
  display: none;
  place-items: center;
  min-height: 64px;
  margin-top: 14px;
  border: 2px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(228, 246, 255, 0.54);
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.trash-drop.is-visible {
  display: grid;
}

.trash-drop.is-drag-over {
  border-color: #d35a5a;
  color: #b53d3d;
  background: #fff0e9;
}

@media (prefers-reduced-motion: reduce) {
  .photo-card,
  .photo-delete,
  .photo-strip.is-reordering .photo-card {
    transition: none;
  }
}

.trash-drop svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.render-panel {
  display: grid;
  gap: 14px;
  align-items: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.94);
}

.music-panel {
  background: linear-gradient(135deg, rgba(255, 247, 201, 0.7), rgba(255, 255, 255, 0.92));
}

.rail-audio,
.file-row {
  display: grid;
  gap: 8px;
}

.audio-picker {
  position: relative;
  min-height: 42px;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0;
  cursor: pointer;
}

.audio-picker input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.file-picker-button {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 8px 0 0 8px;
  color: var(--ink);
  background: var(--blue-100);
  font-weight: 900;
  pointer-events: none;
}

.file-picker-text {
  display: flex;
  min-width: 0;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  color: var(--soft-ink);
  background: var(--paper);
  overflow: hidden;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-picker:hover .file-picker-button,
.audio-picker:focus-within .file-picker-button {
  border-color: var(--blue-500);
  background: var(--blue-200);
}

.audio-picker:hover .file-picker-text,
.audio-picker:focus-within .file-picker-text {
  border-color: var(--blue-500);
}

.audio-picker:focus-within .file-picker-button {
  outline: 3px solid rgba(50, 152, 216, 0.28);
  outline-offset: 2px;
}

.audio-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.audio-list:empty {
  display: none;
}

.audio-list[hidden] {
  display: none;
}

.audio-list li {
  overflow: hidden;
  padding: 7px 9px 7px 24px;
  border: 1px solid rgba(104, 161, 194, 0.42);
  border-radius: 7px;
  color: var(--soft-ink);
  background: rgba(255, 255, 255, 0.76);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-menu {
  overflow: clip;
}

.settings-menu summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 16px;
  padding: 0 16px;
  cursor: pointer;
  list-style: none;
  transition: background 0.16s ease;
}

.settings-menu summary::-webkit-details-marker {
  display: none;
}

.settings-menu summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--blue-100);
  font-weight: 900;
}

.settings-menu[open] summary {
  background: linear-gradient(135deg, rgba(228, 246, 255, 0.74), rgba(255, 247, 201, 0.56));
}

.settings-menu[open] summary::after {
  content: "-";
  background: var(--yellow-100);
}

.settings-menu summary span {
  font-weight: 900;
}

.settings-menu summary small {
  margin-left: auto;
  color: var(--muted);
}

.settings-drawer {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.settings-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 12px;
  margin-bottom: -8px;
}

.settings-toolbar-actions {
  justify-content: flex-end;
}

.settings-toolbar-note {
  min-height: 1.2em;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.tool-settings-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-action-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--soft-ink);
  background: var(--paper);
}

.icon-action-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-action-button:hover,
.icon-action-button:focus-visible {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--blue-100);
}

.icon-action-button::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 2;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-small);
  font-size: 0.78rem;
  line-height: 1.1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.icon-action-button:hover::after,
.icon-action-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.settings-section {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.control {
  display: grid;
  gap: 10px;
}

.control-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
}

output {
  color: var(--blue-500);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 22px;
  width: 100%;
  accent-color: var(--blue-500);
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(90deg, var(--blue-200), var(--yellow-100));
}

input[type="range"]::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow-200);
  box-shadow: 2px 2px 0 var(--ink);
  appearance: none;
}

input[type="range"]::-moz-range-track {
  height: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(90deg, var(--blue-200), var(--yellow-100));
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow-200);
  box-shadow: 2px 2px 0 var(--ink);
}

.toggle-row,
.loop-controls,
.transition-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-50);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
}

.toggle-row span {
  display: grid;
  gap: 3px;
}

.toggle-row small {
  color: var(--muted);
  line-height: 1.35;
}

.toggle-row input {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  accent-color: var(--blue-500);
}

.loop-controls {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--yellow-100);
}

.loop-duration {
  margin: 0;
  color: var(--soft-ink);
  font-size: 0.84rem;
  font-weight: 800;
}

.transition-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 14px;
}

.transition-group legend {
  padding: 0 8px;
  color: var(--soft-ink);
  font-weight: 900;
}

.transition-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

input[type="radio"] {
  accent-color: var(--blue-500);
}

.quality-select {
  width: 100%;
  min-height: 42px;
  padding: 9px 38px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%) right 16px center / 7px 7px no-repeat,
    linear-gradient(135deg, rgba(228, 246, 255, 0.7), rgba(255, 247, 201, 0.72)),
    var(--paper);
  font-weight: 900;
  appearance: none;
}

.quality-select option:disabled {
  color: var(--muted);
}

.generate {
  width: 100%;
  min-height: 58px;
  color: var(--ink);
  background: linear-gradient(135deg, var(--yellow-200), var(--blue-200));
  box-shadow: 6px 6px 0 var(--ink), var(--shadow-small);
  font-size: 1.05rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.generate:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 8px 8px 0 var(--ink), var(--shadow-small);
}

#statusText,
.output-location {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.output-location:empty {
  display: none;
}

.live-preview {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(201, 236, 255, 0.55) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(201, 236, 255, 0.55) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(201, 236, 255, 0.55) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(201, 236, 255, 0.55) 75%),
    #ffffff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.live-preview.is-vertical {
  width: min(100%, 300px);
  max-height: 520px;
  aspect-ratio: 9 / 16;
  justify-self: center;
}

.preview-status {
  z-index: 1;
  padding: 14px;
  color: var(--soft-ink);
  font-size: 0.88rem;
  font-weight: 900;
  text-align: center;
}

.live-preview.has-video .preview-status {
  display: none;
}

.live-preview video {
  display: none;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  object-fit: contain;
}

progress {
  display: none;
  width: 100%;
  height: 12px;
  accent-color: var(--blue-500);
}

progress.is-visible {
  display: block;
}

video {
  display: none;
  width: 100%;
  max-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.profile-dialog {
  width: min(640px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 26px 90px rgba(21, 48, 68, 0.24);
}

.day-pass-dialog {
  width: min(560px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 247, 201, 0.85), transparent 42%),
    radial-gradient(circle at 92% 0%, rgba(228, 246, 255, 0.9), transparent 34%),
    var(--paper);
  box-shadow: 0 26px 90px rgba(21, 48, 68, 0.24);
}

.day-pass-dialog::backdrop {
  background: rgba(21, 48, 68, 0.18);
  backdrop-filter: blur(8px);
}

.day-pass-form {
  margin: 0;
}

.day-pass-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(228, 246, 255, 0.82), rgba(255, 247, 201, 0.72));
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue-500);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.day-pass-dialog-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.day-pass-dialog-copy {
  margin: 0;
  color: var(--soft-ink);
  line-height: 1.45;
}

.day-pass-license-field {
  display: grid;
  gap: 8px;
  font-weight: 900;
}

.day-pass-license-field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  font-weight: 900;
  letter-spacing: 0.03em;
}

.day-pass-license-field input::placeholder {
  color: #99aebb;
  font-size: 0.82rem;
  letter-spacing: 0;
}

.day-pass-dialog-error {
  min-height: 1.2em;
  margin: 0;
  color: #ad4335;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.35;
}

.day-pass-dialog-error:empty {
  display: none;
}

.day-pass-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.day-pass-activate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background: linear-gradient(135deg, var(--yellow-200), var(--blue-200));
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.free-render-limits {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px 16px 12px 34px;
  border: 1px solid rgba(155, 212, 240, 0.78);
  border-radius: 8px;
  color: var(--ink);
  background: linear-gradient(135deg, var(--blue-50), rgba(255, 247, 201, 0.56));
  font-weight: 900;
}

.free-render-buy-link {
  background: linear-gradient(135deg, var(--yellow-200), #ffffff);
}

.profile-dialog::backdrop {
  background: rgba(21, 48, 68, 0.18);
  backdrop-filter: blur(8px);
}

.profile-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--blue-100), var(--yellow-100));
}

.icon-text-button,
.profile-delete-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper);
}

.profile-list {
  display: grid;
  gap: 10px;
  max-height: min(520px, 70vh);
  overflow: auto;
  padding: 16px;
}

.profile-empty {
  margin: 0;
  color: var(--muted);
}

.profile-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}

.profile-load-button {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--blue-50);
  text-align: left;
}

.profile-load-button span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.profile-delete-button {
  align-self: center;
}

body[data-app-error="true"]::after {
  content: "The slideshow app could not start. Check the browser console.";
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid #ffb3a6;
  border-radius: 8px;
  color: #832c1f;
  background: #fff0e9;
  box-shadow: var(--shadow-small);
  font-weight: 800;
}

@media (max-width: 1060px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .right-rail {
    position: static;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .settings-menu,
  .right-rail .render-panel:last-of-type,
  .generate,
  .output-location {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-lockup {
    font-size: 1.2rem;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .brand-mark::before {
    width: 22px;
    height: 15px;
  }

  .app-main {
    padding: 14px;
  }

  .right-rail {
    grid-template-columns: 1fr;
  }

  .source-panel {
    min-height: auto;
  }

  .photo-strip {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  }

  .transition-group,
  .profile-item {
    grid-template-columns: 1fr;
  }

  .settings-menu summary {
    align-items: flex-start;
    flex-wrap: wrap;
    padding-block: 12px;
  }

  .settings-menu summary small {
    flex-basis: 100%;
    margin-left: 0;
  }
}
