/* ============================================================
   md2wechat editor — shell styles
   ============================================================ */

:root {
  --bg: #faf9f5;
  --bg-soft: #f8f6f1;
  --panel: #ffffff;
  --cream: #f0eee6;
  --cream-2: #f3efe7;
  --border: #e8e6dc;
  --border-soft: #f0eee6;
  --ink: #30302e;
  --ink-2: #4d4c48;
  --ink-3: #6f6d66;
  --muted: #9a988f;
  --muted-2: #b0aea5;
  --brand: #c86442;
  --brand-deep: #b55a3c;
  --brand-ink: #a94f30;
  --brand-soft: #f7ece7;
  --blue: #4f7cff;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular,
    Menlo, Consolas, "Courier New", monospace;
  --radius: 12px;
  --shadow-card: 0 1px 2px rgba(48, 48, 46, 0.04), 0 8px 24px -18px rgba(48, 48, 46, 0.35);
  --shadow-pop: 0 18px 48px -12px rgba(48, 48, 46, 0.28), 0 2px 8px rgba(48, 48, 46, 0.08);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ico {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #dcd9cd;
  border: 2px solid transparent;
  border-radius: 99px;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #c7c3b4; background-clip: content-box; }

/* ---------- App frame ---------- */

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ---------- Topbar ---------- */

.topbar {
  flex: 0 0 auto;
  height: 66px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px 0 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: relative;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(150deg, #d4754f 0%, #c86442 52%, #b55a3c 100%);
  box-shadow: 0 1px 2px rgba(169, 79, 48, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  flex: 0 0 auto;
}
.brand-mark svg { width: 22px; height: 22px; display: block; }

.brand-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand-name {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--ink);
}
.brand-desc {
  font-size: 11.5px;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 460px;
}

.topnav { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

.btn-api {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: 7px;
  background: linear-gradient(180deg, #c05a37, #b5502f);
  color: #fff;
  font-size: 12.5px;
  font-weight: 550;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(140, 62, 34, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: filter 0.15s ease, transform 0.15s ease;
}
.btn-api:hover { filter: brightness(1.06); }
.btn-api:active { transform: translateY(0.5px); }
.btn-api .ico { width: 14px; height: 14px; }

.navlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 12.5px;
  transition: background 0.15s ease, color 0.15s ease;
}
.navlink:hover { background: var(--cream); color: var(--ink); }
.navlink .ico { width: 14px; height: 14px; color: var(--muted); }

.topactions { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: 0 0 auto; }

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--cream); color: var(--ink); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm .ico { width: 15px; height: 15px; }

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  margin-left: 8px;
  border-radius: 7px;
  background: linear-gradient(180deg, #c05a37, #b5502f);
  color: #fff;
  font-size: 12.5px;
  font-weight: 550;
  box-shadow: 0 1px 2px rgba(140, 62, 34, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: filter 0.15s ease, transform 0.15s ease;
}
.btn-copy:hover { filter: brightness(1.06); }
.btn-copy:active { transform: translateY(0.5px); }
.btn-copy .ico { width: 14px; height: 14px; }
.btn-copy.is-done { background: linear-gradient(180deg, #5c8a6a, #4d7a5b); }

/* ---------- Workspace ---------- */

.workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 14px 16px 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ---------- Editor ---------- */

.panel-editor { background: #fdfdfb; }

.editor-scroll { position: relative; flex: 1 1 auto; min-height: 0; display: block; }

.editor-inner { position: absolute; inset: 0; }

#source, .hl-layer {
  margin: 0;
  border: 0;
  padding: 20px 22px 64px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.95;
  letter-spacing: 0.006em;
  tab-size: 2;
}

.hl-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: #4a4842;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  pointer-events: none;
  background: transparent;
}

#source {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  resize: none;
  background: transparent;
  color: transparent;
  caret-color: #2f2e2b;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  overflow-y: auto;
  outline: none;
  z-index: 2;
}
.hl-inner { will-change: transform; }
#source::selection { background: rgba(200, 100, 66, 0.18); }
#source::placeholder { color: #b8b5aa; }
button:focus { outline: none; }
button:focus-visible,
a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
#source::-webkit-scrollbar-thumb { background: #e0ddd2; background-clip: content-box; }

/* token colors */
.tok-h { color: var(--brand-deep); font-weight: 700; }
.tok-h6 { color: #8a6a58; font-weight: 600; }
.tok-quote { color: #a8a49a; font-style: italic; }
.tok-marker { color: var(--blue); font-weight: 600; }
.tok-bullet { color: #b6b3a8; }
.tok-code { color: #a9552f; background: rgba(200, 100, 66, 0.08); border-radius: 3px; }
.tok-link { color: #4a6fa5; text-decoration: underline; text-decoration-color: rgba(74, 111, 165, 0.35); }
.tok-url { color: #8d8880; }
.tok-img { color: #7a6f62; }
.tok-module { color: #8b6a9c; font-weight: 600; }
.tok-key { color: #6a7f5a; }
.tok-strong { color: #24231f; font-weight: 700; }
.tok-em { color: #5c5a53; font-style: italic; }
.tok-fence { color: #b3afa4; }
.tok-hr { color: #b3aea0; }

.editor-meta {
  flex: 0 0 auto;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-top: 1px solid var(--border-soft);
  background: #fbfaf6;
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.02em;
  font-family: var(--mono);
}
.save-state { transition: color 0.2s ease; }
.save-state.is-saving { color: var(--brand); }

.trash-btn {
  position: absolute;
  right: 16px;
  bottom: 44px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #8d8a80;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(48, 48, 46, 0.06);
  z-index: 5;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.trash-btn:hover { color: var(--brand); border-color: #e2cfc6; background: #fffaf7; }
.trash-btn .ico { width: 15px; height: 15px; }

/* ---------- Preview ---------- */

.preview-bar {
  flex: 0 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-soft);
  background: #fff;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--cream-2);
}
.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 29px;
  padding: 0 13px;
  border-radius: 7px;
  font-size: 12.5px;
  color: #6f6d66;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.segmented button .ico { width: 14px; height: 14px; }
.segmented button:hover { color: var(--ink); }
.segmented button.active {
  background: #fff;
  color: var(--ink);
  font-weight: 550;
  box-shadow: 0 1px 2px rgba(48, 48, 46, 0.1), 0 0 0 1px rgba(48, 48, 46, 0.05);
}

.preview-tools { display: flex; align-items: center; gap: 8px; }

.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 11px;
  color: var(--ink-3);
  background: var(--cream);
  cursor: pointer;
  transition: background 0.15s ease;
}
.theme-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--theme-dot, var(--brand));
}
.theme-chip:hover { background: var(--cream-2); }

.preview-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: #fcfbf8;
}

.device {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #eae7dc;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(48, 48, 46, 0.04), 0 14px 34px -22px rgba(48, 48, 46, 0.4);
  overflow: hidden;
  transition: max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.device.desktop { max-width: 100%; }

/* ---------- Footer ---------- */

.footer {
  flex: 0 0 auto;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.footer-right { display: flex; align-items: center; gap: 2px; }
.footer .icon-btn { color: #8b8981; }

.feedback-btn {
  width: 34px;
  height: 34px;
  margin-left: 6px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(150deg, #cf6a45, #b5502f);
  box-shadow: 0 3px 8px -2px rgba(169, 79, 48, 0.5);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.feedback-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.feedback-btn .ico { width: 16px; height: 16px; }

/* ---------- Mobile tabs ---------- */

.mobile-tabs {
  display: none;
  flex: 0 0 auto;
  gap: 8px;
  padding: 10px 16px 0;
}
.mobile-tabs button {
  flex: 1;
  height: 34px;
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink-3);
  font-size: 13px;
}
.mobile-tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-card); }

/* ---------- Menu popover ---------- */

.menu-pop {
  position: fixed;
  z-index: 60;
  min-width: 216px;
  padding: 6px;
  border-radius: 11px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  animation: pop 0.14s ease-out;
}
.menu-pop[hidden] { display: none; }
.menu-pop button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
  text-align: left;
}
.menu-pop button:hover { background: var(--cream); color: var(--ink); }
.menu-pop button .ico { width: 14px; height: 14px; color: var(--muted); }
.menu-pop .kbd {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
}
.menu-sep { height: 1px; margin: 5px 4px; background: var(--border-soft); }

@keyframes pop {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ---------- Modal ---------- */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal-root[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(43, 42, 39, 0.34);
  backdrop-filter: blur(3px);
  animation: fade 0.18s ease-out;
}

.modal {
  position: relative;
  width: min(760px, 100%);
  max-height: min(88vh, 860px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(232, 230, 220, 0.9);
  box-shadow: 0 32px 80px -24px rgba(30, 29, 27, 0.45);
  overflow: hidden;
  animation: rise 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.modal-head h2 { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.modal-head p { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.5; }

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 20px 24px 24px;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* ---------- Modal buttons ---------- */

.btn-ghost,
.btn-danger {
  height: 34px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 550;
  transition: background 0.15s ease, filter 0.15s ease;
}
.btn-ghost { background: var(--cream); color: var(--ink-2); }
.btn-ghost:hover { background: var(--cream-2); }
.btn-danger { background: linear-gradient(180deg, #c05a37, #b5502f); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }

/* ---------- Theme gallery ---------- */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 12px;
}

.theme-card {
  text-align: left;
  padding: 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: #fdfcf9;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.theme-card:hover { border-color: #ddd7c7; box-shadow: 0 10px 24px -18px rgba(48, 48, 46, 0.5); transform: translateY(-1px); }
.theme-card.active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset, 0 8px 20px -16px rgba(169, 79, 48, 0.6); }

.theme-preview {
  height: 92px;
  border-radius: 8px;
  padding: 10px 11px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #f0eee6;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tp-banner {
  border-radius: 4px;
  padding: 7px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.tp-line { height: 4px; border-radius: 99px; background: #ece9e0; }
.tp-line.w1 { width: 92%; }
.tp-line.w2 { width: 74%; }
.tp-line.acc { background: currentColor; opacity: 0.75; width: 56%; height: 5px; }

.theme-card .theme-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 600;
}
.theme-card .theme-name .dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--tc, var(--brand));
}
.theme-card .theme-desc { margin-top: 3px; font-size: 11px; color: var(--muted); line-height: 1.45; }

/* ---------- Settings ---------- */

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border-soft);
}
.setting-row:last-child { border-bottom: 0; }
.setting-label { font-size: 13px; font-weight: 550; }
.setting-hint { margin-top: 3px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.setting-control { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

.range-wrap { display: flex; align-items: center; gap: 10px; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 132px;
  height: 4px;
  border-radius: 99px;
  background: var(--cream);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand);
  box-shadow: 0 1px 3px rgba(48, 48, 46, 0.2);
  cursor: pointer;
}
.range-value { width: 38px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); text-align: right; }

.choice {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 8px;
  background: var(--cream-2);
}
.choice button {
  height: 27px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-3);
}
.choice button.active { background: #fff; color: var(--ink); font-weight: 550; box-shadow: 0 1px 2px rgba(48, 48, 46, 0.12); }

.switch {
  width: 40px;
  height: 23px;
  border-radius: 99px;
  background: #ddd9cd;
  position: relative;
  transition: background 0.18s ease;
  flex: 0 0 auto;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(48, 48, 46, 0.25);
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(17px); }

/* ---------- History ---------- */

.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fdfcf9;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.history-item:hover { border-color: #ddd7c7; background: #fff; }
.history-time { font-family: var(--mono); font-size: 11px; color: var(--brand); flex: 0 0 auto; }
.history-preview {
  flex: 1;
  font-size: 12px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-meta { font-size: 11px; color: var(--muted-2); flex: 0 0 auto; }
.empty-state { padding: 36px 0; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ---------- Shortcuts ---------- */

.kbd-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.kbd-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--ink-2); }
.kbd-item kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  color: var(--ink-3);
  white-space: nowrap;
}

/* ---------- Contact ---------- */

.contact-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: #fdfcf9;
  margin-bottom: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.contact-card:hover { border-color: #e2cfc6; background: #fffaf7; }
.contact-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-deep);
  flex: 0 0 auto;
}
.contact-ico .ico { width: 17px; height: 17px; }
.contact-title { font-size: 13px; font-weight: 600; }
.contact-desc { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.contact-arrow { margin-left: auto; color: var(--muted-2); }
.contact-arrow .ico { width: 16px; height: 16px; }

/* ---------- Toast ---------- */

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 74px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 99px;
  background: rgba(43, 42, 39, 0.94);
  color: #f7f5ef;
  font-size: 12.5px;
  box-shadow: 0 12px 28px -14px rgba(0, 0, 0, 0.7);
  animation: toastIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.toast.leaving { animation: toastOut 0.18s ease-in forwards; }
.toast .ico { width: 14px; height: 14px; color: #8fd0a8; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .brand-desc { max-width: 460px; }
}

@media (max-width: 1040px) {
  .brand-desc { display: none; }
  .navlink { padding: 0 8px; }
}

@media (max-width: 900px) {
  .topbar { height: 60px; gap: 10px; padding: 0 12px; }
  .topnav { display: none; }
  .mobile-tabs { display: flex; }
  .workspace { grid-template-columns: 1fr; padding: 10px 12px 12px; gap: 10px; }
  .panel-preview { display: none; }
  .workspace.show-preview .panel-editor { display: none; }
  .workspace.show-preview .panel-preview { display: flex; }
  .footer { height: 42px; padding: 0 12px; }
  .device, .device.desktop { max-width: 100%; }
  .hl-layer, #source { padding: 16px 16px 56px; font-size: 12.5px; }
}
