:root {
  color-scheme: light;
  --ink: #1e1b30;
  --muted: #5e5a70;
  --line: #e5e3ef;
  --paper: #fff;
  --surface: #f6f6fb;
  --accent: #5136a6;
  --accent-dark: #392179;
  --light: #ede9f9;
  font: 15px/1.5 "Avenir Next", Avenir, system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p, dl { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.06; letter-spacing: -.05em; }
h2 { font-size: 1rem; font-weight: 750; }
h3 { font-size: .9rem; }
p, small { color: var(--muted); }
button, input, select { font: inherit; }
button, .button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
button, .button, input, select { border-radius: 9px; }
button, .button { text-decoration: none; min-height: 40px; padding: 8px 14px; font-weight: 650; white-space: nowrap; }
.primary { background: var(--accent); border: 1px solid var(--accent); color: white; }
.primary:hover:enabled { background: var(--accent-dark); }
.secondary { border: 1px solid #dcd8e9; background: var(--paper); color: var(--ink); }
.secondary:hover:enabled, a.secondary:hover { background: var(--light); }
input, select { min-width: 0; width: 100%; min-height: 40px; border: 1px solid #dcd8e9; background: white; color: var(--ink); padding: 8px 10px; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, .table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { display: block; font-size: .85rem; font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.shell { display: grid; min-height: 100dvh; grid-template-columns: 228px minmax(0, 1fr); }
.rail { background: #fbfaff; border-right: 1px solid var(--line); padding: 24px 17px 18px; display: flex; flex-direction: column; gap: 14px; }
.wordmark { display: flex; gap: 10px; align-items: center; font-size: 1.65rem; line-height: 1; font-weight: 800; letter-spacing: -.07em; }
.mark { width: 31px; height: 31px; border-radius: 9px; background: #6244bd; position: relative; display: inline-block; }
.mark::before { content: ""; position: absolute; inset: 8px 7px 8px 11px; background: #f3f0ff; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.workspace-label { margin-top: 15px; padding: 10px; border: 1px solid var(--line); background: white; border-radius: 12px; display: flex; gap: 10px; align-items: center; line-height: 1.2; }
.workspace-label > span { background: var(--light); color: var(--accent); border-radius: 8px; width: 31px; height: 31px; display: grid; place-items: center; font-weight: 800; }
.workspace-label small { display: block; margin-top: 2px; }
.rail-title { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; }
.icon-button { border: 0; min-height: 32px; min-width: 32px; padding: 0; background: var(--light); color: var(--accent-dark); font-size: 1.2rem; }
.rail input { min-height: 35px; font-size: .85rem; }
#tables { display: grid; gap: 4px; }
.table-link { display: flex; min-width: 0; width: 100%; justify-content: space-between; gap: 12px; text-align: left; border: 0; background: transparent; color: var(--ink); font-weight: 600; }
.table-link span:first-child { overflow: hidden; text-overflow: ellipsis; }
.table-link small { font-weight: 600; }
.table-link:hover, .table-link[aria-current="page"] { background: var(--light); color: var(--accent-dark); }
.text-button { color: var(--muted); border: 0; background: transparent; text-align: left; margin-top: auto; }
.content { width: 100%; padding: clamp(18px, 4vw, 49px); max-width: 1460px; margin: 0 auto; }
.notice { border: 1px solid #d8cfee; color: #392179; background: #f0ebfc; padding: 11px 14px; border-radius: 10px; margin-bottom: 18px; overflow-wrap: anywhere; }
.notice[data-error="true"], .error { color: #912f43; }
.notice[data-error="true"] { border-color: #edcdd4; background: #fff1f4; }
.empty { min-height: 75vh; display: grid; place-content: center; justify-items: center; text-align: center; gap: 15px; }
.empty-art { width: 98px; padding: 14px 12px; border-radius: 17px; background: #e8e1f8; transform: rotate(-6deg); display: grid; gap: 7px; margin-bottom: 8px; }
.empty-art span { height: 7px; border-radius: 5px; background: #b5a5df; }
.empty-art span:first-child { background: #6244bd; width: 70%; }
.empty-art span:last-child { width: 82%; }
.table-header { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 25px; }
.table-header h1 { overflow-wrap: anywhere; }
.breadcrumb { margin-bottom: 8px; font-size: .85rem; font-weight: 650; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 19px; }
.stats > div { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px; }
.stats dt { color: var(--muted); font-size: .78rem; font-weight: 650; }
.stats dd { font-weight: 750; margin: 3px 0 0; line-height: 1.15; font-size: 1.7rem; letter-spacing: -.04em; }
.run-panel { display: flex; align-items: end; flex-wrap: wrap; justify-content: space-between; gap: 13px; background: #efecf8; border: 1px solid #e4ddf3; border-radius: 14px; padding: 15px; margin-bottom: 20px; }
.run-panel p { font-size: .86rem; }
.run-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.run-actions label { font-size: .75rem; }
.data-panel { border: 1px solid var(--line); border-radius: 14px; background: white; overflow: hidden; }
.data-heading { padding: 13px 15px; display: flex; justify-content: space-between; align-items: center; }
.data-heading span { color: var(--muted); font-size: .82rem; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: #f9f7fc; color: var(--muted); font-size: .79rem; font-weight: 700; }
th, td { padding: 11px 13px; border-top: 1px solid var(--line); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
td:first-child { font-weight: 650; }
.status { border-radius: 6px; background: #eeedf4; color: #4e4960; padding: 3px 7px; font-size: .76rem; font-weight: 700; }
.status[data-state="matched"] { background: #e6f4ea; color: #1f693e; }
.status[data-state="failed"], .status[data-state="needs_input"], .status[data-state="uncertain"] { background: #fcefd9; color: #75470f; }
.details { min-height: 30px; max-width: 100%; padding: 2px; overflow: hidden; text-overflow: ellipsis; border: 0; color: var(--accent); background: transparent; text-align: left; }
.details:hover { text-decoration: underline; }
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.gate-panel { width: min(100%, 430px); padding: 32px; background: white; border: 1px solid var(--line); border-radius: 20px; }
.gate .wordmark { margin-bottom: 24px; }
.gate h1 { font-size: 2.25rem; margin-bottom: 25px; }
form { display: grid; gap: 9px; }
.gate form button { justify-self: start; }
#login-code { font-variant-numeric: tabular-nums; letter-spacing: .3em; }
#login-message { margin-bottom: 5px; overflow-wrap: anywhere; }
.login-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.login-actions button { padding-inline: 0; font-size: .84rem; }
.error { margin-top: 8px; font-size: .88rem; }
dialog { width: min(calc(100vw - 28px), 590px); max-height: 88dvh; border: 1px solid var(--line); border-radius: 17px; padding: 22px; box-shadow: 0 15px 45px #25203f26; color: var(--ink); }
dialog::backdrop { background: #25203f70; }
dialog header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
dialog h2 { font-size: 1.32rem; }
dialog footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 11px; }
dialog #attempts { margin: 0; padding-left: 20px; }
.profile { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 2px 0 7px; }
.profile dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.profile dt { font-size: .8rem; color: var(--muted); }
.profile dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.preview { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 5px; }
.preview p { padding: 9px 10px; font-size: .83rem; }
.preview td, .preview th { font-size: .83rem; }
@media (max-width: 680px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
  .workspace-label { margin: 0; min-width: 110px; }
  .rail-title { margin: 0; }
  .rail input { grid-column: 2; grid-row: 2; max-width: 150px; }
  #tables { grid-column: 1 / -1; grid-auto-flow: column; grid-auto-columns: minmax(90px, max-content); overflow: auto; }
  #sign-out { grid-column: 2; padding: 0 4px; min-height: 24px; justify-self: end; }
  .content { padding: 17px 14px; }
  .empty { min-height: 55vh; }
  .table-header { align-items: start; }
  .table-header .button { font-size: .78rem; }
  .stats { gap: 6px; }
  .stats > div { padding: 9px; }
}
