:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --ink: #18202f;
  --muted: #687286;
  --border: #dfe4ec;
  --primary: #1e3a5f;
  --accent: #2a9d8f;
  --danger: #b42318;
  --shadow: 0 10px 30px rgba(24, 32, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

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

.app-shell {
  min-height: 100vh;
  display: block;
}

.sidebar {
  background: #142640;
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #f2c94c);
}

.brand small {
  color: rgba(255, 255, 255, 0.58);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 11px 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
}

.main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.topbar .brand {
  min-width: 190px;
  padding: 0;
}

.topbar .brand small {
  color: var(--muted);
}

.topbar-main {
  flex: 1;
  min-width: 260px;
}

.topbar-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-controls select {
  width: auto;
  min-width: 190px;
}

.live-url {
  display: inline-flex;
  align-items: center;
  max-width: min(100%, 720px);
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.live-url:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.08);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 30px;
  letter-spacing: 0;
  margin-bottom: 4px;
}

h2 {
  font-size: 20px;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.stat {
  display: grid;
  gap: 4px;
}

.stat strong {
  font-size: 26px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
}

.btn.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.btn.danger {
  border-color: #f5c2bd;
  color: var(--danger);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: #3f4858;
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.translation-textarea {
  min-height: 72px;
  font-size: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  border: 1px solid var(--border);
}

.pill.ok {
  color: #067647;
  border-color: #abefc6;
  background: #ecfdf3;
}

.pill.off {
  color: #667085;
  background: #f2f4f7;
}

.pill.warn {
  color: #b54708;
  border-color: #fedf89;
  background: #fffaeb;
}

.priority-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.priority-grid-single {
  grid-template-columns: 1fr;
}

.priority-section {
  display: grid;
  gap: 12px;
}

.priority-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.priority-heading h2 {
  margin: 0;
}

.priority-list {
  display: grid;
  gap: 10px;
  min-height: 64px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.priority-item,
.priority-empty {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.priority-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  cursor: grab;
}

.priority-item.dragging {
  opacity: 0.62;
  border-color: var(--primary);
  box-shadow: 0 10px 24px rgba(30, 58, 95, 0.15);
}

.priority-item.saving {
  opacity: 0.7;
}

.priority-item-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.priority-item-main strong,
.priority-item-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-empty {
  color: var(--muted);
  background: #f8fafc;
}

.drag-handle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #667085;
  background: #f2f4f7;
  font-weight: 700;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.status-switch {
  width: fit-content;
  display: inline-flex;
  cursor: pointer;
}

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

.status-switch-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-width: 248px;
  min-height: 46px;
  border-radius: 999px;
  padding: 4px;
  color: #fff;
  background: #175cd3;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: background 180ms ease;
}

.status-switch.is-inactive .status-switch-track {
  background: #c01048;
}

.status-switch-thumb {
  position: absolute;
  left: 4px;
  top: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(16, 24, 40, 0.24);
  transition: transform 180ms ease;
}

.status-switch.is-inactive .status-switch-thumb {
  transform: translateX(100%);
}

.status-switch-label {
  position: relative;
  z-index: 1;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  transition: color 180ms ease;
}

.status-switch.is-active .status-switch-on,
.status-switch.is-inactive .status-switch-off {
  color: #111827;
}

.status-switch.is-active .status-switch-off,
.status-switch.is-inactive .status-switch-on {
  color: rgba(255, 255, 255, 0.82);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 20%, rgba(42, 157, 143, 0.18), transparent 28%), var(--bg);
}

.login-card {
  width: min(420px, 100%);
}

.notice {
  border: 1px solid #b2ddff;
  color: #175cd3;
  background: #eff8ff;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

.app-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: start center;
  padding: 28px 16px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-popup.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-popup-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(440px, 100%);
  border: 1px solid #abefc6;
  border-radius: 8px;
  background: #ecfdf3;
  color: #067647;
  box-shadow: 0 18px 44px rgba(24, 32, 47, 0.16);
  padding: 14px 16px;
  pointer-events: auto;
}

.app-popup-panel strong {
  flex: 1;
}

.error {
  color: var(--danger);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.frame-onboarding {
  width: min(980px, 100%);
}

.frame-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.nameplate-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.frame-choice,
.nameplate-choice {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.frame-choice.selected,
.nameplate-choice.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.frame-choice input,
.nameplate-choice input {
  width: auto;
  min-height: auto;
}

.frame-choice small,
.nameplate-choice small {
  color: var(--muted);
  line-height: 1.35;
}

.frame-choice .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
}

.metric-panel {
  border: 1px solid #c7d7ee;
  background: #f3f7fc;
  color: #27415f;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
}

.slide-image-confirmation {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
  min-height: 76px;
}

.slide-image-confirmation img {
  width: 92px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: #080c13;
}

.content-summary {
  min-height: 78px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  color: #364153;
  white-space: pre-wrap;
}

.slide-upload-flow {
  display: grid;
  gap: 16px;
}

.upload-only-view {
  display: grid;
  gap: 22px;
  min-height: min(620px, calc(100vh - 190px));
  align-content: start;
}

.crop-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.crop-panel,
.preview-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.upload-drop {
  position: relative;
  display: grid;
  gap: 8px;
  border: 1px dashed #9bb4d1;
  background: #f6f9fd;
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.upload-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-drop span {
  color: var(--muted);
  font-weight: 400;
}

.upload-drop-large {
  min-height: min(420px, 52vh);
  place-items: center;
  text-align: center;
  font-size: 18px;
}

.upload-drop-large strong {
  font-size: clamp(24px, 4vw, 42px);
}

.upload-drop.is-dragover {
  border-color: #2563eb;
  background: #edf5ff;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.crop-canvas-shell {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #0a1420;
  border: 1px solid #1c334e;
}

.crop-canvas-shell canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.crop-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 20px;
}

.crop-controls {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.crop-controls label {
  display: grid;
  gap: 6px;
}

.custom-slide-flow {
  display: grid;
  gap: 16px;
}

.composer-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: start;
}

.composer-sidebar {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.composer-sidebar h3 {
  margin: 8px 0 0;
}

.composer-bg-grid {
  display: grid;
  gap: 8px;
}

.composer-bg-choice {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.composer-bg-choice.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.composer-bg-thumb {
  display: block;
  width: 56px;
  aspect-ratio: 16 / 9;
  border-radius: 5px;
  border: 1px solid rgba(16, 24, 40, 0.16);
  background-position: center;
  background-size: cover;
}

.composer-upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.composer-upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.composer-center {
  min-width: 0;
}

.composer-stage-shell {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.composer-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 14px 36px rgba(16, 24, 40, 0.14);
  background-position: center;
  background-size: cover;
  touch-action: none;
}

.composer-object {
  position: absolute;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.composer-object.selected {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.composer-object-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
  pointer-events: none;
}

.composer-object-text {
  display: block;
}

.composer-text-content {
  width: 100%;
  height: 100%;
  overflow: hidden;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.composer-resize {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.28);
  cursor: nwse-resize;
}

.composer-inspector {
  border-left: 1px solid var(--border);
  padding-left: 16px;
}

.font-color-grid {
  display: grid;
  grid-template-columns: repeat(5, 34px);
  gap: 8px;
}

.font-color {
  width: 34px;
  height: 34px;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
}

.font-color.selected {
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.24);
}

.composer-style-row {
  display: flex;
  gap: 8px;
}

.toggle-button {
  min-width: 44px;
  font-weight: 700;
}

.toggle-button.selected {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.crop-source-shell {
  position: relative;
  min-height: min(620px, 62vh);
  height: min(620px, 62vh);
  overflow: hidden;
  border: 1px solid #18304a;
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    #08111e;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.crop-image-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.crop-source-image {
  position: absolute;
  display: block;
  pointer-events: none;
}

.crop-selection {
  position: absolute;
  cursor: grab;
  border: 2px solid rgba(255, 255, 255, 0.96);
  box-shadow:
    0 0 0 9999px rgba(4, 9, 16, 0.62),
    0 10px 28px rgba(0, 0, 0, 0.24);
  background:
    linear-gradient(90deg, transparent 33.333%, rgba(255, 255, 255, 0.34) 33.333%, rgba(255, 255, 255, 0.34) calc(33.333% + 1px), transparent calc(33.333% + 1px), transparent 66.666%, rgba(255, 255, 255, 0.34) 66.666%, rgba(255, 255, 255, 0.34) calc(66.666% + 1px), transparent calc(66.666% + 1px)),
    linear-gradient(0deg, transparent 33.333%, rgba(255, 255, 255, 0.34) 33.333%, rgba(255, 255, 255, 0.34) calc(33.333% + 1px), transparent calc(33.333% + 1px), transparent 66.666%, rgba(255, 255, 255, 0.34) 66.666%, rgba(255, 255, 255, 0.34) calc(66.666% + 1px), transparent calc(66.666% + 1px));
}

.is-cropping .crop-selection {
  cursor: grabbing;
}

.crop-selection-label {
  position: absolute;
  left: 10px;
  top: 10px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff;
  background: rgba(6, 12, 22, 0.72);
  font-size: 12px;
  pointer-events: none;
}

.crop-handle {
  position: absolute;
  right: -9px;
  bottom: -9px;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  cursor: nwse-resize;
}

.crop-frame-preview {
  position: relative;
  overflow: hidden;
  background: #05070a;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(24, 32, 47, 0.16);
  --preview-frame-top: 44px;
  --preview-frame-side: 12px;
  --preview-frame-bottom: 20px;
}

.crop-preview-visible {
  position: absolute;
  left: var(--preview-frame-side);
  right: var(--preview-frame-side);
  top: var(--preview-frame-top);
  bottom: var(--preview-frame-bottom);
  overflow: hidden;
  background: #080c13;
}

.crop-preview-visible img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.screen-frame-preview {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.crop-frame-preview .frame-overlay {
  inset: 0;
  --frame-top: var(--preview-frame-top);
  --frame-side: var(--preview-frame-side);
  --frame-bottom: var(--preview-frame-bottom);
}

.crop-frame-preview .frame-border {
  border-width: var(--preview-frame-top) var(--preview-frame-side) var(--preview-frame-bottom);
}

.crop-frame-preview .frame-nameplate {
  top: calc(var(--preview-frame-top) * 0.14);
  min-width: 22%;
  max-width: 74%;
  min-height: calc(var(--preview-frame-top) * 0.7);
  gap: calc(var(--preview-frame-top) * 0.12);
  padding:
    calc(var(--preview-frame-top) * 0.07)
    calc(var(--preview-frame-top) * 0.55)
    calc(var(--preview-frame-top) * 0.16);
  border-radius: 3px;
  font-size: clamp(13px, calc(var(--preview-frame-top) * 0.54), 23px);
}

.crop-frame-preview .plate-screw {
  width: clamp(5px, calc(var(--preview-frame-top) * 0.16), 10px);
  height: clamp(5px, calc(var(--preview-frame-top) * 0.16), 10px);
}

.crop-frame-preview .plate-screw-left {
  left: calc(var(--preview-frame-top) * 0.34);
}

.crop-frame-preview .plate-screw-right {
  right: calc(var(--preview-frame-top) * 0.34);
}

.crop-frame-preview .plate-ornament {
  height: calc(var(--preview-frame-top) * 0.09);
  bottom: calc(var(--preview-frame-top) * 0.08);
}

.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.frame-preview {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #080c13;
}

.preview-slide {
  position: absolute;
  inset: 15% 7.5% 8%;
  background: linear-gradient(135deg, #15213a, #2a9d8f);
}

.frame-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  border-style: solid;
  border-width: 10.45% 3.125% 4.925%;
  border-image: url("/frame-assets/frame_border_source.png?v=4") 104 48 49 48 stretch;
  pointer-events: none;
  z-index: 3;
}

.preview-nameplate {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 5.8%;
  transform: translateX(-50%);
  width: auto;
  min-width: 34%;
  max-width: 74%;
  border-radius: 2px;
  padding: 2px 9px;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(7px, 1vw, 11px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nameplate-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 72px;
  border-radius: 5px;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  color: #1f1407;
  border: 1px solid rgba(88, 58, 15, 0.68);
  background:
    linear-gradient(100deg, rgba(255, 249, 201, 0.18), transparent 18%, rgba(116, 76, 17, 0.12) 58%, rgba(255, 238, 154, 0.22)),
    linear-gradient(180deg, #f4d77d 0%, #d2a13d 48%, #b77b25 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.74), inset 0 -2px rgba(80, 47, 12, 0.28);
}

.nameplate-preview span {
  position: relative;
  z-index: 2;
}

.nameplate-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 38%, rgba(75, 45, 10, 0.18)),
    url("/frame-assets/brass_noise.png");
  background-size: auto, 256px 96px;
  mix-blend-mode: soft-light;
}

body.screen-mode {
  overflow: hidden;
  background: #05070a;
}

.screen-root {
  position: fixed;
  inset: 0;
  background: #05070a;
  color: #fff;
  display: grid;
  place-items: center;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.screen-stage {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: #080c13;
}

.screen-test-overlay {
  position: fixed;
  left: var(--frame-side);
  right: var(--frame-side);
  top: var(--frame-top);
  bottom: var(--frame-bottom);
  z-index: 3;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(18px, 3vh, 48px);
  pointer-events: none;
  color: #fff;
  font-size: clamp(18px, 2.2vw, 38px);
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.8);
}

.screen-test-overlay.is-visible {
  display: flex;
}

.screen-test-overlay::before {
  content: "";
  position: absolute;
  top: clamp(10px, 2vh, 32px);
  width: min(92%, 1120px);
  height: clamp(52px, 7vh, 92px);
  border-radius: 6px;
  background: rgba(190, 23, 23, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.68);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.4);
  z-index: -1;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 600ms ease;
}

.slide.visible {
  opacity: 1;
}

.slide-visible-area {
  position: absolute;
  left: var(--frame-side);
  right: var(--frame-side);
  top: var(--frame-top);
  bottom: var(--frame-bottom);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #080c13;
}

.slide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.68;
}

.slide-visible-area::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.16));
}

.slide-visible-area.image-only::after {
  display: none;
}

.slide-content {
  position: relative;
  z-index: 2;
  width: min(980px, 100%);
  padding: 7vh 9vw 6vh;
}

.slide-title {
  font-size: clamp(42px, 7vw, 108px);
  line-height: 1;
  margin-bottom: 24px;
}

.slide-text {
  font-size: clamp(22px, 2.6vw, 44px);
  line-height: 1.2;
  max-width: 900px;
}

.frame-test-pattern {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(42, 157, 143, 0.35), transparent 55%),
    #07111d;
  background-size: 80px 80px, 80px 80px, auto, auto;
  outline: 5px solid #25d7ff;
  outline-offset: -5px;
}

