:root {
  color-scheme: light;
  --ink: #17182a;
  --muted: #606479;
  --quiet: #74788d;
  --line: #e5e6ef;
  --white: #fff;
  --bg: #f7f8fc;
  --purple: #5541df;
  --purple-dark: #4430c5;
  --lavender: #eeebff;
  --green: #0c755c;
  --green-bg: #e7f8f0;
  --danger: #a6304a;
  --radius: 18px;
  --shadow: 0 2px 5px #26214504, 0 12px 30px #26214506;
  font-family: Inter, "Geist", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); min-width: 300px; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .54; }
a { color: var(--purple-dark); text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #9d91ff; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mono { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace; }
.loading { height: 100dvh; display: flex; gap: 12px; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.loading img { width: 34px; height: 34px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font-size: 13px; font-weight: 650; white-space: nowrap; }
.btn .icon { width: 17px; height: 17px; }
.btn:hover:not(:disabled) { background: #f7f6fe; border-color: #d8d2ff; }
.btn.primary { background: var(--purple); color: white; border-color: var(--purple); box-shadow: 0 3px 7px #5541df28; }
.btn.primary:hover:not(:disabled) { background: var(--purple-dark); border-color: var(--purple-dark); }
.btn.icon-only { width: 38px; min-height: 38px; padding: 0; }
.btn.quiet { background: transparent; box-shadow: none; }
.btn.quiet:hover:not(:disabled) { background: var(--lavender); }
.topbar { grid-area: top; background: white; border-bottom: 1px solid var(--line); height: 69px; padding: 0 35px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar-left, .crumb, .owner { display: flex; align-items: center; gap: 12px; }
.crumb { font-size: 13px; color: var(--quiet); }
.crumb strong { color: var(--ink); font-weight: 650; }
.crumb .slash { color: #a6a9bc; }
.owner { color: var(--muted); font-size: 12px; font-weight: 650; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; background: var(--lavender); color: var(--purple-dark); border-radius: 50%; font-size: 12px; letter-spacing: .02em; }
.shell { display: grid; grid-template-areas: "side top" "side main"; grid-template-columns: 222px minmax(0, 1fr); grid-template-rows: 69px 1fr; min-height: 100dvh; }
.sidebar { grid-area: side; position: sticky; top: 0; height: 100dvh; align-self: start; background: white; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 23px 16px 17px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); margin: 0 8px; }
.brand img { width: 39px; height: 39px; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.045em; line-height: 1.15; }
.brand span { display: block; font-size: 11px; margin-top: 3px; color: var(--quiet); }
.nav { margin-top: 42px; display: grid; gap: 5px; }
.nav a, .signout { padding: 10px 12px; min-height: 43px; width: 100%; border: 0; border-radius: 9px; display: flex; align-items: center; gap: 11px; text-align: left; background: none; color: var(--muted); font-weight: 580; font-size: 13px; }
.nav a:hover, .signout:hover { background: var(--bg); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--lavender); color: var(--purple-dark); font-weight: 680; }
.nav .icon, .signout .icon { width: 18px; height: 18px; }
.sidebottom { margin-top: auto; display: grid; gap: 10px; }
.domain { display: flex; gap: 9px; min-width: 0; align-items: center; padding: 11px 10px; border: 1px solid var(--line); border-radius: 11px; }
.domain .icon { color: var(--purple); width: 17px; height: 17px; }
.domain p { overflow: hidden; min-width: 0; }
.domain strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.domain span { display: block; font-size: 10px; color: var(--quiet); }
.mobile-menu { display: none; }
.main { grid-area: main; width: 100%; max-width: 1505px; margin: auto; padding: 33px 35px 44px; align-self: start; margin-top: 0; }
.page-heading { margin-bottom: 25px; display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; }
h1 { font-size: clamp(29px, 4vw, 43px); line-height: 1.07; letter-spacing: -.055em; font-weight: 740; overflow-wrap: anywhere; }
.page-heading p { margin-top: 9px; color: var(--muted); font-size: 14px; }
.heading-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { margin-bottom: 11px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; }
.back-link .icon { width: 16px; height: 16px; }
.studio-grid { display: grid; grid-template-columns: minmax(340px, 1.25fr) minmax(300px, 1fr); gap: 21px; align-items: start; }
.editor, .column { display: grid; gap: 16px; min-width: 0; }
.card { border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--radius); background: white; min-width: 0; }
.card-pad { padding: 22px; }
.section-title { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.section-icon { display: grid; place-items: center; width: 35px; height: 35px; flex: none; background: var(--lavender); color: var(--purple-dark); border-radius: 10px; }
.section-icon .icon { width: 18px; height: 18px; }
h2 { font-size: 17px; font-weight: 720; letter-spacing: -.025em; }
.section-title p { color: var(--quiet); font-size: 12px; margin-top: 1px; }
.fields { display: grid; gap: 14px; }
.field { display: grid; min-width: 0; gap: 6px; }
.field > label, .field legend, .field-label { font-size: 12px; font-weight: 680; color: var(--ink); }
.fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.fieldset legend { margin-bottom: 6px; padding: 0; }
.appearance-lock { margin-bottom: 14px; }
.appearance-fields:disabled { opacity: .58; }
.appearance-fields :disabled, .appearance-fields :disabled + span { cursor: default; }
input:not([type=radio],[type=checkbox],[type=color],[type=range],[type=file]), select { width: 100%; min-width: 0; height: 41px; padding: 8px 11px; border-radius: 9px; border: 1px solid #dddfeb; background: white; color: var(--ink); font-size: 13px; }
input::placeholder { color: #82869a; opacity: 1; }
select { appearance: auto; }
small, .hint { display: block; color: var(--quiet); font-size: 11px; line-height: 1.45; }
.with-icon { position: relative; }
.with-icon > .icon { position: absolute; width: 16px; height: 16px; left: 11px; top: 12px; color: var(--quiet); pointer-events: none; }
.with-icon input:not([type]) { padding-left: 35px; }
.with-icon input[type=url], .with-icon input[type=search], .with-icon input[type=password] { padding-left: 35px; }
.row-fields { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 13px; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choices.ecc { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice { position: relative; min-width: 0; }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice span { min-height: 40px; display: flex; gap: 5px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; font-weight: 650; color: var(--muted); cursor: pointer; }
.choice span .icon { width: 14px; height: 14px; }
.choice span:hover { border-color: #b7aaff; }
.choice input:checked + span { background: #f4f1ff; border-color: #9b8af7; color: var(--purple-dark); }
.choice input:focus-visible + span { outline: 3px solid #9d91ff; outline-offset: 2px; }
.choice strong { color: var(--ink); font-family: ui-monospace, monospace; font-size: 12px; }
.choice input:checked + span strong { color: var(--purple-dark); }
.swatch { display: flex; gap: 6px; align-items: center; border: 1px solid #dddfeb; border-radius: 9px; height: 41px; padding: 2px 7px; }
.swatch input[type=color] { width: 38px; height: 34px; flex: none; padding: 4px; border: 0; background: none; cursor: pointer; }
.swatch input.color-hex { height: 31px; padding: 5px 4px; border: 0; background: transparent; font-size: 12px; }
.range-row { display: flex; align-items: center; height: 41px; gap: 8px; }
.range-row input { min-width: 50px; flex: 1; accent-color: var(--purple); }
.range-row output { width: 35px; font-size: 11px; color: var(--muted); }
.style-fields { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.upload { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.art-dropzone, .art-url { display: flex; align-items: center; gap: 8px; }
.art-dropzone { padding: 9px; flex-wrap: wrap; border: 1px dashed #c3bbea; border-radius: 10px; background: #faf9ff; }
.art-dropzone.is-dragging, .art-dropzone:focus-visible { border-color: var(--purple); outline: 2px solid var(--lavender); background: var(--lavender); }
.art-url input { flex: 1; }
.art-framing { display: grid; gap: 12px; }
.art-crop { margin: 0; }
.art-crop canvas { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 9px; cursor: grab; touch-action: none; }
.art-crop canvas.is-panning { cursor: grabbing; }
.art-crop figcaption { margin-top: 4px; }
.appearance-fields:disabled .art-crop canvas { cursor: default; touch-action: auto; }
.art-framing-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 13px; justify-items: start; }
.art-framing-controls .field { width: 100%; gap: 0; }
.art-framing-controls .range-row { height: 27px; }
.art-framing-controls .range-row output { width: 43px; }
.art-framing-controls .btn { min-height: 34px; }
.refine-feedback { display: grid; gap: 6px; }
.refine-status-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 8px; }
.refine-count { font-variant-numeric: tabular-nums; }
.refine-progress { display: block; width: 100%; height: 8px; accent-color: var(--purple); }
.status-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 640; width: fit-content; }
.status-toggle input { width: 16px; height: 16px; accent-color: var(--purple); }
.editor-footer { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.form-error { font-size: 12px; font-weight: 600; color: var(--danger); }
.preview-card { overflow: hidden; position: sticky; top: 22px; }
.preview-header { display: flex; align-items: center; justify-content: space-between; padding: 17px 19px; gap: 8px; }
.preview-header h2 { font-size: 15px; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--green); background: var(--green-bg); border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 710; white-space: nowrap; }
.live::before, .status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.live.inactive { color: var(--purple-dark); background: var(--lavender); }
.preview-stage, .login-art { background-color: #252149; background-image: radial-gradient(ellipse at 48% 49%, #43377f 0, transparent 75%), linear-gradient(120deg, #1f1c3c, #2d2654); color: #e4dfff; position: relative; overflow: hidden; display: grid; place-items: center; }
.preview-stage { min-height: 290px; padding: 32px; isolation: isolate; margin: 0 12px; border-radius: 12px; }
.preview-stage::before, .login-art::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(#c1b6ff13 1px, transparent 1px), linear-gradient(90deg, #c1b6ff13 1px, transparent 1px); background-size: 24px 24px; background-position: center; mask-image: radial-gradient(ellipse at center, black 38%, transparent 95%); z-index: -1; }
.stage-qr { position: relative; padding: 12px; display: grid; place-items: center; width: min(100%, 243px); aspect-ratio: 1; }
.stage-qr img { display: block; aspect-ratio: 1; width: 100%; min-width: 0; border-radius: 7px; background: white; box-shadow: 0 12px 32px #100d30a0; }
.stage-qr i { width: 17px; height: 17px; position: absolute; border-color: #ae9dff; border-style: solid; border-width: 0; pointer-events: none; }
.stage-qr i:nth-of-type(1) { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 4px; }
.stage-qr i:nth-of-type(2) { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 4px; }
.stage-qr i:nth-of-type(3) { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 4px; }
.stage-qr i:nth-of-type(4) { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 4px; }
.preview-status { position: absolute; bottom: 7px; left: 10px; right: 10px; text-align: center; color: #f3efff; font-size: 11px; line-height: 1.2; }
.preview-body { padding: 15px 18px 18px; }
.qr-meta { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-bottom: 13px; }
.qr-meta div { padding-right: 7px; border-right: 1px solid var(--line); }
.qr-meta div:last-child { border-right: 0; }
.qr-meta span { font-size: 10px; color: var(--quiet); display: block; }
.qr-meta strong { font-size: 12px; display: block; font-weight: 710; margin-top: 1px; white-space: nowrap; }
.payload { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding-left: 9px; }
.payload > div { min-width: 0; display: flex; gap: 6px; align-items: center; }
.payload > div .icon { color: var(--purple); width: 14px; height: 14px; }
.payload code { font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.payload button { border: 0; background: transparent; flex: none; }
.export-actions { margin-top: 13px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.published-art-note { margin-top: 12px; }
.export-actions .btn { padding-inline: 6px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 17px; }
.stat { padding: 16px; }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 5px; font-size: 12px; font-weight: 640; color: var(--muted); }
.stat .section-icon { width: 31px; height: 31px; }
.stat strong { display: block; font-size: 27px; line-height: 1.13; margin: 8px 0 3px; font-weight: 740; letter-spacing: -.045em; }
.stat small { margin-top: 5px; }
.list-header, .chart-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 19px; }
.list-header input { width: min(100%, 230px); }
.table-container { overflow: auto; }
table { border-collapse: collapse; width: 100%; white-space: nowrap; font-size: 13px; }
th, td { text-align: left; border-top: 1px solid var(--line); padding: 11px 15px; }
th { background: #fafaff; color: var(--muted); font-size: 11px; font-weight: 650; }
td { height: 56px; }
td:first-child, th:first-child { padding-left: 19px; }
td:last-child, th:last-child { padding-right: 19px; }
td .mono { font-size: 11px; }
td .truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.table-link { color: var(--ink); display: flex; font-weight: 675; align-items: center; gap: 9px; }
.table-link:hover { color: var(--purple-dark); }
.table-link .section-icon { width: 28px; height: 28px; border-radius: 7px; }
.table-link .icon { width: 14px; height: 14px; }
.table-actions { display: flex; gap: 5px; justify-content: flex-end; }
.table-actions .btn { width: 31px; min-height: 31px; }
.status-pill { display: inline-flex; gap: 6px; align-items: center; border-radius: 100px; padding: 4px 8px; background: var(--green-bg); color: var(--green); font-size: 11px; font-weight: 680; }
.status-pill.paused { background: #eeedf4; color: #706980; }
.empty { display: grid; justify-items: center; text-align: center; padding: 38px 14px 46px; border-top: 1px solid var(--line); }
.empty .section-icon { width: 48px; height: 48px; margin-bottom: 10px; }
.empty p { color: var(--muted); font-size: 13px; max-width: 330px; margin: 5px 0 13px; }
.accounts-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 15px; align-items: start; }
.analytics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
#analytics-stats { display: contents; }
.analytics-chart { grid-column: span 2; }
.analytics-grid .chart-header { min-height: 77px; align-items: flex-start; padding-inline: 16px; }
.analytics-grid .chart-header select { align-self: center; }
.chart-header { border-bottom: 1px solid var(--line); }
.chart-header p { color: var(--quiet); font-size: 11px; margin-top: 2px; }
.chart-header select { width: auto; }
.chart-body { padding: 16px 16px 13px; }
.chart-body svg { width: 100%; display: block; overflow: visible; }
.daily { margin: 12px 0 1px; color: var(--muted); font-size: 12px; }
.daily summary { cursor: pointer; font-weight: 640; }
.daily .table-container { max-height: 245px; margin-top: 8px; }
.devices { display: grid; gap: 12px; padding: 16px; }
.device { display: grid; grid-template-columns: 68px minmax(20px, 1fr) minmax(20px, auto); gap: 8px; align-items: center; font-size: 12px; }
.device progress { width: 100%; height: 7px; accent-color: var(--purple); }
.device span:last-child { font-variant-numeric: tabular-nums; }
.analytics-empty { color: var(--muted); font-size: 13px; padding: 4px 0; }
.account-form { margin-top: 15px; }
.account-actions { display: flex; gap: 6px; }
.account-actions .btn { min-height: 34px; padding: 5px 9px; font-size: 11px; }
.account-dialog { width: min(420px, calc(100% - 24px)); color: var(--ink); }
.account-dialog::backdrop { background: #20184288; }
.account-dialog .heading-actions { justify-content: flex-end; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: min(350px, calc(100vw - 40px)); padding: 11px 15px; border-radius: 10px; background: #242144; color: white; font-size: 13px; z-index: 10; box-shadow: 0 8px 22px #241a5660; }
.login { display: grid; min-height: 100dvh; grid-template-columns: minmax(345px, .9fr) 1fr; background: white; }
.login-panel { min-height: 100%; display: grid; grid-template-rows: auto 1fr; padding: 30px clamp(25px, 5vw, 72px); }
.login-panel .brand { margin: 0; }
.login-form { align-self: center; width: min(100%, 370px); margin: 38px auto; display: grid; gap: 16px; }
.login-form p { font-size: 14px; color: var(--muted); }
.login-form .btn { justify-content: space-between; padding-inline: 13px; }
.login-art { padding: clamp(22px, 4vw, 55px); margin: 14px 14px 14px 0; border-radius: 25px; isolation: isolate; }
.login-art .inner { width: min(100%, 490px); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px; }
.login-art .stage-qr { width: min(75%, 260px); }
.login-art h2 { color: white; font-size: clamp(25px, 4.8vw, 49px); letter-spacing: -.055em; line-height: 1.07; }
.login-art p { color: #d3ccf2; font-size: 14px; margin: 9px auto 0; max-width: 310px; }
@media (min-width: 1350px) {
  .main { padding: 37px 45px 45px; }
  .topbar { padding-inline: 45px; }
  .card-pad { padding: 24px; }
  .preview-stage { min-height: 315px; }
  .stage-qr { width: min(100%, 260px); }
}
@media (max-width: 1060px) {
  .shell { grid-template-columns: 182px minmax(0, 1fr); }
  .main, .topbar { padding-inline: 23px; }
  .sidebar { padding-inline: 11px; }
  .studio-grid { grid-template-columns: minmax(310px, 1.1fr) minmax(260px, 1fr); gap: 12px; }
  .card-pad { padding: 17px; }
  .preview-stage { min-height: 234px; padding: 23px; }
}
@media (max-width: 810px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
  .sidebar { display: none; position: fixed; left: 0; top: 0; width: 215px; z-index: 3; box-shadow: 10px 0 30px #17142925; }
  .sidebar.is-open { display: flex; }
  .mobile-menu { display: inline-flex; }
  .overlay { display: block; position: fixed; inset: 0; z-index: 2; border: 0; background: #1e18413d; width: 100%; padding: 0; }
}
@media (max-width: 650px) {
  .main { padding: 22px 13px 31px; }
  .topbar { padding: 0 13px; height: 57px; }
  .shell { grid-template-rows: 57px 1fr; }
  .topbar-left, .crumb, .owner { gap: 7px; }
  .owner > span:first-child { display: none; }
  .page-heading { margin-bottom: 17px; align-items: flex-start; flex-direction: column; gap: 10px; }
  .page-heading p { font-size: 13px; }
  .studio-grid, .accounts-layout { grid-template-columns: 1fr; }
  .analytics-grid { column-gap: 6px; }
  .analytics-chart, .analytics-devices { grid-column: 1 / -1; }
  .analytics-devices .chart-header { min-height: auto; }
  .preview-card { position: static; }
  .stats { gap: 6px; }
  .stat { padding: 9px; }
  .stat .section-icon { display: none; }
  .stat-top { font-size: 10px; }
  .stat strong { font-size: 20px; }
  .stat small { font-size: 9px; }
  .list-header { padding: 12px; }
  .list-header input { width: 150px; }
  .login { grid-template-columns: 1fr; min-height: 100dvh; grid-template-rows: auto 1fr; }
  .login-panel { padding: 20px; }
  .login-form { margin-block: 33px; }
  .login-art { margin: 0 10px 10px; padding: 22px; }
  .login-art .stage-qr { width: 160px; }
  .login-art .inner { gap: 16px; }
}
@media (max-width: 360px) {
  .analytics-grid .stat-top { min-height: 3em; align-items: flex-start; }
}
