:root {
  --ink: #0f172a;
  --ink-soft: #475569;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #dbe4ee;
  --primary: #1d4ed8;
  --primary-dark: #173da8;
  --accent: #f97316;
  --success: #087a4b;
  --danger: #c83232;
  --shadow: 0 14px 40px rgba(15, 23, 42, .12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { overflow-y: scroll; scrollbar-gutter: stable; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: Inter, Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #edf2f7;
  -webkit-font-smoothing: antialiased;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cms-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface-soft);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .05), var(--shadow);
}

.cms-header {
  padding: max(20px, env(safe-area-inset-top)) 20px 18px;
  color: white;
  background: linear-gradient(145deg, #0f172a 0%, #1e3a8a 68%, #1d4ed8 100%);
}

.brand-row,
.header-actions,
.status-row,
.tabs,
.form-row,
.queue-meta,
.queue-item,
.display-toolbar,
.display-status {
  display: flex;
  align-items: center;
}

.brand-row { justify-content: space-between; gap: 16px; }
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25);
}
.brand-title { margin: 0; font-size: 18px; font-weight: 750; letter-spacing: -.02em; }
.brand-subtitle { margin: 3px 0 0; font-size: 12px; color: #cbd5e1; }
.header-link {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: white;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 14px;
  background: rgba(255,255,255,.1);
  transition: background .2s ease, border-color .2s ease;
}
.header-link:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.42); }
.header-link:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(59,130,246,.4);
  outline-offset: 2px;
}

.live-card {
  margin-top: 18px;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(2,6,23,.35);
  border: 1px solid rgba(255,255,255,.13);
}
.status-row { justify-content: space-between; gap: 12px; }
.live-status-copy { display: grid; min-width: 0; gap: 5px; }
.status-copy { font-size: 13px; color: #dbeafe; }
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 5px rgba(74,222,128,.12);
}
.settings-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 74px;
  min-height: 42px;
  padding: 0 12px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px;
  background: rgba(255,255,255,.1);
  font-size: 12px;
  font-weight: 800;
}
.settings-button .icon { width: 17px; height: 17px; }
.settings-button:hover { background: rgba(255,255,255,.18); }