.frame-test-info {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
  font-weight: 800;
  font-size: clamp(20px, 3.2vw, 48px);
  line-height: 1.18;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.85);
}

.frame-test-arrow {
  position: absolute;
  color: #ffde59;
  font-size: clamp(44px, 7vw, 108px);
  line-height: 1;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.9), 0 0 8px #000;
}

.frame-test-arrow.top-left {
  left: 8px;
  top: 6px;
}

.frame-test-arrow.top-right {
  right: 8px;
  top: 6px;
}

.frame-test-arrow.bottom-left {
  left: 8px;
  bottom: 6px;
}

.frame-test-arrow.bottom-right {
  right: 8px;
  bottom: 6px;
}

.screen-logo {
  position: absolute;
  z-index: 4;
  top: 32px;
  right: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.82);
}

.screen-logo img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.screen-frame {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.frame-overlay,
.frame-border {
  position: absolute;
  pointer-events: none;
}

.frame-overlay {
  inset: 0;
  --frame-top: 10.45vh;
  --frame-side: 3.125vw;
  --frame-bottom: 4.925vh;
}

.frame-border {
  inset: 0;
  z-index: 4;
  border-style: solid;
  border-width: var(--frame-top) var(--frame-side) var(--frame-bottom);
  border-image-source: url("/frame-assets/frame_border_source.png?v=4");
  border-image-slice: 104 48 49 48;
  border-image-repeat: stretch;
}

.frame-nameplate {
  position: absolute;
  left: 50%;
  top: clamp(13px, 1.55vh, 18px);
  transform: translateX(-50%);
  width: fit-content;
  min-width: min(22vw, 360px);
  max-width: min(78vw, 1180px);
  min-height: clamp(58px, 7.3vh, 78px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: clamp(7px, 1vh, 11px) clamp(62px, 5.4vw, 92px) clamp(14px, 1.65vh, 20px);
  border-radius: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.25vw, 58px);
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 5;
  isolation: isolate;
}

.frame-nameplate img {
  max-width: clamp(34px, 4.2vw, 62px);
  max-height: clamp(34px, 4.2vw, 62px);
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.frame-nameplate span {
  position: relative;
  z-index: 2;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frame-nameplate::before,
.frame-nameplate::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}

.frame-nameplate::before {
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(75, 44, 11, 0.22), transparent 9%, transparent 91%, rgba(75, 44, 11, 0.24)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.14) 18%, rgba(92, 55, 13, 0.14) 64%, rgba(71, 42, 10, 0.36)),
    radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, 0.42), transparent 55%),
    url("/frame-assets/brass_noise.png");
  background-size: auto, auto, auto, 256px 96px;
  mix-blend-mode: soft-light;
  opacity: 0.95;
}

