:root {
  --accent: #0e7c86;
  --accent-strong: #0a646c;
  --accent-soft: #e3f1f2;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --side: #ffffff;
  --text: #1c2326;
  --muted: #5f6b70;
  --border: #dde3e5;
  --user-bg: #0e7c86;
  --user-text: #ffffff;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #1d7a43;
  --ok-soft: #e7f5ec;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --radius: 14px;
  --side-w: 248px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- layout: sidebar + app ---------- */
.shell { display: flex; height: 100dvh; }
.app { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.sidebar {
  flex: none;
  width: var(--side-w);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px 16px;
  background: var(--side);
  border-right: 1px solid var(--border);
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.side-brand img { border-radius: 9px; flex: none; }
.side-brand div { display: flex; flex-direction: column; line-height: 1.25; }
.side-brand strong { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.side-brand span { font-size: 12.5px; color: var(--muted); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 550;
  transition: background .15s, color .15s;
}
.side-nav a:hover, .side-btn:hover { background: var(--bg); }
.side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
.side-nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.side-nav svg, .side-btn svg, .icon-btn svg {
  width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.dot { width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side-btn { width: 100%; border: 1px solid var(--border); background: var(--surface); }
.side-note { margin: 0; padding: 0 6px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.whoami {
  align-self: flex-start;
  font-size: 12.5px;
  color: var(--text);
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(10, 20, 30, .35); animation: fade .2s ease; }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 56px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { margin: 0 0 0 4px; font-size: 16.5px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; transition: background .15s, transform .15s; }
.icon-btn:hover { background: var(--accent-soft); }
.back-btn { animation: slide-in-left .25s var(--ease); }
.back-btn:hover svg { transform: translateX(-2px); }
.back-btn svg { transition: transform .15s; }
.menu-btn { display: none; }

.ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  font-weight: 550;
}
.ghost:hover { background: var(--accent-soft); border-color: var(--accent); }

/* ---------- conversation ---------- */
.scroller { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.log {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg .avatar {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  margin-top: 2px;
}
.msg .body { min-width: 0; overflow-wrap: anywhere; }
.msg.assistant .body { padding-top: 3px; }
.msg.user { justify-content: flex-end; }
.msg.user .body {
  max-width: 80%;
  padding: 9px 14px;
  border-radius: var(--radius) var(--radius) 4px var(--radius);
  background: var(--user-bg);
  color: var(--user-text);
  white-space: pre-wrap;
}
.body p { margin: 0 0 8px; }
.body p:last-child, .body ul:last-child, .body ol:last-child { margin-bottom: 0; }
.body ul, .body ol { margin: 0 0 8px; padding-inline-start: 22px; }
.body li { margin: 3px 0; }
.body li::marker { color: var(--accent); }
.body strong { font-weight: 650; }
.body code {
  font: 13px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--accent-soft);
}

.status { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite both; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.error .body {
  color: var(--danger);
  background: var(--danger-soft);
  padding: 9px 14px;
  border-radius: var(--radius);
}

/* ---------- confirm card ---------- */
.card {
  margin-top: 10px;
  max-width: 420px;
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--accent);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 650; }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 10px; font-size: 14px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.card .note { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }
.card .buttons { display: flex; gap: 8px; }
.card button { padding: 8px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.card .primary { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.card .primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
.card .secondary { border: 1px solid var(--border); background: transparent; }
.card .secondary:hover:not(:disabled) { background: var(--accent-soft); }
.card button:disabled { opacity: .5; }
.card.wide { max-width: 560px; }

/* Draft scorecard tree inside the Create card */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree {
  max-height: 340px;
  overflow-y: auto;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font-size: 13.5px;
}
.tree ul { padding-inline-start: 16px; border-inline-start: 1px solid var(--border); margin-inline-start: 4px; }
.tree li { padding: 3px 0 3px 8px; }
.tree .persp > .label { font-weight: 650; color: var(--accent-strong); }
.tree .obj > .label { font-weight: 550; }
.tree .kpi { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.tree .kpi .label { color: var(--text); }
.tree .type {
  flex: none;
  font-size: 11px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  align-self: center;
}
.card.done { border-inline-start-color: var(--border); }

/* ---------- composer ---------- */
.composer {
  padding: 8px 16px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg) 30%);
}
.box {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea {
  flex: 1;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  max-height: 180px;
  padding: 6px 0;
}
textarea::placeholder { color: var(--muted); }
.send {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  transition: background .15s, opacity .15s;
}
.send:hover:not(:disabled) { background: var(--accent-strong); }
.send:disabled { opacity: .35; }
.send svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hint { max-width: 780px; margin: 6px auto 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- pages ---------- */
.view { width: min(1120px, 100%); margin: 0 auto; padding: 40px 24px 40px; }
.enter { animation: rise .32s var(--ease); }
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-strong); }
.headline { margin: 0 0 6px; font-size: clamp(26px, 3.6vw, 36px); line-height: 1.15; font-weight: 750; letter-spacing: -.02em; }
.subline { margin: 0 0 30px; font-size: 16.5px; color: var(--muted); }

/* ---------- option cards ---------- */
.options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.templates { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.option {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.option:not(:disabled):hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.option:disabled { cursor: default; }
.option:disabled .art, .option:disabled .option-text { opacity: .55; }
.art { display: grid; place-items: center; height: 140px; transition: height .3s var(--ease); }
.art svg { width: 74px; height: 74px; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: width .3s var(--ease), height .3s var(--ease); }
.option-text { display: flex; flex-direction: column; gap: 4px; padding: 18px 16px 22px; }
.option-text strong { font-size: 16px; }
.option-text span { font-size: 14px; color: var(--muted); line-height: 1.45; }
.badge {
  position: absolute; top: 10px; right: 10px; padding: 1px 9px; border-radius: 999px;
  font: 600 11px/1.6 var(--font); font-style: normal; background: var(--surface); color: var(--muted); border: 1px solid var(--border);
}

/* Templates turn into compact tabs once one is chosen; its settings open below. */
.dash-intro { transition: opacity .2s; }
#dashView.picking .dash-intro { display: none; }
#dashView.picking .templates { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
#dashView.picking .option { flex-direction: row; align-items: center; text-align: left; border-radius: 12px; box-shadow: none; }
#dashView.picking .option:not(:disabled):hover { transform: none; border-color: var(--accent); }
#dashView.picking .art { width: 52px; height: 52px; margin: 8px 0 8px 8px; border-radius: 9px; flex: none; }
#dashView.picking .art svg { width: 30px; height: 30px; }
#dashView.picking .option-text { padding: 8px 12px; gap: 0; min-width: 0; }
#dashView.picking .option-text strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dashView.picking .option-text span { display: none; }
#dashView.picking .badge { position: static; margin: 0 10px 0 auto; flex: none; }
#dashView.picking .option.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
#dashView.picking .option.active .option-text strong { color: var(--accent-strong); }

/* ---------- builder ---------- */
.builder {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.builder-head { padding: 20px 24px 6px; }
.builder-head h3 { margin: 0 0 2px; font-size: 19px; letter-spacing: -.01em; }
.builder-head p { margin: 0; font-size: 14px; color: var(--muted); }
.step { display: flex; gap: 14px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.step:last-of-type { border-bottom: 0; }
.step-n {
  flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-strong); font-size: 13.5px; font-weight: 700;
}
.step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.step-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.step-label { font-size: 14.5px; font-weight: 650; color: var(--text); line-height: 28px; }
.builder.busy .step { opacity: .55; pointer-events: none; transition: opacity .2s; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search-box:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box > svg { position: absolute; left: 12px; width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; pointer-events: none; }
.search-box input {
  flex: 1; min-width: 0; padding: 10px 40px 10px 38px; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 14.5px; color: var(--text);
}
.search-box input:disabled { cursor: not-allowed; }
.search-box input::placeholder { color: var(--muted); }
.clear-btn {
  position: absolute; right: 6px; width: 28px; height: 28px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); animation: pop .15s ease;
}
.clear-btn:hover { background: var(--border); color: var(--text); }
.clear-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px);
  max-height: 280px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg);
  animation: drop .16s var(--ease);
}
.combo-list li { padding: 8px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.combo-list li:hover, .combo-list li.active { background: var(--accent-soft); color: var(--accent-strong); }
.combo-list li.none { color: var(--muted); cursor: default; background: none; }

.check { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }
.pick-list { border: 1px solid var(--border); border-radius: 10px; max-height: 320px; overflow-y: auto; }
.pick-list .group { position: sticky; top: 0; padding: 6px 12px; font-size: 12px; font-weight: 650; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--border); }
.pick-list label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 14px; cursor: pointer; transition: background .12s; }
.pick-list label:last-child { border-bottom: 0; }
.pick-list label:hover { background: var(--accent-soft); }
.pick-list label:has(input:checked) { background: #f0f8f8; }
.pick-list input { flex: none; width: 16px; height: 16px; accent-color: var(--accent); }
.muted { margin: 0; padding: 14px; color: var(--muted); font-size: 14px; }
.muted.loading { display: flex; align-items: center; gap: 10px; }
.muted.loading::before {
  content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.muted-text { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

.brand-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg); font-size: 14px;
}
.brand-row img { max-height: 32px; max-width: 110px; object-fit: contain; }
#brandSummary { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 5px; border: 1px solid var(--border); }
.link { margin-left: auto; color: var(--accent-strong); font-weight: 600; text-decoration: none; font-size: 13.5px; }
.link:hover { text-decoration: underline; }
.upload-btn {
  position: relative; margin-left: auto; display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px;
  border: 1px solid var(--accent); border-radius: 9px; background: var(--surface); color: var(--accent-strong);
  font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s;
}
.upload-btn:hover { background: var(--accent-soft); }
.upload-btn:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }
.upload-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.step-hint { margin: -2px 0 0; font-size: 13px; color: var(--muted); }
.link-inline { color: var(--accent-strong); font-weight: 600; text-decoration: none; }
.link-inline:hover { text-decoration: underline; }
.link-btn { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--danger); font-size: 13px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 550; }
.field select, .field input:not([type=file]) {
  font: inherit; font-size: 14.5px; font-weight: 400; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.field select:focus, .field input:not([type=file]):focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }

.pick-progress { list-style: none; margin: 0 24px 14px; padding: 0; border: 1px solid var(--border); border-radius: 10px; max-height: 240px; overflow-y: auto; }
.pick-progress li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 14px; animation: rise .25s var(--ease) both; }
.pick-progress li:last-child { border-bottom: 0; }
.pick-progress span:last-child { flex: none; font-weight: 600; }
.pick-progress .ok { color: var(--ok); }
.pick-progress .ok::before { content: "✓ "; }
.pick-progress .bad { color: var(--danger); }
.pick-progress .wait { color: var(--muted); font-weight: 400; }
.pick-progress .busy { color: var(--accent-strong); }
.pick-note { margin: 0 24px 14px; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 13.5px; color: var(--muted); }
.builder-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; border-top: 1px solid var(--border); background: #fafbfb; font-size: 14px; color: var(--muted);
}
.primary-btn { padding: 10px 22px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 650; transition: background .15s, transform .1s, opacity .15s; }
.primary-btn:hover:not(:disabled) { background: var(--accent-strong); }
.primary-btn:active:not(:disabled) { transform: scale(.97); }
.primary-btn:disabled { opacity: .45; }

/* ---------- settings ---------- */
#settingsView { max-width: 720px; }
.settings-card {
  display: flex; flex-direction: column; gap: 16px; margin-bottom: 18px; padding: 22px 24px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow);
}
.settings-card h3 { margin: 0; font-size: 16px; }
.settings-card .muted-text { margin: -10px 0 0; }
.settings-card .ghost { align-self: flex-start; }
.upload {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 62px; cursor: pointer;
  border: 1px dashed var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 14px; font-weight: 400;
  transition: border-color .15s, background .15s;
}
.upload:hover { border-color: var(--accent); background: var(--accent-soft); }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload img { max-height: 42px; max-width: 140px; object-fit: contain; }
.logo-colors { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.logo-colors i { display: inline-block; width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--border); }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 50; left: 50%; bottom: 28px;
  display: flex; align-items: center; gap: 10px; max-width: min(460px, calc(100vw - 32px));
  padding: 11px 18px 11px 14px; border-radius: 12px; background: #17322f; color: #fff; font-size: 14px; font-weight: 550;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
  opacity: 0; pointer-events: none; transform: translate(-50%, 16px) scale(.97);
  transition: opacity .25s ease, transform .35s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast svg { width: 22px; height: 22px; flex: none; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.toast svg circle { fill: #2fb37a; stroke: none; transform-origin: center; }
.toast svg path { stroke: #fff; stroke-dasharray: 16; stroke-dashoffset: 16; }
.toast.show svg circle { animation: pop .35s var(--ease); }
.toast.show svg path { animation: draw .35s .15s ease forwards; }
.toast.bad { background: #4a1d19; }
.toast.bad svg circle { fill: #e5534b; }
.toast.bad svg path { d: path("M8.5 8.5l7 7M15.5 8.5l-7 7"); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes slide-in-left { from { opacity: 0; transform: translateX(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .toast svg path { stroke-dashoffset: 0; }
}

/* ---------- smaller screens ---------- */
@media (max-width: 1000px) {
  .options, .templates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #dashView.picking .templates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .menu-btn { display: grid; }
  .sidebar {
    position: fixed; z-index: 40; top: 0; bottom: 0; left: 0;
    transform: translateX(-100%); transition: transform .28s var(--ease); box-shadow: none;
  }
  body.menu-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
}
@media (max-width: 560px) {
  .view { padding: 24px 16px 32px; }
  .options { gap: 12px; }
  .art { height: 104px; }
  .art svg { width: 54px; height: 54px; }
  .option-text { padding: 14px 10px 16px; }
  .option-text span { font-size: 13px; }
  .step { padding: 16px; gap: 10px; }
  .builder-head { padding: 18px 16px 4px; }
  .builder-foot { padding: 12px 16px; }
  .pick-progress, .pick-note { margin-left: 16px; margin-right: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .msg.user .body { max-width: 88%; }
  #dashView.picking .badge { display: none; }
}

/* Patterned panels, drawn with CSS only (the page's security policy blocks inline images). */
.art-teal { background-color: #bdeaf0; background-image: repeating-linear-gradient(60deg, rgba(255,255,255,.45) 0 1px, transparent 1px 22px), repeating-linear-gradient(-60deg, rgba(255,255,255,.45) 0 1px, transparent 1px 22px); }
.art-teal svg { stroke: #0b8fd8; }
.art-yellow { background-color: #fde9ab; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.5) 0 1px, transparent 1px 18px), repeating-linear-gradient(-45deg, rgba(255,255,255,.5) 0 1px, transparent 1px 18px); }
.art-yellow svg { stroke: #ef8a17; }
.art-pink { background-color: #ffd3d3; background-image: radial-gradient(rgba(255,255,255,.6) 1.5px, transparent 1.6px); background-size: 16px 16px; }
.art-pink svg { stroke: #f0645b; }
.art-green { background-color: #c9f5df; background-image: repeating-radial-gradient(circle at 30% 40%, transparent 0 9px, rgba(56,190,120,.25) 9px 10px); }
.art-green svg { stroke: #1f9d62; }
.art-violet { background-color: #e4dcfb; background-image: linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px); background-size: 20px 20px; }
.art-violet svg { stroke: #6b4fd8; }
.art-orange { background-color: #ffdcc2; background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.5) 0 1px, transparent 1px 16px); }
.art-orange svg { stroke: #e8622a; }
