:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --text: #17202a;
  --muted: #687581;
  --line: #dce2e7;
  --line-strong: #c5ced6;
  --accent: #176b5b;
  --accent-strong: #0f5649;
  --accent-soft: #e4f3ee;
  --danger: #b13a34;
  --danger-soft: #fbeceb;
  --shadow: 0 18px 48px rgba(23, 32, 42, 0.08);
  --radius-large: 22px;
  --radius-medium: 14px;
  --radius-small: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -10%, rgba(23, 107, 91, 0.08), transparent 28rem),
    var(--bg);
}

button,
textarea,
input {
  font: inherit;
}

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

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
[data-hash]:focus-visible {
  outline: 3px solid rgba(23, 107, 91, 0.26);
  outline-offset: 2px;
}

.shell {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid rgba(197, 206, 214, 0.72);
  background: rgba(244, 246, 248, 0.88);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 1.28rem;
  font-weight: 780;
  letter-spacing: -0.04em;
}

.app-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  align-items: start;
  gap: 28px;
  padding-block: 48px 64px;
}

.tool-view {
  min-width: 0;
}

.tool-page {
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tool-heading {
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 780;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tool-heading h1 {
  margin: 0;
  font-size: clamp(1.72rem, 4vw, 2.45rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.tool-heading p:last-child {
  max-width: 650px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.drop-zone {
  min-height: 176px;
  padding: 28px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-medium);
  background: var(--surface-soft);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.drop-zone-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 1.2rem;
  font-weight: 800;
}

.drop-zone strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.drop-zone p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.file-picker {
  margin-top: 16px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
}

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

.section-block {
  margin-top: 28px;
}

.algorithm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.algorithm-tag {
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: #53606b;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 750;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

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

.algorithm-tag.is-selected {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.inline-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.field-label,
.section-label {
  display: block;
  margin: 0 0 9px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 720;
}

.text-field {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  padding: 15px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  color: var(--text);
  background: #fbfcfd;
  line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
}

.text-field::placeholder {
  color: #929da7;
}

.text-field:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.text-field[readonly] {
  background: var(--surface-soft);
}

.or-divider {
  margin: 22px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #8a959f;
  font-size: 0.74rem;
  font-weight: 750;
  text-transform: uppercase;
}

.or-divider::before,
.or-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.status-line {
  min-height: 22px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

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

.progress-track {
  height: 8px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ecef;
}

.progress-track[hidden] {
  display: none;
}

.progress-value {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 100ms linear;
}

.working-panel {
  margin-top: 26px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-soft);
}

.working-panel[hidden] {
  display: none;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 0.8rem;
}

.progress-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-head strong {
  color: var(--text);
}

.result-card {
  margin-top: 26px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--surface-soft);
}

.result-card[hidden] {
  display: none;
}

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

.result-head h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 720;
}

.button-primary {
  color: #fff;
  background: var(--accent);
}

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

.button-secondary {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface);
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.result-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.result-algorithm {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 0.72rem;
  font-weight: 780;
}

.result-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.result-grid > div {
  min-width: 0;
  padding: 12px;
  border-radius: 9px;
  background: var(--surface);
}

.result-grid dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.result-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.84rem;
  font-weight: 680;
}

.hash-result {
  margin-top: 16px;
}

.hash-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.hash-row code {
  min-width: 0;
  flex: 1;
  padding: 11px 12px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #26323b;
  background: var(--surface);
  font-size: 0.78rem;
  line-height: 1.5;
}

.hash-row code[data-hash] {
  cursor: copy;
  transition: border-color 150ms ease, color 150ms ease;
}

.hash-row code[data-hash]:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.hash-copy-feedback {
  min-height: 20px;
  margin: 6px 0 0;
  color: var(--accent-strong);
  font-size: 0.78rem;
  line-height: 1.5;
}

.notice {
  margin-top: 24px;
  padding: 13px 15px;
  border-radius: 10px;
  color: #47615b;
  background: var(--accent-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}

.placeholder-card {
  padding: 30px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-medium);
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
}

.tool-menu {
  position: sticky;
  top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 12px 32px rgba(23, 32, 42, 0.05);
  backdrop-filter: blur(12px);
}

.menu-label {
  margin: 2px 8px 12px;
  color: #8a959f;
  font-size: 0.7rem;
  font-weight: 780;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.menu-links {
  display: grid;
  gap: 6px;
}

.menu-links a {
  padding: 12px 13px;
  display: grid;
  gap: 3px;
  border-radius: 11px;
  color: var(--text);
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}

.menu-links a:hover {
  background: #f1f4f5;
}

.menu-links a.is-active {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.menu-links a span {
  font-size: 0.9rem;
  font-weight: 740;
}

.menu-links a small {
  color: var(--muted);
  font-size: 0.74rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
}

.footer-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 0.78rem;
}

@media (max-width: 780px) {
  .shell {
    width: min(100% - 28px, 680px);
  }

  .app-layout {
    grid-template-columns: 1fr;
    padding-block: 26px 44px;
  }

  .tool-menu {
    grid-row: 1;
    position: static;
    overflow-x: auto;
  }

  .menu-label {
    display: none;
  }

  .menu-links {
    min-width: 530px;
    grid-template-columns: repeat(3, 1fr);
  }

  .menu-links a small {
    display: none;
  }

  .menu-links a {
    text-align: center;
  }

  .footer-inner {
    padding-block: 20px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .header-inner {
    min-height: 62px;
  }

  .tool-page {
    padding: 22px 18px;
    border-radius: 17px;
  }

  .drop-zone {
    min-height: 158px;
    padding: 22px 16px;
  }

  .result-head {
    align-items: flex-start;
    flex-direction: column;
  }


  .hash-row {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