.frame-nameplate::after {
  z-index: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -2px 0 rgba(80, 47, 12, 0.4),
    inset 0 0 0 1px rgba(92, 62, 18, 0.52),
    inset 0 0 18px rgba(75, 45, 10, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.3),
    0 8px 14px rgba(0, 0, 0, 0.24);
}

.plate-screw {
  position: absolute;
  z-index: 3;
  top: 50%;
  width: clamp(12px, 1.1vw, 18px);
  height: clamp(12px, 1.1vw, 18px);
  transform: translateY(-50%);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255, 246, 184, 0.96), rgba(120, 79, 18, 0.88)),
    radial-gradient(circle at 35% 30%, #fff4b8, #b8852f 62%, #4f300c);
  border: 1px solid rgba(77, 48, 12, 0.56);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.78), inset 0 -1px 2px rgba(58, 35, 8, 0.55), 0 1px 1px rgba(0, 0, 0, 0.32);
}

.plate-screw::after {
  content: "";
  position: absolute;
  left: 23%;
  right: 23%;
  top: 46%;
  height: 2px;
  transform: rotate(22deg);
  background: rgba(73, 45, 11, 0.58);
  border-radius: 999px;
}

.plate-screw-left {
  left: clamp(16px, 1.7vw, 28px);
}

