/* Styles for the editor app (index.html). */
:root {
  /* Colours from the DataPott Charts logo */
  --brand: #004aad;        /* logo blue: main buttons, active step, selections */
  --brand-dark: #00387f;   /* hover */
  --accent: #ce360e;       /* logo red-orange: top strip, Publish, highlights */
  --accent-dark: #a82b0b;
  --tint: #e8f0fb;         /* light blue background for active items */
  --tint-hover: #f3f7fd;   /* hover background */
  --tint-border: #b7cdee;  /* hover border */
  --ok: #1a7f37;           /* "done" and success messages stay green */
  --ok-tint: #e6f4ea;
  --blue: #004aad;
  --ink: #1d1d1d;
  --muted: #6b6b6b;
  --line: #e3e3e3;
  --soft: #f4f5f7;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Roboto, "Segoe UI", Arial, sans-serif; color: var(--ink); background: var(--soft); }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }

/* Top bar */
.topbar { background: #fff; border-top: 4px solid var(--accent); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 10px 28px; gap: 20px; }
.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo img { height: 46px; width: auto; display: block; }
.logo span { color: #c62828; font-size: 12px; letter-spacing: 1px; margin-left: 4px; }
.topbar nav { margin-left: auto; display: flex; gap: 6px; }
.topbar nav a, .topbar nav button { background: none; border: 0; padding: 9px 14px; border-radius: 6px; color: var(--ink); text-decoration: none; cursor: pointer; font-size: 15px; }
.topbar nav a:hover, .topbar nav button:hover, .topbar nav .active { background: var(--tint); }

main { max-width: 1240px; margin: 0 auto; padding: 22px 28px 60px; }

/* Buttons */
.btn { background: var(--brand); color: #fff; border: 0; border-radius: 4px; padding: 9px 16px; cursor: pointer; font-size: 14px; }
.btn:hover { background: var(--brand-dark); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #cfcfcf; }
.btn.ghost:hover { background: #f0f0f0; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.danger { background: #fff; color: #c62828; border: 1px solid #e3b4b4; }

/* Dashboard / archive */
.dash-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dash-head h2 { color: var(--blue); margin: 0; font-size: 26px; font-weight: 500; }
.dash-head .spacer { flex: 1; }
.folder-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 20px; }
.folder { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 12px 18px; cursor: pointer; }
.folder.active { border-color: var(--brand); background: var(--tint); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 150px; }
.card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.card h3 { margin: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta { font-size: 12px; color: var(--muted); }
.card .thumb { flex: 1; font-size: 40px; color: #c3d3ea; display: flex; align-items: center; justify-content: center; }
.card .actions { display: flex; gap: 6px; }
.empty-note { background: #fff; border: 1px dashed #ccc; padding: 30px; text-align: center; border-radius: 6px; color: var(--muted); }

/* Steps bar */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 22px; }
.step { background: #fff; border: 1px solid var(--line); padding: 12px 16px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 15px; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); }
.step .num { width: 24px; height: 24px; border-radius: 50%; border: 1px solid #999; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.step.active { background: var(--tint); border-color: var(--brand); font-weight: 600; }
.step.active .num { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Editor layout */
.editor { display: grid; grid-template-columns: 380px 1fr; gap: 28px; align-items: start; }
.editor.wide { grid-template-columns: 1fr; }
.panel { background: transparent; }
.panel h3 { font-size: 18px; margin: 4px 0 12px; }
.panel label.field { display: block; font-size: 13px; color: #333; margin: 12px 0 4px; font-weight: 500; }
.panel input[type=text], .panel input[type=url], .panel input[type=number], .panel input[type=password], .panel select, .panel textarea { width: 100%; padding: 8px 10px; border: 1px solid #cfcfcf; border-radius: 4px; background: #fff; }
.panel textarea { resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: 14px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0; }
.error { color: #c62828; font-size: 13px; margin: 8px 0; }
.ok { color: var(--ok); font-size: 13px; margin: 8px 0; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.tile { background: none; border: 1px solid transparent; border-radius: 4px; padding: 12px 6px; text-align: center; cursor: pointer; color: var(--blue); font-size: 12.5px; }
.tile .ico { font-size: 24px; display: block; margin-bottom: 4px; }
.tile.active { background: #fff; border-color: var(--line); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.06); }

.tabs { display: flex; border: 1px solid #cfcfcf; border-radius: 4px; padding: 3px; gap: 3px; margin-bottom: 14px; background: #fff; }
.tabs button { flex: 1; border: 1px solid transparent; background: none; padding: 6px; border-radius: 3px; cursor: pointer; font-size: 13px; }
.tabs button.active { border-color: var(--brand); background: var(--tint); }

.types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.type { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 10px 4px; text-align: center; cursor: pointer; font-size: 11.5px; min-height: 66px; }
.type .ico { display: block; font-size: 20px; color: var(--blue); margin-bottom: 4px; }
.type.active { border-color: var(--brand); background: var(--tint); box-shadow: inset 0 0 0 1px var(--brand); }

.colors { display: grid; grid-template-columns: 1fr 44px; gap: 6px 8px; align-items: center; font-size: 13px; max-height: 220px; overflow: auto; }
.colors input[type=color] { width: 44px; height: 26px; border: 1px solid #ccc; padding: 0; background: none; }

/* Preview */
.preview-wrap { position: sticky; top: 16px; }
.preview { background: #fff; border: 1px solid var(--line); margin: 0 auto; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.preview-bar { margin: 14px auto 0; display: flex; gap: 10px; align-items: center; justify-content: center; font-size: 12.5px; color: var(--muted); background: #fff; border: 1px solid var(--line); padding: 8px 12px; border-radius: 4px; width: fit-content; }
.preview-bar input { width: 70px; padding: 4px 6px; border: 1px solid #ccc; border-radius: 3px; }
.preview-bar button { border: 1px solid #ccc; background: #fff; padding: 4px 8px; border-radius: 3px; cursor: pointer; }
.preview-bar button.active { border-color: var(--brand); background: var(--tint); }

/* Data grid (step 2) */
.grid-wrap { overflow: auto; max-height: 460px; border: 1px solid #ccc; background: #fff; }
table.grid { border-collapse: collapse; font-family: "Roboto Mono", Consolas, monospace; font-size: 12.5px; }
table.grid th, table.grid td { border: 1px solid #ddd; padding: 6px 10px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
table.grid th { background: #f0f0f0; cursor: pointer; position: sticky; top: 0; }
table.grid th.hidden-col, table.grid td.hidden-col { text-decoration: line-through; color: #aaa !important; }
table.grid td.number { color: #1d6fb8; text-align: right; }
table.grid td.date { color: #168232; }
table.grid td.bad { color: #c62828; background: #fdecec; }
table.grid td.rownum { background: #f6f6f6; color: #888; text-align: center; }
.colmenu { background: #fff; border: 1px solid #ccc; border-radius: 4px; padding: 12px; margin-top: 12px; }
.legend-types { font-size: 12.5px; }
.legend-types code { padding: 1px 5px; border: 1px solid #ccc; border-radius: 3px; }

/* Publish */
.codebox { width: 100%; font-family: Consolas, monospace; font-size: 12px; padding: 8px; border: 1px solid #ccc; border-radius: 4px; background: #fafafa; }
.pub-section { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 14px; margin-bottom: 14px; }
.pub-section h4 { margin: 0 0 8px; }
.nav-buttons { display: flex; justify-content: space-between; margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }

@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 10px 14px; }
  main { padding: 16px; }
}

/* Highlight chips (step 3 → Annotate) */
.hl-list { display: flex; flex-wrap: wrap; gap: 6px; }
.hl-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #ccc; border-radius: 14px; padding: 4px 10px; font-size: 12.5px; background: #fff; cursor: pointer; }
.hl-chip input { margin: 0; }
.hl-chip.on { border-color: var(--brand); background: var(--tint); }
.export-preview { display: block; max-width: 100%; max-height: 420px; margin-top: 10px; border: 1px solid #ccc; box-shadow: 0 2px 8px rgba(0,0,0,.08); }

/* Annotation list (step 3 → Annotate) */
.anno-item { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 8px; margin-bottom: 8px; }
.anno-item textarea { width: 100%; padding: 6px 8px; border: 1px solid #cfcfcf; border-radius: 4px; }
.anno-opts { gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.anno-opts > * { flex: 0 0 auto; }
.anno-opts select { width: auto !important; padding: 4px 6px !important; }
.anno-opts input[type=color] { width: 34px; height: 28px; border: 1px solid #ccc; padding: 0; }
.mini { font-size: 12.5px; display: inline-flex; align-items: center; gap: 3px; }

/* Cloud / publishing */
.cloudstat { font-size: 12.5px; color: var(--muted); align-self: center; margin-right: 6px; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cloudstat.warn { color: #c62828; }
.btn.big { font-size: 16px; padding: 11px 22px; margin: 6px 0; }
.pubstate { font-size: 13.5px; padding: 8px 10px; border-radius: 4px; margin-bottom: 6px; }
.pubstate.new { background: #f3f3f3; }
.pubstate.ok { background: var(--ok-tint); color: var(--ok); }
.pubstate.changed { background: #fff4e0; color: #8a5300; }
.badge { align-self: flex-start; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #f0f0f0; color: #555; }
.badge.ok { background: var(--ok-tint); color: var(--ok); }
.badge.changed { background: #fff4e0; color: #8a5300; }
.settings { max-width: 820px; }
.steps-list { font-size: 13.5px; line-height: 1.55; padding-left: 20px; }
.steps-list li { margin-bottom: 6px; }
details summary { cursor: pointer; font-size: 13.5px; margin: 6px 0; }

/* ============ Redesign: studio layout with step list ============ */
main:has(.studio) { max-width: 1480px; }
.studio { display: grid; grid-template-columns: 212px minmax(0, 1fr); gap: 26px; align-items: start; }
.stepper { position: sticky; top: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 10px; }
.stepper-back { display: inline-block; font-size: 12.5px; color: var(--muted); text-decoration: none; margin: 0 6px 8px; }
.stepper-back:hover { color: var(--brand); }
.stepper-title { font-weight: 600; font-size: 14px; margin: 0 6px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper ol { list-style: none; margin: 0; padding: 0; position: relative; }
.stepper li { position: relative; }
.stepper li:not(:last-child)::after { content: ""; position: absolute; left: 21px; top: 40px; bottom: -6px; width: 2px; background: #e2e7ee; border-radius: 0; }
.sstep { width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left; background: none; border: 0; padding: 9px 6px; margin-bottom: 6px; border-radius: 10px; cursor: pointer; color: var(--ink); }
.sstep:hover { background: var(--tint-hover); }
.sstep.active { background: var(--tint); }
.sdot { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; border: 2px solid #cfd6e0; color: #6b7280; background: #fff; position: relative; z-index: 1; }
.sstep.active .sdot { background: var(--brand); border-color: var(--brand); color: #fff; }
.sstep.done .sdot { background: var(--ok-tint); border-color: var(--ok); color: var(--ok); }
.stext { display: flex; flex-direction: column; padding-top: 1px; }
.sname { font-size: 14.5px; font-weight: 600; }
.sdesc { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.studio-main { min-width: 0; }
.btn.pill { border-radius: 999px; padding: 10px 22px; }

/* Chart type gallery (Design step) */
.gallery { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 18px; }
.gallery-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
.gallery:not(.open) .gallery-cats { display: none; }
.gallery-cats { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.gcat { background: none; border: 1px solid transparent; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13.5px; color: #3b4452; }
.gcat:hover { background: var(--tint-hover); }
.gcat.active { background: var(--brand); color: #fff; }
.gallery-toggle { margin-left: auto; background: none; border: 0; color: var(--blue); cursor: pointer; font-size: 13px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; padding: 4px 12px 14px; }
.gcard { display: flex; flex-direction: column; align-items: stretch; text-align: left; background: #fff; border: 1.5px solid #e5e8ee; border-radius: 12px; padding: 6px 6px 9px; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; position: relative; }
.gcard:hover { border-color: var(--tint-border); box-shadow: 0 3px 12px rgba(0,74,173,.10); transform: translateY(-1px); }
.gcard.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(0,74,173,.18); }
.gcard.active::after { content: "✓"; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.gcard img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; border-radius: 8px; background: #fff; }
.gname { font-size: 13.5px; font-weight: 600; margin: 6px 4px 0; }
.gdesc { font-size: 11.5px; color: var(--muted); margin: 1px 4px 0; line-height: 1.3; }

/* Fold-out settings sections */
.editor.design { grid-template-columns: 400px minmax(0, 1fr); }
.acc { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.acc-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: none; border: 0; padding: 12px 14px; cursor: pointer; text-align: left; }
.acc-head:hover { background: var(--tint-hover); }
.acc-title { display: block; font-weight: 600; font-size: 14.5px; color: var(--ink); }
.acc-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.acc-chev { color: var(--muted); }
.acc.open .acc-head { border-bottom: 1px solid var(--line); }
.acc-body { padding: 4px 14px 14px; }
.acc-body h3 { font-size: 14px; }

@media (max-width: 1000px) {
  .studio { grid-template-columns: 1fr; gap: 12px; }
  .stepper { position: static; padding: 8px; }
  .stepper-title, .stepper-back { display: none; }
  .stepper ol { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .stepper li::after { display: none; }
  .sstep { flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 6px 2px; margin: 0; }
  .sdesc { display: none; }
  .sname { font-size: 12.5px; }
  .editor.design { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .topbar { padding: 8px 10px; gap: 8px; }
  .logo img { height: 34px; }
  .topbar nav { gap: 2px; }
  .topbar nav a, .topbar nav button { padding: 7px 8px; font-size: 13px; white-space: nowrap; }
  .cloudstat { display: none; }
  .gallery-head { flex-wrap: nowrap; }
  .gallery-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .gallery-cats::-webkit-scrollbar { display: none; }
  .gcat { white-space: nowrap; }
  .gallery-toggle { white-space: nowrap; font-size: 12px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-wrap { position: static; }
  .preview-bar { flex-wrap: wrap; width: auto; }
}
@media (max-width: 420px) {
  .topbar nav a, .topbar nav button { padding: 6px 5px; font-size: 12px; }
  .logo img { height: 30px; }
}

/* ============ Redesign: smaller gallery pictures ============ */
.gallery-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.gcard { padding: 5px 5px 7px; border-radius: 10px; }
.gcard img { border-radius: 6px; }
.gname { font-size: 12.5px; margin: 4px 3px 0; }
.gdesc { font-size: 11px; margin: 1px 3px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gcard.active::after { width: 18px; height: 18px; font-size: 10px; top: 6px; right: 6px; }

/* ============ Redesign: welcome + Add data step ============ */
.welcome { position: relative; display: flex; align-items: center; gap: 20px; background: linear-gradient(100deg, var(--tint) 0%, #fdf0eb 100%); border: 1px solid #d6e2f3; border-radius: 14px; padding: 16px 52px 16px 20px; margin-bottom: 18px; }
.welcome h2 { margin: 0 0 4px; font-size: 21px; color: #00387f; letter-spacing: -0.2px; }
.welcome p { margin: 0; color: #3b4659; font-size: 14px; }
.welcome-text { flex: 1; }
.welcome-art { width: 120px; height: 64px; flex: 0 0 auto; }
.welcome-close { position: absolute; top: 8px; right: 10px; background: none; border: 0; font-size: 20px; color: #6b7280; cursor: pointer; line-height: 1; padding: 4px 6px; border-radius: 6px; }
.welcome-close:hover { background: rgba(0,0,0,.05); }
.step-title { font-size: 17px; margin: 4px 0 10px; }
.sources { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.source { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: #fff; border: 1.5px solid #e5e8ee; border-radius: 12px; padding: 12px 12px 11px; cursor: pointer; position: relative; transition: border-color .12s, box-shadow .12s, transform .12s; }
.source:hover { border-color: var(--tint-border); box-shadow: 0 3px 12px rgba(0,74,173,.10); transform: translateY(-1px); }
.source.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(0,74,173,.18); }
.source.active::after { content: "✓"; position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.src-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--tint); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.src-icon svg, .dz-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.source.active .src-icon { background: var(--brand); }
.source.active .src-icon svg { stroke: #fff; }
.src-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.src-sub { font-size: 11.5px; color: var(--muted); }
.editor.adddata { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.card-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.card-panel .field:first-child { margin-top: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; cursor: pointer; font-size: inherit; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center; border: 2px dashed var(--tint-border); border-radius: 12px; padding: 34px 16px; cursor: pointer; background: var(--tint-hover); color: var(--muted); font-size: 13px; }
.dropzone b { color: var(--ink); font-size: 15px; }
.dropzone.over, .dropzone:hover { border-color: var(--brand); background: var(--tint); }
.dz-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--tint); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.dz-icon svg { width: 26px; height: 26px; }
.samples { display: grid; gap: 8px; }
.sample-card { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left; background: #fff; border: 1.5px solid #e5e8ee; border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.sample-card:hover { border-color: var(--brand); background: var(--tint-hover); }
.sample-card b { font-size: 13.5px; }
.sample-card span { grid-column: 1; font-size: 12px; color: var(--muted); }
.sample-card em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; font-size: 11px; background: var(--tint); color: var(--brand-dark); padding: 3px 8px; border-radius: 999px; }
.dprev-title { margin: 0 0 8px; font-size: 14px; }
.dprev-meta { font-size: 12.5px; margin-bottom: 6px; }
.dprev-wrap { overflow: auto; max-height: 300px; border: 1px solid var(--line); border-radius: 8px; }
.dprev { border-collapse: collapse; font-size: 12px; width: 100%; }
.dprev th { position: sticky; top: 0; background: #f5f7fa; text-align: left; padding: 6px 8px; white-space: nowrap; border-bottom: 1px solid var(--line); font-weight: 600; }
.dprev td { padding: 5px 8px; border-bottom: 1px solid #f0f2f5; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.dprev td.num { text-align: right; font-variant-numeric: tabular-nums; color: #1d5f8a; }
.ttag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; margin-right: 5px; vertical-align: 1px; }
.ttag.num { background: #e3f0f8; color: #1d5f8a; }
.ttag.txt { background: #eeeeee; color: #555; }
.ttag.date { background: var(--ok-tint); color: var(--ok); }
.dprev-empty { border: 1px dashed #cfd6e0; border-radius: 10px; padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.5; }
.dprev-empty b { color: var(--ink); }
@media (max-width: 1000px) {
  .sources { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .editor.adddata { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .sources { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome { padding: 14px 40px 14px 14px; }
  .welcome h2 { font-size: 17px; }
  .welcome-art { display: none; }
}
@media (max-width: 1000px) {
  .studio, .editor.adddata, .editor.design { grid-template-columns: minmax(0, 1fr); }
}
#pastebox { font-family: "Roboto Mono", Consolas, monospace; font-size: 12.5px; line-height: 1.5; }

/* Logo red-orange accents */
#pubbtn, .btn.accent { background: var(--accent); }
#pubbtn:hover, .btn.accent:hover { background: var(--accent-dark); }
.welcome { border-left: 4px solid var(--accent); border-radius: 0 14px 14px 0; }
.stepper-title { border-left: 3px solid var(--accent); padding-left: 8px; border-radius: 0; }
.source.active::after, .gcard.active::after { background: var(--brand); }

/* ============ Redesign stage 2: dashboard ============ */
.dash-top { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.dash-top h2 { margin: 0; font-size: 26px; color: var(--brand); }
.dash-top p { margin: 2px 0 0; }
.dash-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tpl-section { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 16px; margin-bottom: 22px; border-top: 3px solid var(--accent); }
.tpl-section h3 { margin: 0 0 10px; font-size: 16px; }
.tpl-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(138px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.tpl { display: flex; flex-direction: column; text-align: left; background: #fff; border: 1.5px solid #e5e8ee; border-radius: 12px; padding: 6px 6px 9px; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; }
.tpl:hover { border-color: var(--tint-border); box-shadow: 0 3px 12px rgba(0,74,173,.10); transform: translateY(-1px); }
.tpl-img { display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 2; background: #fff; border-radius: 8px; overflow: hidden; }
.tpl-img img { width: 100%; height: 100%; object-fit: contain; }
.tpl[data-tpl="blank"] .tpl-img { background: var(--tint-hover); border: 1.5px dashed var(--tint-border); }
.tpl-plus { font-size: 30px; color: var(--brand); }
.tpl-name { font-size: 13px; font-weight: 600; margin: 6px 3px 0; }
.tpl-desc { font-size: 11px; color: var(--muted); margin: 1px 3px 0; line-height: 1.3; }
.dash-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.folder-pills { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.fpill { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13px; }
.fpill:hover { border-color: var(--tint-border); }
.fpill.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.dsearch { width: 240px; max-width: 100%; padding: 8px 12px; border: 1px solid #cfcfcf; border-radius: 999px; background: #fff; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.ccard { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; transition: box-shadow .12s, transform .12s, border-color .12s; display: flex; flex-direction: column; }
.ccard:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-2px); border-color: var(--tint-border); }
.cthumb { position: relative; height: 150px; background: #fff; border-bottom: 1px solid #f0f2f5; overflow: hidden; }
.cthumb-inner { position: absolute; left: 50%; top: 50%; transform-origin: center center; pointer-events: none; }
.cthumb .dp-chart { padding: 6px; }
.cthumb:not([data-type="table"]) svg text, .cthumb .dp-legend, .cthumb .dp-footer, .cthumb .dp-panel-title, .cthumb .dp-map-nodata,
.cthumb .dp-map figure > div, .cthumb .dp-map-legend, .cthumb svg[class*="-ramp"], .cthumb .dp-anno, .cthumb .dp-empty { display: none !important; }
.cbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.cbody h3 { margin: 0; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cbody .meta { font-size: 12px; color: var(--muted); }
.crow { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.cact { display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.ccard:hover .cact, .ccard:focus-within .cact { opacity: 1; }
.iconbtn { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; color: #444; }
.iconbtn:hover { background: var(--tint-hover); border-color: var(--tint-border); }
.iconbtn.del:hover { background: #fdecec; border-color: #e3b4b4; color: #c62828; }
.tpl-note { background: #fdf0eb; border: 1px solid #f3cbbd; border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; padding: 12px 14px; margin-bottom: 16px; font-size: 13.5px; color: #5a2a1a; }
@media (hover: none) { .cact { opacity: 1; } }
@media (max-width: 600px) {
  .dash-actions { margin-left: 0; }
  .cgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cthumb { height: 110px; }
  .dsearch { width: 100%; }
}
.cthumb-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; background: repeating-linear-gradient(135deg, #fafbfd 0 10px, #f3f5f9 10px 20px); }

/* ============ Ordered Design sections ============ */
.acc-head { justify-content: flex-start; }
.acc-num { width: 24px; height: 24px; border-radius: 50%; background: var(--tint); color: var(--brand); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.acc.open .acc-num { background: var(--brand); color: #fff; }
.acc-text { flex: 1; }
h4.sub { margin: 16px 0 4px; font-size: 13.5px; }
.hint.tip { background: var(--tint-hover); border-left: 3px solid var(--brand); padding: 6px 9px; border-radius: 0; }
.swatch-row { display: flex; gap: 3px; margin: 8px 0 2px; }
.swatch-row span { flex: 1; height: 10px; border-radius: 2px; }
.anno-item.sel { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(0,74,173,.15); }

/* ============ Note toolbar on the chart ============ */
.preview-wrap { position: sticky; }
.anno-toolbar { position: absolute; z-index: 40; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; max-width: 560px; background: #fff; border: 1px solid #d5dbe5; border-radius: 12px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.atg { display: flex; gap: 2px; align-items: center; padding: 0 4px; border-right: 1px solid #eef0f4; }
.atg:last-child { border-right: 0; }
.anno-toolbar button { min-width: 28px; height: 28px; border: 1px solid transparent; background: none; border-radius: 7px; cursor: pointer; font-size: 12.5px; color: #333; padding: 0 6px; }
.anno-toolbar button:hover { background: var(--tint-hover); }
.anno-toolbar button.on { background: var(--tint); border-color: var(--tint-border); color: var(--brand); }
.anno-toolbar button.danger:hover { background: #fdecec; }
.anno-toolbar .sw { min-width: 20px; width: 20px; height: 20px; padding: 0; border-radius: 50%; background: var(--c); border: 1px solid #c9ced6; }
.anno-toolbar .sw.on { outline: 2px solid var(--brand); outline-offset: 1px; }
.anno-toolbar input[type=color] { width: 24px; height: 24px; border: 1px solid #ccc; border-radius: 6px; padding: 0; background: none; }
.anno-toolbar select { height: 28px; border: 1px solid #d5dbe5; border-radius: 7px; font-size: 12px; padding: 0 4px; background: #fff; }
.atl { font-size: 11px; color: var(--muted); margin-right: 2px; }
.pbsep { width: 1px; height: 18px; background: #ddd; }
.eye-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.eye { display: flex; align-items: center; gap: 8px; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #f0f2f5; padding: 7px 10px; cursor: pointer; font-size: 13px; }
.eye:last-child { border-bottom: 0; }
.eye span { color: var(--brand); width: 14px; }
.eye.off { color: #9aa1ab; text-decoration: line-through; }
.eye.off span { color: #b5bbc4; }
.eye:hover { background: var(--tint-hover); }
.at-pin { flex-basis: 100%; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 5px 4px 1px; border-top: 1px solid #eef0f4; font-size: 12px; color: var(--muted); }
.at-pin b { color: var(--text, #1d1d1d); }
.at-pin button { width: auto !important; padding: 0 8px; }
.at-pin .atl.warn { color: var(--accent); }
.at-more { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 6px 4px 2px; border-top: 1px solid #eef0f4; margin-top: 2px; font-size: 12px; color: var(--muted); }
.at-more label { display: inline-flex; align-items: center; gap: 4px; }
