:root {
  --ink: #172033;
  --muted: #607087;
  --line: #dce4ee;
  --panel: #ffffff;
  --paper: #f6f8fb;
  --accent: #0f8b8d;
  --accent-dark: #0b6668;
  --sun: #f7b538;
  --rose: #d65a6f;
  --shadow: 0 18px 48px rgba(20, 32, 55, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: rgba(246, 248, 251, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 72px);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(16px);
}

.brand,
.nav {
  align-items: center;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.brand {
  color: var(--ink);
  font-weight: 850;
  white-space: nowrap;
}

.brand-mark {
  border-radius: 8px;
  height: 34px;
  object-fit: contain;
  width: 34px;
}

.nav a {
  color: var(--muted);
  font-size: 14px;
}

.nav-form {
  margin: 0;
}

.nav-user {
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  padding: 9px 13px;
  min-height: auto;
}

main {
  padding: 0 clamp(20px, 5vw, 72px) 56px;
}

.hero {
  align-items: center;
  display: grid;
  gap: clamp(28px, 5vw, 72px);
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 0.62fr);
  min-height: auto;
  padding: clamp(46px, 7vw, 92px) 0 clamp(34px, 5vw, 64px);
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  margin: 0 0 12px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(42px, 5.6vw, 70px);
  line-height: 1;
  margin: 0;
  max-width: 900px;
}

h2 {
  font-size: 28px;
  margin: 0 0 12px;
}

.lead,
.page-heading p,
.section-grid p,
.auth-shell p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  max-width: 720px;
}

.hero-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-steps span {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  padding: 10px 12px;
}

.upload-panel,
.price-card,
.auth-form,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.upload-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.dropzone {
  background: #f9fbfd;
  border: 1px dashed #7e93aa;
  border-radius: 8px;
  min-height: 178px;
  position: relative;
}

.dropzone.compact {
  min-height: 138px;
}

.dropzone:hover {
  border-color: var(--accent);
}

.dropzone input {
  cursor: pointer;
  inset: 0;
  opacity: 0;
  position: absolute;
  width: 100%;
}

.dropzone label {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.dropzone strong {
  font-size: 24px;
}

.dropzone span,
.quota,
.field-label,
.format-note {
  color: var(--muted);
  font-size: 14px;
}

.format-note {
  line-height: 1.5;
  margin: -4px 0 0;
}

select,
input {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 13px 14px;
  width: 100%;
}

select,
button,
input {
  min-height: 44px;
}

button,
.primary,
.secondary {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  min-height: 48px;
  padding: 0 18px;
}

.primary {
  background: var(--accent);
  color: white;
  width: 100%;
}

.primary:hover {
  background: var(--accent-dark);
}

.primary:disabled {
  background: #87b9ba;
  cursor: wait;
}

.secondary {
  background: #eef3f7;
  color: var(--ink);
}

.quota {
  display: flex;
  justify-content: space-between;
}

.metrics {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, 1fr);
  padding: 24px 0;
}

.metrics div {
  display: grid;
  gap: 6px;
}

.metric {
  color: var(--rose);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 900;
}

.section-grid,
.auth-shell {
  align-items: start;
  display: grid;
  gap: 34px;
  grid-template-columns: 0.7fr 1fr;
  padding-top: 42px;
}

.table-wrap {
  overflow: hidden;
}

.wide {
  margin-top: 28px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 13px;
}

.empty {
  color: var(--muted);
  padding: 28px;
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
}

.download-link {
  align-items: center;
  background: #e8f7ef;
  border-radius: 8px;
  color: #13643b;
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  min-height: 34px;
  padding: 0 12px;
}

.history-notice {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  padding: 14px 16px;
}

.history-notice.success {
  background: #e8f7ef;
  color: #13643b;
}

.history-notice.error {
  background: #fdecef;
  color: #8f2437;
}

.status-pill {
  background: #eef3f7;
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  padding: 5px 9px;
}

.status-pill.processing::before,
.status-pill.queued::before {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 6px;
  margin: 5px 6px 0 0;
  width: 6px;
}

.status-pill.completed {
  background: #e8f7ef;
  color: #13643b;
}

.status-pill.failed {
  background: #fdecef;
  color: #8f2437;
}

.status-pill.processing {
  background: #fff6dd;
  color: #7a560b;
}

.page-heading {
  padding-top: clamp(40px, 6vw, 68px);
}

.page-heading h1 {
  max-width: 820px;
}

.tool-summary {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 34px;
  padding: 22px 0;
}

.tool-summary div {
  display: grid;
  gap: 6px;
}

.tool-summary-number {
  align-items: center;
  background: var(--accent);
  border-radius: 8px;
  color: white;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.tool-summary strong {
  font-size: 17px;
}

.tool-summary span:last-child {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.tool-filters {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(240px, 0.42fr) 1fr;
  padding-top: 28px;
}

.tool-search {
  display: grid;
  gap: 8px;
}

.tool-search span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.tool-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-filter {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  min-height: 40px;
  padding: 0 12px;
}

.tool-filter.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.tool-empty {
  margin-top: 24px;
}

.pricing-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 32px;
}

.price-card {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.badge {
  background: rgba(247, 181, 56, 0.22);
  border-radius: 999px;
  color: #8a5c00;
  font-size: 13px;
  font-weight: 850;
  justify-self: start;
  padding: 7px 10px;
}

.price {
  font-size: 38px;
  font-weight: 900;
  margin: 0;
}

.price span {
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
}

ul {
  color: var(--muted);
  line-height: 1.9;
  margin: 0;
  padding-left: 20px;
}

.auth-form {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.tool-detail-shell {
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 0.6fr);
  padding-top: clamp(46px, 7vw, 84px);
}

.tool-detail-copy h1 {
  font-size: clamp(42px, 5vw, 64px);
}

.tool-form {
  gap: 14px;
}

.auth-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.tool-section {
  padding-top: 38px;
}

.tool-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
}

.tool-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 194px;
  padding: 18px;
}