.plate-screw-right {
  right: clamp(16px, 1.7vw, 28px);
}

.plate-ornament {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: clamp(6px, 0.8vh, 10px);
  width: min(220px, 34%);
  height: 10px;
  transform: translateX(-50%);
  opacity: 0.72;
  background:
    radial-gradient(ellipse at center, rgba(68, 38, 8, 0.55) 0 12%, transparent 13%),
    linear-gradient(90deg, transparent, rgba(72, 43, 9, 0.48) 22%, rgba(72, 43, 9, 0.18) 50%, rgba(72, 43, 9, 0.48) 78%, transparent),
    linear-gradient(160deg, transparent 44%, rgba(72, 43, 9, 0.45) 46% 52%, transparent 54%),
    linear-gradient(20deg, transparent 44%, rgba(72, 43, 9, 0.45) 46% 52%, transparent 54%);
  background-size: 24px 10px, 100% 1px, 50% 100%, 50% 100%;
  background-position: center, center 5px, left center, right center;
  background-repeat: no-repeat;
}

.frame-classic_wood .frame-nameplate,
.frame-classic_wood .preview-nameplate {
  color: #1f1407;
  background:
    linear-gradient(100deg, rgba(255, 249, 201, 0.18), transparent 18%, rgba(116, 76, 17, 0.12) 58%, rgba(255, 238, 154, 0.22)),
    linear-gradient(180deg, #f4d77d 0%, #d2a13d 48%, #b77b25 100%);
  border: 1px solid rgba(88, 58, 15, 0.68);
  text-shadow: 0 1px rgba(255, 255, 255, 0.5), 0 2px 1px rgba(75, 45, 10, 0.22);
}

.frame-nordic_light .frame-nameplate,
.frame-nordic_light .preview-nameplate {
  color: #24313a;
  background: linear-gradient(180deg, #f9fbf9, #d7e1dd);
  border: 1px solid rgba(94, 112, 107, 0.45);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.8), 0 8px 22px rgba(0, 0, 0, 0.16);
}

.frame-dark_oak .frame-nameplate,
.frame-dark_oak .preview-nameplate {
  color: #f6f0e4;
  background: linear-gradient(180deg, #62717a, #26333b);
  border: 1px solid rgba(220, 230, 232, 0.28);
  text-shadow: 0 1px rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.25), 0 8px 22px rgba(0, 0, 0, 0.32);
}

.frame-simple_white .frame-nameplate,
.frame-simple_white .preview-nameplate {
  color: #1d252b;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.82), transparent 22%, rgba(185, 195, 194, 0.18) 66%, rgba(255, 255, 255, 0.5)),
    linear-gradient(180deg, #ffffff 0%, #eef2f1 48%, #d9dfdc 100%);
  border: 1px solid rgba(141, 151, 149, 0.58);
  text-shadow: 0 1px rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.9), 0 8px 20px rgba(0, 0, 0, 0.14);
}

.frame-simple_white .frame-nameplate::before {
  background:
    linear-gradient(90deg, rgba(145, 154, 151, 0.16), transparent 12%, transparent 88%, rgba(145, 154, 151, 0.16)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.2) 22%, rgba(132, 143, 139, 0.18) 100%);
  mix-blend-mode: normal;
  opacity: 0.74;
}

