:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #ecf0f4;
  background: #12161a;
  --surface: #1c2228;
  --stroke: #36424b;
  --muted: #bac4ce;
  --accent: #abddff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.top { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 16px max(18px, calc((100vw - 1560px) / 2)); border-bottom: 1px solid var(--stroke); }
a { color: var(--accent); }
.brand { color: inherit; text-decoration: none; font-size: 1.2rem; font-weight: 800; letter-spacing: .04em; }
.brand span { color: var(--muted); font-weight: 500; font-size: .75em; }
main { max-width: 1600px; margin: auto; padding: clamp(14px, 2vw, 28px); }
h1 { margin: 0 0 10px; font-size: clamp(1.5rem, 2.8vw, 2.4rem); }
h2 { font-size: 1.15rem; margin: 0 0 14px; }
p { line-height: 1.45; }
.notice { color: var(--muted); margin: 0 0 16px; }
button { cursor: pointer; color: inherit; background: var(--surface); border: 1px solid var(--stroke); padding: 9px 12px; border-radius: 8px; font: inherit; }
button[aria-pressed="true"], button.primary { color: #102536; background: var(--accent); border-color: var(--accent); font-weight: 650; }
button:disabled { opacity: .5; cursor: wait; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabs, .device, .actions { display: flex; flex-wrap: wrap; gap: 7px; }
.tabs { margin: 0 0 14px; }
.top-actions, .publish-bar { align-items: center; }
.publish-bar { margin-bottom: 14px; }
.auth { max-width: 420px; margin: 24px auto 0; }
.workspace { display: grid; grid-template-columns: minmax(300px, .75fr) minmax(0, 1.35fr); gap: 14px; align-items: start; }
.workspace.solo { grid-template-columns: minmax(0, 760px); }
.panel, .preview { min-width: 0; padding: 14px; border-radius: 12px; border: 1px solid var(--stroke); background: var(--surface); }
.panel form { display: grid; gap: 10px; }
label { min-width: 0; display: grid; gap: 5px; font-size: .9rem; }
label.inline { display: flex; align-items: center; gap: 8px; }
input:not([type="checkbox"]), textarea, select { min-width: 0; width: 100%; color: inherit; border: 1px solid var(--stroke); background: #14191e; border-radius: 7px; font: inherit; padding: 8px 9px; }
input[type="file"] { font-size: .83rem; }
textarea { min-height: 74px; resize: vertical; }
.filter { margin-bottom: 10px; }
.picker { margin-bottom: 14px; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
figure { margin: 0; display: flex; align-items: flex-start; gap: 9px; }
figure img { width: 95px; height: 72px; object-fit: contain; border-radius: 6px; background: #14191e; }
figure .photo-control { min-width: 0; display: grid; gap: 4px; flex: 1; }
figure button { justify-self: start; font-size: .8rem; padding: 4px 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 4px; }
thead { color: var(--muted); font-size: .82rem; }
.sku { display: block; font-size: .69rem; color: var(--muted); }
.preview { position: sticky; top: 10px; --preview-height: clamp(430px, 72vh, 860px); }
.preview header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding-bottom: 10px; }
.device button { padding: 5px 8px; font-size: .8rem; }
.device { align-items: center; }
.device label { display: flex; align-items: center; gap: 6px; font-size: .8rem; }
.device select { padding: 5px 7px; width: auto; }
.viewport { border: 1px solid var(--stroke); overflow: auto; background: #12161a; }
iframe { display: block; width: 100%; height: var(--preview-height); border: 0; background: #101317; }
.phone .viewport { height: var(--preview-height); display: grid; place-items: center; overflow: hidden; }
.phone .frame-window {
  width: calc(var(--phone-width, 390px) * var(--phone-scale, .5));
  height: calc(var(--phone-height, 844px) * var(--phone-scale, .5));
  position: relative; overflow: hidden; border-radius: 7px;
}
.phone iframe {
  position: absolute; inset: 0 auto auto 0; width: var(--phone-width, 390px); height: var(--phone-height, 844px);
  transform: scale(var(--phone-scale, .5)); transform-origin: top left;
}
.muted { color: var(--muted); font-size: .87rem; }
#status { position: sticky; bottom: 8px; margin: 10px 0 0; padding: 8px 12px; background: #102536; color: #def1ff; border-radius: 8px; width: fit-content; max-width: 100%; }
#status:empty { display: none; }
dl { margin: 0; }
dt { font-weight: 650; }
dd { margin: 3px 0 12px; color: var(--muted); }
.order-list { display: grid; gap: 10px; margin-top: 14px; }
.order-card { padding: 12px; border: 1px solid var(--stroke); border-radius: 10px; }
.order-card header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.order-card header time { margin-left: auto; }
.order-card ul { padding-inline-start: 20px; }
.order-card summary { cursor: pointer; font-weight: 600; }
.order-card dd { overflow-wrap: anywhere; }
.order-status { font-size: .8rem; font-weight: 600; padding: 4px 7px; border-radius: 6px; color: var(--accent); background: #122c3c; }
@media (max-width: 760px) {
  .workspace { grid-template-columns: 1fr; }
  .preview { position: static; }
  th, td { padding: 2px; }
}
