:root {
  font-family: system-ui, sans-serif;
  color: #231e2c;
  background: #f7f6fa;
  --purple: #5d437c;
  --border: #e2dce9;
  --muted: #615a6e;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: #533770; text-underline-offset: .2em; }
:focus-visible { outline: 3px solid #8b64b9; outline-offset: 3px; }
.skip, .sr-only { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: .5rem; z-index: 2; background: white; padding: .7rem; }
.shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.rail { background: #282231; color: #f9f5ff; padding: 1.6rem 1rem; display: flex; flex-direction: column; gap: 2.5rem; }
.rail a { color: inherit; text-decoration: none; }
.brand { font-weight: 750; font-size: 1.15rem; }
.brand span { color: #d0b6ed; margin-right: .35rem; }
.rail nav { display: grid; gap: .3rem; }
.rail nav a { display: block; border-radius: .55rem; padding: .7rem .85rem; }
.rail nav a:hover, .rail nav a[aria-current] { background: #463957; }
.storage { margin-top: auto; display: grid; gap: .35rem; font-size: .85rem; }
meter { width: 100%; accent-color: #cdb1ed; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem clamp(1rem, 4vw, 3.5rem); background: white; border-bottom: 1px solid var(--border); }
.toolbar form { display: flex; gap: .4rem; }
.account { color: var(--muted); overflow-wrap: anywhere; }
.content { padding: 2rem clamp(1rem, 4vw, 3.5rem) 4rem; max-width: 88rem; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.045em; margin: .4rem 0 1.4rem; overflow-wrap: anywhere; }
h2 { margin-top: 0; font-size: 1.15rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: .5rem; }
.actions, .detail { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; margin-bottom: 1.3rem; }
.panel, .files { background: white; border: 1px solid var(--border); border-radius: .85rem; }
.panel { padding: 1.1rem; }
.panel label { display: block; font-weight: 650; margin-bottom: .5rem; }
.panel input { margin-bottom: .5rem; }
#upload.dragging { outline: 3px solid #8b64b9; background: #f3ecfa; }
input, button { font: inherit; border: 1px solid #c9c0d4; border-radius: .45rem; padding: .45rem .65rem; max-width: 100%; min-width: 0; }
input { background: #fff; color: inherit; }
button { cursor: pointer; color: #392951; background: #f5f0fa; }
button:hover { background: #eae0f5; }
.primary { background: var(--purple); color: white; }
.primary:hover { background: #473163; }
.muted, small { color: var(--muted); }
.files { list-style: none; padding: 0; margin: 0; }
.files li { display: grid; grid-template-columns: minmax(0, 1fr) 7rem minmax(6rem, auto); gap: .8rem; align-items: start; padding: .85rem 1rem; }
.files li + li { border-top: 1px solid var(--border); }
.file-name { display: flex; gap: .6rem; align-items: baseline; overflow-wrap: anywhere; }
.file-icon { color: var(--purple); }
details { max-width: 18rem; }
summary { cursor: pointer; color: var(--purple); }
details form, details > a { display: block; margin-top: .55rem; }
.notice { border: 1px solid #c0d4c4; background: #edf6ef; padding: .75rem; border-radius: .5rem; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f7f6fa; padding: .8rem; border-radius: .45rem; }
.versions small { display: block; margin: .3rem 0 .75rem; }
@media (max-width: 740px) {
  .shell { display: block; }
  .rail { gap: .75rem; padding: .9rem 1rem; }
  .rail nav { display: flex; flex-wrap: wrap; }
  .rail nav a { padding: .45rem .55rem; }
  .storage { display: none; }
  .toolbar { flex-wrap: wrap; }
  .actions, .detail { grid-template-columns: minmax(0, 1fr); }
  .files li { grid-template-columns: minmax(0, 1fr) auto; }
  .files details { grid-column: 1 / -1; }
}
.login { max-width: 34rem; margin-inline: auto; padding-top: 12vh; }
.login input { display: block; width: 100%; }
.tool-form { max-width: 54rem; }
.tool-form fieldset { border: 1px solid var(--border); border-radius: .5rem; margin-block: 1rem; }
.tool-form legend { font-weight: 650; }
.tool-form select, .tool-form textarea { display: block; width: 100%; font: inherit; padding: .5rem; border: 1px solid var(--border); border-radius: .45rem; background: white; margin-bottom: .65rem; }
.tool-form label { margin-top: .55rem; }
.tool-form details { max-width: none; margin-block: 1rem; }
.mapping-row, .inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.stats { display: flex; gap: .75rem; flex-wrap: wrap; }
.stats div { background: #f4eff8; padding: .65rem; border-radius: .5rem; }
.stats dd { margin: .2rem 0 0; font-weight: 750; }
.section-title { margin-top: 1.5rem; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .75rem; background: transparent; border: 0; }
.files-grid li { grid-template-columns: minmax(0, 1fr); border: 1px solid var(--border); border-radius: .7rem; background: white; }
.view-toggle { text-align: right; }
.file-image { max-width: 100%; height: auto; display: block; border: 1px solid var(--border); }


.table-scroll {
    overflow-x: auto;
    max-width: 100%;
}

.result-sample {
    border-collapse: collapse;
    min-width: 100%;
    font-size: .875rem;
}

.result-sample th,
.result-sample td {
    border-bottom: 1px solid currentColor;
    padding: .55rem .65rem;
    text-align: left;
    overflow-wrap: anywhere;
}

/* Workspace shell and shared product components */
:root {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: #f6f5f8;
  color: #25222b;
  --purple: #674884;
  --border: #e8e3ee;
  --muted: #625c6e;
}
.shell { grid-template-columns: 15.75rem minmax(0, 1fr); }
.rail { background: #26222c; gap: 1.8rem; padding: 1.45rem 1rem; }
.brand { display: flex; align-items: center; gap: .65rem; padding: .2rem .4rem; }
.brand span { color: inherit; margin: 0; }
.brand strong { color: #d9bdf0; }
.brand-mark, .avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .68rem;
  background: #4d395b;
  color: #f1dcff;
}
.icon { flex: 0 0 auto; vertical-align: middle; }
.rail nav { gap: 1.25rem; }
.rail nav[hidden] { display: none; }
.nav-group p { margin: 0 0 .35rem .65rem; color: #bcb1c7; font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.rail nav a { display: flex; align-items: center; gap: .6rem; min-height: 2.5rem; padding: .5rem .65rem; font-size: .9rem; }
.rail nav a[aria-current] { box-shadow: inset 3px 0 #caabee; color: #fff; }
.nav-toggle { display: none; }
.toolbar { min-height: 4.5rem; position: relative; }
.toolbar .global-search { width: min(35rem, 65%); align-items: center; background: #f6f4f8; border: 1px solid var(--border); border-radius: .7rem; }
.global-search button, .global-search input { border: 0; background: transparent; }
.global-search input { width: 100%; }
.global-search kbd { margin-right: .7rem; color: var(--muted); }
.account-menu { position: relative; }
.account-menu summary { display: flex; gap: .65rem; align-items: center; list-style: none; font-size: .9rem; font-weight: 650; color: inherit; }
.account-menu .avatar { background: #eee6f4; color: #593771; }
.menu-card { position: absolute; z-index: 5; inset: calc(100% + .5rem) 0 auto auto; width: min(18rem, 85vw); max-width: 85vw; padding: .85rem; background: white; border: 1px solid var(--border); border-radius: .8rem; box-shadow: 0 14px 40px #30203f20; overflow-wrap: anywhere; }
.menu-card p { margin: 0 0 .75rem; }
.menu-card form { flex-wrap: wrap; }
.content { padding-top: 2.1rem; }
.dashboard-hero { display: flex; justify-content: space-between; align-items: end; gap: 1rem; padding: clamp(1.25rem, 4vw, 2.6rem); border: 1px solid #e7d9f1; border-radius: 1.15rem; background: linear-gradient(115deg, #f0e9f6, #faf8fc 75%); }
.dashboard-hero h1 { margin: 0; }
.dashboard-hero p:last-child { margin-bottom: 0; color: var(--muted); }
.eyebrow { color: #63457d; text-transform: uppercase; letter-spacing: .13em; font-weight: 750; font-size: .75rem; margin: 0 0 .55rem; }
.button { border-radius: .6rem; padding: .65rem .85rem; display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; white-space: nowrap; }
.quick-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-block: 1rem 1.3rem; }
.quick-tools a { display: flex; align-items: center; gap: .65rem; background: white; border: 1px solid var(--border); border-radius: .85rem; padding: .9rem; text-decoration: none; font-weight: 650; }
.quick-tools a:hover { background: #f1e9f8; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.dashboard-panel { min-height: 9rem; }
.dashboard-panel header { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.dashboard-panel header a { font-size: .875rem; }
.dashboard-list { list-style: none; margin: 0; padding: 0; }
.dashboard-list li { display: flex; align-items: center; gap: .6rem; padding: .65rem 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.dashboard-list li:last-child { border: 0; }
.dashboard-list li > :last-child:not(a) { margin-left: auto; }
.status-pill { border-radius: 2rem; background: #efe8f5; padding: .25rem .55rem; font-size: .8rem; color: #4b2e63; }
.status-failed { background: #f9e3e6; color: #852439; }
.status-completed { background: #e6f2ea; color: #235f40; }
#upload { border-style: dashed; border-color: #bcabcc; background: #fbf8fe; }
.files li { align-items: center; }
.files li:hover { background-color: #fbf9fd; }
.file-icon { display: inline-grid; place-items: center; width: 2rem; height: 2rem; flex: 0 0 auto; background: #f1eaf7; border-radius: .55rem; }
.file-name { align-items: center; }
.login { padding-top: clamp(3rem, 11vh, 8rem); }
.login .panel { padding: clamp(1.2rem, 5vw, 2rem); box-shadow: 0 16px 45px #31244412; }
.login .primary { margin-top: .45rem; }
@media (max-width: 1050px) {
  .quick-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 740px) {
  .rail { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
  .rail nav { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .nav-toggle { display: block; }
  .rail nav[hidden] { display: none; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-hero { align-items: start; flex-direction: column; }
  .toolbar { flex-wrap: nowrap; }
  .toolbar .global-search { min-width: 0; width: 100%; }
  .global-search kbd, .account-menu summary > span:nth-child(2) { display: none; }
}

.library-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin: .75rem 0; }
.library-controls label { display: flex; gap: .35rem; align-items: center; font-size: .875rem; }
.library-controls select { font: inherit; padding: .45rem; border: 1px solid var(--border); border-radius: .45rem; background: white; }
.library-controls .view-toggle { margin-left: auto; }

.sign-in-brand { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.4rem; }
.sign-in-brand h1 { margin: 0; font-size: clamp(2rem, 7vw, 2.9rem); }
.sign-in-brand .brand-mark { width: 3rem; height: 3rem; background: #674884; color: white; }

.mapping-row [hidden] { display: none; }
.mapping-row:has([data-step-remove]) { border-bottom: 1px solid var(--border); margin: .5rem 0; padding: .25rem 0 .6rem; }

.quick-tools a[aria-current="true"] { border-color: #ad8cc5; background: #f2ebf8; }
.tool-requirement { color: var(--muted); }

.file-quick-actions { margin: 0 0 1rem; }

#bulk-trash { padding: .65rem .8rem; border-radius: .65rem; background: #f0ecf5; }
#bulk-trash [role="status"] { font-size: .875rem; color: var(--muted); }
#bulk-trash button:disabled { opacity: .6; cursor: default; }

/* Workspace overview, file and processing views */
.content { max-width: 105rem; padding-inline: clamp(1rem, 3vw, 3rem); }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.page-heading h1 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.65rem); }
.dashboard-start { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(12rem, 1fr); gap: 1rem; }
.dashboard-upload { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; }
.dashboard-upload label, .dashboard-upload p { margin: 0; }
.dashboard-upload #file-picker { flex: 1 1 14rem; margin: 0; }
.dashboard-upload .file-icon { width: 2.75rem; height: 2.75rem; }
.dashboard-upload progress, .dashboard-upload [role=status] { width: 100%; }
.dashboard-storage meter { display: block; margin-top: .7rem; accent-color: var(--purple); }
.dashboard-storage strong { font-size: 1.3rem; }
.dashboard-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.dashboard-panel { min-height: 0; }
.dashboard-panel header h2 { margin-bottom: .6rem; }
.recent-panel { grid-row: span 2; }
.dashboard-list progress { width: 2rem; height: .5rem; accent-color: var(--purple); }
.tool-flow { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.tool-flow > * { background: #eee8f4; padding: .45rem .7rem; border-radius: .5rem; font-size: .875rem; }
[data-file-tool] { max-width: 70rem; }
[data-file-tool] [hidden] { display: none; }
[data-file-tool] fieldset { min-inline-size: 0; background: #fcfafd; }
[data-file-tool] select { max-width: 100%; }
.tool-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem 1rem; }
.tool-inputs details { grid-column: 1 / -1; margin-block: .25rem; }
.tracking-search { margin-bottom: 1rem; }
.comparison-grid, .template-library { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.comparison-grid > section { padding: .75rem; border: 1px solid var(--border); border-radius: .6rem; }
.template-library { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.template-card { display: grid; align-content: start; gap: .5rem; }
.template-card :is(h2, p) { margin: 0; overflow-wrap: anywhere; }
.template-card .button { justify-self: start; background: #f3edf7; }
.files li:has(input[type=checkbox]:checked) { background: #f1e9f8; box-shadow: inset 3px 0 #ac91c3; }
.files-grid .file-icon { width: 2.6rem; height: 2.6rem; }
.file-actions > form { padding-top: .4rem; }
button:disabled { opacity: .6; cursor: default; }
@media (max-width: 740px) {
  .dashboard-start, .dashboard-grid, .tool-inputs, .comparison-grid { grid-template-columns: minmax(0, 1fr); }
  .recent-panel { grid-row: auto; }
  .dashboard-list li { flex-wrap: wrap; }
  .dashboard-upload #file-picker { flex-basis: 100%; }
}
.template-list { grid-template-columns: minmax(0, 1fr); }
.template-list .template-card { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.template-list .template-card :is(p, small) { grid-column: 2; }
.template-list .template-card .button { grid-column: 3; grid-row: 1; }
@media (max-width: 540px) {
  .template-list .template-card .button { grid-column: 2; grid-row: auto; }
}
.studio-compose { border-top: 3px solid #a683bb; }
.studio-compose textarea { margin-block: .5rem 1rem; }
.studio-reply { max-width: 54rem; margin-bottom: 1rem; background: #f4eef9; }
.studio-reply p { margin-bottom: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.label-upload { max-width: 70rem; margin-block: 1rem; }
.label-upload form { padding-top: .7rem; }
.studio-usage, .studio-sources, .studio-suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin-bottom: .8rem; }
.studio-usage { max-width: 54rem; justify-content: space-between; }
.studio-sources span { padding: .35rem .55rem; background: #f1e9f6; border-radius: .45rem; overflow-wrap: anywhere; }
.menu-card > a { display: block; margin: .55rem 0; }
.template-drop { padding: 1.1rem; background: #f7f1fa; border-color: #d9c9e3; margin: 1rem 0; }
.template-drop #upload { padding: 1.3rem; border-width: 1px; border-radius: .7rem; }
.template-drop label { font-size: 1.15rem; }
.template-paths { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.template-paths small { display: block; margin-top: .22rem; font-weight: 500; }
@media (max-width: 620px) { .template-paths { grid-template-columns: minmax(0, 1fr); } }