.frame-simple_white .frame-nameplate::after {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(123, 134, 131, 0.28),
    inset 0 0 0 1px rgba(135, 145, 142, 0.34),
    0 8px 14px rgba(0, 0, 0, 0.16);
}

.frame-simple_white .plate-screw {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(152, 162, 162, 0.9)),
    radial-gradient(circle at 35% 30%, #ffffff, #c7cfce 62%, #747f7e);
  border-color: rgba(113, 123, 122, 0.58);
}

.frame-simple_white .plate-screw::after {
  background: rgba(92, 102, 101, 0.58);
}

.frame-simple_white .plate-ornament {
  opacity: 0.28;
  background:
    radial-gradient(ellipse at center, rgba(84, 95, 94, 0.46) 0 12%, transparent 13%),
    linear-gradient(90deg, transparent, rgba(84, 95, 94, 0.38) 22%, rgba(84, 95, 94, 0.14) 50%, rgba(84, 95, 94, 0.38) 78%, transparent),
    linear-gradient(160deg, transparent 44%, rgba(84, 95, 94, 0.36) 46% 52%, transparent 54%),
    linear-gradient(20deg, transparent 44%, rgba(84, 95, 94, 0.36) 46% 52%, transparent 54%);
  background-size: 24px 10px, 100% 1px, 50% 100%, 50% 100%;
  background-position: center, center 5px, left center, right center;
  background-repeat: no-repeat;
}

