:root {
  --ink: #17202a;
  --muted: #5d6b7a;
  --line: #d9e2e9;
  --paper: #ffffff;
  --soft: #f5f7f8;
  --teal: #0f766e;
  --green: #2f855a;
  --amber: #b7791f;
  --red: #b42318;
  --sky: #2563eb;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.kkt-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(23, 32, 42, 0.08);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.kkt-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.kkt-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-size: 14px;
}

.kkt-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #314150;
  font-size: 14px;
  font-weight: 650;
}

.kkt-nav-button,
.kkt-primary-link,
.kkt-small-action,
.kkt-ghost-link,
.kkt-upload-actions button,
.kkt-tax-row button,
.kkt-report-modal button,
#kkt-report-submit {
  min-height: 42px;
  border-radius: 8px;
}

.kkt-nav-button,
.kkt-primary-link,
.kkt-upload-actions button,
#kkt-report-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: var(--teal);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}

.kkt-nav-button {
  padding: 0 15px;
}

.kkt-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 32px;
  align-items: end;
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 32px 28px;
}

.kkt-hero-copy {
  padding: 28px 0;
}

.kkt-kicker {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.08;
}

h1 {
  max-width: 760px;
  font-size: clamp(38px, 7vw, 74px);
}

h2 {
  font-size: 28px;
}

.kkt-lead {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.kkt-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.kkt-primary-link,
.kkt-ghost-link,
.kkt-small-action {
  padding: 0 18px;
}

.kkt-ghost-link,
.kkt-small-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: #20303e;
  font-weight: 750;
  cursor: pointer;
}

.kkt-tax-panel,
.kkt-workspace {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 44px rgba(23, 32, 42, 0.08);
}

.kkt-tax-panel {
  padding: 20px;
}

.kkt-tax-panel label {
  display: block;
  margin-bottom: 8px;
  color: #2f3d49;
  font-size: 13px;
  font-weight: 800;
}

.kkt-tax-row {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 8px;
}

.kkt-tax-row input,
.kkt-modal-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

.kkt-tax-row input {
  height: 48px;
  padding: 0 14px;
}

.kkt-tax-row input:focus,
.kkt-modal-panel textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.kkt-tax-row button {
  border: 0;
  background: var(--amber);
  color: #fff;
  cursor: pointer;
}

.kkt-tax-result {
  min-height: 24px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.kkt-tax-result strong {
  display: block;
  color: var(--ink);
}

.kkt-workspace {
  max-width: 1180px;
  margin: 0 auto 42px;
  padding: 24px;
}

.kkt-tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.kkt-upload-form {
  display: grid;
  gap: 16px;
}

.kkt-segments {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kkt-segments input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.kkt-segments span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #344251;
  font-weight: 750;
  cursor: pointer;
}

.kkt-segments input:checked + span {
  border-color: rgba(15, 118, 110, 0.25);
  background: #e9f7f4;
  color: var(--teal);
}

#kkt-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.kkt-dropzone {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 136px;
  padding: 22px;
  border: 2px dashed #aebdca;
  border-radius: 8px;
  background: #fbfcfc;
  cursor: pointer;
}

.kkt-dropzone.is-dragover {
  border-color: var(--teal);
  background: #eef8f5;
}

.kkt-drop-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  background: #e7f0ea;
  color: var(--green);
  font-size: 24px;
}

.kkt-dropzone strong,
.kkt-dropzone small {
  display: block;
}

.kkt-dropzone small {
  margin-top: 4px;
  color: var(--muted);
}

.kkt-upload-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.kkt-upload-actions button {
  padding: 0 18px;
}

#kkt-upload-status {
  color: var(--muted);
  font-size: 14px;
}

.kkt-results {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.kkt-result-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.kkt-result-row:first-child {
  border-top: 0;
}

.kkt-result-row strong,
.kkt-result-row small {
  display: block;
}

.kkt-result-row small {
  color: var(--muted);
}

.kkt-pill {
  align-self: start;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef3f7;
  color: #2f3d49;
  font-size: 12px;
  font-weight: 800;
}

.kkt-tabs {
  margin-top: 24px;
}

.kkt-tab-buttons {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.kkt-tab-buttons button {
  min-height: 44px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #40505f;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.kkt-tab-buttons button.is-active {
  border-color: var(--teal);
  color: var(--teal);
}

.kkt-tab-buttons span {
  margin-left: 5px;
  color: var(--muted);
  font-size: 12px;
}

.kkt-tab-panel {
  display: none;
  padding-top: 14px;
}

.kkt-tab-panel.is-active {
  display: block;
}

.kkt-empty {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
  text-align: center;
}

.kkt-file-list {
  display: grid;
  gap: 10px;
}

.kkt-file-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.kkt-file-row strong,
.kkt-file-row small,
.kkt-file-meta span {
  display: block;
}

.kkt-file-row small,
.kkt-file-meta {
  color: var(--muted);
  font-size: 13px;
}

.kkt-file-actions {
  display: flex;
  gap: 8px;
}

.kkt-file-actions button,
.kkt-modal-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #344251;
  cursor: pointer;
}

.kkt-file-actions button:hover {
  color: var(--red);
}

.kkt-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 32, 42, 0.48);
}

.kkt-modal[hidden] {
  display: none;
}

.kkt-modal-panel {
  position: relative;
  width: min(520px, 100%);
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.kkt-modal-panel h2 {
  margin-bottom: 14px;
}

.kkt-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.kkt-modal-panel textarea {
  min-height: 134px;
  padding: 12px;
  resize: vertical;
}

#kkt-report-submit {
  margin-top: 12px;
  padding: 0 16px;
}

#kkt-report-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.kkt-footer {
  padding: 28px 20px 34px;
  color: var(--muted);
  text-align: center;
}

.kkt-auth-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 30px;
  align-items: start;
  max-width: 1080px;
  margin: 38px auto 60px;
  padding: 0 20px;
}

.kkt-auth-intro {
  padding: 34px 0;
}

.kkt-auth-intro h1 {
  font-size: clamp(34px, 5vw, 58px);
}

.kkt-auth-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 24px;
  box-shadow: 0 18px 44px rgba(23, 32, 42, 0.08);
}

.kkt-auth-card .form-group {
  margin-bottom: 16px;
}

.kkt-auth-card label {
  display: block;
  margin-bottom: 7px;
  color: #2f3d49;
  font-weight: 750;
}

.kkt-auth-card .form-control {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.kkt-auth-card .form-control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.kkt-auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}

.kkt-auth-link {
  display: block;
  margin-top: 12px;
  color: var(--teal);
  font-weight: 750;
  text-align: center;
}

.kkt-auth-link.muted {
  color: var(--muted);
  font-weight: 650;
}

.kkt-register-tax-row {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 8px;
}

.kkt-register-tax-row button {
  border: 0;
  border-radius: 8px;
  background: var(--amber);
  color: #fff;
}

@media (max-width: 860px) {
  .kkt-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px;
  }

  .kkt-nav {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .kkt-hero {
    grid-template-columns: 1fr;
    padding: 34px 18px 20px;
  }

  .kkt-workspace {
    margin: 0 18px 34px;
    padding: 18px;
  }

  .kkt-tool-head,
  .kkt-auth-wrap,
  .kkt-result-row,
  .kkt-file-row {
    grid-template-columns: 1fr;
  }

  .kkt-file-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 40px;
  }

  .kkt-nav {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .kkt-dropzone {
    grid-template-columns: 1fr;
  }

  .kkt-hero-actions,
  .kkt-upload-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