.cms-main { width: 100%; min-height: 720px; padding: 18px 16px 110px; }
#schedule-view { width: 100%; min-height: 650px; }
.panel-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(15,23,42,.06);
}
.section-title { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.section-copy { margin: 7px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }

.tabs {
  gap: 6px;
  margin: 18px 0;
  padding: 5px;
  border-radius: 14px;
  background: #eaf0f7;
}
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  flex: 1;
  border: 0;
  border-radius: 10px;
  color: #526176;
  background: transparent;
  font-weight: 700;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.tab.is-active { color: var(--primary); background: white; box-shadow: 0 4px 14px rgba(15,23,42,.09); }

.ticker-preview {
  display: flex;
  align-items: center;
  min-height: 54px;
  overflow: hidden;
  padding: 0 16px;
  color: white;
  border-radius: 12px;
  background: #111315;
  font-weight: 800;
  white-space: nowrap;
}
.ticker-preview span { animation: cms-ticker-preview 8s linear infinite; }
@keyframes cms-ticker-preview { from { transform: translateX(105%); } to { transform: translateX(-115%); } }
.ticker-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; }
.ticker-textbox { position: relative; }
.ticker-textbox textarea { min-height: 154px; padding-bottom: 58px; }
.ticker-ai-actions { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; }
.ticker-ai-button, .ticker-ai-undo {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 850;
}
.ticker-ai-button { color: #fff; border: 0; background: linear-gradient(135deg,#7c3aed,#2563eb); box-shadow: 0 7px 16px rgba(99,102,241,.24); }
.ticker-ai-undo { color: #5b21b6; border: 1px solid #ddd6fe; background: rgba(255,255,255,.94); }
.ticker-ai-undo:disabled { color: #94a3b8; border-color: #e2e8f0; background: #f8fafc; cursor: default; }
.ticker-ai-help { min-height: 18px; margin: 7px 2px 0; color: #64748b; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.emoji-picks { display: flex; flex-wrap: wrap; gap: 5px; }
.emoji-picks button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #d7e0ea;
  border-radius: 9px;
  background: #f8fafc;
}
.emoji-picks button:hover { border-color: #93c5fd; background: #eff6ff; }
.character-count { flex: 0 0 auto; color: #64748b; font-size: 12px; font-variant-numeric: tabular-nums; }

.field { margin-top: 16px; }
.field:first-child { margin-top: 0; }
.field label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.field input[type="text"], .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  color: var(--ink);
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { min-height: 112px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus { border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(59,130,246,.12); outline: none; }
.field-hint { margin: 7px 0 0; font-size: 12px; color: #64748b; line-height: 1.45; }

.upload-box {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 190px;
  overflow: hidden;
  text-align: center;
  border: 1.5px dashed #94a3b8;
  border-radius: 16px;
  background: #f8fafc;
  transition: border-color .2s ease, background .2s ease;
}
.upload-box:hover { border-color: #3b82f6; background: #eff6ff; }
.upload-box input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-empty { padding: 22px; }
.upload-empty .icon { width: 34px; height: 34px; color: #2563eb; }
.upload-title { margin: 11px 0 3px; font-weight: 750; }
.upload-copy { margin: 0; font-size: 12px; color: #64748b; }
.upload-preview { display: none; width: 100%; height: 250px; object-fit: contain; background: #111827; }
.upload-box.has-image .upload-preview { display: block; }
.upload-box.has-image .upload-empty { display: none; }

.form-row { gap: 12px; }
.form-row .field { flex: 1; }
.color-input {
  width: 100%;
  height: 48px;
  padding: 5px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: white;
}
.check-row {
  display: flex;
  align-items: center;
  min-height: 48px;
  gap: 10px;
  padding-top: 23px;
  font-size: 13px;
  font-weight: 700;
}
.check-row input { width: 20px; height: 20px; accent-color: var(--danger); }

.publish-bar {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  width: min(100%, 520px);
  transform: translateX(-50%);
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  background: rgba(248,250,252,.94);
  border-top: 1px solid rgba(203,213,225,.9);
  backdrop-filter: blur(18px);
}
.publish-requirement {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.publish-requirement.is-ready { color: var(--success); }
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  color: white;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--primary), #2563eb);
  box-shadow: 0 10px 24px rgba(29,78,216,.25);
  font-weight: 800;
  transition: filter .2s ease, box-shadow .2s ease;
}
.primary-button:hover { filter: brightness(1.06); box-shadow: 0 12px 28px rgba(29,78,216,.31); }
.primary-button:disabled { cursor: not-allowed; opacity: .55; box-shadow: none; }

.has-dialog { overflow: hidden; }
.delete-dialog[hidden] { display: none; }
.delete-dialog { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 20px; }
.delete-dialog__backdrop { position: absolute; inset: 0; background: rgba(2,6,23,.62); backdrop-filter: blur(5px); }
.delete-dialog__card {
  position: relative;
  width: min(100%, 390px);
  padding: 24px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(2,6,23,.32);
  text-align: center;
}
.delete-dialog__icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 13px; color: #b42318; border-radius: 15px; background: #fff1f0; }
.delete-dialog__icon .icon { width: 25px; height: 25px; }
.delete-dialog__card h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.delete-dialog__card p { margin: 8px 0 0; color: #64748b; font-size: 13px; line-height: 1.5; }
.delete-dialog__item { display: -webkit-box; margin: 15px 0 0; padding: 11px 12px; overflow: hidden; color: #334155; border-radius: 11px; background: #f8fafc; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.delete-dialog__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }
.dialog-secondary, .dialog-danger { min-height: 48px; border-radius: 13px; font-weight: 800; }
.dialog-secondary { color: #334155; border: 1px solid #cbd5e1; background: #fff; }
.dialog-danger { color: #fff; border: 0; background: #b42318; }
.dialog-danger:disabled { cursor: wait; opacity: .65; }

.queue-card { max-width: 100%; margin-top: 16px; overflow: hidden; }
.queue-meta { justify-content: space-between; gap: 12px; min-width: 0; margin-bottom: 12px; }
.queue-meta > div { min-width: 0; }
.queue-count { padding: 5px 9px; border-radius: 999px; color: #1e40af; background: #dbeafe; font-size: 12px; font-weight: 800; }
.ticker-count-badge { color: #475569; background: #e2e8f0; }
.queue-list { display: grid; width: 100%; min-width: 0; gap: 10px; }
.queue-item { width: 100%; min-width: 0; gap: 12px; padding: 10px; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
.queue-item.is-ticker { align-items: flex-start; }
.queue-thumb { width: 48px; height: 68px; flex: 0 0 auto; overflow: hidden; border-radius: 7px; background: #e2e8f0; }
.queue-thumb img { width: 100%; height: 100%; object-fit: cover; }
.queue-notice { display: grid; place-items: center; width: 100%; height: 100%; color: white; font-size: 10px; font-weight: 800; text-align: center; padding: 4px; }
.queue-ticker { display: grid; place-items: center; width: 100%; height: 100%; color: white; background: #111315; font-size: 10px; font-weight: 850; }
.queue-copy { width: 0; min-width: 0; flex: 1 1 0; overflow: hidden; }
.queue-title { display: -webkit-box; max-width: 100%; overflow: hidden; margin: 0; font-size: 14px; font-weight: 750; line-height: 1.42; overflow-wrap: anywhere; word-break: break-word; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.queue-time { margin: 4px 0 0; color: #64748b; font-size: 11px; }
.queue-empty { margin: 0; padding: 22px 12px; color: #64748b; border: 1px dashed #cbd5e1; border-radius: 12px; background: #f8fafc; font-size: 13px; text-align: center; }
.delete-button { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; color: #b42318; border: 0; border-radius: 12px; background: #fff1f0; }
.delete-button:hover { background: #fee4e2; }

/* Schedule-first mobile CMS */
.schedule-tabs {
  position: sticky;
  z-index: 15;
  top: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 9px 12px;
  background: rgba(248,250,252,.94);
  border-bottom: 1px solid #dbe4ee;
  backdrop-filter: blur(18px);
}
.schedule-tab {
  display: grid;
  place-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 58px;
  padding: 6px 4px;
  color: #64748b;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}
.schedule-tab .icon { width: 20px; height: 20px; }
.schedule-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-tab.is-active { color: #1d4ed8; background: #e8efff; box-shadow: inset 0 0 0 1px rgba(37,99,235,.12); }
.schedule-tab[data-schedule="ai"].is-active { color: #6d28d9; background: #f3e8ff; box-shadow: inset 0 0 0 1px rgba(124,58,237,.14); }
.schedule-panel, .editor-view {
  width: 100%;
  min-width: 0;
  min-height: 590px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(15,23,42,.06);
}
.schedule-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.schedule-heading > div { min-width: 0; }
.eyebrow { margin: 0 0 5px; color: #2563eb; font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.add-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  color: #fff;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 9px 20px rgba(37,99,235,.24);
}
.campaign-add { background: linear-gradient(135deg, #7c3aed, #a855f7); box-shadow: 0 9px 20px rgba(124,58,237,.23); }
.setting-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid #dbe4ee;
  border-radius: 14px;
  background: #f8fafc;
}
.setting-card > div { display: grid; min-width: 0; gap: 3px; }
.setting-card strong { font-size: 13px; }
.setting-card span { color: #64748b; font-size: 11px; }
.setting-card select {
  min-width: 84px;
  height: 42px;
  padding: 0 30px 0 12px;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
  border-radius: 11px;
  background: #eff6ff;
  font-weight: 800;
}
.campaign-setting select { color: #6d28d9; border-color: #ddd6fe; background: #f5f3ff; }
.setting-toggle { cursor: pointer; }
.switch-input {
  position: relative;
  flex: 0 0 auto;
  width: 50px;
  height: 28px;
  margin: 0;
  appearance: none;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #e2e8f0;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.switch-input::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15,23,42,.25);
  transition: transform .18s ease;
}
.switch-input:checked { border-color: #2563eb; background: #2563eb; }
.switch-input.is-campaign:checked { border-color: #7c3aed; background: #7c3aed; }
.switch-input:checked::before { transform: translateX(22px); }
.switch-input:focus-visible { outline: 3px solid rgba(37,99,235,.24); outline-offset: 2px; }
.editor-setting { margin-top: 14px; }
.campaign-rule {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 10px;
  padding: 11px 12px;
  color: #5b21b6;
  border-radius: 12px;
  background: #f5f3ff;
  font-size: 11px;
  line-height: 1.5;
}
.campaign-rule .icon { width: 18px; height: 18px; flex: 0 0 auto; }
.schedule-summary { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; color: #64748b; font-size: 12px; font-weight: 750; }
.schedule-summary strong { color: #1e40af; padding: 4px 8px; border-radius: 999px; background: #dbeafe; }
.schedule-list { display: grid; min-width: 0; gap: 9px; }
.schedule-item {
  display: grid;
  grid-template-columns: 30px 52px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}
.schedule-order { color: #94a3b8; font-size: 11px; font-weight: 850; font-variant-numeric: tabular-nums; }
.schedule-thumb { display: grid; place-items: center; width: 52px; height: 70px; overflow: hidden; border-radius: 8px; background: #e2e8f0; }
.schedule-thumb > img, .schedule-thumb > video { width: 100%; height: 100%; object-fit: cover; }
.ticker-thumb { color: #fff; background: #111315; font-size: 9px; font-weight: 850; }
.notice-thumb { padding: 4px; color: #fff; font-size: 8px; font-weight: 800; text-align: center; }
.campaign-thumb { grid-template-columns: repeat(3, 1fr); background: #111827; }
.campaign-thumb > img, .campaign-thumb > video { min-width: 0; }
.campaign-thumb-placeholder { display: grid; place-items: center; min-width: 0; color: #64748b; background: #e8edf5; font-size: 12px; font-weight: 900; }
.schedule-copy { display: grid; min-width: 0; gap: 4px; }
.schedule-copy strong { display: -webkit-box; max-width: 100%; overflow: hidden; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.schedule-copy span { overflow: hidden; color: #64748b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.schedule-controls { display: grid; gap: 3px; }
.order-button, .schedule-delete {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
}
.order-button { color: #1d4ed8; background: #eff6ff; }
.schedule-delete { color: #b42318; background: #fff1f0; }
.order-button:disabled { color: #cbd5e1; background: #f8fafc; cursor: default; }
.order-button .icon, .schedule-delete .icon { width: 16px; height: 16px; }
.schedule-empty { padding: 30px 14px; color: #64748b; border: 1px dashed #cbd5e1; border-radius: 14px; background: #f8fafc; font-size: 13px; text-align: center; }
.back-button { display: inline-flex; align-items: center; gap: 5px; margin: -5px 0 18px -6px; padding: 7px 8px; color: #475569; border: 0; background: transparent; font-size: 12px; font-weight: 800; }
.back-button .icon { width: 18px; height: 18px; }
.editor-heading { margin-bottom: 18px; }
.editor-panel { min-width: 0; }
.multi-upload {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 24px;
  color: #1e40af;
  border: 1.5px dashed #93c5fd;
  border-radius: 16px;
  background: #eff6ff;
  text-align: center;
  cursor: pointer;
}
.multi-upload input, .campaign-slot input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.multi-upload .icon { width: 34px; height: 34px; }
.multi-upload strong { margin-top: 10px; color: #172554; font-size: 15px; }
.multi-upload span { margin-top: 4px; color: #64748b; font-size: 11px; }
.upload-selection { display: grid; gap: 8px; margin-top: 12px; }
.selected-file { display: grid; grid-template-columns: 50px minmax(0,1fr) 36px; align-items: center; gap: 10px; min-width: 0; padding: 8px; border: 1px solid #e2e8f0; border-radius: 12px; }
.selected-file img, .selected-file video { width: 50px; height: 64px; object-fit: cover; border-radius: 7px; background: #111827; }
.selected-file > div { display: grid; min-width: 0; gap: 3px; }
.selected-file span { color: #2563eb; font-size: 10px; font-weight: 800; }
.selected-file strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.selected-file button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; color: #b42318; border: 0; border-radius: 9px; background: #fff1f0; }
.selected-file button .icon { width: 16px; height: 16px; }
.campaign-editor-meta { display: grid; gap: 3px; margin: 20px 0 10px; }
.campaign-editor-meta strong { font-size: 14px; }
.campaign-editor-meta span { color: #64748b; font-size: 11px; }
.campaign-slots { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.campaign-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  aspect-ratio: .7;
  overflow: hidden;
  color: #6d28d9;
  border: 1.5px dashed #c4b5fd;
  border-radius: 13px;
  background: #f5f3ff;
  text-align: center;
  cursor: pointer;
}
.campaign-slot > img, .campaign-slot > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.campaign-slot .slot-number { position: relative; z-index: 2; padding: 3px 6px; border-radius: 999px; background: rgba(255,255,255,.9); font-size: 9px; font-weight: 850; }
.campaign-slot .slot-plus { font-size: 30px; font-weight: 300; line-height: 1; }
.campaign-slot > strong { position: relative; z-index: 2; max-width: 92%; margin-top: 6px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.campaign-slot.has-file > strong { position: absolute; right: 4px; bottom: 4px; left: 4px; max-width: none; padding: 5px; color: #fff; border-radius: 6px; background: rgba(2,6,23,.72); }
.campaign-slot.has-file .slot-number { position: absolute; top: 4px; left: 4px; }

.metadata-card { margin-top: 12px; overflow: hidden; border: 1px solid #dbe4ee; border-radius: 14px; background: #fff; }
.metadata-card summary { display: grid; grid-template-columns: 36px minmax(0,1fr) 20px; align-items: center; gap: 10px; padding: 13px; cursor: pointer; list-style: none; }
.metadata-card summary::-webkit-details-marker { display: none; }
.metadata-card summary > span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.metadata-card summary strong { font-size: 13px; }
.metadata-card summary small { overflow: hidden; color: #64748b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.metadata-card summary > .icon { width: 18px; color: #64748b; transition: transform .2s ease; }
.metadata-card[open] summary > .icon { transform: rotate(180deg); }
.metadata-icon { display: grid; place-items: center; width: 34px; height: 34px; color: #1d4ed8; border-radius: 10px; background: #eff6ff; font-size: 17px; font-weight: 900; }
.metadata-icon.target { color: #0f766e; background: #ecfdf5; }
.metadata-body { display: grid; gap: 14px; padding: 0 13px 14px; border-top: 1px solid #eef2f7; }
.inline-check { display: flex; align-items: center; gap: 9px; padding-top: 13px; font-size: 12px; font-weight: 750; }
.inline-check input, .weekday-field input, .target-tree input { width: 18px; height: 18px; accent-color: #2563eb; }
.date-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.date-grid label { display: grid; gap: 5px; color: #475569; font-size: 10px; font-weight: 750; }
.date-grid input, .time-range input { min-width: 0; height: 40px; padding: 0 9px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; }
.weekday-field { margin: 0; padding: 0; border: 0; }
.weekday-field legend { margin-bottom: 7px; color: #475569; font-size: 10px; font-weight: 750; }
#weekday-options { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
#weekday-options label { display: grid; place-items: center; gap: 4px; padding: 6px 1px; color: #475569; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 9px; }
.time-range-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #475569; font-size: 10px; }
.time-range-heading button { padding: 6px 8px; color: #1d4ed8; border: 0; border-radius: 8px; background: #eff6ff; font-size: 10px; font-weight: 800; }
.time-ranges { display: grid; gap: 7px; }
.time-range { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) 32px; align-items: center; gap: 6px; color: #94a3b8; }
.time-range button { width: 32px; height: 32px; padding: 0; color: #b42318; border: 0; border-radius: 8px; background: #fff1f0; }
.target-tree { display: grid; gap: 6px; max-height: 340px; overflow-y: auto; }
.target-building { border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.target-building summary { display: flex; align-items: center; gap: 8px; padding: 9px 10px; font-size: 11px; font-weight: 800; }
.target-elevators { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; padding: 0 10px 10px 36px; }
.target-elevators label { display: flex; align-items: center; gap: 6px; color: #475569; font-size: 10px; }

.pin-button { color: #a16207; background: #fffbeb; }
.pin-button.is-active { color: #fff; background: #d97706; }
.pin-button .icon { width: 15px; height: 15px; }
.schedule-item.is-pinned { border-color: #fbbf24; box-shadow: 0 0 0 2px rgba(251,191,36,.14); }
.schedule-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.schedule-badge { padding: 3px 6px; color: #475569; border-radius: 999px; background: #f1f5f9; font-size: 9px; font-weight: 800; }
.schedule-badge.pin { color: #92400e; background: #fef3c7; }
.schedule-badge.schedule { color: #1e40af; background: #dbeafe; }
.schedule-badge.target { color: #0f766e; background: #ccfbf1; }
.pin-dialog__icon { display: grid; place-items: center; width: 50px; height: 50px; margin: 0 auto 12px; border-radius: 16px; background: #fef3c7; font-size: 24px; }
.pin-panel-options { display: grid; grid-template-columns: repeat(5,1fr); gap: 7px; margin: 16px 0; }
.pin-panel-options button { height: 48px; color: #92400e; border: 1px solid #fde68a; border-radius: 10px; background: #fffbeb; font-size: 11px; font-weight: 850; }
.pin-panel-options button.is-current { color: #fff; border-color: #d97706; background: #d97706; }
.pin-release { color: #92400e; background: #fef3c7; }

.ai-landing { display: grid; place-items: center; min-height: 420px; padding: 36px 18px; text-align: center; }
.ai-orb { display: grid; place-items: center; width: 78px; height: 78px; margin-bottom: 20px; color: #fff; border-radius: 26px; background: linear-gradient(135deg,#7c3aed,#2563eb); box-shadow: 0 18px 38px rgba(99,102,241,.3); font-size: 34px; }
.ai-landing .section-copy { max-width: 390px; margin-top: 10px; line-height: 1.7; }
.ai-start-button, .ai-generate-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; color: #fff; border: 0; border-radius: 13px; background: linear-gradient(135deg,#7c3aed,#2563eb); font-weight: 850; box-shadow: 0 12px 24px rgba(99,102,241,.24); }
.ai-start-button { margin-top: 24px; }
.ai-start-button .icon { width: 18px; }
.ai-request-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.voice-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; color: #5b21b6; border: 1px solid #ddd6fe; border-radius: 13px; background: #f5f3ff; font-weight: 800; }
.voice-button.is-listening { color: #fff; background: #dc2626; border-color: #dc2626; animation: voice-pulse 1.2s infinite; }
@keyframes voice-pulse { 50% { box-shadow: 0 0 0 7px rgba(220,38,38,.12); } }
.voice-status { min-height: 18px; margin: 8px 0 0; color: #64748b; font-size: 11px; }
.ai-result { display: grid; gap: 12px; margin-top: 20px; padding: 15px; border: 1px solid #ddd6fe; border-radius: 16px; background: #faf7ff; }
.ai-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-result-heading span { color: #6d28d9; font-size: 13px; font-weight: 900; }
.ai-result-heading small { color: #64748b; font-size: 9px; }
.ai-result .field { margin-top: 0; }
.ai-result textarea { min-height: 90px; }
.ai-publish-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ai-publish-actions button { min-height: 46px; color: #fff; border: 0; border-radius: 11px; background: #2563eb; font-weight: 850; }
.ai-publish-actions button:last-child { background: #111315; }

.settings-dialog__card { width: min(100%, 440px); max-height: min(90vh, 760px); overflow-y: auto; text-align: left; }
.settings-dialog__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.settings-dialog__heading h2 { margin-top: 0; }
.settings-close { width: 40px; height: 40px; padding: 0; color: #475569; border: 0; border-radius: 11px; background: #f1f5f9; font-size: 25px; line-height: 1; }
.settings-dialog .setting-card { margin-top: 11px; }
.settings-dialog__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }
.settings-save { min-height: 48px; color: #fff; border: 0; border-radius: 13px; background: #2563eb; font-weight: 850; }
.settings-save:disabled { cursor: wait; opacity: .65; }
.ai-key-card { display: grid; gap: 11px; margin-top: 16px; padding: 15px; border: 1px solid #dbeafe; border-radius: 15px; background: #f8fbff; }
.ai-key-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ai-key-heading > div { display: grid; gap: 2px; }
.ai-key-heading strong { color: #0f172a; font-size: 13px; }
.ai-key-heading span:not(.ai-key-status) { color: #64748b; font-size: 10px; }
.ai-key-status { flex: none; padding: 5px 8px; color: #9a3412; border: 1px solid #fed7aa; border-radius: 999px; background: #fff7ed; font-size: 10px; font-weight: 850; }
.ai-key-status.is-connected { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.ai-key-field { display: grid; gap: 6px; }
.ai-key-field > span { color: #334155; font-size: 11px; font-weight: 800; }
.ai-key-field input { min-width: 0; min-height: 44px; padding: 0 12px; color: #0f172a; border: 1px solid #cbd5e1; border-radius: 11px; background: #fff; font: inherit; font-size: 12px; }
.ai-key-field input:focus { outline: 3px solid rgba(37,99,235,.18); border-color: #2563eb; }
.ai-key-field input:disabled { color: #94a3b8; background: #f1f5f9; }
.ai-key-help { min-height: 16px; margin: 0; color: #64748b; font-size: 10px; line-height: 1.55; }
.ai-key-save { min-height: 44px; color: #1d4ed8; border: 1px solid #bfdbfe; border-radius: 11px; background: #eff6ff; font-weight: 850; }
.ai-key-save:disabled { cursor: not-allowed; opacity: .58; }

@media (max-width: 390px) {
  .schedule-item { grid-template-columns: 24px 46px minmax(0, 1fr) 30px; gap: 7px; padding: 7px; }
  .schedule-thumb { width: 46px; height: 64px; }
  .campaign-slots { gap: 5px; }
}

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  top: 18px;
  width: min(calc(100% - 32px), 470px);
  padding: 13px 16px;
  color: white;
  border-radius: 13px;
  background: #0f172a;
  box-shadow: var(--shadow);
  transform: translate(-50%, -130%);
  opacity: 0;
  transition: transform .28s ease, opacity .28s ease;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.toast.is-error { background: #9f2525; }

.display-page { min-height: 100vh; color: white; background: #06090f; overflow: hidden; }
.display-shell { position: relative; display: grid; place-items: center; width: 100vw; height: 100vh; }
.scene-stage {
  position: relative;
  width: min(100vw, calc(100vh * 1.333333));
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #161616;
}
.scene-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }

.screen-panel {
  position: absolute;
  z-index: 4;
  overflow: hidden;
  background: #030303;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.9);
  --ticker-height: 14%;
  --circuit-width: 1.05%;
}
.screen-1 {
  left: 53.6257%;
  top: 38.0755%;
  width: 7.3895%;
  height: 16.8508%;
  clip-path: polygon(0 2.7322%, 100% 0, 100% 100%, 0 99.4536%);
}
.screen-2 {
  left: 61.2914%;
  top: 37.5230%;
  width: 7.9420%;
  height: 17.4494%;
  clip-path: polygon(0 2.9024%, 100% 0, 100% 100%, 0 99.4723%);
}
.screen-3 {
  left: 69.5787%;
  top: 36.9705%;
  width: 8.5290%;
  height: 18.0939%;
  clip-path: polygon(0 3.3079%, 100% 0, 100% 100%, 0 99.4911%);
}
.added-device-shell {
  position: absolute;
  z-index: 3;
  display: none;
  isolation: isolate;
  background: transparent;
  filter: drop-shadow(3px 5px 5px rgba(20,18,15,.32));
  transform-origin: 0 0;
}
.added-device-shell::before,
.added-device-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 4px 4px 5px 5px;
  clip-path: var(--shell-clip);
}
.added-device-shell::after {
  z-index: -1;
  background:
    linear-gradient(100deg, #b9b0a2 0%, #d8d0c2 42%, #a89f91 100%);
  box-shadow: 2px 3px 5px rgba(25,22,18,.33);
  transform: translate(var(--shell-depth-x), var(--shell-depth-y));
}
.added-device-shell::before {
  z-index: 0;
  border: 1px solid rgba(172,164,151,.78);
  background:
    radial-gradient(ellipse at 38% 0%, rgba(255,255,255,.96) 0%, rgba(255,255,255,0) 44%),
    linear-gradient(96deg, rgba(151,141,126,.18) 0%, rgba(255,255,255,.12) 8%, rgba(255,255,255,0) 55%, rgba(125,116,102,.19) 100%),
    linear-gradient(to bottom, #f8f4eb 0%, #f2ecdf 79.7%, #eee6d8 79.7%, #e8dfcf 100%);
  box-shadow:
    inset 1px 0 1px rgba(255,255,255,.94),
    inset -2px 0 2px rgba(119,111,98,.17),
    inset 0 2px 2px rgba(255,255,255,.9),
    inset 0 -2px 3px rgba(125,115,100,.18);
}
.device-shell-4 {
  --shell-clip: polygon(0 2.7%,100% 0,100% 100%,0 99.2%);
  --shell-depth-x: 2.2%;
  --shell-depth-y: 1.25%;
  left: 46.23%;
  top: 38.03%;
  width: 7.43%;
  height: 21.05%;
}
.device-shell-5 {
  --shell-clip: polygon(0 3.2%,100% 0,100% 100%,0 99.1%);
  --shell-depth-x: 1.8%;
  --shell-depth-y: 1.15%;
  left: 78.08%;
  top: 35.78%;
  width: 9.86%;
  height: 23.35%;
}
.screen-4, .screen-5 { display: none; border: 1px solid rgba(28,30,31,.9); border-radius: 1px; box-shadow: 0 2px 5px rgba(0,0,0,.34); }
.screen-4 { left: 69.5787%; top: 36.9705%; width: 8.5290%; height: 18.0939%; clip-path: polygon(0 3.3079%,100% 0,100% 100%,0 99.4911%); }
.screen-5 { left: 78.43%; top: 36.40%; width: 9.13%; height: 18.73%; clip-path: polygon(0 3.45%,100% 0,100% 100%,0 99.5%); }
body.panel-count-5 .screen-4, body.panel-count-5 .screen-5 { display: block; }
body.panel-count-5 .screen-1 {
  left: 46.51%;
  top: 38.62%;
  width: 6.85%;
  height: 16.25%;
  clip-path: polygon(0 2.55%,100% 0,100% 100%,0 99.43%);
}
body.panel-count-5 .screen-2 {
  left: 53.6257%;
  top: 38.0755%;
  width: 7.3895%;
  height: 16.8508%;
  clip-path: polygon(0 2.7322%,100% 0,100% 100%,0 99.4536%);
}
body.panel-count-5 .screen-3 {
  left: 61.2914%;
  top: 37.5230%;
  width: 7.9420%;
  height: 17.4494%;
  clip-path: polygon(0 2.9024%,100% 0,100% 100%,0 99.4723%);
}
.panel-plane {
  position: absolute;
  z-index: 1;
  inset: 0;
  transform-origin: 0 0;
  backface-visibility: hidden;
  will-change: transform;
}
.content-viewport {
  position: absolute;
  z-index: 2;
  inset: 0 var(--circuit-width) var(--ticker-height) 0;
  overflow: hidden;
  background: #050505;
}
.screen-panel.is-fullscreen .content-viewport { z-index: 8; bottom: 0; }
.screen-panel.is-fullscreen .ticker-strip { visibility: hidden; }
.screen-layer { position: absolute; inset: 0; overflow: hidden; will-change: transform; }
.screen-layer img, .screen-layer > video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  background: #050505;
}
.campaign-layer {
  background: #050505;
}
.campaign-layer.is-preparing { opacity: 0; pointer-events: none; }
.campaign-layer video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  background: #050505;
}
.screen-layer.incoming { transform: translateX(99.6%); }
.screen-panel.is-sliding .screen-layer.current { animation: screen-out .95s cubic-bezier(.65,0,.35,1) forwards; }
.screen-panel.is-sliding .screen-layer.incoming { animation: screen-in .95s cubic-bezier(.65,0,.35,1) forwards; }
@keyframes screen-out { to { transform: translateX(-100.4%); } }
@keyframes screen-in { to { transform: translateX(-.4%); } }

.ticker-strip {
  position: absolute;
  z-index: 7;
  left: 0;
  right: var(--circuit-width);
  bottom: 0;
  display: flex;
  align-items: center;
  height: var(--ticker-height);
  overflow: hidden;
  padding: 0;
  color: #fff;
  background: #111315;
  border-top: 1px solid rgba(255,255,255,.08);
  font-family: Inter, Pretendard, "Noto Sans KR", "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  font-size: clamp(7px, .48vw, 13px);
  font-weight: 800;
  letter-spacing: -.035em;
  white-space: nowrap;
}
.ticker-track { display: inline-flex; align-items: center; width: max-content; height: 100%; will-change: transform; }
.ticker-sequence { display: inline-flex; align-items: center; flex: 0 0 auto; height: 100%; }
.ticker-message { display: inline-block; flex: 0 0 auto; padding-right: 5.5em; white-space: nowrap; }
.circuit-strip {
  position: absolute;
  z-index: 10;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--circuit-width);
  background: linear-gradient(90deg, #34383d 0%, #202429 42%, #181c20 72%, #292e33 100%);
  border-left: 1px solid rgba(255,255,255,.13);
  box-shadow: -1px 0 1px rgba(0,0,0,.32), 1px 0 1px rgba(255,255,255,.06);
  pointer-events: none;
}

.notice-slide {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 13% 9% 9%;
  color: #0f172a;
  background: linear-gradient(165deg, #fff 0%, #f8fafc 64%, #e8edf5 100%);
  isolation: isolate;
}
.notice-slide::before { content: ''; position: absolute; z-index: -1; inset: 0 0 auto; height: 2.4%; background: var(--notice-accent); }
.notice-slide::after { content: ''; position: absolute; z-index: -1; width: 76%; aspect-ratio: 1; right: -39%; top: -15%; border-radius: 50%; background: color-mix(in srgb, var(--notice-accent) 13%, transparent); }
.notice-kicker { margin: 0 0 11%; color: var(--notice-accent); font-size: clamp(7px, .55vw, 15px); font-weight: 850; letter-spacing: .08em; }
.notice-heading { margin: 0; font-size: clamp(15px, 1.25vw, 33px); line-height: 1.12; letter-spacing: -.055em; word-break: keep-all; }
.notice-body { margin: 9% 0 0; color: #334155; font-size: clamp(8px, .55vw, 15px); line-height: 1.5; white-space: pre-line; word-break: keep-all; }
.notice-footer { margin-top: auto; padding-top: 8%; border-top: 1px solid #cbd5e1; color: #64748b; font-size: clamp(6px, .42vw, 11px); font-weight: 700; }
.notice-slide.is-urgent { color: #fff; background: linear-gradient(160deg, #7f1d1d, #dc2626); }
.notice-slide.is-urgent::before { background: #fbbf24; }
.notice-slide.is-urgent::after { background: rgba(255,255,255,.1); }
.notice-slide.is-urgent .notice-kicker { color: #fde68a; }
.notice-slide.is-urgent .notice-body, .notice-slide.is-urgent .notice-footer { color: #fff; border-color: rgba(255,255,255,.3); }

.display-toolbar {
  position: fixed;
  z-index: 20;
  top: 16px;
  left: 50%;
  gap: 8px;
  width: min(calc(100% - 32px), 760px);
  transform: translateX(-50%);
  justify-content: space-between;
  pointer-events: auto;
}
.display-toolbar .header-actions { position: relative; z-index: 2; pointer-events: auto; }
.display-status, .toolbar-button {
  min-height: 42px;
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 13px;
  background: rgba(2,6,23,.72);
  box-shadow: 0 8px 30px rgba(0,0,0,.24);
  backdrop-filter: blur(15px);
  pointer-events: auto;
}
.display-status { gap: 9px; padding: 0 14px; font-size: 13px; }
.toolbar-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; font-weight: 750; text-decoration: none; cursor: pointer; touch-action: manipulation; }
.toolbar-button:hover { background: rgba(15,23,42,.9); }
.countdown { min-width: 28px; color: #93c5fd; font-variant-numeric: tabular-nums; font-weight: 800; }

.display-shell.is-zoomed .scene-stage { transform: scale(1.45) translate(-11%, 7%); transform-origin: center; transition: transform .4s ease; }
.display-shell:not(.is-zoomed) .scene-stage { transform: none; transition: transform .4s ease; }

@media (max-width: 680px) {
  .display-toolbar { align-items: stretch; }
  .display-status { flex: 1; }
  .toolbar-button span { display: none; }
  .display-shell.is-zoomed .scene-stage { transform: scale(2.25) translate(-16%, 8%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