.frame-gold_frame .frame-nameplate,
.frame-gold_frame .preview-nameplate {
  color: #1f1203;
  background:
    linear-gradient(100deg, rgba(255, 250, 187, 0.28), transparent 16%, rgba(107, 66, 8, 0.18) 56%, rgba(255, 232, 118, 0.32)),
    linear-gradient(180deg, #ffe28a 0%, #d9a842 46%, #a96a18 100%);
  border: 1px solid rgba(83, 49, 8, 0.72);
  text-shadow: 0 1px rgba(255, 245, 183, 0.55), 0 2px 1px rgba(62, 35, 4, 0.24);
  box-shadow: inset 0 1px rgba(255, 246, 188, 0.82), 0 9px 22px rgba(0, 0, 0, 0.24);
}

.frame-gold_frame .frame-nameplate::before {
  background:
    linear-gradient(90deg, rgba(68, 38, 6, 0.26), transparent 9%, transparent 91%, rgba(68, 38, 6, 0.28)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 244, 169, 0.18) 18%, rgba(98, 55, 6, 0.18) 70%, rgba(54, 30, 4, 0.38)),
    radial-gradient(120% 72% at 50% 0%, rgba(255, 247, 178, 0.46), transparent 58%),
    url("/frame-assets/brass_noise.png");
  background-size: auto, auto, auto, 256px 96px;
  mix-blend-mode: soft-light;
  opacity: 0.98;
}

