/* PDB2Vector — styled after bioicons.com (Tailwind emerald + Inter) */
:root {
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-200: #a7f3d0;
  --emerald-500: #10b981;
  --emerald-600: #0e9f6e;
  --emerald-700: #046c4e;
  --emerald-900: #03543f;
  --hero-ink: #f3faf7;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f9fafb;
  --radius: 12px;
  --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #fff; }
[hidden] { display: none !important; }
a { color: var(--emerald-600); }

/* ---- Hero: same layout as bioicons.com (components/AppHeader.vue) --------- */
html { font-family: 'Inter', sans-serif; }
@supports (font-variation-settings: normal) { html { font-family: 'Inter var', sans-serif; } }
/* fixed green band + curve behind the page on wide screens (pages/index.vue) */
@media (min-width: 1072px) {
  html {
    background-attachment: fixed, fixed;
    background-image: url("data:image/svg+xml,%3Csvg fill='rgba(16, 185, 129,50)' viewBox='0 0 1 1' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1' height='1' /%3E%3C/svg%3E"),
      url("data:image/svg+xml,%3Csvg fill='rgba(16, 185, 129,50)' viewBox='0 0 32 1' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 1C4 1 0 0 0 0H32C32 0 28 1 16 1Z' /%3E%3C/svg%3E");
    background-repeat: repeat-x, no-repeat;
    background-size: 112px, 100%;
    background-position: 0 0, 0 112px;
  }
  body { background: transparent; }
}
.bi-hero-wrap { position: relative; word-spacing: 1px; line-height: 1.5; } /* as bioicons.com's html/preflight */
.bi-gh { display: none; position: absolute; left: 0; top: 0; padding: 16px; z-index: 5; }
@media (min-width: 1072px) { .bi-gh { display: block; } }
.bi-gh br { line-height: 22px; }
.bi-header { padding: 0 16px; display: flex; justify-content: center; background: #10b981; color: #f3faf7; }
@media (min-width: 1072px) { .bi-header { padding: 0 24px; } }
.bi-inner { width: 100%; max-width: 1280px; }
.bi-h16 { height: 4rem; }
.bi-h2 { height: .5rem; }
.bi-h8 { height: 2rem; }
.bi-h4 { height: 1rem; }
.bi-overlap { height: 6rem; } /* --search-bar-negative-margin: the card below overlaps this */
.bi-mt4 { margin-top: 1rem; }
.bi-row { display: flex; flex-direction: row; justify-content: center; }
.bi-logo { height: 5rem; max-width: 100%; display: block; }
.bi-meta { margin: 0; text-align: center; font-weight: 500; font-size: 1.25rem; line-height: 1.75rem; color: #f3faf7; }
.bi-meta-items { display: flex; flex-wrap: wrap; justify-content: center; font-size: 1rem; line-height: 1.5rem; }
.bi-meta-items > * + * { margin-left: 1rem; }
.bi-meta-item { display: flex; align-items: center; }
.bi-meta-item > * + * { margin-left: .5rem; }
.bi-meta-icon { width: 1.25rem; height: 1.25rem; color: #f4f5f7; flex: none; }
.bi-handle { color: inherit; font-weight: 600; text-decoration: none; }
.bi-handle:hover { text-decoration: underline; }
.bi-btns { display: flex; flex-direction: column; width: 100%; }
@media (min-width: 640px) { .bi-btns { flex-direction: row; width: auto; } }
.bi-spacer { width: .75rem; height: .75rem; }
.bi-btn-link { display: block; text-decoration: none; }
.bi-btn { padding: 1.25rem; border-radius: .75rem; background-color: rgba(243, 250, 247, .1875); color: #f3faf7; }
.bi-btn:hover { background-color: #fff; color: #252f3f; }
.bi-btn-label { margin: 0; text-align: center; font-weight: 500; font-size: 1.125rem; line-height: 1; }
@media (min-width: 640px) { .bi-btn-label { text-align: left; } }
.bi-btn-inner { vertical-align: top; display: inline-flex; flex-direction: row; align-items: center; }
.bi-gap8 > * + * { margin-left: .5rem; }
.bi-icon { width: 2rem; height: 2rem; }
.bi-title { margin: 2rem 0 0; text-align: center; font-size: 2.25rem; line-height: 2.5rem; font-weight: 600; color: #f4f5f7; }
.bi-curve { position: absolute; left: 0; right: 0; top: 100%; pointer-events: none; color: #10b981; line-height: 0; }
.bi-curve svg { display: block; width: 100%; height: auto; }

/* GitHub/Twitter buttons, verbatim from components/GithubButtons.vue */
.gh-button {
  display: inline-block;
}
.gh-button {
  box-sizing: border-box;
  height: 30px;
  font-weight: bold;
  font-size: 11px;
  line-height: 14px;
  padding: 2px 5px 2px 4px;
  color: #333;
  text-decoration: none;
  text-shadow: 0 1px 0 #fff;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  border-radius: 3px;

  padding: 3px 10px 3px 8px;
  font-size: 16px;
  line-height: 22px;
  border-radius: 4px;
  background-color: #eee;
  background-image: linear-gradient(#fcfcfc, #eee);
  border: 1px solid #d5d5d5;
}

.gh-button:hover,
.gh-button:focus {
  text-decoration: none;
  background-color: #ddd;
  background-image: linear-gradient(#eee, #ddd);
  border-color: #ccc;
}

.gh-button:active {
  background: #dcdcdc;
  border-color: #b5b5b5;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.gh-button-gh span {
  display: inline-block;
  vertical-align: top;
  width: 20px;
  height: 20px;
  margin-right: 4px;
  background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIxMiAxMiA0MCA0MCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAxMiAxMiA0MCA0MCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8cGF0aCBmaWxsPSIjMzMzMzMzIiBkPSJNMzIsMTMuNGMtMTAuNSwwLTE5LDguNS0xOSwxOWMwLDguNCw1LjUsMTUuNSwxMywxOGMxLDAuMiwxLjMtMC40LDEuMy0wLjljMC0wLjUsMC0xLjcsMC0zLjINCgljLTUuMywxLjEtNi40LTIuNi02LjQtMi42QzIwLDQxLjYsMTguOCw0MSwxOC44LDQxYy0xLjctMS4yLDAuMS0xLjEsMC4xLTEuMWMxLjksMC4xLDIuOSwyLDIuOSwyYzEuNywyLjksNC41LDIuMSw1LjUsMS42DQoJYzAuMi0xLjIsMC43LTIuMSwxLjItMi42Yy00LjItMC41LTguNy0yLjEtOC43LTkuNGMwLTIuMSwwLjctMy43LDItNS4xYy0wLjItMC41LTAuOC0yLjQsMC4yLTVjMCwwLDEuNi0wLjUsNS4yLDINCgljMS41LTAuNCwzLjEtMC43LDQuOC0wLjdjMS42LDAsMy4zLDAuMiw0LjcsMC43YzMuNi0yLjQsNS4yLTIsNS4yLTJjMSwyLjYsMC40LDQuNiwwLjIsNWMxLjIsMS4zLDIsMywyLDUuMWMwLDcuMy00LjUsOC45LTguNyw5LjQNCgljMC43LDAuNiwxLjMsMS43LDEuMywzLjVjMCwyLjYsMCw0LjYsMCw1LjJjMCwwLjUsMC40LDEuMSwxLjMsMC45YzcuNS0yLjYsMTMtOS43LDEzLTE4LjFDNTEsMjEuOSw0Mi41LDEzLjQsMzIsMTMuNHoiLz4NCjwvc3ZnPg0K);
  background-size: contain;
}

.gh-button-tweet span {
  display: inline-block;
  vertical-align: top;
  width: 20px;
  height: 20px;
  margin-right: 4px;
  background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDU2LjY5MyA1Ni42OTMiIGhlaWdodD0iNTYuNjkzcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1Ni42OTMgNTYuNjkzIiB3aWR0aD0iNTYuNjkzcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxwYXRoIGQ9Ik0yOC4zNDgsNS4xNTdjLTEzLjYsMC0yNC42MjUsMTEuMDI3LTI0LjYyNSwyNC42MjVjMCwxMy42LDExLjAyNSwyNC42MjMsMjQuNjI1LDI0LjYyM2MxMy42LDAsMjQuNjIzLTExLjAyMywyNC42MjMtMjQuNjIzICBDNTIuOTcxLDE2LjE4NCw0MS45NDcsNS4xNTcsMjguMzQ4LDUuMTU3eiBNNDAuNzUyLDI0LjgxN2MwLjAxMywwLjI2NiwwLjAxOCwwLjUzMywwLjAxOCwwLjgwM2MwLDguMjAxLTYuMjQyLDE3LjY1Ni0xNy42NTYsMTcuNjU2ICBjLTMuNTA0LDAtNi43NjctMS4wMjctOS41MTMtMi43ODdjMC40ODYsMC4wNTcsMC45NzksMC4wODYsMS40OCwwLjA4NmMyLjkwOCwwLDUuNTg0LTAuOTkyLDcuNzA3LTIuNjU2ICBjLTIuNzE1LTAuMDUxLTUuMDA2LTEuODQ2LTUuNzk2LTQuMzExYzAuMzc4LDAuMDc0LDAuNzY3LDAuMTExLDEuMTY3LDAuMTExYzAuNTY2LDAsMS4xMTQtMC4wNzQsMS42MzUtMC4yMTcgIGMtMi44NC0wLjU3LTQuOTc5LTMuMDgtNC45NzktNi4wODRjMC0wLjAyNywwLTAuMDUzLDAuMDAxLTAuMDhjMC44MzYsMC40NjUsMS43OTMsMC43NDQsMi44MTEsMC43NzcgIGMtMS42NjYtMS4xMTUtMi43NjEtMy4wMTItMi43NjEtNS4xNjZjMC0xLjEzNywwLjMwNi0yLjIwNCwwLjg0LTMuMTJjMy4wNjEsMy43NTQsNy42MzQsNi4yMjUsMTIuNzkyLDYuNDgzICBjLTAuMTA2LTAuNDUzLTAuMTYxLTAuOTI4LTAuMTYxLTEuNDE0YzAtMy40MjYsMi43NzgtNi4yMDUsNi4yMDYtNi4yMDVjMS43ODUsMCwzLjM5NywwLjc1NCw0LjUyOSwxLjk1OSAgYzEuNDE0LTAuMjc3LDIuNzQyLTAuNzk1LDMuOTQxLTEuNTA2Yy0wLjQ2NSwxLjQ1LTEuNDQ4LDIuNjY2LTIuNzMsMy40MzNjMS4yNTctMC4xNSwyLjQ1My0wLjQ4NCwzLjU2NS0wLjk3NyAgQzQzLjAxOCwyMi44NDksNDEuOTY1LDIzLjk0Miw0MC43NTIsMjQuODE3eiIvPjwvc3ZnPg==);
  background-size: contain;
  color: blue;
}

/* ---- Sheet / card --------------------------------------------------------- */
.sheet { position: relative; z-index: 2; margin: -6rem auto 0; padding: 0; width: 100%; }
@media (min-width: 640px) { .sheet { max-width: 640px; } }
@media (min-width: 768px) { .sheet { max-width: 768px; } }
@media (min-width: 1072px) { .sheet { max-width: 1072px; } }
@media (min-width: 1328px) { .sheet { max-width: 1328px; } }
.sheet-card { background: #fff; border-radius: .75rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05); padding: 36px; }
.intro { margin: 0 0 22px; font-size: 16px; line-height: 1.6; color: #111827; max-width: 980px; }
.intro a { color: var(--emerald-700); text-decoration: none; }
.intro a:hover { text-decoration: underline; }

.site-footer { max-width: 1328px; margin: 0 auto 1rem; text-align: right; padding: 70px 16px 0; font-size: 16px; color: #252f3f; }
.site-footer a { color: var(--emerald-500); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---- App layout ----------------------------------------------------------- */
.layout { display: grid; grid-template-columns: 330px 1fr; gap: 20px; align-items: start; }
.panel { display: flex; flex-direction: column; gap: 12px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h2 { font-size: 15px; font-weight: 600; margin: 0 0 14px; display: flex; align-items: center; gap: 9px; color: #111827; }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--emerald-500); color: #fff; font-size: 12.5px; font-weight: 700; }

.tabs { display: flex; gap: 4px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.tab { flex: 1; border: 0; background: transparent; padding: 7px 4px; border-radius: 8px; font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer; color: var(--muted); }
.tab.active { background: #fff; color: var(--emerald-700); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }
.tabpane { display: none; }
.tabpane.active { display: block; }

.field { position: relative; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; margin-bottom: 12px; color: #374151; }
.field output { position: absolute; right: 0; top: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.grow { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; }
.row.tight { gap: 6px; margin-top: 8px; }
.sub { border-left: 2px solid var(--emerald-100); padding-left: 10px; margin: -2px 0 12px; }
input[type=text], select {
  font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: var(--ink); width: 100%;
}
input[type=text] { text-transform: uppercase; letter-spacing: .04em; }
input[type=text]::placeholder { text-transform: none; letter-spacing: 0; color: #9ca3af; }
input[type=text]:focus, select:focus { outline: 2px solid var(--emerald-200); border-color: var(--emerald-500); }
input[type=range] { width: 100%; accent-color: var(--emerald-500); }
input[type=checkbox] { accent-color: var(--emerald-500); width: 15px; height: 15px; }
input[type=color] { width: 34px; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: #fff; cursor: pointer; }

.btn {
  font: inherit; font-size: 13.5px; font-weight: 500; padding: 8px 14px; border-radius: 8px; border: 1px solid #d1d5db;
  background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; transition: background .12s ease, border-color .12s ease;
}
.btn:hover:not(:disabled) { border-color: var(--emerald-500); background: var(--emerald-50); }
.btn.primary { background: var(--emerald-500); border-color: var(--emerald-500); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--emerald-600); border-color: var(--emerald-600); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { font-size: 12px; padding: 5px 10px; }

.examples { font-size: 13px; color: var(--muted); }
.examples a { color: var(--emerald-600); text-decoration: none; margin-left: 6px; font-weight: 600; }
.examples a:hover { text-decoration: underline; }

.drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 12px; border: 2px dashed #d1d5db;
  border-radius: var(--radius); cursor: pointer; text-align: center; font-size: 14px; color: var(--ink); background: var(--soft);
}
.drop svg { color: var(--emerald-500); }
.drop small { color: var(--muted); }
.drop:hover, .drop.over { border-color: var(--emerald-500); background: var(--emerald-50); }

.status { margin-top: 12px; font-size: 13px; padding: 9px 11px; border-radius: 8px; background: var(--emerald-50); color: var(--emerald-900); line-height: 1.45; }
.status.error { background: #fef2f2; color: #991b1b; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.segmented button {
  display: flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 14.5px; font-weight: 600; padding: 12px;
  border-radius: var(--radius); border: 2px solid var(--line); background: #fff; cursor: pointer; color: var(--muted);
}
.segmented button:hover { border-color: var(--emerald-200); }
.segmented button.active { border-color: var(--emerald-500); color: var(--emerald-700); background: var(--emerald-50); }

.chains { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; max-height: 220px; overflow-y: auto; }
.chip { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; background: #fff; }
.chip.off { opacity: .45; }
.chip.wide { grid-column: 1 / -1; border-radius: 10px; }
.chip .csub { color: var(--muted); font-weight: 400; margin-left: 4px; }
.chip input[type=color] { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); overflow: hidden; }
.chip input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.chip input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.chip input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }
.chip .cname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.chip input[type=checkbox] { margin: 0; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.15); }
.ramp { position: relative; height: 12px; border-radius: 999px; border: 1px solid rgba(0,0,0,.12); margin: 2px 0 26px; }
.ramp::before, .ramp::after { position: absolute; top: 16px; font-size: 11.5px; color: var(--muted); }
.ramp::before { content: attr(data-left); left: 0; }
.ramp::after { content: attr(data-right); right: 0; }
details { font-size: 13.5px; }
details summary { cursor: pointer; color: var(--emerald-700); font-weight: 500; margin-bottom: 10px; }

.stage { display: flex; flex-direction: column; gap: 12px; min-width: 0; position: sticky; top: 16px; }
.viewer {
  position: relative; height: min(76vh, 820px); min-height: 420px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden;
  background-color: #fff;
  background-image: radial-gradient(circle, #d1e7dd 1px, transparent 1.2px);
  background-size: 18px 18px;
  cursor: grab; touch-action: none; user-select: none;
}
.viewer.dragging { cursor: grabbing; }
.viewer canvas, #svg-host { position: absolute; inset: 0; width: 100%; height: 100%; }
.viewer canvas { object-fit: contain; }
#svg-host svg { width: 100%; height: 100%; display: block; }
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 15px; line-height: 1.5; text-align: center; padding: 20px; cursor: default; }
.empty b { color: var(--ink); }
.structure-info {
  position: absolute; top: 12px; left: 12px; max-width: min(46%, 420px); z-index: 1; pointer-events: none;
  font-size: 13px; line-height: 1.4; color: var(--ink); background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px;
}
.structure-info b { color: var(--emerald-700); }
.structure-info .info-title { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .02em; margin-top: 2px; }
.busy {
  position: absolute; bottom: 12px; left: 12px; z-index: 1; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--emerald-900);
  background: rgba(236, 253, 245, .95); padding: 6px 11px; border-radius: 999px; border: 1px solid var(--emerald-200);
}
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--emerald-200); border-top-color: var(--emerald-600); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.viewtools { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; }
.iconbtn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.95); font-size: 17px; cursor: pointer; color: var(--ink); }
.iconbtn:hover { background: var(--emerald-50); border-color: var(--emerald-500); color: var(--emerald-700); }
.hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); font-size: 12.5px; color: var(--muted); background: rgba(255,255,255,.92); padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; pointer-events: none; }

.exportbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: var(--soft); }
.meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.btngroup { display: flex; align-items: center; gap: 6px; }
.glabel { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--emerald-700); margin-right: 2px; }
.field.bg { margin: 0; font-size: 13px; color: var(--muted); }
.field.bg select { width: auto; padding: 5px 8px; font-size: 13px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--emerald-900); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Embedded (iframe or ?embed=1): only the app card */
body.embed .bi-hero-wrap, body.embed .site-footer, body.embed .intro { display: none; }
body.embed .sheet { margin: 0; padding: 0; max-width: none; }
body.embed .sheet-card { box-shadow: none; padding: 12px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .stage { position: static; order: -1; }
  .viewer { height: auto; aspect-ratio: 1 / 1; min-height: 0; }
  .structure-info { max-width: calc(100% - 24px); padding: 5px 9px; font-size: 12px; }
  .structure-info .info-title { display: none; }
  .viewtools { top: auto; bottom: 12px; }
  .iconbtn { width: 32px; height: 32px; font-size: 15px; }
  .hint { display: none; }
  .exportbar { flex-direction: column; align-items: stretch; }
  .actions { justify-content: space-between; gap: 10px; }
  .sheet-card { padding: 16px; }
  .site-footer { text-align: center; padding: 40px 16px 24px; }
}
