:root {
  --page: #f5f5f2;
  --surface: #ffffff;
  --surface-subtle: #fafaf8;
  --surface-active: #f0f4f2;
  --ink: #171a18;
  --muted: #626a65;
  --faint: #8a928d;
  --line: #dfe2df;
  --line-strong: #c9ceca;
  --accent: #1f6a4f;
  --accent-soft: #e9f3ee;
  --danger: #a63b32;
  --warning: #8a571d;
  --radius: 7px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  display: none;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

nav {
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 245, 242, 0.94);
  backdrop-filter: blur(12px);
}

.nav-inner {
  width: min(100% - 32px, 900px);
  height: 56px;
  margin: 0 auto;
  padding: 0;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.nav-logo img {
  width: auto;
  height: 27px;
}

.nav-links {
  position: static;
  display: flex;
  align-items: center;
  width: auto;
  height: auto;
  padding: 0;
  gap: 20px;
  border: 0;
  background: transparent;
}

.nav-link {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;
}

.nav-link:hover {
  color: var(--ink);
}

.menu-btn,
.overlay {
  display: none !important;
}

.hero {
  width: min(100% - 32px, 900px);
  max-width: none;
  margin: 0 auto;
  padding: 50px 0 25px;
  text-align: left;
}

.hero h1 {
  max-width: none;
  margin: 0 0 8px;
  background: none;
  color: var(--ink);
  font-size: clamp(29px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  -webkit-text-fill-color: currentColor;
}

.hero p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px !important;
  color: var(--accent) !important;
  font-family: var(--sans);
  font-size: 12px !important;
  font-weight: 600 !important;
}

.hero-note span {
  font-size: 7px;
}

.hero-pills,
.security-banner {
  display: none;
}

main {
  position: relative;
  z-index: 1;
  width: min(100% - 32px, 900px);
  max-width: none;
  margin: 0 auto;
  padding: 0 0 64px;
}

.tabs {
  display: flex;
  gap: 0;
  margin: 0;
  padding: 0 12px;
  overflow: visible;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface-subtle);
}