.plate-brass .frame-nameplate,
.plate-brass.nameplate-preview {
  color: #1f1407;
  background:
    linear-gradient(100deg, rgba(255, 249, 201, 0.18), transparent 18%, rgba(116, 76, 17, 0.12) 58%, rgba(255, 238, 154, 0.22)),
    linear-gradient(180deg, #f4d77d 0%, #d2a13d 48%, #b77b25 100%);
  border: 1px solid rgba(88, 58, 15, 0.68);
  text-shadow: 0 1px rgba(255, 255, 255, 0.5), 0 2px 1px rgba(75, 45, 10, 0.22);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.74), 0 9px 22px rgba(0, 0, 0, 0.22);
}

.plate-brass .frame-nameplate::before,
.plate-brass.nameplate-preview::before {
  background:
    linear-gradient(90deg, rgba(75, 44, 11, 0.22), transparent 9%, transparent 91%, rgba(75, 44, 11, 0.24)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.14) 18%, rgba(92, 55, 13, 0.14) 64%, rgba(71, 42, 10, 0.36)),
    radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, 0.42), transparent 55%),
    url("/frame-assets/brass_noise.png");
  background-size: auto, auto, auto, 256px 96px;
  mix-blend-mode: soft-light;
  opacity: 0.9;
}

.plate-brass .frame-nameplate::after {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -2px 0 rgba(80, 47, 12, 0.4),
    inset 0 0 0 1px rgba(92, 62, 18, 0.52),
    inset 0 0 18px rgba(75, 45, 10, 0.18),
    0 8px 16px rgba(0, 0, 0, 0.28);
}

.plate-brass .plate-screw {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(154, 102, 24, 0.8)),
    radial-gradient(circle at 35% 30%, #fff3bd, #c89532 62%, #6d4310);
  border-color: rgba(82, 50, 10, 0.52);
}

.plate-brass .plate-screw::after {
  background: rgba(79, 47, 12, 0.58);
}

.plate-brass .plate-ornament {
  opacity: 0.5;
  filter: none;
}

