:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #eef4f6;
  --text: #172026;
  --muted: #61707a;
  --line: #dbe2e6;
  --accent: #0f7b8f;
  --accent-2: #d24f32;
  --accent-3: #2f7d4d;
  --focus: #ffb84d;
  --shadow: 0 16px 36px rgba(23, 32, 38, 0.09);
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 52px);
  border-bottom: 1px solid rgba(219, 226, 230, 0.9);
  background: rgba(247, 248, 251, 0.92);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0;
}

.top-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-nav-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.top-nav-item:hover,
.top-nav-item.active {
  background: var(--surface-2);
  color: var(--text);
}

main {
  padding: 0 clamp(16px, 4vw, 52px) 44px;
}

.intro {
  padding: 34px 0 24px;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 0.96;
  letter-spacing: 0;
}

.intro p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.tool-list,
.tool-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tool-list {
  position: sticky;
  top: 78px;
  max-height: calc(100vh - 98px);
  overflow: auto;
}

.tool-list-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.tool-list h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.tool-list input,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.field textarea {
  min-height: 170px;
  resize: vertical;
  line-height: 1.5;
}

.file-picker {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.native-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.file-button:hover {
  border-color: var(--accent);
  background: #eaf6f8;
  color: var(--accent);
}

.file-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.file-clear:hover {
  border-color: var(--accent-2);
  background: #fff1ec;
  color: var(--accent-2);
}

.file-clear[hidden] {
  display: none;
}

.native-file:focus-visible + .file-button {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.file-name {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-cards {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.tool-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  text-align: left;
}

.tool-card:hover,
.tool-card.active {
  border-color: var(--line);
  background: var(--surface-2);
}

.tool-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #e2f1f4;
  color: var(--accent);
  font-weight: 900;
}

.tool-card:nth-child(3n) .tool-icon {
  background: #f7e6df;
  color: var(--accent-2);
}

.tool-card:nth-child(3n + 1) .tool-icon {
  background: #e4f0e8;
  color: var(--accent-3);
}

.tool-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
}

.tool-card span:last-child {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.tool-panel {
  min-height: 620px;
  padding: clamp(18px, 3vw, 34px);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin-bottom: 8px;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.04;
}

.panel-head p {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.badge {
  align-self: start;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7e8;
  color: #7a4b00;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

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

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.field small {
  color: var(--muted);
  line-height: 1.45;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 18px;
}

.primary,
.secondary,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

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

.secondary,
.download-link {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.primary:hover,
.secondary:hover,
.download-link:hover {
  transform: translateY(-1px);
}

.result {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.result:empty {
  display: none;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.preview-image {
  max-width: min(100%, 520px);
  max-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qr-output canvas,
.qr-output img {
  width: 220px;
  height: 220px;
  border: 12px solid #fff;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(23, 32, 38, 0.12);
}

.password-output {
  display: flex;
  gap: 10px;
}

.password-output input {
  flex: 1;
}

.notice {
  color: var(--muted);
  line-height: 1.55;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px clamp(16px, 4vw, 52px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer-links a {
  text-decoration: none;
}

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

.legal-page {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.legal-card {
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-card h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

.legal-card h2 {
  margin: 34px 0 10px;
  font-size: 22px;
}

.legal-card p,
.legal-card li {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.legal-card ul {
  margin: 12px 0 0;
  padding-left: 22px;
}

.legal-card a {
  color: var(--accent);
  font-weight: 700;
}

.last-updated {
  margin: 0 0 28px;
  color: var(--muted);
}

@media (max-width: 920px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .tool-list {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .site-header,
  .panel-head,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .file-picker {
    grid-template-columns: 1fr auto;
  }

  .file-name {
    grid-column: 1 / -1;
  }

  .password-output {
    flex-direction: column;
  }
}