.tool-card.soon {
  background: #f9fbfd;
  box-shadow: none;
  opacity: 0.78;
}

.tool-card h3 {
  font-size: 18px;
  margin: 10px 0 8px;
}

.tool-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.tool-status {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.tool-action {
  align-items: center;
  background: #e8f7ef;
  border-radius: 8px;
  color: #13643b;
  display: inline-flex;
  font-size: 14px;
  font-weight: 850;
  justify-content: center;
  margin-top: 18px;
  min-height: 40px;
  padding: 0 14px;
}

.tool-action.disabled {
  background: #eef3f7;
  color: var(--muted);
}

.flash-stack {
  display: grid;
  gap: 10px;
  left: 50%;
  max-width: 620px;
  position: fixed;
  top: 82px;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  z-index: 10;
}

.flash {
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.flash.success {
  background: #e8f7ef;
  color: #13643b;
}

.flash.error {
  background: #fdecef;
  color: #8f2437;
}

.flash.warning {
  background: #fff6dd;
  color: #7a560b;
}

@media (max-width: 920px) {
  .hero,
  .section-grid,
  .auth-shell,
  .pricing-grid,
  .metrics,
  .tool-summary,
  .tool-filters,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding: 38px 0 30px;
  }

  h1 {
    font-size: 44px;
  }

  .upload-panel {
    padding: 18px;
  }

  .topbar,
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    gap: 10px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  main {
    padding: 0 14px 36px;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 12px;
    padding: 12px 14px;
    position: static;
  }

  .brand {
    gap: 10px;
    flex: 0 0 auto;
    width: auto;
  }

  .brand span:last-child {
    display: none;
  }

  .brand-mark {
    flex: 0 0 32px;
    height: 32px;
    width: 32px;
  }

  .nav {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    margin-left: auto;
    max-width: calc(100vw - 62px);
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    width: auto;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a,
  .nav-button {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: inline-flex;
    font-size: 13px;
    min-height: 36px;
    padding: 0 10px;
  }

  .nav-form {
    flex: 0 0 auto;
    display: inline-flex;
  }

  .nav-user {
    display: none;
  }

  .hero {
    gap: 22px;
    padding: 22px 0 26px;
  }

  h1 {
    font-size: 32px;
    line-height: 1.04;
  }

  h2 {
    font-size: 24px;
  }

  .lead,
  .page-heading p,
  .section-grid p,
  .auth-shell p {
    font-size: 16px;
    line-height: 1.55;
  }

  .eyebrow {
    font-size: 12px;
  }

  .hero-steps {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 18px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .hero-steps::-webkit-scrollbar {
    display: none;
  }

  .hero-steps span {
    flex: 0 0 auto;
    font-size: 13px;
    padding: 9px 10px;
  }

  .upload-panel,
  .auth-form,
  .price-card {
    padding: 16px;
  }

  .dropzone {
    min-height: 132px;
  }

  .dropzone.compact {
    min-height: 118px;
  }

  .dropzone label {
    padding: 18px;
  }

  .dropzone strong {
    font-size: 20px;
  }

  .format-note,
  .quota,
  .field-label,
  .dropzone span {
    font-size: 13px;
  }

  .quota {
    gap: 6px;
  }

  .metrics,
  .tool-summary {
    gap: 14px;
    padding: 18px 0;
  }

  .metric {
    font-size: 20px;
  }

  .section-grid,
  .auth-shell {
    gap: 20px;
    padding-top: 30px;
  }

  .page-heading {
    padding-top: 32px;
  }

  .tool-detail-copy h1 {
    font-size: 32px;
  }

  .tool-filters {
    padding-top: 20px;
  }

  .tool-filter-tabs {
    flex-wrap: nowrap;
    margin-right: -14px;
    overflow-x: auto;
    padding: 0 14px 2px 0;
    scrollbar-width: none;
  }

  .tool-filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .tool-filter {
    flex: 0 0 auto;
  }

  .tool-grid {
    gap: 12px;
  }

  .tool-card {
    min-height: 0;
    padding: 16px;
  }

  .tool-action,
  .download-link {
    width: 100%;
  }

  .table-wrap {
    box-shadow: none;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
  }

  tr {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
  }

  td {
    align-items: start;
    border-bottom: 0;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
    padding: 7px 0;
  }

  td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 12px;
    font-weight: 850;
  }

  td:empty {
    display: none;
  }

  .empty {
    padding: 22px 16px;
  }

  .flash-stack {
    top: 70px;
    width: calc(100% - 28px);
  }
}

@media (max-width: 380px) {
  h1,
  .tool-detail-copy h1 {
    font-size: 32px;
  }

  .nav {
    gap: 8px;
  }

  .nav a,
  .nav-button {
    font-size: 12px;
    padding: 0 8px;
  }

  td {
    grid-template-columns: 1fr;
  }
}