.plate-polished_metal .frame-nameplate,
.plate-polished_metal.nameplate-preview {
  color: #172027;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.92), transparent 18%, rgba(58, 74, 86, 0.18) 48%, rgba(255, 255, 255, 0.62) 72%, rgba(112, 126, 134, 0.24)),
    linear-gradient(180deg, #f8fbfb 0%, #cdd5d7 38%, #eef2f2 58%, #9aa7ab 100%);
  border: 1px solid rgba(86, 99, 106, 0.68);
  text-shadow: 0 1px rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.94), 0 9px 22px rgba(0, 0, 0, 0.24);
}

.plate-polished_metal .frame-nameplate::before,
.plate-polished_metal.nameplate-preview::before {
  background:
    linear-gradient(90deg, rgba(72, 82, 88, 0.18), transparent 9%, transparent 91%, rgba(72, 82, 88, 0.18)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.12) 20%, rgba(45, 58, 66, 0.22) 72%, rgba(255, 255, 255, 0.28)),
    repeating-linear-gradient(96deg, rgba(255, 255, 255, 0.22) 0 1px, rgba(70, 86, 95, 0.1) 1px 3px, transparent 3px 8px);
  mix-blend-mode: soft-light;
  opacity: 0.94;
}

.plate-polished_metal .frame-nameplate::after {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -2px 0 rgba(68, 78, 84, 0.42),
    inset 0 0 0 1px rgba(82, 96, 104, 0.48),
    inset 0 0 18px rgba(255, 255, 255, 0.2),
    0 8px 16px rgba(0, 0, 0, 0.28);
}

.plate-polished_metal .plate-screw {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(120, 134, 141, 0.9)),
    radial-gradient(circle at 35% 30%, #fff, #bfc9cc 62%, #5a686e);
  border-color: rgba(73, 86, 92, 0.62);
}

.plate-polished_metal .plate-screw::after {
  background: rgba(51, 63, 69, 0.62);
}

.plate-polished_metal .plate-ornament {
  opacity: 0.24;
  filter: grayscale(1) brightness(0.82);
}

.frame-classic_wood .frame-border,
.frame-classic_wood.frame-preview::after {
  filter: none;
}

.frame-nordic_light .frame-border {
  border-image-source: url("/frame-assets/frame_light_oak_source.png?v=1");
  filter: none;
}

.frame-nordic_light.frame-preview::after {
  border-image: url("/frame-assets/frame_light_oak_source.png?v=1") 104 48 49 48 stretch;
  filter: none;
}

.frame-dark_oak .frame-border,
.frame-dark_oak.frame-preview::after {
  filter: saturate(0.82) brightness(0.52) contrast(1.22);
}

.frame-simple_white .frame-border {
  border-image-source: url("/frame-assets/frame_white_source.png?v=1");
  filter: none;
}

.frame-simple_white.frame-preview::after {
  border-image: url("/frame-assets/frame_white_source.png?v=1") 104 48 49 48 stretch;
  filter: none;
}

.frame-gold_frame .frame-border {
  border-image-source: url("/frame-assets/frame_gold_source.png?v=3");
  filter: none;
}

.frame-gold_frame.frame-preview::after {
  border-image: url("/frame-assets/frame_gold_source.png?v=3") 104 48 49 48 stretch;
  filter: none;
}

.screen-offline {
  position: absolute;
  z-index: 5;
  left: 24px;
  bottom: 20px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 14px;
}

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

  .sidebar {
    min-height: auto;
  }

  .form-grid,
  .grid.two,
  .grid.three,
  .frame-choice-grid,
  .nameplate-choice-grid,
  .priority-grid,
  .composer-layout,
  .crop-workspace {
    grid-template-columns: 1fr;
  }

  .composer-inspector {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 14px;
  }

  .priority-item {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .priority-status,
  .priority-item > .row-actions {
    grid-column: 2;
    justify-self: start;
  }

  .main {
    padding: 18px;
  }
}
