/* OpenPDF dashboard — OpenCertifier-aligned collapsible navigation */
:root {
  --ink: #1e1b4b;
  --ink-2: #6e6b8f;
  --ink-3: #9a97b8;
  --accent: #4f46e5;
  --accent-2: #6366f1;
  --accent-soft: #ecebfa;
  --surface: #f2f2fb;
  --card: #ffffff;
  --line: #e8e7f5;
  --side: #1c1a42;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 18px;
  --shadow: 0 12px 34px rgba(38, 34, 98, .07);
}
* { box-sizing: border-box; margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--surface); color: var(--ink); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; }
.loading { padding: 60px; color: var(--ink-2); }

/* ---------- shell + sidebar ---------- */
.shell { display: grid; grid-template-columns: 112px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease-out; }
.shell.nav-expanded { grid-template-columns: 292px minmax(0, 1fr); }
#appShell { height: 100vh; min-height: 0; overflow: hidden; }
html[data-nav-expanded="true"] #appShell { grid-template-columns: 292px minmax(0, 1fr); }
html[data-nav-expanded="true"] #appShell .side-brand-copy,
html[data-nav-expanded="true"] #appShell .side-label,
html[data-nav-expanded="true"] #appShell .side-account-copy { opacity: 1; }
html[data-nav-expanded="true"] #appShell .side-toggle svg { transform: rotate(180deg); }
.side {
  position: sticky; top: 0; height: calc(100vh - 28px); min-height: 620px; margin: 14px 0 14px 14px;
  background: var(--side); border-radius: 28px; padding: 12px;
  display: flex; flex-direction: column;
  box-shadow: 0 18px 44px rgba(20, 18, 60, .35);
}
.side-brand { height: 56px; display: flex; align-items: center; overflow: hidden; padding: 0 4px; flex: none; }
.side-logo {
  width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; flex: none;
  background: #fff;
  color: var(--side); font-weight: 900; font-size: 20px; text-decoration: none;
  box-shadow: 0 4px 12px rgba(8, 7, 34, .2);
}
.side-brand-copy { min-width: 0; margin-left: 12px; white-space: nowrap; opacity: 0; transition: opacity .15s ease; }
.side-brand-copy strong, .side-brand-copy span { display: block; }
.side-brand-copy strong { color: #fff; font-size: 14px; }
.side-brand-copy span { color: #aaa8dc; font-size: 12px; margin-top: 2px; }
.nav-expanded .side-brand-copy { opacity: 1; }
.side-toggle {
  position: absolute; top: 82px; right: -14px; z-index: 50; width: 32px; height: 32px;
  border: 3px solid var(--surface); border-radius: 50%; background: var(--side); color: #c8c6ee;
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 20px rgba(17,16,47,.24); transition: .15s;
}
.side-toggle:hover { background: var(--accent); color: #fff; }
.side-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.nav-expanded .side-toggle svg { transform: rotate(180deg); }
.side-divider { height: 1px; margin: 16px 2px; background: rgba(255,255,255,.1); }
.side-nav { display: flex; min-height: 0; width: 100%; flex: 1; flex-direction: column; gap: 4px; overflow: visible; }
.nav-expanded .side-nav { overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.nav-expanded .side-nav::-webkit-scrollbar { display: none; }
.side-link {
  position: relative; width: 100%; min-height: 44px; border: 0; border-radius: 15px; display: flex; align-items: center;
  color: #aaa8dc; background: transparent; transition: .15s; text-decoration: none; cursor: pointer; flex: none;
}
.side-icon { width: 56px; height: 44px; display: grid; place-items: center; flex: none; }
.side-link svg, .side-status svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-label { min-width: 0; white-space: nowrap; font-size: 14px; font-weight: 650; opacity: 0; transition: opacity .15s; }
.nav-expanded .side-label { opacity: 1; }
.side-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.side-link.active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 24px rgba(98,85,242,.28); }
.shell:not(.nav-expanded) .side-link::after {
  content: attr(data-label); pointer-events: none; position: absolute; left: calc(100% + 14px); z-index: 60;
  padding: 8px 12px; border-radius: 12px; background: var(--side); color: #fff; font-size: 13px; font-weight: 650;
  white-space: nowrap; opacity: 0; transform: translateX(-4px); transition: .15s; box-shadow: 0 12px 30px rgba(17,16,47,.24);
}
.shell:not(.nav-expanded) .side-link:hover::after, .shell:not(.nav-expanded) .side-link:focus-visible::after { opacity: 1; transform: translateX(0); }
.side-bottom { display: grid; gap: 6px; margin-top: auto; }
.side-status { height: 44px; display: flex; align-items: center; overflow: hidden; color: #aaa8dc; }
.side-account { width: 100%; min-height: 54px; padding: 5px; border: 0; border-radius: 16px; background: rgba(255,255,255,.07); color: #fff; display: flex; align-items: center; text-align: left; cursor: pointer; transition: .15s; }
.side-account:hover { background: rgba(255,255,255,.11); }
.side-account-copy { min-width: 0; margin-left: 10px; white-space: nowrap; opacity: 0; transition: opacity .15s; }
.side-account-copy strong, .side-account-copy span { display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.side-account-copy strong { font-size: 13.5px; }
.side-account-copy span { margin-top: 2px; color: #aaa8dc; font-size: 12px; }
.nav-expanded .side-account-copy { opacity: 1; }
.avatar {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; font-weight: 800; font-size: 13px;
}
[hidden] { display: none !important; }

/* ---------- main ---------- */
.main { height: 100vh; min-width: 0; max-width: 1500px; padding: 26px 30px 50px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.main[aria-busy="true"] { cursor: progress; }
.main .docs-workspace { padding-left: 0; }
.view-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.view-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.view-head h1 { font-size: 27px; letter-spacing: -.02em; }
.view-head h1 b { font-weight: 800; }
.head-side { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 13.5px; }
.head-side .chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 600; color: var(--ink); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card h3 { font-size: 15.5px; margin-bottom: 4px; }
.card .sub { color: var(--ink-2); font-size: 13px; }

/* KPI row */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 22px; }
.kpi { position: relative; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; display: grid; gap: 10px; }
.kpi .kpi-label { font-size: 13px; color: var(--ink-2); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.kpi .kpi-value { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.kpi .kpi-value small { font-size: 13.5px; color: var(--ink-3); font-weight: 600; margin-left: 6px; }
.kpi .arrow { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.kpi-featured { background: linear-gradient(135deg, #6366f1, #4c40d8 70%); color: #fff; }
.kpi-featured .kpi-label, .kpi-featured .kpi-value small { color: rgba(255, 255, 255, .75); }
.kpi-featured .arrow { background: rgba(255, 255, 255, .18); color: #fff; }
.meter { height: 7px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.kpi-featured .meter { background: rgba(255, 255, 255, .22); }
.kpi-featured .meter i { background: #fff; }

/* chart */
.chart-card { margin-bottom: 22px; border: 1px solid var(--line); border-radius: 24px; box-shadow: none; padding: 28px 30px 24px; }
.chart-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 10px; }
.chart-head h3 { font-size: 21px; letter-spacing: -.025em; }
.chart-head .sub { display: block; margin-top: 3px; font-size: 14px; color: #9693bd; }
.chart-actions { margin-left: auto; display: flex; align-items: center; gap: 15px; }
.chart-range { position: relative; }
.chart-range::after { content: "⌄"; position: absolute; right: 14px; top: 50%; transform: translateY(-56%); pointer-events: none; color: var(--ink-2); font-size: 16px; }
.chart-range select { min-width: 138px; height: 42px; padding: 0 38px 0 15px; appearance: none; border: 0; border-radius: 13px; background: #f0eff9; color: #5f5c83; font-size: 13px; font-weight: 750; cursor: pointer; }
.chart-range select:focus-visible { outline: 3px solid rgba(98,85,242,.2); }
.chart-total { color: #6255f2; font-size: 31px; line-height: 1; letter-spacing: -.04em; }
.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: 286px; display: block; overflow: visible; }
.chart-hover-line { stroke: #c9c7ec; stroke-width: 1; stroke-dasharray: 4 4; opacity: 0; }
.chart-hover-dot { fill: #5750ed; stroke: #fff; stroke-width: 3; vector-effect: non-scaling-stroke; opacity: 0; }
.chart-hover-line.visible, .chart-hover-dot.visible { opacity: 1; }
.chart-tip {
  position: absolute; pointer-events: none; background: #201d4a; color: #fff; border-radius: 10px;
  padding: 7px 12px; font-size: 12.5px; font-weight: 600; transform: translate(-50%, -120%);
  box-shadow: 0 10px 24px rgba(20, 18, 60, .35); white-space: nowrap; opacity: 0; transition: opacity .12s;
}
.chart-tip small { display: block; color: #a5a3d1; font-weight: 500; }

/* segmented usage */
.segbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin: 16px 0 14px; background: var(--accent-soft); }
.segbar i { display: block; height: 100%; }
.seg-legend { display: flex; gap: 10px; flex-wrap: wrap; }
.seg-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.seg-chip .swatch { width: 9px; height: 9px; border-radius: 50%; }

/* right rail */
.rail { display: grid; gap: 18px; align-content: start; }
.rail-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rail-head h3 { font-size: 15px; }
.rail-head a { font-size: 12.5px; font-weight: 700; }
.date-strip { display: flex; gap: 7px; margin-bottom: 16px; }
.date-chip {
  flex: 1; text-align: center; border-radius: 12px; padding: 8px 2px; display: grid; gap: 1px;
  color: var(--ink-2); font-size: 11px; border: 1px solid transparent;
}
.date-chip b { font-size: 15px; color: var(--ink); }
.date-chip.active { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: rgba(255,255,255,.8); box-shadow: 0 8px 16px rgba(79,70,229,.35); }
.date-chip.active b { color: #fff; }
.date-chip .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent-2); margin: 2px auto 0; }
.date-chip.active .dot { background: #fff; }
.feed { display: grid; gap: 9px; }
.feed-item {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 13px;
  padding: 9px 12px; font-size: 12.5px;
}
.feed-item .t { color: var(--ink-3); font-size: 11.5px; min-width: 52px; }
.feed-item .op { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.feed-item .op small { display: block; color: var(--ink-3); font-weight: 500; }
.quick { display: grid; gap: 8px; }
.quick button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: #fbfbfe; border-radius: 13px; padding: 11px 14px; font-weight: 700; font-size: 13px; color: var(--ink);
}
.quick button:hover { border-color: #c9c7ec; background: #fff; }
.quick button span { margin-left: auto; color: var(--accent); }

/* status chips */
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 700; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.success { background: #e8f7ee; color: var(--ok); }
.status.working, .status.queued { background: #fff4e5; color: var(--warn); }
.status.failed, .status.aborted { background: #fdeaea; color: var(--bad); }

/* tables */
.table-card { padding: 8px 0 4px; overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th { text-align: left; color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; padding: 12px 18px 8px; }
table.grid td { padding: 11px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
table.grid tr:hover td { background: #fafaff; }
table.grid code { background: var(--accent-soft); border-radius: 6px; padding: 2px 7px; font-size: 12px; color: #37327a; }

/* buttons & forms */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 12px;
  padding: 10px 16px; font-weight: 700; font-size: 13.5px; cursor: pointer; color: var(--ink);
  background: #fff; border: 1px solid var(--line); transition: .15s;
}
.btn:hover { border-color: #c9c7ec; }
.btn-primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; border: 0; box-shadow: 0 8px 18px rgba(79, 70, 229, .3); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; }
.btn-danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }
input, select, textarea {
  font: inherit; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px;
  background: #fbfbfe; color: var(--ink); font-size: 13.5px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #c7c5f4; border-color: var(--accent-2); }
label.f { display: grid; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
label.f small { font-weight: 500; color: var(--ink-3); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.check input { width: auto; }

/* playground */
.play-grid { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 22px; align-items: start; }
.play-form { display: grid; gap: 13px; }
.op-pick { display: grid; gap: 6px; }
.json-out {
  background: #201d4a; color: #dcdaf5; border-radius: 14px; padding: 18px; overflow: auto;
  font: 12.5px/1.65 Consolas, "Cascadia Code", monospace; max-height: 560px; white-space: pre-wrap; word-break: break-word;
}
.json-out .k { color: #93c5fd; } .json-out .s { color: #9ee8b8; } .json-out .n { color: #fbbf24; } .json-out .b { color: #f9a8d4; }
.result-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.result-preview { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.result-preview iframe, .result-preview img { width: 100%; height: 420px; border: 0; display: block; object-fit: contain; background: #fff; }

/* visual PDF tools studio */
.tool-count { font-weight: 700; color: var(--accent); }
.tools-hero {
  position: relative; min-height: 230px; margin-bottom: 22px; padding: 36px 42px; overflow: hidden;
  display: flex; align-items: center; border-radius: 26px; color: #fff;
  background: radial-gradient(circle at 76% 20%, rgba(133,125,255,.55), transparent 26%), linear-gradient(125deg, #211d59, #4f46e5 72%, #776df2);
  box-shadow: 0 18px 46px rgba(42,35,130,.18);
}
.tools-hero::after { content: ""; position: absolute; inset: 0; opacity: .12; background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(90deg, transparent 45%, #000); }
.tools-hero > div:first-child { position: relative; z-index: 2; max-width: 670px; }
.eyebrow { display: block; margin-bottom: 9px; font-size: 10.5px; font-weight: 850; letter-spacing: .14em; color: #9f9af6; }
.tools-hero .eyebrow { color: #c9c6ff; }
.tools-hero h2 { font-size: clamp(28px, 4vw, 44px); line-height: 1.04; letter-spacing: -.04em; }
.tools-hero p { max-width: 570px; margin-top: 15px; color: #d4d2f4; font-size: 14.5px; line-height: 1.55; }
.hero-orbit { position: absolute; z-index: 1; right: 8%; width: 164px; height: 164px; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; display: grid; place-items: center; }
.hero-orbit span { width: 86px; height: 104px; border-radius: 12px 22px 12px 12px; display: grid; place-items: center; background: #fff; color: var(--accent); font-weight: 900; box-shadow: 0 18px 45px rgba(17,13,67,.35); transform: rotate(6deg); }
.hero-orbit i { position: absolute; width: 34px; height: 34px; border-radius: 11px; background: rgba(255,255,255,.2); backdrop-filter: blur(6px); }
.hero-orbit i:nth-of-type(1) { top: 0; left: 5px; }.hero-orbit i:nth-of-type(2) { right: -5px; top: 55px; }.hero-orbit i:nth-of-type(3) { bottom: -3px; left: 35px; }
.tools-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.tool-search { min-width: min(340px, 100%); height: 44px; padding: 0 14px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 6px 18px rgba(38,34,98,.04); }
.tool-search span { color: var(--accent); font-size: 20px; }.tool-search input { min-width: 0; width: 100%; border: 0; padding: 0; background: transparent; }.tool-search input:focus { outline: 0; }
.tool-filters { display: flex; gap: 7px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tool-filters button { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; background: #fff; color: var(--ink-2); cursor: pointer; font-size: 12px; font-weight: 700; }
.tool-filters button.active { color: #fff; border-color: var(--accent); background: var(--accent); box-shadow: 0 6px 14px rgba(79,70,229,.22); }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tool-card { min-width: 0; min-height: 154px; padding: 18px; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto 1fr; gap: 13px 12px; text-align: left; border: 1px solid var(--line); border-radius: 19px; background: #fff; color: var(--ink); cursor: pointer; box-shadow: 0 8px 24px rgba(38,34,98,.045); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.tool-card:hover { transform: translateY(-3px); border-color: #c9c6ee; box-shadow: 0 16px 34px rgba(38,34,98,.11); }
.tool-glyph { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex: none; font-size: 14px; font-weight: 900; letter-spacing: -.03em; }
.tool-glyph.violet { background: #f1eafd; color: #7c3aed; }.tool-glyph.blue { background: #e8f2ff; color: #2563eb; }.tool-glyph.indigo { background: #ecebff; color: #4f46e5; }
.tool-glyph.amber { background: #fff3dc; color: #d97706; }.tool-glyph.emerald { background: #e4f7ee; color: #059669; }.tool-glyph.pink { background: #fde9f4; color: #db2777; }
.tool-card-copy { min-width: 0; grid-column: 1 / -1; align-self: end; }.tool-card-copy b, .tool-card-copy small { display: block; }.tool-card-copy b { margin-bottom: 6px; font-size: 14px; }
.tool-card-copy small { min-height: 32px; overflow: hidden; color: var(--ink-2); font-size: 11.5px; line-height: 1.42; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tool-arrow { grid-column: 3; grid-row: 1; align-self: center; color: var(--ink-3); font-weight: 800; transition: .15s; }.tool-card:hover .tool-arrow { color: var(--accent); transform: translateX(3px); }
.tool-empty { padding: 60px 20px; text-align: center; color: var(--ink-3); }
.tool-breadcrumb { display: flex; align-items: center; gap: 9px; margin: -10px 0 18px; font-size: 12.5px; color: var(--ink-3); }.tool-breadcrumb button { padding: 0; border: 0; background: transparent; color: var(--accent); font-weight: 750; cursor: pointer; }
.tool-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 22px; align-items: start; }
.tool-work-main, .tool-result { border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.tool-work-main { padding: 28px; }.tool-result { position: sticky; top: 22px; min-height: 420px; padding: 22px; }
.tool-work-title { display: flex; gap: 17px; align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--line); }.tool-work-title .tool-glyph { width: 58px; height: 58px; border-radius: 18px; font-size: 16px; }
.tool-work-title h2 { font-size: 24px; letter-spacing: -.025em; }.tool-work-title p { margin-top: 5px; color: var(--ink-2); font-size: 13px; }.tool-work-title .eyebrow { margin-bottom: 4px; }
.tool-step { display: flex; align-items: center; gap: 12px; margin: 25px 0 14px; }.step-num { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 850; }
.step-copy h3 { font-size: 14px; }.step-copy p { margin-top: 2px; color: var(--ink-3); font-size: 11.5px; }
.tool-drop { min-height: 160px; border: 1.5px dashed #c8c5e8; border-radius: 18px; background: #fafaff; display: grid; place-items: center; align-content: center; gap: 5px; cursor: pointer; transition: .16s; }.tool-drop:hover, .tool-drop.dragging { border-color: var(--accent); background: #f5f4ff; transform: translateY(-1px); }.tool-drop input { display: none; }
.drop-icon { width: 42px; height: 42px; margin-bottom: 4px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 8px 18px rgba(79,70,229,.24); font-size: 20px; }.tool-drop b { font-size: 13.5px; }.tool-drop small { color: var(--ink-3); font-size: 11.5px; }
.stored-source { display: flex; gap: 8px; margin-top: 10px; }.stored-source select { min-width: 0; flex: 1; }
.source-pills { display: grid; gap: 7px; margin-top: 10px; }.source-pill { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-2); font-size: 11.5px; }.source-pill > span { padding: 4px 6px; border-radius: 6px; background: #fdeaea; color: #dc2626; font-size: 9px; font-weight: 900; }.source-pill b { flex: 1; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.source-pill button { width: 24px; height: 24px; border: 0; border-radius: 7px; background: var(--surface); cursor: pointer; color: var(--ink-2); }
.tool-options { display: grid; gap: 14px; }.tool-options > .f textarea { resize: vertical; }.form-2, .form-4 { display: grid; gap: 12px; }.form-2 { grid-template-columns: 1.4fr 1fr; }.form-4 { grid-template-columns: repeat(4, 1fr); margin-top: 12px; }
.tool-switch { display: flex; align-items: center; gap: 11px; cursor: pointer; }.tool-switch > input { position: absolute; opacity: 0; pointer-events: none; }.tool-switch > span { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #d9d7e9; transition: .15s; flex: none; }.tool-switch > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.15); transition: .15s; }.tool-switch > input:checked + span { background: var(--accent); }.tool-switch > input:checked + span::after { left: 19px; }.tool-switch b, .tool-switch small { display: block; }.tool-switch b { font-size: 12.5px; }.tool-switch small { margin-top: 2px; color: var(--ink-3); font-size: 10.5px; }
.field-builder { border: 1px solid var(--line); border-radius: 15px; padding: 14px; }.field-builder-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 12.5px; font-weight: 750; }.field-row { display: grid; grid-template-columns: 1fr 1fr 34px; gap: 7px; margin-top: 7px; }.field-row button { border: 0; border-radius: 10px; background: #fdeaea; color: var(--bad); cursor: pointer; }
.rotate-editor { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #f7f7fc; }
.rotate-toolbar { min-height: 64px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: #fff; }
.rotate-toolbar b, .rotate-toolbar small { display: block; }.rotate-toolbar b { font-size: 12.5px; }.rotate-toolbar small { margin-top: 3px; color: var(--ink-3); font-size: 10.5px; }
.rotate-toolbar-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }.rotate-toolbar-actions .btn { min-width: 58px; }
.rotate-pages { min-height: 250px; max-height: 580px; padding: 18px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); align-items: start; gap: 14px; }
.rotate-page { position: relative; min-width: 0; padding: 10px; border: 1px solid #deddec; border-radius: 15px; background: #fff; box-shadow: 0 5px 15px rgba(32,29,74,.05); transition: border-color .15s, box-shadow .15s, transform .15s; }
.rotate-page:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(32,29,74,.1); }.rotate-page.changed { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(79,70,229,.1), 0 10px 24px rgba(32,29,74,.1); }
.page-document { min-width: 0; height: 25px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; overflow: hidden; color: var(--ink-2); font-size: 9.5px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }.page-document span { flex: none; padding: 3px 5px; border-radius: 5px; background: #fdeaea; color: #dc2626; font-size: 8px; font-weight: 900; }
.page-canvas { height: 180px; overflow: hidden; display: grid; place-items: center; border: 1px solid #e7e6f1; border-radius: 9px; background: #ececf3; }
.page-canvas img { max-width: 94%; max-height: 94%; object-fit: contain; box-shadow: 0 3px 9px rgba(25,22,64,.16); transition: transform .24s ease; }
.page-meta { display: flex; justify-content: space-between; gap: 6px; margin: 9px 2px 7px; }.page-meta b { font-size: 11.5px; }.page-meta small { color: var(--accent); font-size: 9.5px; font-weight: 750; }
.page-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }.page-actions button { min-height: 31px; border: 1px solid var(--line); border-radius: 9px; background: #fafaff; color: var(--ink); cursor: pointer; font-size: 19px; line-height: 1; }.page-actions button:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.rotate-empty, .rotate-loading { grid-column: 1 / -1; min-height: 215px; display: grid; place-items: center; align-content: center; gap: 6px; text-align: center; color: var(--ink-3); }.rotate-empty > span { width: 48px; height: 48px; margin-bottom: 4px; display: grid; place-items: center; border-radius: 15px; background: var(--accent-soft); color: var(--accent); font-size: 20px; }.rotate-empty b, .rotate-loading b { color: var(--ink); font-size: 12.5px; }.rotate-empty small { max-width: 350px; font-size: 10.5px; line-height: 1.45; }.rotate-invalid > span { background: #fdeaea; color: var(--bad); }.rotate-invalid .btn { margin-top: 7px; }
.rotate-loading i { width: 32px; height: 32px; border: 3px solid #deddf4; border-top-color: var(--accent); border-radius: 50%; animation: toolspin .7s linear infinite; }
.advanced-options { margin-top: 20px; border: 1px solid var(--line); border-radius: 15px; }.advanced-options summary { padding: 13px 15px; cursor: pointer; font-size: 12.5px; font-weight: 750; }.advanced-options summary span { float: right; color: var(--ink-3); font-weight: 500; }.advanced-grid { padding: 3px 15px 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tool-run { width: 100%; margin-top: 18px; justify-content: center; padding: 13px 18px; border-radius: 14px; }.tool-run b { margin-left: auto; }
.result-empty, .result-loading, .result-error { min-height: 370px; display: grid; place-items: center; align-content: center; text-align: center; gap: 8px; }.result-empty > span, .result-error > span { width: 68px; height: 68px; margin-bottom: 6px; border-radius: 22px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 26px; font-weight: 850; }.result-empty h3, .result-loading h3, .result-error h3 { font-size: 15px; }.result-empty p, .result-loading p, .result-error p { max-width: 280px; color: var(--ink-3); font-size: 12px; line-height: 1.5; }.result-loading i { width: 42px; height: 42px; margin-bottom: 8px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: toolspin .7s linear infinite; }@keyframes toolspin { to { transform: rotate(360deg); } }
.result-error > span { background: #fdeaea; color: var(--bad); }.result-success { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }.result-success > span { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: #e8f7ee; color: var(--ok); font-weight: 900; }.result-success small { color: var(--ok); font-size: 9px; font-weight: 900; letter-spacing: .1em; }.result-success h3 { margin-top: 2px; font-size: 15px; }.result-success p { margin-top: 2px; color: var(--ink-3); font-size: 10.5px; }
.tool-preview { height: 310px; margin: 16px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fafaff; }.tool-preview iframe, .tool-preview img { width: 100%; height: 100%; border: 0; object-fit: contain; }.qr-preview { height: 290px; padding: 20px; background-image: linear-gradient(45deg,#f5f4fb 25%,transparent 25%),linear-gradient(-45deg,#f5f4fb 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#f5f4fb 75%),linear-gradient(-45deg,transparent 75%,#f5f4fb 75%); background-size: 18px 18px; background-position: 0 0,0 9px,9px -9px,-9px 0; }
.result-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }.result-json { max-height: 240px; margin-top: 12px; padding: 12px; overflow: auto; border-radius: 12px; background: #201d4a; color: #dcdaf5; font: 11px/1.55 Consolas, monospace; white-space: pre-wrap; }
.batch-results { margin: 14px 0 2px; display: grid; gap: 7px; }.batch-results article { min-width: 0; padding: 9px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); transition: border-color .15s, background .15s; }.batch-results article:hover { border-color: var(--accent); background: #fafaff; }.batch-results article > span { padding: 5px 6px; border-radius: 6px; background: #fdeaea; color: #dc2626; font-size: 8px; font-weight: 900; }.batch-results b, .batch-results small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.batch-results b { font-size: 11px; }.batch-results small { margin-top: 2px; color: var(--ink-3); font-size: 9px; }.batch-file-actions { display: flex; gap: 8px; align-items: center; }.batch-file-actions a { color: var(--accent); font-size: 9.5px; font-weight: 800; text-decoration: none; white-space: nowrap; }.batch-file-actions a:last-child { padding: 6px 8px; border: 1px solid #d8d6ef; border-radius: 8px; background: #fff; }.batch-file-actions a:hover { text-decoration: underline; }

/* pricing cards in billing */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 18px; }
.plan-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 8px; background: #fbfbfe; }
.plan-card.current { outline: 2px solid var(--accent); background: #fff; }
.plan-price { font-size: 22px; font-weight: 800; }
.plan-card ul { list-style: none; padding: 0; color: var(--ink-2); font-size: 12.5px; display: grid; gap: 4px; }

/* misc */
.stack { display: grid; gap: 18px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--ink-2); }
.mono { font-family: Consolas, monospace; font-size: 12.5px; }
.badge { background: var(--accent-soft); color: #37327a; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 700; }
.empty { text-align: center; color: var(--ink-3); padding: 40px 10px; font-size: 13.5px; }
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: #201d4a; color: #fff; border-radius: 12px; padding: 11px 20px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 14px 30px rgba(20, 18, 60, .4);
}

@media (max-width: 1200px) { .tool-grid { grid-template-columns: repeat(3, 1fr); }.tool-workspace { grid-template-columns: minmax(0, 1fr) 340px; } }
@media (max-width: 1000px) { .view-grid, .play-grid, .tool-workspace { grid-template-columns: 1fr; }.tool-result { position: static; }.tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .chart-card { padding: 22px 18px 18px; }
  .chart-head { display: grid; }
  .chart-actions { width: 100%; margin-left: 0; justify-content: space-between; }
  .chart-wrap svg { height: 240px; }
  .shell, .shell.nav-expanded { display: block; }
  #appShell { height: 100vh; }
  .side { position: sticky; z-index: 40; top: 0; width: 100%; height: 72px; min-height: 0; margin: 0; border-radius: 0; flex-direction: row; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; box-shadow: 0 1px 0 var(--line); }
  .side-brand { height: auto; padding: 0; }
  .side-logo { width: 44px; height: 44px; border-radius: 14px; background: var(--side); color: #fff; }
  .side-brand-copy, .side-toggle, .side-divider, .side-bottom, .side-label { display: none; }
  .side-nav { flex: 1; min-width: 0; flex-direction: row; align-items: center; gap: 2px; overflow-x: auto; overflow-y: visible; border-radius: 16px; background: var(--side); padding: 4px; }
  .side-link { width: 44px; min-height: 44px; border-radius: 14px; }
  .side-icon { width: 44px; height: 44px; }
  .shell:not(.nav-expanded) .side-link::after { display: none; }
  .main { height: calc(100vh - 72px); padding: 22px 14px 50px; }
  .kpis { grid-template-columns: 1fr; }
  .tools-hero { min-height: 215px; padding: 28px 24px; }.hero-orbit { right: -78px; opacity: .35; }.tools-hero > div:first-child { max-width: 88%; }
  .tool-grid { grid-template-columns: 1fr; }.tool-card { min-height: 128px; }.tool-work-main, .tool-result { padding: 18px; border-radius: 19px; }.form-2, .form-4, .advanced-grid { grid-template-columns: 1fr; }.stored-source { align-items: stretch; }.advanced-options summary span { display: none; }
  .rotate-toolbar { align-items: flex-start; flex-direction: column; }.rotate-toolbar-actions { width: 100%; justify-content: stretch; }.rotate-toolbar-actions .btn { flex: 1; }.rotate-pages { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 9px; }.page-canvas { height: 150px; }
  .batch-results article { grid-template-columns: auto minmax(0, 1fr); }.batch-file-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
