:root {
  color-scheme: dark;
  --bg: #09090b;
  --panel: #18181b;
  --panel-2: #27272a;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --line: #3f3f46;
  --red: #dc2626;
  --red-strong: #ef4444;
  --red-dark: #991b1b;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: #111113;
  color: var(--muted);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.top-links a {
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
}

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

.page-shell {
  width: min(760px, calc(100% - 32px));
  margin: 48px auto;
}

.tool-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: clamp(22px, 5vw, 42px);
}

.tool-header {
  margin-bottom: 28px;
}

.hero-logo {
  display: block;
  width: clamp(118px, 24vw, 168px);
  height: clamp(118px, 24vw, 168px);
  margin: 0 0 18px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.35);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red-strong);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  line-height: 1.2;
}

p {
  color: var(--muted);
  margin: 0;
}

.upload-form,
.cancel-form {
  display: grid;
  gap: 18px;
}

.cancel-form {
  margin-top: 12px;
}

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

label {
  color: var(--text);
  font-weight: 650;
}

input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #09090b;
  color: var(--text);
  padding: 12px;
}

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

.file-picker {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #09090b;
  color: var(--text);
  padding: 10px;
}

.file-pick-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid #52525b;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
  padding: 8px 12px;
}

.file-pick-button:hover,
.native-file-input:focus-visible + .file-picker .file-pick-button {
  border-color: var(--red-strong);
  background: #3f3f46;
}

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

.check-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  color: var(--text);
  font-weight: 500;
}

.check-row input {
  margin-top: 5px;
  accent-color: var(--red);
}

.authorization-box {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 16px;
  align-items: center;
  border: 2px solid var(--red-strong);
  border-radius: 6px;
  background: #1c1214;
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
  padding: 16px 18px;
}

.authorization-box input {
  width: 30px;
  height: 30px;
  margin: 0;
  accent-color: var(--red);
}

.authorization-box span {
  display: grid;
  gap: 2px;
}

.authorization-box strong {
  color: var(--red-strong);
  font-size: 0.92rem;
  line-height: 1.2;
}

button {
  border: 1px solid #f87171;
  border-radius: 6px;
  background: var(--red);
  color: white;
  cursor: pointer;
  font-weight: 800;
  padding: 12px 18px;
}

button:hover {
  background: var(--red-strong);
}

button:disabled {
  border-color: var(--line);
  background: #3f3f46;
  color: #a1a1aa;
  cursor: not-allowed;
}

button:disabled:hover {
  background: #3f3f46;
}

button.secondary {
  border-color: var(--line);
  background: var(--panel-2);
}

button.secondary:hover {
  background: #3f3f46;
}

.alert {
  margin-bottom: 18px;
  border: 1px solid var(--red);
  border-radius: 6px;
  background: rgba(220, 38, 38, 0.16);
  color: #fecaca;
  padding: 12px 14px;
}

.content-section {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.content-section p {
  max-width: 68ch;
}

.content-section p + p {
  margin-top: 12px;
}

.text-flow {
  display: grid;
  gap: 14px;
}

.text-flow p {
  max-width: 68ch;
}

.text-flow a,
.content-section a,
.faq-section a {
  color: var(--text);
  font-weight: 750;
}

.blog-list {
  display: grid;
  gap: 18px;
}

.blog-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111113;
  padding: 18px;
}

.blog-card h2 {
  margin-bottom: 8px;
}

.blog-card h2 a,
.text-link {
  color: var(--text);
  text-decoration: none;
}

.blog-card h2 a:hover,
.text-link:hover {
  text-decoration: underline;
}

.article-page {
  display: grid;
  gap: 22px;
}

.article-header {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: clamp(22px, 5vw, 42px);
}

.article-header p,
.article-section p,
.article-section li,
.article-cta p {
  color: var(--muted);
}

.article-meta {
  color: var(--red-strong);
  font-size: 0.9rem;
  font-weight: 750;
  margin-bottom: 10px;
}

.breadcrumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

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

.breadcrumbs span::before {
  content: "/";
  margin-right: 8px;
  color: var(--line);
}

.toc,
.article-section,
.article-cta {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

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

.toc a {
  color: var(--text);
  text-decoration: none;
}

.toc a:hover,
.article-section a:hover {
  text-decoration: underline;
}

.article-section {
  display: grid;
  gap: 12px;
}

.article-section a {
  color: var(--text);
  font-weight: 750;
}

.article-section ol,
.article-section ul {
  margin: 0;
  padding-left: 22px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--text);
  background: #111113;
}

td {
  color: var(--muted);
}

tr:last-child td {
  border-bottom: 0;
}

.notice-box,
.article-cta,
.highlight-section {
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 6px;
  background: #1c1214;
  padding: 16px;
}

.button-link {
  display: inline-flex;
  width: fit-content;
  border: 1px solid #f87171;
  border-radius: 6px;
  background: var(--red);
  color: white;
  font-weight: 800;
  padding: 10px 14px;
  text-decoration: none;
}

.button-link:hover {
  background: var(--red-strong);
}

.faq-section {
  display: grid;
  gap: 10px;
}

.faq-section details {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111113;
  padding: 12px 14px;
}

.faq-section summary {
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
}

.faq-section details[open] summary {
  margin-bottom: 8px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  width: min(760px, calc(100% - 32px));
  margin: 0 auto 32px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

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

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-links {
    gap: 12px;
  }

  .page-shell {
    margin: 28px auto;
  }

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