.tab-btn {
  position: relative;
  flex: 0 0 auto;
  min-height: 47px;
  padding: 0 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.tab-btn::after {
  position: absolute;
  right: 18px;
  bottom: -1px;
  left: 18px;
  height: 2px;
  background: transparent;
  content: "";
}

.tab-btn.active {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.tab-btn.active::after {
  background: var(--accent);
}

.tab-btn:hover:not(.active) {
  background: transparent;
  color: var(--ink);
}

.panel {
  display: none;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
  box-shadow: none;
}

.panel.active {
  display: block;
}

.field {
  margin: 0 0 22px;
}

.field label,
.advanced-label,
.result-label span,
.preview-section h3 {
  display: block;
  margin: 0 0 7px;
  color: #3d443f;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.required {
  color: var(--danger);
}

textarea,
input[type="text"],
input[type="password"] {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea {
  min-height: 120px;
  padding: 12px 13px;
  resize: vertical;
}

input[type="text"],
input[type="password"] {
  height: 44px;
  padding: 0 13px;
}

textarea::placeholder,
input::placeholder {
  color: var(--faint);
}

textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(31, 106, 79, 0.11);
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.field-hint,
.char-counter,
.status-line,
.rt-result,
.toggle-label {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.5;
}

.field-hint {
  margin-top: 6px;
}

.char-counter {
  margin-top: 5px;
  text-align: right;
}

.cover-text-examples {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  flex-wrap: wrap;
}

.cover-text-examples > span {
  color: var(--faint);
  font-family: var(--sans);
  font-size: 12px;
}

.cover-example-chip,
.example-btn,
.pipe-btn,
.wm-chip {
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.cover-example-chip:hover,
.example-btn:hover,
.pipe-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-subtle);
  color: var(--ink);
}

.btn-row,
.export-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  width: auto;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  border-color: #303632;
  background: #303632;
  box-shadow: none;
  transform: none;
}

.btn-ghost {
  border-color: var(--line-strong);
  background: var(--surface);
  color: #464e49;
}

.btn-ghost:hover {
  border-color: #adb5af;
  background: var(--surface-subtle);
  color: var(--ink);
}

.btn-success {
  border-color: #bed6c9;
  background: var(--accent-soft);
  color: var(--accent);
}

.btn:disabled,
.pipe-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn i,
.tab-btn i,
.cover-example-chip i,
.example-btn i,
.pipe-btn i,
.wm-chip i,
.section-heading i,
.info-card h3 i,
.preview-section h3 i,
.technical-preview summary i,
.inspection-details summary i,
.inline-security-note i {
  display: none;
}

.inline-security-note {
  display: block;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.status-line {
  min-height: 0;
  margin-top: 8px;
}

.status-line:empty {
  display: none;
}

.status-line.ok {
  color: var(--accent);
}

.status-line.err {
  color: var(--danger);
}

.status-line.warn {
  color: var(--warning);
}

.result-card {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
}

.result-card.is-ready,
.result-card.is-found {
  border-color: #bed6c9;
  background: #f5faf7;
}

.result-card.needs-attention {
  border-color: #e5d2b7;
  background: #fffaf2;
}

.result-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.result-label span {
  margin: 0;
}

.result-label .result-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.result-box,
.preview-display,
.detect-result,
.file-loaded {
  min-height: 74px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.result-box.empty {
  color: var(--faint);
  font-family: var(--sans);
  font-style: normal;
}

.result-box.has-content {
  border-color: #bed6c9;
}

.export-row {
  margin-top: 10px;
}

.pipe-btn {
  margin-left: auto;
}

.advanced-options,
.inspection-details,
.technical-preview {
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.advanced-options > summary,
.inspection-details > summary,
.technical-preview > summary {
  display: flex;
  align-items: center;
  min-height: 43px;
  padding: 0 12px;
  gap: 10px;
  color: #464e49;
  cursor: pointer;
  font-size: 13px;
  font-weight: 620;
  list-style: none;
}

.advanced-options > summary::-webkit-details-marker,
.inspection-details > summary::-webkit-details-marker,
.technical-preview > summary::-webkit-details-marker {
  display: none;
}

.advanced-options > summary::after,
.inspection-details > summary::after,
.technical-preview > summary::after {
  margin-left: auto;
  color: var(--faint);
  content: "⌄";
}

.advanced-options[open] > summary::after,
.inspection-details[open] > summary::after,
.technical-preview[open] > summary::after {
  transform: rotate(180deg);
}

.summary-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.advanced-options > summary::after {
  margin-left: 0;
}

.advanced-content {
  padding: 16px 12px 13px;
  border-top: 1px solid var(--line);
}

.advanced-label {
  margin-bottom: 7px;
}

.mode-selector,
.wm-sub-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 10px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.mode-btn,
.wm-sub-btn {
  flex: 1;
  min-height: 43px;
  padding: 7px 11px;
  border: 1px solid var(--line-strong) !important;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0;
  text-transform: none;
}

.mode-btn.active-v2,
.mode-btn.active-binary,
.wm-sub-btn.active {
  border-color: #9fc4b3 !important;
  background: var(--accent-soft);
  color: var(--accent);
}

.mode-badge {
  padding: 2px 5px;
  border: 0;
  border-radius: 4px;
  background: rgba(23, 26, 24, 0.06);
  color: inherit;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
}

.mode-info-strip {
  display: flex;
  margin: 0 0 15px;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.5;
}

.passphrase-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.toggle-switch {
  position: relative;
  width: 34px;
  height: 20px;
  flex: 0 0 auto;
}

.toggle-track {
  border-color: var(--line-strong);
  background: #e8ebe9;
}

input:checked + .toggle-track {
  border-color: var(--accent);
  background: var(--accent);
}

.passphrase-field {
  margin-top: 10px;
}

.advanced-test-btn {
  margin-top: 13px;
}

.technical-preview {
  margin-top: 10px;
}

.technical-preview .preview-display,
.technical-preview .preview-legend {
  margin-inline: 12px;
}

.technical-preview .preview-display {
  margin-top: 0;
}

.technical-preview .preview-legend {
  margin-bottom: 12px;
}

.preview-legend {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
}

.decode-empty-state {
  margin-bottom: 20px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
  text-align: left;
}

.decode-empty-state p {
  margin-bottom: 10px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
}

.decode-empty-state p strong {
  color: var(--ink);
}

.example-btns {
  display: flex;
  gap: 6px;
  justify-content: flex-start !important;
  flex-wrap: wrap;
}

.inspection-details {
  margin-top: 10px;
}

.inspection-details .detect-result {
  min-height: 0;
  margin: 0 12px 10px;
}

.inspection-details > .btn {
  margin: 0 12px 12px;
}

.detect-row {
  padding: 7px 0;
  border-bottom-color: var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
}

.detect-row strong {
  color: var(--ink);
}

.file-drop-zone {
  padding: 28px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--surface-subtle);
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
  border-color: #9fc4b3;
  background: #f5faf7;
}

.file-drop-zone .drop-icon {
  display: none;
}

.file-drop-zone p {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
}

.file-drop-zone p strong {
  color: var(--ink);
}

.wm-info-strip {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.wm-chip {
  min-height: 26px;
  background: var(--surface-subtle);
}

.wm-id-row {
  align-items: flex-end;
}

.verify-result-card {
  border-radius: 6px;
  font-family: var(--sans);
}

.divider {
  margin: 64px 0 42px;
  border: 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  max-width: 720px;
  margin: 0 auto 12px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.info-grid {
  display: block;
  max-width: 720px;
  margin: 0 auto;
}

.info-card {
  padding: 22px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.info-card:last-child {
  border-bottom: 0;
}

.info-card:hover {
  border-color: var(--line);
}

.info-card h3 {
  margin: 0 0 9px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 680;
  line-height: 1.4;
}

.info-card ul {
  margin: 0;
  padding-left: 20px;
  list-style: disc;
}

.info-card li {
  position: static;
  padding: 3px 0;
  border: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.info-card li::before {
  display: none;
}

.info-card strong {
  color: #3d443f;
  font-weight: 650;
}

.info-card code {
  font-family: var(--mono);
  font-size: 0.92em;
}

footer {
  display: flex;
  width: min(100% - 32px, 900px);
  max-width: none;
  margin: 0 auto;
  padding: 23px 0 28px;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.footer-links-inline {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links-inline a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.footer-links-inline a:hover {
  color: var(--ink);
}

.footer-bottom {
  display: block;
  padding: 0;
  border: 0;
}

.footer-bottom p {
  margin: 0;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0;
  text-align: right;
  text-transform: none;
}

#toast {
  right: 16px;
  bottom: 16px;
  max-width: min(320px, calc(100vw - 32px));
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 13px;
  box-shadow: 0 8px 28px rgba(23, 26, 24, 0.18);
}

@media (max-width: 700px) {
  html {
    scroll-padding-top: 62px;
  }

  .nav-inner,
  .hero,
  main,
  footer {
    width: min(100% - 24px, 900px);
  }

  .nav-inner {
    height: 52px;
  }

  .nav-logo img {
    height: 25px;
  }

  .nav-links {
    position: static;
    display: flex;
    width: auto;
    height: auto;
    padding: 0;
    gap: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .nav-link-secondary {
    display: none;
  }

  .hero {
    padding: 34px 0 20px;
  }

  .hero h1 {
    font-size: clamp(27px, 8.4vw, 34px);
  }

  .hero p {
    font-size: 14px;
  }

  .tabs {
    padding: 0 4px;
  }

  .tab-btn {
    flex: 1;
    min-width: 0;
    min-height: 45px;
    padding: 0 6px;
    font-size: 12px;
  }

  .tab-btn::after {
    right: 10px;
    left: 10px;
  }

  .panel {
    padding: 18px 14px 20px;
  }

  .field {
    margin-bottom: 19px;
  }

  textarea {
    min-height: 112px;
  }

  .btn-row,
  .export-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .btn-row .btn-primary,
  .export-row .btn-primary {
    grid-column: 1 / -1;
  }

  .btn,
  .pipe-btn,
  .export-row .btn {
    width: 100%;
    min-height: 44px;
  }

  .pipe-btn {
    margin-left: 0;
  }

  .mode-selector {
    flex-direction: column;
  }

  .mode-btn {
    border: 1px solid var(--line-strong) !important;
  }

  .summary-meta {
    display: inline;
    overflow: hidden;
    max-width: 120px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .result-card {
    padding: 12px;
  }

  .wm-id-row {
    flex-direction: column;
    align-items: stretch;
  }

  .wm-id-row .btn {
    width: 100%;
    height: 44px;
  }

  .divider {
    margin: 52px 0 34px;
  }

  .section-heading {
    font-size: 20px;
  }

  .info-card {
    padding: 19px 0;
  }

  footer {
    display: block;
    padding: 21px 0 25px;
  }

  .footer-links-inline {
    gap: 8px 15px;
  }

  .footer-bottom {
    margin-top: 15px;
  }

  .footer-bottom p {
    text-align: left;
  }
}

@media (max-width: 380px) {
  .cover-text-examples > span {
    flex-basis: 100%;
  }

  .summary-meta {
    display: none;
  }

  .wm-sub-btn {
    padding-inline: 7px;
    font-size: 11px;
  }

  .btn-row,
  .export-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
