:root {
  --bg: #f6f8fc;
  --card: #fbfcff;
  --line: #d8e2f0;
  --text: #0f172a;
  --muted: #64748b;
  --blue: #1d4ed8;
  --blue2: #2563eb;
  --accent: #02b0f8;
  --green: #0f766e;
  --danger: #c5202f;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1000px 340px at top left, #edf4ff 0%, rgba(237,244,255,0) 58%),
    radial-gradient(760px 280px at top right, #ebfaf6 0%, rgba(235,250,246,0) 56%),
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 42%, #eef3fb 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
.designWrap { max-width: 1540px; margin: 0 auto; padding: 22px 22px 18px; }
.topHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #cfdaef;
  border-radius: 16px;
  background: linear-gradient(180deg,#ffffff,#f6f9ff);
  box-shadow: 0 12px 24px rgba(30,58,138,.08);
  margin-bottom: 12px;
}
.logoLink { display: inline-flex; align-items: center; text-decoration: none; }
.logo { display:block; width: clamp(180px, 20vw, 300px); height: auto; max-height: 56px; object-fit: contain; }
.headBtns, .heroActions, .actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.headBtns { gap: 8px; }
.headBtns .btn,
.headBtns a.btn {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid #c6d5f4;
  border-radius: 12px;
  background: linear-gradient(180deg,#f9fbff,#edf3ff);
  color: #183370;
  clip-path: none;
  min-height: auto;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.headBtns .btn:hover,
.headBtns a.btn:hover {
  background: linear-gradient(180deg,#eff5ff,#e2ecff);
  border-color:#9db8ee;
  transform: translateY(-1px);
  box-shadow:0 8px 16px rgba(37,99,235,.14);
}
.headBtns .btn.primary,
.headBtns a.btn.primary {
  background: linear-gradient(180deg, var(--blue2), var(--blue));
  color:#fff;
  border-color:#1f4fd6;
  box-shadow:0 10px 20px rgba(37,99,235,.28);
}
.btn {
  border: 1px solid var(--line);
  background: #fbfcff;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 13px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(2,176,248,.11); }
.btn.primary {
  border-color: #1f4fd6;
  color: #fbfdff;
  background: linear-gradient(180deg, var(--blue2), var(--blue));
  box-shadow: 0 10px 20px rgba(37,99,235,.24);
}
.btn.ghost { background: rgba(255,255,255,0.84); }
.btn.success { color: #fff; background: #0f766e; border-color: #0f766e; }
.btn.danger { color: var(--danger); background: #fff5f6; border-color: #f2c2c7; }
.btn:disabled { opacity: .58; cursor: not-allowed; box-shadow: none; }
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border: 1px solid #e1e8f4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.06);
  margin-bottom: 10px;
}
.eyebrow { color: #087da8; font-weight: 850; text-transform: uppercase; font-size: 11px; letter-spacing: .06em; }
.hero h1 { margin: 4px 0 0; font-size: 24px; line-height: 1.14; }
.hero p { margin: 6px 0 0; color: var(--muted); max-width: 680px; line-height: 1.38; font-size: 14px; }
.heroActions .btn { min-height: 36px; padding: 8px 12px; }
.stepBar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.step {
  border: 1px solid #dce6f4;
  border-radius: 8px;
  background: rgba(255,255,255,.9);
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}
.step span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd8ea;
  background: #fff;
  color: #52647e;
  font-size: 12px;
}
.step.done { color: #0f766e; }
.step.done span { background: #0f766e; border-color: #0f766e; color: #fff; }
.step.active { border-color: #86b1ff; color: var(--blue); background: #f5f9ff; }
.step.active span { background: var(--blue); border-color: var(--blue); color: #fff; }
.designGrid {
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.linePanel, .editorPanel {
  border: 1px solid rgba(205, 217, 237, 0.95);
  border-radius: 18px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 16px 36px rgba(31,60,112,0.07);
}
.linePanel { position: sticky; top: 16px; padding: 14px; }
.panelHead h2 { margin: 0; font-size: 22px; }
.panelHead p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.uploadWide {
  width: 100%;
  margin-top: 12px;
  border-color: #159bd3;
  color: #0477ad;
  background: #f7fcff;
}
.lineList { display: grid; gap: 10px; margin-top: 12px; max-height: calc(100vh - 250px); overflow: auto; padding-right: 2px; }
.lineItem {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid #d9e4f4;
  border-radius: 10px;
  background: #fff;
  padding: 9px;
  cursor: pointer;
}
.lineItem.active { border-color: #8fb6ff; box-shadow: 0 0 0 3px rgba(37,99,235,0.11); }
.lineThumb { width: 64px; height: 64px; border: 1px solid #e0e8f4; border-radius: 8px; background: #fff; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.lineThumb img { width: 100%; height: 100%; object-fit: contain; }
.lineName { font-weight: 900; line-height: 1.2; font-size: 14px; }
.lineInfo { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.savedMark { margin-top: 6px; color: var(--green); font-weight: 900; font-size: 12px; }
.fileMark {
  margin-top: 6px;
  display: inline-flex;
  max-width: 100%;
  border: 1px solid #cfe7f4;
  border-radius: 8px;
  background: #f0faff;
  color: #087da8;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editorPanel { min-height: 640px; padding: 18px; }
.emptyState {
  min-height: 460px;
  border: 1px dashed #cbd6e7;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--muted);
  font-weight: 800;
}
.editorHeader {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom: 14px;
}
.editorTitle { margin: 0; font-size: 28px; line-height: 1.08; }
.editorMeta { margin-top: 7px; color: var(--muted); font-size: 13px; }
.printPlaceBar {
  border: 1px solid #dce6f4;
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.printPlaceTabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 1px;
}
.printPlaceTab {
  border: 1px solid #d4e0f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  min-width: 142px;
  padding: 8px 9px;
  display: grid;
  gap: 3px;
  text-align: left;
  cursor: pointer;
}
.printPlaceTab span { font-weight: 950; }
.printPlaceTab small {
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.printPlaceTab.active {
  border-color: #86b1ff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.printPlaceActions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.statusPill {
  border: 1px solid #dbe7f5;
  border-radius: 999px;
  padding: 7px 10px;
  background: #f8fbff;
  font-size: 12px;
  font-weight: 900;
  color: #35527d;
  white-space: nowrap;
}
.editorBody { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.previewCard, .controlCard {
  border: 1px solid #dce6f4;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}
.previewToolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}
.zoomControl {
  display:grid;
  grid-template-columns: auto minmax(140px, 1fr) 54px;
  align-items:center;
  gap:10px;
  width:100%;
  color:#334155;
  font-size:13px;
  font-weight:900;
}
.smallBtn { min-height: 34px; padding: 7px 10px; }
.previewStage {
  position: relative;
  min-height: 610px;
  border: 1px solid #d7e1ef;
  border-radius: 10px;
  background:
    linear-gradient(45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f8fafc 75%),
    linear-gradient(-45deg, transparent 75%, #f8fafc 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  overflow: hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}
.previewZoomLayer {
  position: absolute;
  inset: 0;
  transform-origin: center center;
}
.previewStage img.baseImage { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.placementBox {
  position: absolute;
  border: 0;
  background: transparent;
  display:flex;
  align-items:center;
  justify-content:center;
}
.placementSafe {
  position: relative;
  width: 100%;
  height: 100%;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow: hidden;
}
.logoPreview {
  position: absolute;
  user-select: none;
  touch-action: none;
  cursor: grab;
  object-fit: contain;
}
.logoPreviewTint {
  display: block;
  filter: drop-shadow(0 1px 1px rgba(15, 23, 42, .35)) drop-shadow(0 0 2px rgba(15, 23, 42, .22));
}
.logoPreview:active { cursor: grabbing; }
.logoResizeHandle {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #111827;
  background: #f8fafc;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .18);
  z-index: 4;
  padding: 0;
  touch-action: none;
}
.logoResizeHandle.nw { left: 2px; top: 2px; cursor: nwse-resize; }
.logoResizeHandle.ne { right: 2px; top: 2px; cursor: nesw-resize; }
.logoResizeHandle.sw { left: 2px; bottom: 2px; cursor: nesw-resize; }
.logoResizeHandle.se { right: 2px; bottom: 2px; cursor: nwse-resize; }
.logoResizeHandle:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}
.textPreview {
  position: absolute;
  user-select: none;
  touch-action: none;
  cursor: grab;
  white-space: nowrap;
  font-weight: 800;
  line-height: 1;
  max-width: 100%;
}
.textPreview:active { cursor: grabbing; }
.editorTabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.editorTab {
  border: 1px solid #d9e4f4;
  background: #f8fbff;
  border-radius: 8px;
  min-height: 54px;
  font-weight: 900;
  cursor: pointer;
}
.editorTab.active {
  background: #fff;
  border-color: #86b1ff;
  box-shadow: inset 0 -4px 0 #f7b34d;
}
.formatBox {
  border: 1px solid #dce6f4;
  border-radius: 10px;
  padding: 10px;
  background: #fbfdff;
  display: grid;
  gap: 7px;
}
.formatTitle { font-weight: 900; color: #1d4ed8; font-size: 13px; }
.formatList { display:flex; flex-wrap:wrap; gap:6px; }
.formatList span {
  border: 1px solid #dce6f4;
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}
.formGrid { display: grid; gap: 10px; }
.field { display: grid; gap: 5px; font-size: 13px; font-weight: 800; color: #334155; }
.field span { color: #40536f; }
.input, .textarea {
  width: 100%;
  border: 1px solid #cfdbea;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  min-height: 42px;
  padding: 9px 10px;
  font: inherit;
}
.textarea { min-height: 86px; resize: vertical; }
.pantoneSelect { position: relative; width: 100%; }
.pantoneSelectButton {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfdbea;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.pantoneSelectedSwatch,
.pantoneOptionSwatch {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid #aab8cb;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
  flex: 0 0 auto;
}
.pantoneSelectedText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pantoneSlots {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.pantoneSlot { margin: 0; }
.pantoneMenu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  border: 1px solid #cfdbea;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .16);
  padding: 8px;
}
.pantoneSearch { margin-bottom: 7px; }
.pantoneResults { max-height: 260px; overflow: auto; display: grid; gap: 4px; }
.pantoneOption {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #172033;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px;
  text-align: left;
  cursor: pointer;
}
.pantoneOption:hover { background: #eef4ff; }
.pantoneOptionName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.pantoneNoResults { padding: 12px; color: var(--muted); font-size: 12px; }
.rangeRow { display:grid; grid-template-columns: 1fr 64px; align-items:center; gap:10px; }
.fileBox {
  border: 1px dashed #b9c8dc;
  border-radius: 10px;
  background: #f8fbff;
  padding: 12px;
  display: grid;
  gap: 8px;
}
.textBox { background:#fff; border-style: solid; }
.pantoneSuggestions {
  border: 1px solid #dce6f4;
  border-radius: 10px;
  background: #fbfdff;
  padding: 10px;
  display:grid;
  gap:8px;
}
.suggestionTitle {
  color:#1d4ed8;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
}
.suggestionGrid { display:flex; flex-wrap:wrap; gap:6px; }
.pantoneChip {
  border: 1px solid #d6e1ef;
  border-radius: 8px;
  background:#fff;
  color:#334155;
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 8px;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
  max-width:100%;
}
.pantoneChip span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.swatch {
  width:16px;
  height:16px;
  border-radius:4px;
  border:1px solid #b8c5d6;
  flex:0 0 auto;
}
.swatch.empty { background: repeating-linear-gradient(45deg,#fff,#fff 3px,#d8e2f0 3px,#d8e2f0 6px); }
.small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.chips { display:flex; gap:6px; flex-wrap:wrap; margin-top: 10px; }
.chip { border:1px solid #dce6f4; background:#f8fbff; border-radius:999px; padding:5px 9px; color:#334155; font-size:12px; font-weight:800; }
.actionBar { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; padding-top:12px; border-top:1px solid #e2eaf5; margin-top:12px; }
.summaryMini {
  border: 1px solid #dce6f4;
  border-radius: 10px;
  background: #f6f9ff;
  padding: 11px;
  display: grid;
  gap: 8px;
}
.summaryMiniRow { display:flex; justify-content:space-between; gap:10px; color:#334155; font-size:13px; }
.summaryMiniRow strong { color:#0f172a; }
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  background: #0f172a;
  color: #fff;
  border-radius: 8px;
  padding: 11px 14px;
  font-weight: 800;
  box-shadow: 0 18px 38px rgba(15,23,42,0.18);
}
.siteFooter {
  margin-top: 18px;
  padding: 13px 4px 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
@media (max-width: 1180px) {
  .designGrid, .editorBody { grid-template-columns: 1fr; }
  .linePanel { position: static; }
  .lineList { max-height: none; }
  .printPlaceBar { grid-template-columns: 1fr; }
  .printPlaceActions { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .designWrap { padding: 12px; }
  .topHeader {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
  }
  .logoLink { justify-content: center; }
  .logo { width: clamp(160px, 56vw, 240px); max-height: 44px; }
  .headBtns { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
  .headBtns .btn,
  .headBtns a.btn {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 11px;
    border-radius: 999px;
    text-align: center;
    clip-path: none;
    letter-spacing: .02em;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
    flex: 1 1 calc(33.333% - 4px);
    min-width: 0;
  }
  .hero, .editorHeader { flex-direction: column; align-items: stretch; }
  .heroActions, .actions { display:grid; grid-template-columns: 1fr; }
  .hero h1 { font-size: 23px; }
  .previewStage { min-height: 420px; }
  .stepBar { grid-template-columns: 1fr; }
}
