:root {
  --ink: #17201c;
  --muted: #5a6761;
  --line: #d9e2dd;
  --panel: #ffffff;
  --soft: #f5f8f4;
  --mint: #dff6e8;
  --green: #126b44;
  --teal: #0d6f72;
  --amber: #f1bc47;
  --shadow: 0 22px 60px rgba(23, 32, 28, 0.12);
}

* {
  box-sizing: border-box;
}

/* Components set their own display, so make the hidden attribute always win. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 5vw, 64px);
  background: rgba(245, 248, 244, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--teal));
  border-radius: 8px;
  font-weight: 900;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  padding: 9px 12px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
}

.site-nav a:hover {
  color: var(--ink);
  background: #fff;
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  background: #fff;
}

.language-picker {
  display: inline-flex;
  align-items: center;
}

.language-picker select {
  width: auto;
  min-height: 38px;
  padding: 7px 30px 7px 10px;
  color: var(--ink);
  background-color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 800;
}

.hero,
.page-hero,
.section,
.tool-detail {
  padding-inline: clamp(18px, 5vw, 64px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: 76vh;
  padding-block: clamp(54px, 8vw, 100px);
}

.hero-copy h1,
.page-hero h1,
.tool-intro h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(2.45rem, 7vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-text,
.page-hero p,
.tool-intro p,
.section-heading p,
.contact-layout > div > p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.08rem;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-actions,
.section-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

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

.button.secondary {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

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

.hero-panel {
  display: grid;
  gap: 16px;
}

.metric-card,
.tool-stack,
.contact-note,
.mock-tool {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-form {
  display: grid;
  gap: 16px;
  padding: clamp(20px, 4vw, 32px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-form .form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-status {
  min-height: 28px;
  margin: 0;
  padding: 10px 12px;
  color: var(--muted);
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tool-status[data-kind="success"] {
  color: #0f5d3a;
  background: #e7f7ee;
  border-color: #b5dfc7;
}

.tool-status[data-kind="error"] {
  color: #9a291f;
  background: #fff0ed;
  border-color: #f1bbb2;
}

.qr-output {
  display: grid;
  gap: 12px;
  justify-items: start;
}

#qr-canvas {
  max-width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

#qr-general-canvas {
  max-width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.color-row input[type="color"] {
  min-height: 46px;
  padding: 4px;
}

.scanner-video {
  width: 100%;
  min-height: 220px;
  max-height: 420px;
  object-fit: cover;
  background: #17201c;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.scanner-canvas {
  display: none;
}

.scan-output {
  min-height: 112px;
}

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

.blog-card {
  display: grid;
  gap: 8px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.blog-card h2 {
  font-size: 1.25rem;
}

.article-body {
  max-width: 860px;
  margin: 0 auto;
  padding-block: clamp(42px, 7vw, 84px);
}

.article-body h2 {
  margin-top: 36px;
}

.article-body p,
.article-body li {
  color: var(--muted);
  font-size: 1.04rem;
}

.article-body a {
  color: var(--green);
  font-weight: 850;
}

.metric-card {
  padding: 32px;
}

.metric-value {
  display: block;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 950;
  line-height: 1;
}

.metric-label {
  color: var(--muted);
  font-weight: 750;
}

.tool-stack {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.tool-stack a {
  text-decoration: none;
}

.tool-stack a {
  padding: 14px 16px;
  background: var(--mint);
  border-radius: 8px;
  font-weight: 800;
}

.section {
  padding-block: clamp(46px, 7vw, 86px);
}

.section-heading {
  margin-bottom: 26px;
}

.section-heading h2,
.section h2,
.mock-tool h2 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: 0;
}

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

.tool-grid.expanded {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.tool-card {
  position: relative;
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tool-card:hover {
  border-color: #9fcab6;
  transform: translateY(-2px);
  transition: transform 160ms ease, border-color 160ms ease;
}

.tool-card h2,
.tool-card h3 {
  margin: 18px 0 8px;
  font-size: 1.18rem;
  line-height: 1.2;
}

.tool-card p {
  margin: 0 0 20px;
  color: var(--muted);
}

.tool-card h2 a,
.tool-card h3 a,
.tool-card h4 a {
  text-decoration: none;
}

/* Whole card is clickable through the heading link. */
.tool-card h2 a::after,
.tool-card h3 a::after,
.tool-card h4 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.tool-card h4 {
  margin: 14px 0 6px;
  font-size: 1.08rem;
  line-height: 1.25;
}

.card-icon {
  display: inline-grid;
  width: 54px;
  height: 42px;
  place-items: center;
  color: var(--ink);
  background: var(--amber);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 950;
}

.split,
.tool-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

.lead-form {
  display: grid;
  gap: 16px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.phone-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.42fr) minmax(0, 1fr);
  gap: 14px;
}

label,
.mock-label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fbfdfb;
  border: 1px solid #cbd8d1;
  border-radius: 8px;
  font: inherit;
}

textarea {
  resize: vertical;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.enquiry-modal {
  width: min(100% - 36px, 520px);
  padding: 0;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.enquiry-modal::backdrop {
  background: rgba(23, 32, 28, 0.62);
}

.enquiry-modal-content {
  padding: clamp(26px, 5vw, 42px);
}

.enquiry-modal h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  line-height: 1.15;
}

.enquiry-modal p:not(.eyebrow) {
  color: var(--muted);
}

.enquiry-section {
  margin-top: clamp(30px, 5vw, 72px);
  padding-top: clamp(42px, 7vw, 84px);
  padding-bottom: clamp(42px, 7vw, 84px);
  background: #eaf5ee;
  border-top: 1px solid var(--line);
}

.enquiry-copy h2 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  line-height: 1.15;
}

.enquiry-copy p:last-child {
  max-width: 620px;
  color: var(--muted);
}

.page-hero {
  padding-block: clamp(56px, 9vw, 110px);
  background: linear-gradient(180deg, #ffffff 0%, var(--soft) 100%);
}

.page-hero.compact {
  padding-top: clamp(28px, 5vw, 56px);
  padding-bottom: 36px;
}

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

.three-columns article,
.faq details,
.faq > p {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.three-columns h2 {
  font-size: 1.25rem;
}

.contact-layout {
  padding-top: clamp(56px, 9vw, 100px);
}

.contact-note {
  margin-top: 24px;
  padding: 18px;
  box-shadow: none;
}

.contact-note p {
  margin-bottom: 0;
  color: var(--muted);
}

.tool-detail {
  padding-block: clamp(48px, 8vw, 94px);
}

.tool-intro {
  position: sticky;
  top: 96px;
}

.mock-tool {
  display: grid;
  gap: 16px;
  padding: clamp(22px, 4vw, 34px);
}

.status-pill {
  width: max-content;
  padding: 6px 10px;
  color: var(--green);
  background: var(--mint);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
}

.drop-zone {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 22px;
  color: var(--muted);
  background: #f8faf8;
  border: 2px dashed #b9cac1;
  border-radius: 8px;
  text-align: center;
}

.qr-preview {
  width: 150px;
  height: 150px;
  background:
    linear-gradient(90deg, var(--ink) 10px, transparent 10px) 0 0 / 30px 30px,
    linear-gradient(var(--ink) 10px, transparent 10px) 0 0 / 30px 30px,
    #fff;
  border: 12px solid #fff;
  box-shadow: inset 0 0 0 1px var(--line), 0 8px 26px rgba(23, 32, 28, 0.12);
}

.faq {
  display: grid;
  gap: 12px;
}

.faq summary {
  cursor: pointer;
  font-weight: 900;
}

.faq p {
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(18px, 5vw, 64px);
  color: #e8f5ee;
  background: #17201c;
}

.site-footer p {
  max-width: 560px;
  margin: 6px 0 0;
  color: #b8c9c0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer a {
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 980px) {
  .hero,
  .split,
  .tool-detail,
  .three-columns {
    grid-template-columns: 1fr;
  }

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

  .tool-intro {
    position: static;
  }
}

/* Tablets: longer menu words (Russian, German) need a tighter header. */
@media (min-width: 701px) and (max-width: 900px) {
  .site-header {
    gap: 12px;
  }

  .site-nav {
    gap: 2px;
  }

  .site-nav a {
    padding: 9px 8px;
    font-size: 0.94rem;
  }
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    inset: 65px 18px auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .language-picker,
  .language-picker select {
    width: 100%;
  }

  .hero {
    min-height: auto;
  }

  .hero-copy h1,
  .page-hero h1,
  .tool-intro h1 {
    font-size: clamp(1.9rem, 8.5vw, 2.6rem);
    line-height: 1.1;
  }

  .hero {
    padding-block: 32px 24px;
  }

  .tool-grid,
  .tool-grid.expanded {
    grid-template-columns: 1fr;
  }

  .tool-card {
    padding: 18px;
  }

  .hero-panel {
    display: none;
  }

  .tool-form .form-row,
  .phone-row {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
  }
}

/* ---------- Shared tool page layout (mobile first) ---------- */

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 14px;
  color: #fff;
  background: var(--green);
  border-radius: 8px;
  font-weight: 800;
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.tool-page {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px clamp(16px, 4vw, 32px) 48px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 14px;
  padding: 0;
  color: var(--muted);
  font-size: 0.88rem;
  list-style: none;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: #a3b2ab;
}

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

.tool-header h1 {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.8rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.tool-lede {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.privacy-badge {
  display: inline-block;
  margin: 12px 0 0;
  padding: 5px 10px;
  color: var(--green);
  background: var(--mint);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
}

.tool-shell {
  margin-top: 20px;
}

.tool-shell .tool-form {
  padding: clamp(16px, 4vw, 28px);
  box-shadow: 0 10px 30px rgba(23, 32, 28, 0.08);
}

.tool-shell .tool-actions .button {
  flex: 1 1 auto;
}

@media (min-width: 701px) {
  .tool-shell .tool-actions .button {
    flex: 0 0 auto;
  }
}

.content-section {
  margin-top: 40px;
}

.content-section h2 {
  margin: 0 0 14px;
  font-size: clamp(1.3rem, 3.5vw, 1.75rem);
  line-height: 1.2;
}

.content-section h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.content-section p,
.content-section li {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.prose p {
  max-width: 760px;
}

.steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 14px 16px 14px 56px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 12px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  font-weight: 900;
}

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

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

.feature p {
  margin: 0;
}

.content-section.faq details {
  padding: 14px 16px;
}

.content-section.faq summary {
  min-height: 28px;
}

.content-section.faq details p {
  margin: 10px 0 0;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table-wrap th,
.table-wrap td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table-wrap th {
  background: var(--soft);
}

.guide-link {
  margin-top: 28px;
}

.guide-link a,
.article-body .guide-link a {
  color: var(--green);
  font-weight: 850;
}

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

.related-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.related-card:hover {
  border-color: #9fcab6;
}

.related-card strong {
  display: block;
  line-height: 1.25;
}

.related-card span span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.related-card .card-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 36px;
  font-size: 0.74rem;
}

.disclaimer {
  margin: 14px 0 0;
  padding: 12px 14px;
  color: #6b4d00;
  background: #fff8e5;
  border: 1px solid #f1d58a;
  border-radius: 8px;
  font-size: 0.92rem;
}

.category-block + .category-block {
  margin-top: 32px;
}

.category-block > h2,
.category-block > h3 {
  margin: 0 0 14px;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
}

.page-hero .breadcrumbs,
.article-body .breadcrumbs {
  margin-bottom: 18px;
}

.article-body {
  padding-inline: clamp(16px, 4vw, 32px);
}

.article-body h1 {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.6rem);
  line-height: 1.15;
}

.site-footer .language-links {
  flex-basis: 100%;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.92rem;
}

.site-footer {
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .page-hero {
    padding-block: 28px 32px;
  }

  .section {
    padding-block: 36px;
  }
}

/* ---------- Form helpers ---------- */

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

.tool-form .form-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label.check {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: end;
  min-height: 46px;
  font-weight: 700;
}

label.check input {
  width: 22px;
  min-height: 22px;
  height: 22px;
}

.button.small {
  min-height: 40px;
  padding: 8px 12px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 8px;
  padding: 0;
  font-weight: 800;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  position: relative;
  font-weight: 750;
}

.pill input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.pill span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid #cbd8d1;
  border-radius: 999px;
  cursor: pointer;
}

.pill input:checked + span {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.pill input:focus-visible + span {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

details.qr-options {
  padding: 12px 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

details.qr-options > summary {
  min-height: 28px;
  font-weight: 850;
  cursor: pointer;
}

details.qr-options[open] > summary {
  margin-bottom: 12px;
}

details.qr-options > * + * {
  margin-top: 12px;
}

/* ---------- QR generator ---------- */

.qr-layout {
  display: grid;
  gap: 18px;
}

.qr-inputs,
.qr-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

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

.qr-result {
  display: grid;
  gap: 10px;
  align-content: start;
}

.qr-canvas-wrap {
  display: grid;
  place-items: center;
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

#qr-canvas {
  width: min(100%, 300px);
  height: auto;
  aspect-ratio: 1;
  image-rendering: pixelated;
  background: #fff;
  border-radius: 4px;
}

#qr-canvas.is-empty {
  background: repeating-linear-gradient(45deg, #fff 0 10px, #f1f5f2 10px 20px);
  border: 2px dashed #b9cac1;
}

.qr-check {
  min-height: 24px;
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
}

.qr-check[data-state="ok"] {
  color: #0f5d3a;
}

.qr-check[data-state="ok"]::before {
  content: "✓ ";
}

.qr-check[data-state="fail"] {
  color: #9a291f;
}

.qr-check[data-state="pending"] {
  color: var(--muted);
}

.qr-meter {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.qr-payload-label {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
}

.qr-payload {
  display: block;
  min-height: 24px;
  padding: 8px 10px;
  overflow-wrap: anywhere;
  background: var(--soft);
  border-radius: 6px;
  font-size: 0.85rem;
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.logo-row label {
  flex: 1 1 220px;
}

@media (min-width: 821px) {
  .qr-layout {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    align-items: start;
  }

  .qr-result {
    position: sticky;
    top: 90px;
  }
}

/* ---------- QR scanner ---------- */

.scan-sources {
  display: grid;
  gap: 12px;
}

.scan-sources .button {
  min-height: 52px;
}

.drop-zone {
  display: grid;
  gap: 4px;
  min-height: 130px;
  place-content: center;
  padding: 18px;
  color: var(--muted);
  background: #f8faf8;
  border: 2px dashed #b9cac1;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
}

.drop-zone.is-over,
.drop-zone:hover {
  border-color: var(--green);
  background: var(--mint);
}

.drop-zone:focus-within {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.drop-title {
  color: var(--ink);
  font-weight: 850;
}

.drop-hint {
  font-size: 0.9rem;
  font-weight: 600;
}

.scanner-stage {
  position: relative;
  display: grid;
  gap: 10px;
}

.scanner-stage[hidden] {
  display: none;
}

.scanner-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(60%, 260px);
  aspect-ratio: 1;
  transform: translate(-50%, calc(-50% - 28px));
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.scanner-video {
  max-height: 60vh;
}

.scan-result {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #f4fbf7;
  border: 1px solid #b5dfc7;
  border-radius: 8px;
}

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

.scan-result-title {
  margin: 0;
  font-size: 1.15rem;
}

.scan-type {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  color: var(--green);
  background: var(--mint);
  border-radius: 999px;
  font-size: 0.82rem;
  vertical-align: middle;
}

.scan-fields {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 14px;
  margin: 0;
}

.scan-fields dt {
  font-weight: 800;
}

.scan-fields dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (min-width: 701px) {
  .scan-sources {
    grid-template-columns: minmax(200px, 0.6fr) minmax(0, 1.4fr);
    align-items: stretch;
  }
}

@media (max-width: 700px) {
  .tool-form .form-row.three {
    grid-template-columns: 1fr;
  }
}

/* JSON formatter */
.json-tool {
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.json-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-button {
  position: relative;
  cursor: pointer;
}

.file-button:focus-within {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.json-layout {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.json-pane {
  display: grid;
  gap: 8px;
  min-width: 0;
  align-content: start;
}

.json-pane-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.json-pane-title {
  font-weight: 800;
}

.json-view {
  margin: 0;
  padding: 0;
  border: 0;
}

.pill-group.compact {
  gap: 6px;
}

.pill-group.compact .pill span {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.92rem;
}

.json-input,
.json-code,
.json-tree {
  width: 100%;
  min-height: 260px;
  margin: 0;
  padding: 12px;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.5;
  background: #fff;
  border: 1px solid #cbd8d1;
  border-radius: 8px;
}

.json-input {
  resize: vertical;
  tab-size: 2;
}

.json-code,
.json-tree {
  max-height: 60vh;
  overflow: auto;
  tab-size: 2;
  white-space: pre;
}

.json-tree {
  white-space: normal;
}

.json-tree ul {
  margin: 0;
  padding-left: 18px;
  list-style: none;
}

.json-tree > ul {
  padding-left: 0;
}

.json-tree summary,
.j-leaf {
  min-height: 32px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.j-leaf {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
  font: inherit;
  text-align: left;
  background: none;
  border: 0;
}

.json-tree summary:hover,
.j-leaf:hover,
.j-leaf:focus-visible {
  background: var(--soft);
}

.json-tree .is-selected {
  background: var(--mint);
}

.j-type {
  color: var(--muted);
}

.j-k {
  color: #8a1c5c;
}

.j-s {
  color: #116b3a;
}

.j-n {
  color: #0b5394;
}

.j-b {
  color: #8a4b00;
}

.j-z {
  color: #6b4fa3;
}

.json-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.json-path code {
  flex: 1 1 200px;
  min-width: 0;
  padding: 6px 10px;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  background: var(--soft);
  border-radius: 6px;
}

.json-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.json-options {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 24px;
}

.json-options fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.json-error {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.json-error[hidden],
.json-notes[hidden] {
  display: none;
}

.json-error pre {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 10px 12px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: #9a291f;
  background: #fff7f5;
  border: 1px solid #f1bbb2;
  border-radius: 8px;
}

.json-notes {
  margin: 0;
  padding: 10px 12px 10px 30px;
  color: var(--ink);
  background: #fff8e6;
  border: 1px solid #f1d58f;
  border-radius: 8px;
}

@media (min-width: 900px) {
  .json-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .json-input,
  .json-code,
  .json-tree {
    min-height: 420px;
  }
}

/* Image format converter */
.img-options {
  display: grid;
  gap: 14px;
}

.img-options fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.img-quality output {
  font-weight: 800;
}

.img-quality input[type="range"] {
  min-height: 0;
  padding: 0;
  accent-color: var(--green);
  background: none;
  border: 0;
}

.img-background input[type="color"] {
  width: 72px;
  padding: 4px;
}

.img-results {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.img-results:empty {
  display: none;
}

.img-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.img-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: repeating-conic-gradient(#e9eeeb 0% 25%, #fff 0% 50%) 50% / 12px 12px;
  border-radius: 6px;
}

.img-thumb:not([src]) {
  visibility: hidden;
}

.img-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.img-name {
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.img-meta,
.img-note {
  color: var(--muted);
  font-size: 0.88rem;
}

.img-note:empty {
  display: none;
}

.img-item[data-state="error"] {
  border-color: #f1bbb2;
  background: #fff7f5;
}

.img-item[data-state="error"] .img-note {
  color: #9a291f;
}

@media (min-width: 700px) {
  .img-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  .img-options fieldset {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .img-item {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .img-thumb {
    width: 48px;
    height: 48px;
  }

  .img-item .button {
    grid-column: 1 / -1;
  }
}

/* Scientific calculator */
.calc-layout {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.calc-main {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 520px;
  width: 100%;
  margin-inline: auto;
}

.calc-display {
  display: grid;
  gap: 4px;
  padding: 10px 12px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.calc-display-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.calc-angle {
  margin: 0;
  padding: 0;
  border: 0;
}

.calc-angle abbr {
  text-decoration: none;
}

.calc-flag {
  padding: 2px 8px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--teal);
  border-radius: 6px;
}

.calc-kbd {
  margin-left: auto;
  padding: 6px 10px;
  color: var(--teal);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.calc-kbd[aria-pressed="true"] {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.calc-input {
  width: 100%;
  min-width: 0;
  padding: 6px 2px;
  color: var(--ink);
  font: 600 1.45rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  text-align: right;
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
}

.calc-input:focus {
  outline: none;
  border-bottom-color: var(--teal);
}

.calc-result {
  min-height: 2.2rem;
  overflow-x: auto;
  color: var(--muted);
  font: 600 1.25rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  text-align: right;
  white-space: nowrap;
}

.calc-result.is-final {
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1.3;
}

.calc-status {
  margin: 0;
  font-size: 0.9rem;
}

.calc-keys {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.calc-key {
  min-width: 0;
  min-height: 48px;
  padding: 4px 2px;
  color: var(--ink);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.1;
  background: #eef3ef;
  border: 1px solid #d3ddd7;
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.calc-key:hover {
  background: #e3ebe6;
}

.calc-key:active {
  transform: translateY(1px);
}

.calc-key:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.calc-key.k-num {
  font-size: 1.25rem;
  background: #fff;
}

.calc-key.k-op {
  font-size: 1.35rem;
  background: var(--mint);
  border-color: #b9e3c9;
}

.calc-key.k-mode[aria-pressed="true"] {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.calc-key.k-clear {
  color: #8a1c1c;
  background: #fbe9e7;
  border-color: #f0c8c3;
}

.calc-key.k-equals {
  color: #fff;
  font-size: 1.4rem;
  background: var(--green);
  border-color: var(--green);
}

.calc-actions {
  justify-content: flex-end;
  margin: 0;
}

.calc-history {
  min-width: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  align-self: start;
}

.calc-history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calc-history-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.calc-history-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.calc-history-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  max-height: 420px;
  overflow-y: auto;
}

.calc-history-list li {
  display: grid;
  justify-items: end;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
}

.calc-h-expr,
.calc-h-value {
  max-width: 100%;
  padding: 4px 6px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font: 500 0.95rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  text-align: right;
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.calc-h-value {
  min-height: 32px;
  color: var(--ink);
  font-weight: 700;
}

.calc-h-expr:hover,
.calc-h-value:hover {
  background: var(--soft);
}

@media (min-width: 900px) {
  .calc-layout {
    grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
  }

  .calc-main {
    margin-inline: 0;
  }

  .calc-key {
    min-height: 52px;
  }
}

/* The on-screen keyboard toggle only matters on touch screens. */
@media (hover: hover) and (pointer: fine) {
  .calc-kbd {
    display: none;
  }
}

/* Private SEO dashboard */
.admin-page {
  min-width: 320px;
  background: #f3f7f4;
}

.admin-login-page {
  display: grid;
  min-width: 320px;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #eef6f1;
}

.admin-login-shell {
  width: min(100%, 460px);
}

.admin-login-panel {
  padding: clamp(28px, 6vw, 48px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(18, 75, 48, 0.1);
}

.admin-login-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 40px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.admin-login-panel h1 {
  margin: 7px 0 8px;
}

.admin-login-panel > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.admin-login-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.admin-login-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 700;
}

.admin-login-form input {
  min-height: 46px;
  padding: 9px 12px;
  color: var(--ink);
  font: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.admin-login-form input:focus,
.admin-filter select:focus {
  outline: 3px solid rgba(18, 107, 68, 0.2);
  outline-offset: 1px;
  border-color: var(--green);
}

.admin-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.admin-header,
.admin-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.admin-header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.admin-header h1 {
  margin: 6px 0 8px;
}

.admin-header p:not(.eyebrow) {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
}

.admin-site-link {
  flex: 0 0 auto;
  color: var(--green);
  font-weight: 700;
}

.admin-controls {
  align-items: end;
  padding: 24px 0 16px;
}

.admin-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
}

.admin-tabs button {
  min-height: 42px;
  padding: 8px 14px;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.admin-tabs button[aria-selected="true"] {
  color: var(--green);
  border-bottom-color: var(--green);
}

.admin-filter {
  display: grid;
  gap: 5px;
  min-width: 180px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.admin-filter select {
  min-height: 42px;
  padding: 8px 10px;
  color: var(--ink);
  font: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.admin-status {
  min-height: 24px;
  margin: 0 0 12px;
  color: var(--muted);
}

.admin-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th,
.admin-table td {
  padding: 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.admin-table th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-url {
  min-width: 350px;
  overflow-wrap: anywhere;
}

.admin-url-content {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.admin-url a {
  min-width: 0;
  color: var(--green);
}

.copy-url {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 4px 8px;
  color: var(--green);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
}

.copy-url:hover,
.copy-url:focus-visible {
  background: var(--soft);
  border-color: var(--green);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 270px;
}

.admin-actions .button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.85rem;
}

.admin-tool-form {
  display: grid;
  grid-template-columns: minmax(170px, 1.4fr) minmax(130px, 0.8fr) minmax(150px, 1fr) minmax(170px, 1.2fr) auto;
  align-items: end;
  gap: 12px;
  margin: 0 0 20px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-tool-form strong {
  grid-column: 1 / -1;
}

.admin-tool-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.admin-tool-form input,
.admin-tool-build select,
.admin-tool-page-url input {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  color: var(--ink);
  font: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.admin-tools-table {
  min-width: 1420px;
}

.admin-tool-identity,
.admin-tool-priority,
.admin-tool-build,
.admin-tool-page-url,
.admin-tool-index-summary,
.admin-tool-links {
  min-width: 150px;
}

.admin-tool-identity strong,
.admin-tool-identity span,
.admin-tool-identity small,
.admin-tool-priority strong,
.admin-tool-priority small {
  display: block;
  margin-bottom: 5px;
}

.admin-tool-identity span,
.admin-tool-identity small,
.admin-tool-priority small,
.admin-tool-links small {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-tool-page-url {
  min-width: 280px;
}

.admin-tool-page-url .button {
  margin-top: 7px;
  min-height: 34px;
  padding: 6px 10px;
}

.admin-tool-index-summary {
  min-width: 170px;
  font-size: 0.85rem;
}

.admin-tool-links {
  min-width: 260px;
}

.admin-tool-links details + details {
  margin-top: 8px;
}

.admin-tool-links summary {
  color: var(--green);
  font-weight: 700;
  cursor: pointer;
}

.admin-tool-links ul {
  display: grid;
  gap: 9px;
  margin: 8px 0 0;
  padding-left: 18px;
}

.admin-tool-links li {
  overflow-wrap: anywhere;
}

.admin-tool-links a {
  color: var(--green);
}

.admin-tool-url-actions {
  display: inline-flex;
  gap: 5px;
  margin-left: 5px;
  vertical-align: middle;
}

@media (max-width: 680px) {
  .admin-shell {
    width: min(100% - 24px, 1440px);
    padding-top: 28px;
  }

  .admin-header,
  .admin-controls {
    flex-direction: column;
  }

  .admin-controls {
    align-items: stretch;
  }

  .admin-filter {
    width: 100%;
  }

  .admin-site-link {
    order: -1;
  }

  .admin-tool-form {
    grid-template-columns: 1fr;
  }
}

/* BMI calculator */
.bmi-tool {
  display: grid;
  gap: 14px;
}

.bmi-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.bmi-group > legend,
.bmi-label {
  margin-bottom: 7px;
  padding: 0;
  font-weight: 800;
}

.bmi-inputs {
  display: grid;
  gap: 14px;
}

.unit-row {
  display: flex;
  gap: 10px;
}

.unit-field {
  position: relative;
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  align-items: center;
}

.unit-field input {
  padding-right: 58px;
  font-size: 1.15rem;
  font-weight: 700;
}

.unit-field .unit {
  position: absolute;
  right: 12px;
  color: var(--muted);
  font-weight: 700;
  pointer-events: none;
}

details.bmi-more {
  padding: 12px 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

details.bmi-more > summary {
  min-height: 28px;
  font-weight: 850;
  cursor: pointer;
}

.bmi-more-body {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.bmi-more-body .bmi-label {
  display: grid;
  gap: 7px;
  margin: 0;
}

.bmi-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.bmi-result {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.bmi-score {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.bmi-label-small {
  flex-basis: 100%;
  color: var(--muted);
  font-weight: 700;
}

#bmi-value {
  font-size: 2.6rem;
  line-height: 1;
}

.bmi-category {
  padding: 4px 12px;
  font-weight: 800;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
}

.bmi-category[data-level="under"] {
  color: #134b80;
  background: #e2effb;
}

.bmi-category[data-level="over"],
.bmi-category[data-level="obeseG"] {
  color: #7a4b00;
  background: #fff1d2;
}

.bmi-category[data-level="obese"] {
  color: #8a1c1c;
  background: #fbe4e1;
}

.bmi-gauge {
  position: relative;
  padding: 0 0 22px;
}

.bmi-bands {
  display: flex;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
}

.bmi-band {
  opacity: 0.55;
}

.bmi-band.is-current {
  opacity: 1;
}

.band-under { background: #6aa6dc; }
.band-healthy { background: #3fa76f; }
.band-over { background: #f1bc47; }
.band-obeseG { background: #e8893d; }
.band-obese { background: #d9534f; }

.bmi-marker {
  position: absolute;
  top: -5px;
  width: 4px;
  height: 24px;
  margin-left: -2px;
  background: var(--ink);
  border: 1px solid #fff;
  border-radius: 2px;
}

.bmi-ticks span {
  position: absolute;
  top: 18px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.78rem;
}

.bmi-facts {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 1.1rem;
}

.bmi-standard-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (min-width: 700px) {
  .bmi-inputs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Finance calculators (mortgage, compound interest) */
.fin-tool {
  display: grid;
  gap: 14px;
}

.fin-grid {
  display: grid;
  gap: 12px;
}

.fin-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.fin-label {
  padding: 0;
  font-weight: 800;
}

.fin-pair-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.5rem;
  gap: 8px;
}

.fin-tool .unit-field input {
  padding-right: 52px;
  font-size: 1.05rem;
}

.fin-tool .unit-field .unit {
  font-size: 0.85rem;
}

.mtg-month {
  font-weight: 700;
}

details.fin-more {
  padding: 12px 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

details.fin-more > summary {
  min-height: 28px;
  font-weight: 850;
  cursor: pointer;
}

details.fin-more > .fin-grid {
  margin-top: 12px;
}

.fin-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.fin-result {
  display: grid;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.fin-headline {
  display: grid;
  gap: 4px;
}

.fin-small,
.fin-note {
  color: var(--muted);
  font-weight: 700;
}

.fin-note:empty {
  display: none;
}

#mtg-payment {
  font-size: 2.4rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.mtg-costs {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--soft);
  border-radius: 8px;
}

.mtg-total {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  font-weight: 800;
}

.mtg-stack,
.fin-share-bar {
  display: flex;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0c9a8;
}

.mtg-seg-pi { background: var(--green); }
.mtg-seg-tax { background: var(--teal); }
.mtg-seg-ins { background: var(--amber); }
.mtg-seg-pmi { background: #b5523b; }
.mtg-seg-fees { background: #7a6bb0; }

.mtg-parts,
.fin-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
}

.mtg-dot,
.fin-key {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
  border-radius: 3px;
}

.fin-summary {
  display: grid;
  grid-template-columns: minmax(7.5rem, 1fr) minmax(0, 1.5fr);
  gap: 8px 12px;
  margin: 0;
}

.fin-summary dt {
  color: var(--muted);
  font-weight: 700;
}

.fin-summary dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}

.mtg-savings {
  margin: 0;
  padding: 10px 12px;
  color: var(--green);
  font-weight: 800;
  background: var(--mint);
  border-radius: 8px;
}

.fin-share {
  display: grid;
  gap: 6px;
}

.fin-share-bar span {
  background: var(--green);
}

.fin-share-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.fin-chart {
  display: grid;
  gap: 8px;
  margin: 0;
}

.fin-chart-title {
  font-weight: 850;
}

.fin-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.fin-grid-line { stroke: var(--line); stroke-width: 1; }
.fin-axis { fill: var(--muted); font-size: 11px; }
.fin-area { fill: var(--mint); stroke: none; }
.fin-line-balance { fill: none; stroke: var(--green); stroke-width: 2.5; }
.fin-line-base { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 5; }
.fin-line-interest { fill: none; stroke: #b5523b; stroke-width: 2.5; }
.fin-key {
  width: 18px;
  height: 4px;
  vertical-align: 3px;
  border-radius: 2px;
}
.fin-key-balance { background: var(--green); }
.fin-key-base { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); }
.fin-key-interest { background: #b5523b; }

.fin-schedule {
  display: grid;
  gap: 10px;
}

.fin-schedule h3 {
  margin: 0;
}

.fin-schedule-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fin-table-wrap {
  max-height: 460px;
}

.fin-table caption {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: left;
}

.fin-table th,
.fin-table td {
  padding: 7px 10px;
  white-space: nowrap;
  text-align: right;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.fin-table thead th {
  position: sticky;
  top: 0;
  background: var(--soft);
}

.fin-table tbody th,
.fin-table thead th:first-child,
#mtg-tool .fin-table thead th:nth-child(2),
#mtg-tool .fin-table td:nth-child(2) {
  text-align: left;
}

@media (min-width: 700px) {
  .fin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fin-result {
    padding: 20px;
  }
}

.fin-big {
  font-size: clamp(1.75rem, 8vw, 2.4rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.ci-range-wrap .fin-table {
  font-size: 0.875rem;
}

.ci-range-wrap .fin-table th,
.ci-range-wrap .fin-table td {
  padding-inline: 6px;
}

.ci-pair {
  grid-template-columns: minmax(0, 1fr) 8.5rem;
}

.ci-goals {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 12px 10px 28px;
  background: var(--mint);
  border-radius: 8px;
  color: var(--green);
  font-weight: 750;
}

.fin-area-interest { fill: #f6dccb; stroke: none; }
.fin-line-real { fill: none; stroke: var(--teal); stroke-width: 2; stroke-dasharray: 4 4; }
.fin-key-deposits { background: var(--mint); outline: 1px solid var(--green); }
.fin-key-growth { background: #f6dccb; outline: 1px solid #b5523b; }
.fin-key-real { background: repeating-linear-gradient(90deg, var(--teal) 0 4px, transparent 4px 7px); }

/* Color picker and contrast checker */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--green);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.cp-tool {
  display: grid;
  gap: 18px;
}

.cp-main {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.cp-swatch {
  position: relative;
  display: block;
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(var(--c), var(--c)), repeating-conic-gradient(#cfd6d2 0 25%, #fff 0 50%) 0 0 / 16px 16px;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

.cp-swatch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.cp-swatch:focus-within {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.cp-entry {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.cp-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.1rem;
  font-weight: 700;
}

.cp-code[aria-invalid="true"] {
  border-color: #b42318;
}

.cp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cp-actions .button {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.95rem;
}

.cp-file-label {
  cursor: pointer;
}

.cp-file-label:focus-within {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.cp-image {
  margin: 0;
  display: grid;
  gap: 8px;
}

.cp-image canvas {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: crosshair;
  touch-action: manipulation;
}

.cp-image figcaption {
  color: var(--muted);
  font-size: 0.92rem;
}

.cp-sliders {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.cp-slider {
  display: grid;
  gap: 4px;
  font-weight: 700;
}

.cp-slider-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.cp-slider output {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cp-slider input[type="range"] {
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}

.cp-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--track, var(--line));
}

.cp-slider input[type="range"]::-moz-range-track {
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--track, var(--line));
}

.cp-slider input[type="range"]::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -6px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  -webkit-appearance: none;
}

.cp-slider input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

#cp-h {
  --track: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}

.cp-section {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.cp-h {
  margin: 0;
  font-size: 1.15rem;
}

.cp-values {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0;
  align-items: center;
}

.cp-values dt {
  font-weight: 800;
  color: var(--muted);
  font-size: 0.85rem;
}

.cp-values dd {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  margin: 0;
  padding: 6px 6px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.cp-values code {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.cp-copy {
  flex: none;
  min-height: 34px;
  padding: 4px 10px;
  font-size: 0.85rem;
}

.cp-name {
  margin: 0;
  color: var(--muted);
}

.cp-link {
  justify-self: start;
}

.cp-bg-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.cp-bg-row .fin-field {
  flex: 1 1 14rem;
}

.cp-bg-inputs {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
}

.cp-bg-inputs input[type="color"] {
  width: 48px;
  height: 100%;
  min-height: 44px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.cp-preview {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--fg);
}

.cp-preview p {
  margin: 0;
}

.cp-sample-normal {
  font-size: 1rem;
}

.cp-sample-large {
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.25;
}

.cp-sample-ui {
  display: flex;
  gap: 10px;
  align-items: center;
}

.cp-sample-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.cp-sample-box {
  padding: 6px 12px;
  border: 2px solid var(--fg);
  border-radius: 8px;
}

.cp-ratio {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin: 0;
}

.cp-ratio strong {
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
}

.cp-checks {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cp-badge {
  display: inline-block;
  min-width: 3.6rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
}

.cp-checks .pass .cp-badge {
  background: var(--mint);
  color: var(--green);
}

.cp-checks .fail .cp-badge {
  background: #fde7e4;
  color: #a1281b;
}

.cp-fix {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff6e0;
}

.cp-fix-chip {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--c);
}

.cp-row {
  display: grid;
  gap: 6px;
}

.cp-row-title {
  margin: 0;
  font-size: 0.95rem;
}

.cp-chips {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;
}

.cp-chip {
  min-width: 0;
  min-height: 40px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: linear-gradient(var(--c), var(--c)), repeating-conic-gradient(#cfd6d2 0 25%, #fff 0 50%) 0 0 / 12px 12px;
  cursor: pointer;
}

.cp-chip:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.cp-chips:has(.labelled) {
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
}

.cp-chip.labelled {
  display: flex;
  align-items: flex-end;
  min-height: 56px;
  padding: 0;
  overflow: hidden;
}

.cp-chip-code {
  width: 100%;
  padding: 2px 4px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 700;
}

.cp-recent {
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
}

@media (min-width: 700px) {
  .cp-main {
    grid-template-columns: 140px minmax(0, 1fr);
  }

  .cp-swatch {
    width: 140px;
    height: 140px;
  }

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

  .cp-sliders legend {
    grid-column: 1 / -1;
  }

  .cp-values {
    grid-template-columns: 5rem minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .cp-values {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .cp-values dt {
    margin-top: 6px;
  }
}

/* Barcode generator and validator */
.bc-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.bc-fix {
  display: grid;
  gap: 8px;
  margin: -4px 0 12px;
}

.bc-fix > .button {
  justify-self: start;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.bc-swaps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bc-swap {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.bc-result {
  display: grid;
  gap: 10px;
  margin: 8px 0 16px;
}

.bc-result.is-empty .bc-preview,
.bc-result.is-empty .bc-size,
.bc-result.is-empty .bc-warn {
  display: none;
}

.bc-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.bc-preview svg {
  display: block;
  width: 100%;
  max-width: 22rem;
  height: auto;
}

#bc-batch-status:empty {
  display: none;
}

.bc-size {
  margin: 0;
  text-align: center;
}

.bc-warn {
  margin: 0;
  padding: 10px 12px;
  border-left: 4px solid #b5523b;
  border-radius: 6px;
  background: #fbeee8;
  color: #6b2a1b;
}

.bc-prefix {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--mint);
}

.bc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.bc-explain-table th,
.bc-explain-table td {
  padding: 4px 6px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.bc-explain-table tbody th {
  text-align: left;
  white-space: nowrap;
}

.bc-explain-table .bc-products td {
  font-weight: 600;
}

.bc-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.bc-color,
.bc-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.bc-color input[type="color"] {
  width: 44px;
  height: 44px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bc-check input {
  width: 20px;
  height: 20px;
}

.bc-batch {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.bc-batch .fin-hint {
  margin: 0;
}

.bc-list {
  width: 100%;
  min-height: 120px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.bc-seq {
  display: grid;
  grid-template-columns: 1fr 7rem;
  gap: 8px 12px;
  align-items: end;
}

.bc-seq .button {
  grid-column: 1 / -1;
  justify-self: start;
}

.bc-errors {
  margin: 0;
  padding-left: 20px;
  color: #8a2c1a;
}

.bc-batch-out {
  display: grid;
  gap: 12px;
}

.bc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.bc-item {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bc-item svg {
  max-width: 100%;
  height: auto;
}

.bc-item figcaption {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
}

@media (min-width: 720px) {
  .bc-seq {
    grid-template-columns: 1fr 8rem auto;
  }

  .bc-seq .button {
    grid-column: auto;
  }
}

/* Printing a batch: only the barcodes, at their real size. */
#bc-print-area {
  display: none;
}

@media print {
  body.bc-printing > :not(#bc-print-area) {
    display: none !important;
  }

  body.bc-printing #bc-print-area {
    display: flex;
    flex-wrap: wrap;
    gap: 4mm;
  }

  #bc-print-area .bc-item {
    border: 0;
    padding: 0;
    break-inside: avoid;
  }

  #bc-print-area .bc-item svg {
    max-width: none;
  }

  #bc-print-area .bc-item figcaption {
    display: none;
  }
}

/* Work hours calculator */
.wh-days {
  display: grid;
  gap: 8px;
}

.wh-day {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 3.6rem;
  grid-template-areas:
    "name name out"
    "start end brk";
  gap: 6px 8px;
  align-items: end;
  margin: 0;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wh-day[hidden] {
  display: none;
}

.wh-day.is-error {
  border-color: #b5523b;
  box-shadow: inset 3px 0 0 #b5523b;
}

.wh-day.is-short {
  box-shadow: inset 3px 0 0 var(--amber);
}

.wh-name {
  grid-area: name;
  float: left;
  padding: 0;
  font-weight: 850;
}

.wh-day > .wh-cell:nth-of-type(1) { grid-area: start; }
.wh-day > .wh-cell:nth-of-type(2) { grid-area: end; }
.wh-day > .wh-break { grid-area: brk; }

.wh-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.wh-cap {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.wh-cell input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 6px 4px 6px 6px;
  font: inherit;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.wh-cell input::-webkit-calendar-picker-indicator {
  margin: 0;
  padding: 0;
}

.wh-out {
  grid-area: out;
  justify-self: end;
  color: var(--green);
  font-weight: 800;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wh-actions,
.wh-export {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wh-warnings {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 12px 10px 28px;
  color: #7a4b00;
  font-weight: 700;
  background: #fff4dc;
  border-radius: 8px;
}

@media (min-width: 700px) {
  .wh-day {
    grid-template-columns: 9rem minmax(0, 1fr) minmax(0, 1fr) 5.5rem 10rem;
    grid-template-areas: "name start end brk out";
  }

  .wh-name {
    align-self: center;
  }

  .wh-out {
    align-self: center;
  }
}

@media print {
  body.wh-printing .site-header,
  body.wh-printing .site-footer,
  body.wh-printing .skip-link,
  body.wh-printing .breadcrumbs,
  body.wh-printing .tool-lede,
  body.wh-printing .privacy-badge,
  body.wh-printing .enquiry-section,
  body.wh-printing .tool-page > :not(.tool-header):not(.tool-shell),
  body.wh-printing .wh-tool > fieldset,
  body.wh-printing .wh-actions,
  body.wh-printing .wh-export,
  body.wh-printing .wh-tool details,
  body.wh-printing #wh-status {
    display: none !important;
  }

  body.wh-printing .wh-day {
    break-inside: avoid;
    grid-template-columns: 9rem 1fr 1fr 5rem 10rem;
    grid-template-areas: "name start end brk out";
  }
}

/* Wire gauge calculator */
.wire-pair {
  grid-template-columns: minmax(0, 1fr) 8.5rem;
}

.wire-table tbody tr.is-best th,
.wire-table tbody tr.is-best td {
  color: var(--green);
  font-weight: 850;
  background: var(--mint);
}

/* Paycheck calculator */
.pay-pair {
  grid-template-columns: minmax(0, 1fr) 9rem;
}

.pay-deductions {
  margin: 0;
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pay-deductions > legend {
  padding: 0 6px;
}

.pay-deductions > .fin-hint {
  margin: 0 0 12px;
}

.pay-tool .fin-field.is-muted {
  opacity: 0.6;
}

#pay-table tbody tr.is-best th,
#pay-table tbody tr.is-best td {
  color: var(--green);
  font-weight: 850;
  background: var(--mint);
}

/* Measurement converter */
.ms-tool .ms-kinds .pill-group {
  flex-wrap: wrap;
}

.ms-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto minmax(0, 1.4fr);
  gap: 12px;
  align-items: end;
}

.ms-swap {
  min-width: 48px;
  min-height: 48px;
  padding: 0 12px;
  font-size: 1.2rem;
}

.ms-ingredient {
  margin-top: 12px;
  max-width: 24rem;
}

.ms-table tbody tr.is-best th,
.ms-table tbody tr.is-best td {
  color: var(--green);
  font-weight: 850;
  background: var(--mint);
}

@media (max-width: 640px) {
  .ms-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ms-row > .fin-field:first-child {
    grid-column: 1 / -1;
  }

  .ms-row > .fin-field:last-child {
    grid-column: 1 / -1;
  }
}

/* Tire size calculator */
.tire-pair {
  grid-template-columns: minmax(0, 1fr) 9.5rem;
}

.tire-warning {
  margin: 0;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff4e5;
  border: 1px solid #f0c27b;
  border-radius: 8px;
}

.tire-trip {
  display: grid;
  gap: 12px;
  margin: 8px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tire-trip > legend {
  padding: 0 6px;
  font-size: 1.1rem;
  font-weight: 850;
}

.tire-trip > .fin-hint {
  margin: 0;
}

.tire-round .bc-check input {
  width: 20px;
  height: 20px;
}

@media (max-width: 640px) {
  .tire-round > .fin-label {
    display: none;
  }
}

/* Concrete calculator */
.ct-tool .ct-kinds {
  grid-column: 1 / -1;
}

.ct-tool .pill-group {
  align-items: flex-start;
  align-content: flex-start;
}

.ct-panel {
  display: grid;
  gap: 12px;
}

.ct-panel[hidden],
.ct-shape[hidden],
.ct-quantity[hidden] {
  display: none;
}

.ct-check-field .bc-check {
  min-height: 48px;
  align-items: center;
}

.ct-check-field .bc-check input {
  width: 20px;
  height: 20px;
}

@media (max-width: 640px) {
  .ct-check-field > .fin-label {
    display: none;
  }
}

/* CPM calculator */
.ad-tool .ad-modes {
  grid-column: 1 / -1;
}

.ad-tool .pill-group {
  align-items: flex-start;
  align-content: flex-start;
}

.ad-panel {
  display: grid;
  gap: 12px;
}

.ad-panel[hidden],
.ad-tool .fin-field[hidden],
.ad-tool .fin-schedule[hidden] {
  display: none;
}

/* What is my IP */
.ip-panel {
  display: grid;
  gap: 12px;
}

.ip-panel[hidden],
.ip-tool .fin-result[hidden] {
  display: none;
}

.ip-address {
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.ip-panel-mine .ip-address,
#ip-mine {
  font-size: clamp(1.6rem, 6vw, 2.4rem);
}

.ip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.ip-summary dd {
  font-variant-numeric: tabular-nums;
}

/* VAT calculator */
.vat-tool [hidden] {
  display: none;
}

.vat-tool .pill-group {
  align-items: flex-start;
  align-content: flex-start;
}

.vat-rate-field {
  gap: 10px;
}

.vat-rate-field .fin-hint {
  margin: 0;
}

.vat-rate-input {
  max-width: 14rem;
}

/* Random number, password and UUID generator */
.rng-panel {
  display: grid;
  gap: 14px;
}

.rng-presets .button.small {
  min-height: 36px;
  padding: 6px 12px;
}

.rng-grid {
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
}

.rng-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.rng-checks label.check {
  min-height: 40px;
  align-self: auto;
}

.rng-slider output {
  margin-left: 6px;
  padding: 1px 9px;
  color: var(--green);
  background: var(--mint);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.rng-slider input[type="range"] {
  min-height: 32px;
  padding: 0;
  accent-color: var(--green);
  background: none;
  border: 0;
}

.rng-value {
  display: block;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1.15rem, 4.5vw, 1.6rem);
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rng-value[data-mode="number"] {
  font-family: inherit;
  font-size: clamp(2.2rem, 10vw, 3.6rem);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.rng-list {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
}

.rng-strength {
  display: grid;
  gap: 6px;
}

.rng-strength .fin-note {
  margin: 0;
}

.rng-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.rng-meter span {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
}

.rng-strength[data-level="weak"] .rng-meter span:nth-child(-n + 1) { background: #b5523b; }
.rng-strength[data-level="fair"] .rng-meter span:nth-child(-n + 2) { background: var(--amber); }
.rng-strength[data-level="strong"] .rng-meter span:nth-child(-n + 3) { background: var(--teal); }
.rng-strength[data-level="veryStrong"] .rng-meter span { background: var(--green); }

.rng-range {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rng-more > .fin-grid {
  margin-top: 12px;
}

.rng-slider .fin-label {
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 520px) {
  .rng-list {
    font-size: 0.78rem;
  }

  .rng-range {
    gap: 8px;
  }
}

/* Image to PDF */
.i2p-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.i2p-count {
  margin: 0;
  font-weight: 800;
}

.i2p-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.i2p-grid:empty {
  display: none;
}

.i2p-item {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: grab;
}

.i2p-item.is-dragging {
  opacity: 0.45;
  border-style: dashed;
}

.i2p-frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--soft);
  border-radius: 6px;
}

.i2p-thumb {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.i2p-nopreview .i2p-thumb {
  visibility: hidden;
}

.i2p-nopreview .i2p-frame::after {
  content: "IMG";
  position: absolute;
  color: var(--muted);
  font-weight: 850;
}

.i2p-num {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 26px;
  padding: 1px 7px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
  background: var(--green);
  border-radius: 999px;
}

.i2p-name {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.i2p-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.i2p-btn {
  min-height: 36px;
  padding: 0;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.i2p-btn:hover:not(:disabled) {
  background: var(--mint);
}

.i2p-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.i2p-btn:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 1px;
}

.i2p-options {
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  align-items: start;
}

@media (max-width: 420px) {
  .i2p-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* PDF to image */
.p2i-doc {
  display: grid;
  gap: 14px;
}

.p2i-item {
  cursor: default;
}

.p2i-pick {
  display: grid;
  gap: 6px;
  font-weight: 700;
  cursor: pointer;
}

.p2i-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}

.p2i-check input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--green);
}

.p2i-item:has(input:checked) {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.p2i-item:has(input:not(:checked)) .i2p-frame {
  opacity: 0.5;
}

.p2i-grid .i2p-thumb {
  width: auto;
  height: auto;
  box-shadow: 0 1px 4px rgba(23, 32, 28, 0.18);
}

/* GPA calculator */
.gpa-head,
.gpa-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.7fr) minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
}

.gpa-head {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.gpa-rows {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gpa-cell {
  display: block;
  min-width: 0;
}

.gpa-cell-label {
  display: none;
}

.gpa-cell input,
.gpa-cell select {
  min-height: 44px;
  padding: 9px 10px;
}

.gpa-remove {
  min-height: 44px;
}

.gpa-unweighted .gpa-level-col {
  display: none;
}

.gpa-unweighted .gpa-head,
.gpa-unweighted .gpa-row {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.7fr) 40px;
}

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

.gpa-bar {
  background: var(--line);
}

#gpa-plan-result {
  font-weight: 700;
}

@media (max-width: 640px) {
  .gpa-head {
    display: none;
  }

  .gpa-row {
    position: relative;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.5fr) minmax(0, 1fr);
    gap: 6px;
    padding: 10px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .gpa-unweighted .gpa-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .gpa-cell-label {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
  }

  .gpa-cell input,
  .gpa-cell select {
    padding-left: 8px;
    font-size: 0.92rem;
  }

  .gpa-cell select {
    padding-right: 2px;
  }

  .gpa-remove,
  .gpa-unweighted .gpa-remove {
    position: absolute;
    top: 4px;
    right: 6px;
    min-height: 32px;
    width: 32px;
    padding: 0;
  }
}

/* DNS checker */
.dns-tool [hidden] {
  display: none;
}

.dns-query {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(7rem, 10rem);
  gap: 12px;
}

.dns-single .dns-query {
  grid-template-columns: minmax(0, 1fr);
}

.dns-email .dns-query {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

.dns-tool input[translate="no"],
.dns-big,
.dns-values,
.dns-value,
.dns-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.dns-big {
  overflow-wrap: anywhere;
}

.dns-list,
.dns-values,
.dns-notes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dns-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.dns-row {
  display: grid;
  grid-template-columns: minmax(9rem, 0.9fr) minmax(0, 1.6fr) minmax(8rem, 0.8fr);
  gap: 10px 14px;
  align-items: start;
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 8px;
}

.dns-row-ok {
  border-left-color: var(--green);
}

.dns-row-warn {
  border-left-color: var(--amber);
}

.dns-row-fail {
  border-left-color: #c2410c;
}

.dns-pending {
  opacity: 0.65;
}

.dns-who,
.dns-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dns-meta {
  justify-items: end;
  text-align: right;
}

.dns-sub {
  color: var(--muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.dns-answer {
  min-width: 0;
}

.dns-values li,
.dns-value,
.dns-code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dns-values li + li {
  margin-top: 2px;
}

.dns-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.dns-ok {
  color: var(--green);
  background: var(--mint);
}

.dns-warn {
  color: #7a4b00;
  background: #fdf0cf;
}

.dns-fail {
  color: #9a3412;
  background: #fde4d8;
}

.dns-records {
  display: grid;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.dns-record {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.dns-type {
  font-weight: 800;
}

.dns-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.dns-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-top: 4px solid var(--line);
  border-radius: 8px;
}

.dns-card-ok {
  border-top-color: var(--green);
}

.dns-card-warn {
  border-top-color: var(--amber);
}

.dns-card-fail {
  border-top-color: #c2410c;
}

.dns-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dns-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.dns-code {
  display: block;
  padding: 8px 10px;
  font-size: 0.85rem;
  white-space: pre-wrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.dns-notes {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
}

.dns-notes li {
  padding-left: 14px;
  text-indent: -14px;
}

.dns-notes li::before {
  content: "• ";
  color: var(--muted);
}

.dns-out > .dns-notes {
  margin-top: 14px;
}

.dns-ok-text::before {
  content: "✓ " !important;
  color: var(--green) !important;
}

.dns-warn-text::before {
  content: "! " !important;
  color: #9a3412 !important;
}

@media (max-width: 640px) {
  .dns-query,
  .dns-email .dns-query {
    grid-template-columns: minmax(0, 1fr);
  }

  .dns-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .dns-who {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
  }

  .dns-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 8px;
    text-align: left;
  }

  .dns-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .dns-record {
    grid-template-columns: 3.4rem minmax(0, 1fr);
  }

  .dns-record .dns-sub {
    grid-column: 2;
  }
}

/* Gantt chart generator */
.gc-tool [hidden] {
  display: none;
}

.gc-rows {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gc-row {
  display: grid;
  grid-template-columns: 1.8rem minmax(0, 1fr) minmax(0, 1fr) 5.2rem 6.6rem minmax(0, 1.3fr);
  grid-template-areas:
    "num name name name color tools"
    "num start end days progress after";
  gap: 8px 10px;
  align-items: end;
  padding: 10px 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.gc-num {
  grid-area: num;
  align-self: start;
  padding-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.gc-name {
  grid-area: name;
}

.gc-row > .gc-cell:nth-of-type(2) {
  grid-area: start;
}

.gc-end {
  grid-area: end;
}

.gc-days {
  grid-area: days;
}

.gc-progress {
  grid-area: progress;
}

.gc-row > .gc-cell:nth-of-type(6) {
  grid-area: after;
}

.gc-row > .gc-cell:nth-of-type(7) {
  grid-area: color;
}

.gc-tools {
  grid-area: tools;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

.gc-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.gc-cell-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.gc-cell input,
.gc-cell select {
  min-height: 42px;
  padding: 8px 9px;
}

.gc-tools .i2p-btn {
  min-width: 38px;
  min-height: 40px;
}

.gc-ms {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 8px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.gc-ms input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.gc-ms .gc-cell-label {
  display: none;
}

.gc-is-ms .gc-ms {
  color: var(--green);
  border-color: var(--green);
}

.gc-is-ms .gc-end,
.gc-is-ms .gc-days,
.gc-is-ms .gc-progress {
  visibility: hidden;
}

.gc-chart {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.gc-chart svg {
  display: block;
  max-width: none;
}

.gc-result {
  display: grid;
  gap: 14px;
}

.gc-file {
  cursor: pointer;
}

.gc-import {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

@media (max-width: 640px) {
  .gc-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "num tools"
      "name name"
      "start end"
      "days progress"
      "after color";
  }

  .gc-num {
    align-self: center;
    padding: 0;
  }

  .gc-cell input[type="date"] {
    min-width: 0;
    width: 100%;
    padding: 8px 4px 8px 6px;
    font-size: 0.88rem;
  }

  .gc-is-ms .gc-end,
  .gc-is-ms .gc-days,
  .gc-is-ms .gc-progress {
    display: none;
  }
}

@media print {
  body.gc-printing .site-header,
  body.gc-printing .site-footer,
  body.gc-printing .skip-link,
  body.gc-printing .breadcrumbs,
  body.gc-printing .tool-lede,
  body.gc-printing .privacy-badge,
  body.gc-printing .enquiry-section,
  body.gc-printing .tool-page > :not(.tool-header):not(.tool-shell),
  body.gc-printing .gc-tool > :not(.gc-result),
  body.gc-printing .gc-export {
    display: none !important;
  }

  body.gc-printing .gc-chart {
    overflow: visible;
    border: 0;
  }

  body.gc-printing .gc-chart svg {
    max-width: 100%;
    height: auto;
  }
}

/* Word counter */
.wc-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.wc-stat {
  display: grid;
  gap: 2px;
  padding: 10px 8px;
  text-align: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wc-stat strong {
  font-size: clamp(1.25rem, 3.2vw, 1.9rem);
  font-weight: 850;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.wc-stat span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
}

.wc-stat:first-child {
  color: var(--green);
  background: var(--mint);
  border-color: #b9e5cb;
}

.wc-editor textarea {
  min-height: 260px;
  line-height: 1.6;
}

.wc-actions .wc-file {
  cursor: pointer;
}

.wc-limit {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  gap: 10px 14px;
  align-items: end;
}

.wc-meter {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
}

.wc-meter .fin-hint {
  margin: 0;
}

.wc-bar span {
  transition: width 0.15s ease;
}

.wc-bar span[data-over="warn"] {
  background: var(--amber);
}

.wc-bar span[data-over="over"] {
  background: #b5523b;
}

.wc-bar {
  background: var(--line);
}

.wc-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.wc-kw-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin: 10px 0;
}

.wc-kw {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.wc-kw th,
.wc-kw td {
  padding: 6px 8px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.wc-kw th:first-child,
.wc-kw tbody th {
  text-align: left;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.wc-kw thead th {
  color: var(--muted);
  font-size: 0.85rem;
}

.wc-case {
  margin-top: 10px;
}

@media (max-width: 860px) {
  .wc-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .wc-panels {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .wc-stat {
    padding: 8px 4px;
  }

  .wc-stat span {
    font-size: 0.76rem;
  }

  .wc-editor textarea {
    min-height: 200px;
  }

  .wc-limit {
    grid-template-columns: minmax(0, 1fr);
  }

  .wc-limit select {
    padding-right: 6px;
  }
}

.wc-tool .fin-summary {
  grid-template-columns: minmax(0, 1fr) auto;
}

/* Budget calculator */
.bt-panel {
  display: grid;
  gap: 14px;
}

.bt-top {
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.bt-grid {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.bt-lists {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.bt-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.bt-list > .button {
  justify-self: start;
}

.bt-list-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
  margin: 0;
  font-size: 1rem;
}

.bt-list-total {
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.bt-rows {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bt-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(5.5rem, 0.8fr) minmax(7.5rem, 0.9fr) auto;
  gap: 6px;
  align-items: center;
}

.bt-list:not([data-list="expenses"]) .bt-row {
  grid-template-columns: minmax(0, 1.4fr) minmax(5.5rem, 0.9fr) auto;
}

.bt-list:not([data-list="expenses"]) .bt-bucket {
  display: none;
}

.bt-cell {
  display: block;
  min-width: 0;
}

.bt-cell input,
.bt-cell select {
  min-height: 40px;
  padding: 8px 10px;
  background: #fff;
}

.bt-amount input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bt-remove {
  width: 36px;
  height: 36px;
}

.bt-buckets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.bt-bucket-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.bt-bucket-card span {
  color: var(--muted);
  font-weight: 800;
}

.bt-bucket-card strong {
  font-size: 1.5rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.bt-bucket-card small {
  color: var(--muted);
}

.bt-bucket-card em {
  font-style: normal;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--green);
}

.bt-bucket-card[data-state="high"] em,
.bt-bucket-card[data-state="low"] em {
  color: #a5442e;
}

.bt-meter {
  position: relative;
  height: 8px;
  background: var(--line);
  border-radius: 999px;
}

.bt-meter i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
}

.bt-meter b {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  background: var(--ink);
}

.bt-bar {
  background: var(--line);
}

#bt-main[data-sign="neg"] {
  color: #a5442e;
}

@media (max-width: 860px) {
  .bt-lists {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .bt-buckets {
    grid-template-columns: minmax(0, 1fr);
  }

  .bt-list {
    padding: 10px 8px;
  }

  .bt-list:not([data-list="expenses"]) .bt-row {
    grid-template-columns: minmax(0, 1fr) minmax(5rem, 0.6fr) auto;
  }

  .bt-list[data-list="expenses"] .bt-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  }

  .bt-list[data-list="expenses"] .bt-name {
    grid-column: 1 / 3;
  }

  .bt-list[data-list="expenses"] .bt-remove {
    grid-column: 3;
    grid-row: 1;
  }

  .bt-list[data-list="expenses"] .bt-row {
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
  }

  .bt-cell select {
    padding-right: 6px;
  }
}

@media print {
  body.bt-printing .site-header,
  body.bt-printing .site-footer,
  body.bt-printing .skip-link,
  body.bt-printing .breadcrumbs,
  body.bt-printing .tool-lede,
  body.bt-printing .privacy-badge,
  body.bt-printing .enquiry-section,
  body.bt-printing .tool-page > :not(.tool-header):not(.tool-shell),
  body.bt-printing .bt-modes,
  body.bt-printing .bt-tool .button,
  body.bt-printing .bt-remove,
  body.bt-printing .tool-status {
    display: none !important;
  }
}

/* PNG to SVG, SVG to PNG and favicon generator */
.ps-panel {
  display: grid;
  gap: 14px;
}

.ps-grid {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  align-items: end;
}

.ps-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.ps-checks label.check {
  min-height: 40px;
}

.ps-slider output {
  margin-left: 6px;
  padding: 1px 9px;
  color: var(--green);
  background: var(--mint);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.ps-slider input[type="range"] {
  min-height: 32px;
  padding: 0;
  accent-color: var(--green);
  background: none;
  border: 0;
}

.ps-color input[type="color"] {
  min-height: 46px;
  padding: 4px;
  cursor: pointer;
}

.ps-result {
  display: grid;
  gap: 14px;
}

.ps-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ps-compare figure {
  display: grid;
  gap: 6px;
  margin: 0;
}

.ps-compare figcaption {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.ps-stage {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 12px;
  background-color: #fff;
  background-image: linear-gradient(45deg, #e9eeeb 25%, transparent 25%), linear-gradient(-45deg, #e9eeeb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e9eeeb 75%), linear-gradient(-45deg, transparent 75%, #e9eeeb 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ps-stage img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  height: auto;
}

.ps-stage-large img {
  max-height: 520px;
}

.ps-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ps-swatches span {
  padding: 3px 8px;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
}

.ps-tab {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 360px;
  padding: 8px 10px 0;
  background: #dfe3e8;
  border-radius: 10px 10px 0 0;
}

.ps-tab-dots {
  display: flex;
  gap: 5px;
  padding-bottom: 12px;
}

.ps-tab-dots i {
  width: 10px;
  height: 10px;
  background: #b9c0c8;
  border-radius: 50%;
}

.ps-tab-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  padding: 8px 12px;
  font-size: 0.85rem;
  background: #fff;
  border-radius: 8px 8px 0 0;
}

.ps-tab-title span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ps-tab-title img {
  width: 16px;
  height: 16px;
  flex: none;
}

.ps-previews {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.ps-previews figure {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 0;
}

.ps-previews figcaption {
  color: var(--muted);
  font-size: 0.8rem;
}

#ps-fav-html,
#ps-svg-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .ps-compare {
    grid-template-columns: minmax(0, 1fr);
  }

  .ps-stage {
    min-height: 140px;
  }

  .ps-tool select {
    padding-right: 6px;
  }
}

/* LinkedIn post preview, hashtags and social image resizer */
.lp-panel {
  display: grid;
  gap: 14px;
}

.lp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 555px);
  gap: 20px;
  align-items: start;
}

.lp-edit,
.lp-view {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.lp-view {
  position: sticky;
  top: 84px;
}

.lp-profile {
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.lp-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lp-tb {
  min-width: 40px;
  height: 38px;
  padding: 0 10px;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.lp-tb:hover,
.lp-tb:focus-visible {
  border-color: var(--green);
}

.lp-tb-italic { font-style: italic; }
.lp-tb-boldItalic { font-style: italic; font-weight: 900; }
.lp-tb-underline { text-decoration: underline; }
.lp-tb-strike { text-decoration: line-through; }
.lp-tb-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.lp-edit textarea {
  min-height: 280px;
  line-height: 1.5;
}

.lp-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.92rem;
}

.lp-counts i {
  color: var(--muted);
  font-style: normal;
}

.lp-counts [data-state="over"] b { color: #a5442e; }
.lp-counts [data-state="warn"] b { color: #9a6a00; }

.lp-bar { background: var(--line); }
.lp-bar span[data-over="warn"] { background: var(--amber); }
.lp-bar span[data-over="over"] { background: #b5523b; }

.lp-file {
  cursor: pointer;
}

.lp-view-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
}

.lp-card {
  --lp-bg: #ffffff;
  --lp-ink: rgba(0, 0, 0, 0.9);
  --lp-muted: rgba(0, 0, 0, 0.6);
  --lp-line: #e8e8e8;
  --lp-link: #0a66c2;
  width: 100%;
  max-width: 555px;
  justify-self: center;
  overflow: hidden;
  color: var(--lp-ink);
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--lp-bg);
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.06);
}

.lp-card[data-device="mobile"] {
  max-width: 375px;
  border-radius: 0;
}

.lp-card[data-theme="dark"] {
  --lp-bg: #1b1f23;
  --lp-ink: rgba(255, 255, 255, 0.9);
  --lp-muted: rgba(255, 255, 255, 0.6);
  --lp-line: #38434f;
  --lp-link: #71b7fb;
}

.lp-card-head {
  display: flex;
  gap: 8px;
  padding: 12px 16px 0;
}

.lp-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--teal), var(--green));
  border-radius: 50%;
}

.lp-who {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.lp-who strong {
  font-size: 0.9rem;
  font-weight: 600;
}

.lp-who span {
  overflow: hidden;
  color: var(--lp-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lp-body {
  margin: 8px 16px 0;
  font-size: 0.875rem;
  line-height: 1.43;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lp-body.is-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.lp-probe {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
  margin: 0;
}

.lp-link {
  color: var(--lp-link);
  font-weight: 600;
}

.lp-empty {
  color: var(--lp-muted);
}

.lp-more {
  display: block;
  margin: 0 16px 0 auto;
  padding: 0;
  color: var(--lp-muted);
  font: inherit;
  font-size: 0.875rem;
  background: none;
  border: 0;
  cursor: pointer;
}

.lp-more:hover {
  color: var(--lp-link);
  text-decoration: underline;
}

.lp-card-img {
  display: block;
  width: 100%;
  margin-top: 8px;
}

.lp-card-foot {
  display: flex;
  justify-content: space-around;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 8px;
  color: var(--lp-muted);
  font-size: 0.8rem;
  font-weight: 600;
  border-top: 1px solid var(--lp-line);
}

.lp-card-foot span {
  padding: 8px 4px;
  white-space: nowrap;
}

.lp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lp-tag {
  padding: 6px 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.lp-tag[aria-pressed="true"] {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.lp-rs-grid {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  align-items: end;
}

.lp-slider input[type="range"],
.lp-rs-color input[type="color"] {
  min-height: 32px;
  padding: 0;
  accent-color: var(--green);
  background: none;
  border: 0;
}

.lp-rs-color input[type="color"] {
  min-height: 46px;
  padding: 4px;
  border: 1px solid #cbd8d1;
}

.lp-rs-result {
  display: grid;
  gap: 10px;
}

.lp-rs-stage {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 70vh;
  margin: 0 auto;
  background: var(--soft);
  border: 1px solid var(--line);
}

.lp-rs-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.lp-rs-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.lp-rs-guide[data-guide="circle"]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
  outline: 2px dashed #fff;
}

.lp-rs-guide[data-guide="circle"] {
  overflow: hidden;
}

.lp-rs-guide[data-guide="youtube"]::after {
  content: "12:34";
  position: absolute;
  right: 2%;
  bottom: 3%;
  padding: 0.2em 0.4em;
  color: #fff;
  font-size: clamp(0.6rem, 2vw, 0.9rem);
  font-weight: 700;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 4px;
}

.lp-rs-guide[data-guide="story"]::before,
.lp-rs-guide[data-guide="story"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 13%;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.25) 0 6px, rgba(0, 0, 0, 0.25) 6px 12px);
}

.lp-rs-guide[data-guide="story"]::before { top: 0; }
.lp-rs-guide[data-guide="story"]::after { bottom: 0; }

.lp-rs-guide[data-guide="libanner"]::after {
  content: "";
  position: absolute;
  left: 3%;
  bottom: -35%;
  width: 19%;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.55);
  border: 2px dashed #fff;
  border-radius: 50%;
}

.lp-rs-guide[data-guide="fbcover"]::before,
.lp-rs-guide[data-guide="fbcover"]::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 11%;
  background: rgba(0, 0, 0, 0.3);
}

.lp-rs-guide[data-guide="fbcover"]::before { left: 0; }
.lp-rs-guide[data-guide="fbcover"]::after { right: 0; }

@media (max-width: 900px) {
  .lp-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .lp-view {
    position: static;
  }
}

@media (max-width: 640px) {
  .lp-edit textarea {
    min-height: 220px;
  }

  .lp-tool select {
    padding-right: 6px;
  }

  .lp-card-foot {
    font-size: 0.72rem;
  }
}

/* Margin calculator */
.mg-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

.mg-any {
  margin: 0;
}

.mg-calc {
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
  vertical-align: 1px;
}

.mg-field.is-computed input {
  background: #f4f8f6;
  border-style: dashed;
}

.mg-bar {
  background: var(--line);
}

.mg-bar .mg-seg-cost { background: #c9d6cf; }
.mg-bar .mg-seg-profit { background: var(--green); }

#mg-main[data-sign="neg"] {
  color: #a5442e;
}

.mg-more:empty {
  display: none;
}

.mg-table caption {
  padding-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
}

.mg-more {
  min-width: 0;
}

.mg-table {
  width: 100%;
  font-variant-numeric: tabular-nums;
}

.mg-table td,
.mg-table th {
  padding: 7px 6px;
  font-size: 0.9rem;
}

@media (max-width: 420px) {
  .mg-table td,
  .mg-table th {
    padding: 7px 3px;
    font-size: 0.82rem;
  }
}

.mg-table td:first-child,
.mg-table th:first-child {
  text-align: left;
}

.mg-chart svg {
  width: 100%;
  height: auto;
}

.mg-be-line { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 4; }
.mg-be-dot { fill: #fff; stroke: var(--green); stroke-width: 3; }

.mg-field .fin-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
}

.mg-calc {
  margin-left: 0;
}

#mg-result > * {
  min-width: 0;
}

.mg-more .fin-table-wrap {
  max-height: none;
  overflow-x: auto;
}

/* Invoice generator */
.iv-layout {
  display: grid;
  gap: 20px;
  align-items: start;
}

@media (min-width: 960px) {
  .iv-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  }

  .iv-side {
    position: sticky;
    top: 88px;
  }
}

.iv-editor {
  display: grid;
  gap: 12px;
  min-width: 0;
  container-type: inline-size;
}

.iv-from {
  display: grid;
  gap: 12px;
}

.iv-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.iv-section > summary {
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
}

.iv-section-body {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}

.iv-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
}

.iv-tool textarea {
  width: 100%;
  resize: vertical;
}

.iv-logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.iv-logo-pick {
  cursor: pointer;
}

.iv-logo-row:focus-within .iv-logo-pick {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.iv-logo-thumb {
  max-width: 120px;
  max-height: 48px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.iv-items {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.iv-items-head,
.iv-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 88px 56px 88px 32px;
  gap: 6px;
  align-items: start;
}

.iv-items-head {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.iv-items-head span:nth-child(n+2):nth-child(-n+5) {
  text-align: right;
}

.iv-cell {
  display: grid;
  min-width: 0;
}

.iv-cell input,
.iv-cell textarea {
  min-width: 0;
  min-height: 42px;
  padding: 9px 8px;
}

.iv-cell input,
.iv-cell textarea {
  font-weight: 400;
}

.iv-cell textarea {
  resize: none;
  overflow: hidden;
  line-height: 1.35;
}

.iv-qty input,
.iv-rate input,
.iv-tax input {
  text-align: right;
}

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

.iv-amount {
  padding-top: 11px;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}

.iv-remove {
  margin-top: 4px;
}

@container (max-width: 470px) {
  .iv-items-head {
    display: none;
  }

  .iv-item {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 36px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .iv-desc {
    grid-column: 1 / 4;
  }

  .iv-remove {
    grid-column: 4;
    grid-row: 1;
  }

  .iv-amount {
    grid-column: 1 / -1;
    padding-top: 0;
  }

  .iv-cell-label {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
  }
}

.iv-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.iv-side {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.iv-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.iv-preview-title {
  margin: 0;
  font-size: 1.05rem;
}

.iv-pages {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.iv-paper {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(23, 32, 28, 0.1);
}

.iv-paper canvas {
  display: block;
  width: 100%;
}

.iv-total {
  margin: 0;
  font-weight: 800;
}

.iv-print {
  display: none;
}

@media print {
  body.iv-printing > *:not(.iv-print) {
    display: none !important;
  }

  body.iv-printing {
    margin: 0;
    background: #fff;
  }

  body.iv-printing > .iv-print {
    display: block;
  }

  .iv-print img {
    display: block;
    width: 100%;
    break-after: page;
  }

  .iv-print img:last-child {
    break-after: auto;
  }
}

/* CSV to Excel converter */
.cx-panel {
  display: grid;
  gap: 14px;
}

.cx-paste-box textarea {
  width: 100%;
  margin-top: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  white-space: pre;
}

.cx-checks label.check {
  font-weight: 600;
}

.cx-result {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.cx-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 16px;
}

.cx-sheet-field {
  flex: 1 1 220px;
  max-width: 360px;
}

.cx-info {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.cx-preview {
  max-height: 420px;
  overflow: auto;
}

.cx-preview table {
  width: auto;
  min-width: 100%;
  font-size: 0.85rem;
}

.cx-preview th,
.cx-preview td {
  max-width: 260px;
  padding: 6px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid var(--line);
}

.cx-preview thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.cx-preview tbody th {
  position: sticky;
  left: 0;
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.cx-preview tr.cx-head td {
  font-weight: 800;
  background: #e8f1ec;
}

@media (min-width: 720px) {
  .cx-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Cron expression explainer */
.cr-main {
  display: grid;
  gap: 8px;
}

.cr-expr {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.04em;
}

.cr-desc {
  margin: 4px 0 0;
  padding: 14px 16px;
  color: var(--green);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  background: #eef6f1;
  border-radius: 8px;
}

.cr-desc:empty {
  display: none;
}

.cr-error {
  margin: 4px 0 0;
  padding: 12px 14px;
  color: #a12c2c;
  font-weight: 700;
  background: #fdf0f0;
  border: 1px solid #f1c6c6;
  border-radius: 8px;
}

.cr-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.cr-tool.has-seconds .cr-fields {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.cr-field {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  text-align: center;
}

.cr-field label {
  font-size: 0.85rem;
  font-weight: 800;
}

.cr-field input {
  min-width: 0;
  padding-right: 6px;
  padding-left: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}

.cr-field.is-bad input {
  border-color: #c94b4b;
  box-shadow: 0 0 0 2px #f6d4d4;
}

.cr-allowed {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.cr-preset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cr-next-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.cr-next-title span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.cr-next-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  counter-reset: run;
}

.cr-next-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.cr-next-list li:last-child {
  border-bottom: 0;
}

.cr-next-list time {
  font-weight: 700;
}

.cr-rel {
  color: var(--muted);
  font-size: 0.9rem;
}

.cr-never {
  color: #a12c2c;
  font-weight: 700;
}

@media (max-width: 560px) {
  .cr-expr {
    font-size: 1.25rem;
  }

  .cr-fields,
  .cr-tool.has-seconds .cr-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Reverse text */
.rv-panes {
  display: grid;
  gap: 12px;
}

.rv-panes textarea {
  width: 100%;
  font-size: 1.05rem;
  line-height: 1.5;
}

#rv-output {
  background: var(--soft);
}

.rv-count {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.rv-clean {
  margin-top: 10px;
}

@media (min-width: 760px) {
  .rv-panes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Inches to cm */
.it-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.it-row #it-value {
  font-size: 1.25rem;
  font-weight: 800;
}

.it-ruler-box {
  margin: 0;
}

.it-ruler svg {
  display: block;
  width: 100%;
  height: auto;
}

.it-r-body { fill: #fbf6e4; stroke: #d9c98f; }
.it-r-tick { stroke: #4a4a3f; stroke-width: 1; }
.it-r-num { fill: #33332b; font-size: 14px; font-weight: 700; text-anchor: middle; }
.it-r-mark { stroke: #c2410c; stroke-width: 2.5; }

.it-chart-grid {
  display: grid;
  gap: 16px;
}

.it-chart caption {
  text-align: left;
  font-weight: 800;
  padding-bottom: 6px;
}

.it-chart td,
.it-chart th {
  text-align: left;
}

@media (min-width: 760px) {
  .it-chart-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

@media (max-width: 520px) {
  .it-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .it-row > .fin-field:last-child {
    grid-column: 1 / -1;
  }
}

/* Internet speed test */
.sp-stage {
  display: grid;
  justify-items: center;
  max-width: 380px;
  margin: 0 auto;
}

.sp-gauge {
  width: 100%;
}

.sp-gauge svg {
  display: block;
  width: 100%;
  height: auto;
}

.sp-track { fill: none; stroke: var(--line); stroke-width: 16; stroke-linecap: round; }
.sp-fill { fill: none; stroke: var(--green); stroke-width: 16; stroke-linecap: round; }
.sp-fill[data-phase="up"] { stroke: #7c3aed; }
.sp-mark { fill: var(--muted); font-size: 12px; font-weight: 700; text-anchor: middle; }

.sp-gauge,
.sp-readout {
  grid-area: 1 / 1;
}

.sp-readout {
  display: grid;
  align-self: center;
  justify-items: center;
  padding-top: 8%;
  text-align: center;
}

.sp-phase {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.sp-value {
  font-size: clamp(2rem, 9vw, 2.75rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.sp-unit {
  color: var(--muted);
  font-weight: 800;
}

.sp-start {
  min-width: 10rem;
  margin-top: -12px;
}

.sp-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sp-stat {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.sp-stat.is-active {
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--mint);
}

.sp-stat-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.sp-stat strong {
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
}

.sp-stat small {
  color: var(--muted);
  font-size: 0.8rem;
}

.sp-verdict,
.sp-history {
  display: grid;
  gap: 10px;
}

.sp-verdict-title {
  margin: 0;
  font-size: 1.1rem;
}

.sp-grades {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sp-grades li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f6f7f5;
}

.sp-grades li[data-grade="good"] b { color: var(--green); }
.sp-grades li[data-grade="ok"] b { color: #b45309; }
.sp-grades li[data-grade="poor"] b { color: #b91c1c; }

@media (min-width: 640px) {
  .sp-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sp-grades {
    grid-template-columns: 1fr 1fr;
  }
}

/* JWT decoder */
.jw-layout {
  display: grid;
  gap: 16px;
}

.jw-col {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}

#jw-input,
#jw-public {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  word-break: break-all;
}

.jw-colored {
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  word-break: break-all;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.jw-p0 { color: #c0392b; }
.jw-p1 { color: #7c3aed; }
.jw-p2 { color: #0369a1; }

.jw-time {
  margin: 0;
  padding: 10px 12px;
  font-weight: 800;
  border-radius: 8px;
  background: var(--mint);
  color: var(--green);
}

.jw-time[data-state="expired"],
.jw-time[data-state="notYet"] {
  background: #fdecea;
  color: #b91c1c;
}

.jw-time[data-state="noExp"] {
  background: #fff7e6;
  color: #92400e;
}

.jw-block {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.jw-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.jw-block-title {
  margin: 0;
  font-size: 1rem;
}

.jw-block[data-part="header"] .jw-block-title { color: #c0392b; }
.jw-block[data-part="payload"] .jw-block-title { color: #7c3aed; }

.jw-json {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f6f7f5;
  border-radius: 10px;
}

.jw-k { color: #1d4ed8; }
.jw-s { color: #15803d; }
.jw-n { color: #b45309; }
.jw-b { color: #7c3aed; }

.jw-claims th code {
  font-weight: 800;
}

.jw-claims small {
  display: block;
  color: var(--muted);
  font-weight: 600;
}

.table-wrap .jw-claims th,
.table-wrap .jw-claims td {
  white-space: normal;
  vertical-align: top;
}

.jw-claims tbody th {
  width: 45%;
  background: transparent;
}

.jw-claims td {
  word-break: break-word;
}

.jw-verify {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.jw-key {
  display: grid;
  gap: 6px;
}

.jw-key[hidden] {
  display: none;
}

.jw-alg {
  padding: 2px 8px;
  font-size: 0.8rem;
  color: #0369a1;
  background: #e0f2fe;
  border-radius: 999px;
}

.jw-result {
  margin: 0;
  font-weight: 800;
}

.jw-result[data-kind="success"] { color: var(--green); }
.jw-result[data-kind="error"] { color: #b91c1c; }

@media (min-width: 900px) {
  .jw-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* Password strength checker */
.pw-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

#pw-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.15rem;
}

.pw-meter {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.pw-meter span {
  height: 10px;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.2s;
}

.pw-meter[data-score="0"] span:nth-child(-n+1) { background: #b91c1c; }
.pw-meter[data-score="1"] span:nth-child(-n+2) { background: #ea580c; }
.pw-meter[data-score="2"] span:nth-child(-n+3) { background: #ca8a04; }
.pw-meter[data-score="3"] span:nth-child(-n+4) { background: #65a30d; }
.pw-meter[data-score="4"] span { background: var(--green); }

.pw-result {
  display: grid;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.pw-headline {
  display: grid;
  gap: 12px;
}

.pw-headline > div {
  display: grid;
  gap: 4px;
}

.pw-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 0;
}

.pw-facts dt {
  color: var(--muted);
  font-weight: 700;
}

.pw-facts dd {
  margin: 0;
  font-weight: 800;
}

.pw-title {
  margin: 0 0 8px;
  font-size: 1rem;
}

.pw-warnings,
.pw-checks {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pw-warnings:empty {
  display: none;
}

.pw-warnings li {
  padding: 8px 12px;
  border-radius: 8px;
  color: #92400e;
  background: #fff7e6;
}

.pw-warnings li.is-tip {
  color: #1e3a8a;
  background: #eef4ff;
}

.pw-warnings li.is-good {
  color: var(--green);
  background: var(--mint);
}

.pw-checks li {
  position: relative;
  padding-left: 26px;
}

.pw-checks li::before {
  position: absolute;
  left: 0;
  font-weight: 900;
}

.pw-checks li[data-ok="yes"]::before { content: "✓"; color: var(--green); }
.pw-checks li[data-ok="no"]::before { content: "✗"; color: #b91c1c; }
.pw-checks li[data-ok="no"] { color: var(--muted); }

.pw-pieces {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.pw-piece {
  display: inline-grid;
  padding: 4px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
  border-radius: 6px;
  background: #f1f5f9;
}

.pw-piece small {
  font-family: inherit;
  font-size: 0.7rem;
  color: var(--muted);
}

.pw-piece:not(.is-bruteforce) {
  background: #fdecea;
}

.table-wrap .pw-table th,
.table-wrap .pw-table td {
  white-space: normal;
}

.pw-table th {
  font-weight: 700;
}

.pw-table td {
  font-weight: 800;
  text-align: right;
}

.pw-breach {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.pw-breach-result {
  margin: 0;
  font-weight: 800;
}

.pw-breach-result[data-kind="success"] { color: var(--green); }
.pw-breach-result[data-kind="error"] { color: #b91c1c; }

@media (min-width: 720px) {
  .pw-headline {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .pw-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

@media (max-width: 719px) {
  .pw-cols {
    display: grid;
    gap: 16px;
  }
}

/* Loan payment calculator */
.ln-modes {
  flex-wrap: wrap;
}

.ln-split {
  display: flex;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

#ln-bar-principal { background: var(--green); }
#ln-bar-interest { background: #b5523b; }

.ln-tool [data-hide][hidden] {
  display: none;
}

/* UTM builder */
.ut-url input,
.ut-tool .fin-field input[data-key] {
  width: 100%;
}

.ut-req {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.ut-key {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.ut-output {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-all;
  user-select: all;
}

.ut-channel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 14px 0 2px;
}

.ut-channel strong {
  padding: 3px 10px;
  border-radius: 999px;
  background: #e3f1e8;
  color: #1d5b3a;
}

.ut-channel strong[data-channel="unassigned"],
.ut-channel strong[data-channel="none"] {
  background: #fbeee0;
  color: #8a4a12;
}

.ut-warnings {
  margin: 8px 0 12px;
  padding-left: 20px;
  color: #8a4a12;
}

.ut-warnings:empty {
  display: none;
}

.ut-warnings li + li {
  margin-top: 4px;
}

.ut-qr {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin: 12px 0;
}

.ut-qr canvas {
  width: 200px;
  height: 200px;
  border: 1px solid var(--line);
  border-radius: 8px;
  image-rendering: pixelated;
}

.ut-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.ut-bulk textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ut-bulk-list,
.ut-history-list {
  margin: 10px 0;
  padding-left: 22px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.ut-bulk-list:empty {
  display: none;
}

.ut-bulk-list li + li {
  margin-top: 6px;
}

.ut-bulk-list .is-bad {
  color: #a23b2a;
}

.ut-history {
  margin-top: 18px;
}

.ut-history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ut-history-list {
  padding: 0;
  list-style: none;
}

.ut-history-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.ut-history-url {
  flex: 1 1 100%;
}

/* MP3 converter */
.au-item {
  grid-template-columns: 40px minmax(0, 1fr) auto;
}

.au-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--mint);
  color: var(--green);
  font-size: 1.2rem;
  font-weight: 800;
}

.au-progress {
  width: 100%;
  height: 6px;
  accent-color: var(--green);
}

.au-player {
  width: 100%;
  max-width: 360px;
  height: 36px;
  margin-top: 4px;
}

.au-credit {
  margin-top: 14px;
  font-size: 0.82rem;
}

@media (max-width: 480px) {
  .au-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .au-icon {
    display: none;
  }
}

/* SSL checker */
.sc-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.sc-search input,
.sc-search select {
  width: 100%;
}

@media (min-width: 700px) {
  .sc-search {
    grid-template-columns: minmax(0, 1fr) 210px auto;
  }
}

.sc-verdict {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 10px;
  background: #e3f1e8;
}

.sc-verdict[data-state="warn"] { background: #fbeee0; }
.sc-verdict[data-state="bad"] { background: #fbe4df; }

.sc-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
}

.sc-verdict[data-state="warn"] .sc-badge { background: #b26a12; }
.sc-verdict[data-state="bad"] .sc-badge { background: #a23b2a; }

.sc-verdict-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.sc-verdict-text {
  margin: 0;
}

.sc-expiry {
  display: grid;
  gap: 4px;
  margin: 18px 0 10px;
}

.sc-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.sc-meter span {
  display: block;
  height: 100%;
  background: var(--green);
}

.sc-meter span[data-state="warn"] { background: #d18a2a; }
.sc-meter span[data-state="bad"] { background: #a23b2a; }

.sc-checks {
  display: grid;
  gap: 6px;
  margin: 14px 0 18px;
  padding: 0;
  list-style: none;
}

.sc-checks li {
  position: relative;
  padding-left: 28px;
}

.sc-checks li::before {
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  content: "✓";
  font-size: 0.75rem;
  font-weight: 800;
}

.sc-checks li[data-state="warn"]::before { background: #b26a12; content: "!"; }
.sc-checks li[data-state="bad"]::before { background: #a23b2a; content: "✕"; }

.sc-summary dd {
  overflow-wrap: anywhere;
}

.sc-san {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.sc-san li {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.sc-san li.is-match {
  border-color: var(--green);
  background: #e3f1e8;
}

.sc-chain {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding-left: 22px;
}

.sc-chain li span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.sc-result h3 {
  margin: 20px 0 8px;
  font-size: 1.05rem;
}

.sc-summary dd {
  font-weight: 650;
}

@media (max-width: 600px) {
  .sc-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .sc-summary dd {
    margin-bottom: 8px;
    text-align: left;
  }
}

/* PDF converter */
.pc-routes {
  display: grid;
  gap: 12px;
}

.pc-icon {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.pc-password {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.pc-password input {
  flex: 1 1 160px;
  min-width: 0;
}

.pc-item[data-state="merged"] {
  opacity: 0.75;
}

.pc-item[data-state="locked"] {
  border-color: #f1d3a8;
  background: #fffaf2;
}

/* Markdown editor */
.md-tool,
#md-print-area {
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.md-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.md-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.md-tb {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
}

.md-tb:hover,
.md-tb:focus-visible {
  background: var(--mint);
  border-color: #b9e5cb;
}

.md-glyph {
  font-size: 1.02rem;
  font-weight: 800;
}

.md-i {
  font-style: italic;
  font-family: Georgia, serif;
}

.md-s {
  text-decoration: line-through;
}

.md-sep {
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: var(--line);
}

.md-panes {
  display: grid;
  gap: 12px;
}

.md-panes[data-view="split"] {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.md-panes[data-view="write"] .md-show,
.md-panes[data-view="preview"] .md-write {
  display: none;
}

.md-pane {
  min-width: 0;
}

.md-write textarea,
.md-preview {
  height: clamp(360px, 62vh, 720px);
  min-height: 0;
}

.md-write textarea {
  display: block;
  resize: none;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.65;
  tab-size: 2;
}

.md-preview {
  overflow: auto;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid #cbd8d1;
  border-radius: 8px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.md-preview > :first-child {
  margin-top: 0;
}

.md-preview h1,
.md-preview h2 {
  padding-bottom: 0.25em;
  border-bottom: 1px solid var(--line);
}

.md-preview h1 {
  font-size: 1.7rem;
}

.md-preview h2 {
  font-size: 1.35rem;
}

.md-preview h3 {
  font-size: 1.12rem;
}

.md-preview a {
  color: var(--teal);
}

.md-preview code {
  padding: 0.12em 0.35em;
  background: #f0f4f2;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.88em;
}

.md-preview pre {
  overflow: auto;
  padding: 12px 14px;
  background: #f0f4f2;
  border-radius: 8px;
}

.md-preview pre code {
  padding: 0;
  background: none;
}

.md-preview blockquote {
  margin: 1em 0;
  padding: 0 1em;
  color: var(--muted);
  border-left: 4px solid var(--line);
}

.md-preview table {
  display: block;
  max-width: 100%;
  overflow: auto;
  border-collapse: collapse;
}

.md-preview th,
.md-preview td {
  padding: 6px 12px;
  border: 1px solid var(--line);
}

.md-preview th {
  background: var(--soft);
}

.md-preview img {
  max-width: 100%;
  height: auto;
}

.md-preview hr {
  border: 0;
  border-top: 1px solid var(--line);
}

.md-preview li:has(> input[type="checkbox"]) {
  list-style: none;
}

.md-preview li > input[type="checkbox"] {
  width: auto;
  min-height: 0;
  margin: 0 0.45em 0 -1.3em;
  vertical-align: middle;
}

.md-empty {
  color: var(--muted);
}

.md-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.md-stats {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.md-file {
  cursor: pointer;
}

/* Full screen: the editor covers the window. */
.md-tool.md-full {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: auto;
  max-width: none;
  margin: 0;
  padding: 14px;
  border-radius: 0;
  background: var(--soft);
}

.md-tool.md-full .md-write textarea,
.md-tool.md-full .md-preview {
  height: calc(100vh - 230px);
  min-height: 240px;
}

html.md-noscroll {
  overflow: hidden;
}

@media (max-width: 760px) {
  .md-panes[data-view="split"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .md-panes[data-view="split"] .md-write textarea,
  .md-panes[data-view="split"] .md-preview {
    height: 44vh;
    min-height: 220px;
  }

  .md-write textarea,
  .md-preview {
    height: 60vh;
  }

  .md-tb {
    width: 34px;
    height: 34px;
  }

  .md-sep {
    display: none;
  }
}

/* Printing: only the rendered document. */
#md-print-area {
  display: none;
}

@media print {
  body.md-printing > :not(#md-print-area) {
    display: none !important;
  }

  body.md-printing #md-print-area {
    display: block;
    height: auto;
    overflow: visible;
    padding: 0;
    border: 0;
  }

  #md-print-area pre,
  #md-print-area table,
  #md-print-area img {
    break-inside: avoid;
  }
}

/* YAML validator */
.yml-sample {
  width: auto;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.92rem;
}

.yml-hints {
  margin-top: 10px;
  padding: 10px 14px;
  background: #fffaf2;
  border: 1px solid #f1d3a8;
  border-radius: 8px;
}

.yml-hints[hidden] {
  display: none;
}

.yml-hints-title {
  margin: 0 0 6px;
  font-weight: 800;
}

.yml-hints ul {
  margin: 0;
  padding-left: 1.2em;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

/* Hash checker */
.hc-algos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.hc-expected {
  min-height: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

.hc-expected-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 8px;
}

.hc-file {
  cursor: pointer;
}

.hc-results {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hc-results:empty {
  display: none;
}

.hc-item {
  display: block;
}

.hc-item[data-verdict="match"] {
  border-color: #9fd8b5;
  background: #f3fbf6;
}

.hc-item[data-verdict="mismatch"] {
  border-color: #f0b4ad;
  background: #fff6f5;
}

.hc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.hc-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.hc-size {
  color: var(--muted);
  font-size: 0.9rem;
}

.hc-badge {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  background: var(--soft);
}

.hc-badge[data-kind="match"] {
  color: #0c5a37;
  background: var(--mint);
}

.hc-badge[data-kind="mismatch"] {
  color: #9b1c12;
  background: #fde3e0;
}

.hc-bar {
  margin-top: 10px;
}

.hc-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
}

.hc-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
}

.hc-row[data-kind="match"] {
  background: var(--mint);
}

.hc-row[data-kind="mismatch"] {
  background: #fde3e0;
}

.hc-row dt {
  font-weight: 800;
  font-size: 0.88rem;
}

.hc-row dd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
}

.hc-row code {
  flex: 1 1 auto;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
  word-break: break-all;
}

@media (max-width: 560px) {
  .hc-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

/* Flowchart builder */
.fc-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.fc-select {
  width: auto;
  max-width: 100%;
  min-height: 38px;
  padding: 6px 10px;
}

.fc-bar > *,
.fc-panes {
  min-width: 0;
  max-width: 100%;
}

.fc-panes {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
}

.fc-edit {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.fc-edit textarea {
  height: clamp(320px, 56vh, 620px);
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  tab-size: 2;
}

.fc-help ul {
  margin: 8px 0 0;
  padding-left: 1.1em;
  font-size: 0.9rem;
}

.fc-help code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--soft);
  padding: 0 4px;
  border-radius: 4px;
}

.fc-view {
  position: relative;
  min-width: 0;
}

.fc-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: flex;
  gap: 4px;
}

.fc-zoom .button {
  min-width: 36px;
  background: rgba(255, 255, 255, 0.92);
}

.fc-canvas {
  height: clamp(360px, 62vh, 700px);
  overflow: auto;
  padding: 44px 12px 12px;
  background: #fff;
  border: 1px solid #cbd8d1;
  border-radius: 8px;
  text-align: center;
}

.fc-canvas svg {
  display: inline-block;
}

.fc-node {
  cursor: pointer;
}

.fc-node:hover > :first-child,
.fc-node:focus-visible > :first-child {
  filter: brightness(0.94);
  stroke-width: 2.6;
}

.fc-node:focus {
  outline: none;
}

.fc-problems {
  margin: 0;
  padding: 8px 12px 8px 28px;
  background: #fffaf2;
  border: 1px solid #f1d3a8;
  border-radius: 8px;
  font-size: 0.92rem;
}

.fc-problems[hidden] {
  display: none;
}

@media (max-width: 860px) {
  .fc-panes {
    grid-template-columns: minmax(0, 1fr);
  }

  .fc-edit textarea {
    height: 240px;
  }

  .fc-canvas {
    height: 60vh;
  }
}

/* Aspect ratio calculator */
.ar-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ar-presets button {
  min-height: 36px;
  padding: 6px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.ar-presets button:hover,
.ar-presets button[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--soft);
}

.ar-box {
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.ar-box > legend {
  float: left;
  width: 100%;
  margin-bottom: 4px;
}

.ar-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 10px;
}

.ar-pair input {
  font-size: 1.1rem;
}

.ar-x {
  padding-bottom: 10px;
  color: var(--muted);
  font-weight: 800;
}

.ar-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ar-file {
  cursor: pointer;
}

.ar-hint {
  margin: 0;
}

.ar-round {
  max-width: 320px;
}

.ar-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ar-preview-box {
  display: grid;
  place-items: center;
  width: 236px;
  max-width: 100%;
  height: 166px;
  margin: 0;
}

.ar-preview {
  display: grid;
  place-items: center;
  max-width: 100%;
  background: linear-gradient(135deg, #e5f4ec, #cfe9dc);
  border: 2px solid var(--green);
  border-radius: 6px;
  color: var(--green);
  font-weight: 850;
  transition: width 0.2s, height 0.2s;
}

.ar-table {
  width: 100%;
}

.ar-table td:last-child {
  width: 1%;
  text-align: right;
}

.ar-use {
  min-height: 34px;
  padding: 4px 12px;
}

.ar-sizes .table-wrap {
  margin-top: 10px;
}

.ar-tool {
  grid-template-columns: minmax(0, 1fr);
}

.ar-tool fieldset {
  min-width: 0;
}

.ar-table {
  min-width: 0;
}

.ar-table th,
.ar-table td {
  white-space: normal;
}

.ar-table tbody th {
  white-space: nowrap;
}

@media (max-width: 520px) {
  .ar-preview-box {
    width: 100%;
    height: 130px;
  }
}

/* XML validator */
.xml-extra > .fin-hint {
  margin: 10px 0;
}

.xml-xsd {
  height: 180px;
  margin-top: 10px;
}

.xml-xpath-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.xml-xpath-row input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.xml-xsd-errors,
.xml-xpath-results {
  max-height: 320px;
  margin: 8px 0 0;
  padding: 10px 12px 10px 30px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.9rem;
}

.xml-xsd-errors li + li,
.xml-xpath-results li + li {
  margin-top: 6px;
}

.xml-xpath-results code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Image compressor */
.cmp-size {
  display: grid;
  gap: 8px;
}

.cmp-size-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
}

.cmp-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cmp-tool .img-quality .fin-hint {
  font-weight: 400;
}

.cmp-thumb-button {
  display: block;
  width: 56px;
  height: 56px;
  padding: 0;
  cursor: zoom-in;
  background: none;
  border: 0;
}

.cmp-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.cmp-compare {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.cmp-compare[hidden] {
  display: none;
}

.cmp-compare-title {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1.1rem;
}

.cmp-compare .fin-hint {
  margin: 0;
}

.cmp-frame {
  max-height: 70vh;
  overflow: auto;
  background: repeating-conic-gradient(#e9eeeb 0% 25%, #fff 0% 50%) 50% / 16px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cmp-view {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.cmp-view.is-actual {
  max-width: none;
}

.cmp-view img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.cmp-view::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  width: 2px;
  margin-left: -1px;
  content: "";
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.cmp-tag {
  position: absolute;
  top: 8px;
  z-index: 1;
  padding: 2px 8px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(16, 32, 24, 0.72);
  border-radius: 4px;
  pointer-events: none;
}

.cmp-tag-before {
  left: 8px;
}

.cmp-tag-after {
  right: 8px;
}

.cmp-slider-label input {
  width: 100%;
  min-height: 0;
  padding: 0;
  accent-color: var(--green);
  background: none;
  border: 0;
}

@media (max-width: 520px) {
  .cmp-item {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .cmp-item-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .cmp-item-actions .button {
    flex: 1;
  }
}

/* Split PDF */
.spl-tool .p2i-item:has(input:not(:checked)) .i2p-frame {
  opacity: 1;
}

.spl-tool .p2i-item:has(input:checked) {
  border-color: var(--line);
  box-shadow: none;
}

.spl-tool:not([data-mode="extract"]) .p2i-check input {
  display: none;
}

.spl-tool:not([data-mode="extract"]) .p2i-pick {
  cursor: default;
}

.spl-item {
  --group: var(--green);
}

.spl-item[data-group="1"] { --group: #2563eb; }
.spl-item[data-group="2"] { --group: #c2410c; }
.spl-item[data-group="3"] { --group: #7c3aed; }
.spl-item[data-group="4"] { --group: #0f766e; }
.spl-item[data-group="5"] { --group: #be185d; }

.spl-tool .spl-item[data-group] {
  border-color: var(--group);
  box-shadow: inset 0 -4px 0 var(--group);
}

.spl-item.is-out .i2p-frame {
  opacity: 0.4;
}

.spl-file {
  position: absolute;
  right: 6px;
  bottom: 6px;
  max-width: calc(100% - 12px);
  padding: 1px 7px;
  overflow: hidden;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--group);
  border-radius: 999px;
}

.spl-file:empty {
  display: none;
}

.spl-item.is-out .spl-file {
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line);
}

.spl-result-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 850;
  background: #b42318;
  border-radius: 6px;
}

/* MLA citation generator */
.mla-tool .ip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.mla-lookup {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mla-lookup .fin-hint {
  margin: 0;
}

.mla-people {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.mla-rows {
  display: grid;
  gap: 8px;
  width: 100%;
}

.mla-person {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
  gap: 8px;
}

.mla-remove {
  min-width: 40px;
  padding: 0;
  font-size: 1.2rem;
}

.mla-fields {
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.mla-wide {
  grid-column: 1 / -1;
}

.mla-date-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) 5.5rem;
  gap: 6px;
}

.mla-options {
  display: grid;
  gap: 10px;
}

.mla-result,
.mla-list-box {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.mla-list-box[hidden] {
  display: none;
}

.mla-result-title {
  margin: 0;
  font-size: 1.15rem;
}

.mla-entry {
  padding: 14px 16px 14px 2.6rem;
  text-indent: -1.6rem;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.08rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
}

.mla-placeholder {
  color: var(--muted);
  font-family: inherit;
}

.mla-intext {
  display: grid;
  gap: 6px;
}

.mla-intext-row {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.mla-intext-row output {
  font-family: "Times New Roman", Times, serif;
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

.mla-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mla-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mla-list-entry {
  margin: 0;
  padding-left: 1.6rem;
  text-indent: -1.6rem;
  font-family: "Times New Roman", Times, serif;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.mla-list-actions {
  display: flex;
  gap: 6px;
}

@media (max-width: 520px) {
  .mla-list li {
    grid-template-columns: minmax(0, 1fr);
  }

  .mla-intext-row {
    grid-template-columns: 5.5rem minmax(0, 1fr);
  }

  .mla-intext-row button {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* Video compressor */
.vid-options {
  display: grid;
  gap: 14px;
}

.vid-info {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.vid-size-row {
  display: grid;
  grid-template-columns: minmax(0, 12rem) auto;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}

.vid-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.5rem;
  gap: 10px;
  align-items: center;
  font-weight: 800;
}

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

.vid-progress progress {
  width: 100%;
  height: 12px;
  accent-color: var(--green);
}

.vid-result {
  display: grid;
  gap: 10px;
}

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

.vid-result video {
  width: 100%;
  max-height: 60vh;
  background: #000;
  border-radius: 8px;
}

.vid-result-meta {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Volume calculator */
.vol-panel {
  display: grid;
  gap: 12px;
}

.vol-top {
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  align-items: end;
}

.vol-fields {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.vol-figure {
  display: flex;
  justify-content: center;
  padding: 6px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.vol-figure:empty {
  display: none;
}

.vol-figure svg {
  max-width: 100%;
  height: auto;
}

.vol-figure path,
.vol-figure circle,
.vol-figure ellipse,
.vol-figure rect {
  fill: none;
  stroke: var(--green);
  stroke-width: 2;
  stroke-linejoin: round;
}

.vol-figure .vol-dim {
  stroke: #b5523b;
  stroke-dasharray: 4 3;
  stroke-width: 1.5;
}

.vol-figure text {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 800;
  font-style: italic;
}

.vol-box-table input {
  width: 100%;
  min-width: 4.2rem;
  padding: 8px;
}

.vol-box-table td,
.vol-box-table th {
  padding: 6px;
  vertical-align: middle;
}

.vol-box-cbm {
  font-weight: 800;
  white-space: nowrap;
}

.vol-gauge {
  height: 14px;
  overflow: hidden;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.vol-gauge span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.vol-formula {
  margin: 0;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: var(--soft);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

/* Carbon footprint calculator */
.cf-top,
.cf-grid {
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  align-items: start;
}

.cf-block {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.cf-block > legend {
  padding: 0 6px;
  font-weight: 850;
  font-size: 1.05rem;
}

.cf-stack {
  height: 18px;
  background: var(--soft);
}

.cf-compare {
  display: grid;
  gap: 8px;
}

.cf-bar-row {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr) 4.5rem;
  gap: 10px;
  align-items: center;
  font-size: 0.92rem;
}

.cf-bar-row strong {
  text-align: right;
  white-space: nowrap;
}

.cf-bar-track {
  height: 12px;
  overflow: hidden;
  background: var(--soft);
  border-radius: 999px;
}

.cf-bar-track span {
  display: block;
  height: 100%;
  background: var(--muted);
  border-radius: 999px;
}

.cf-you .cf-bar-track span { background: var(--green); }
.cf-target .cf-bar-track span { background: var(--teal); }

.cf-ideas h3 {
  margin: 0 0 6px;
}

.cf-ideas ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 4px;
}

@media (max-width: 520px) {
  .cf-bar-row {
    grid-template-columns: minmax(0, 1fr) 4.5rem;
  }

  .cf-bar-row .cf-bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* Electrical load calculator */
.ld-panel {
  display: grid;
  gap: 12px;
}

.ld-top {
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  align-items: start;
}

.ld-table select,
.ld-table input {
  width: 100%;
  min-width: 4.5rem;
  padding: 8px;
}

.ld-table td:first-child {
  min-width: 11rem;
}

.ld-table td,
.ld-table th {
  padding: 6px;
  vertical-align: middle;
}

.ld-row-total {
  font-weight: 800;
  white-space: nowrap;
}

/* HTML to PDF */
.hp-layout {
  align-items: stretch;
}

.hp-input {
  min-height: 420px;
}

.hp-stage {
  min-height: 420px;
  max-height: 640px;
  overflow: auto;
  padding: 8px;
  background: #e6ebe8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hp-paper {
  box-sizing: border-box;
  background: #fff;
  box-shadow: 0 2px 10px rgba(23, 32, 28, 0.18);
  transform-origin: top left;
}

.hp-paper iframe {
  display: block;
  border: 0;
  background: #fff;
}

.hp-grid {
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  align-items: start;
  margin-top: 12px;
}

.hp-pair {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hp-pair input {
  width: 5.5rem;
}

.hp-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
}

/* Website checker */
@media (min-width: 700px) {
  .wc-search {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.wc-recent {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.wc-recent .fin-hint {
  margin: 0 6px 0 0;
}

#wc-recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wc-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.wc-light {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
}

.wc-light-pass { background: #1f9d55; box-shadow: 0 0 0 6px #dff6e8; }
.wc-light-warn { background: var(--amber); box-shadow: 0 0 0 6px #fdf1d3; }
.wc-light-fail { background: #c0392b; box-shadow: 0 0 0 6px #f8dcd8; }

.wc-verdict {
  margin: 0;
  font-size: 1.5rem;
  overflow-wrap: anywhere;
}

.wc-head .fin-note {
  margin: 4px 0 0;
}

.wc-score {
  display: grid;
  justify-items: center;
  min-width: 5.5rem;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 0.8rem;
  color: var(--muted);
}

.wc-score strong {
  font-size: 1.9rem;
  line-height: 1.1;
  color: var(--ink);
}

.wc-score[data-level="good"] strong { color: #1f9d55; }
.wc-score[data-level="ok"] strong { color: #b07d10; }
.wc-score[data-level="poor"] strong { color: #c0392b; }

.wc-timing h3,
.wc-chain-wrap h3 {
  margin: 0 0 8px;
}

.wc-timebar {
  height: 16px;
  background: var(--soft);
}

.wc-chain td {
  overflow-wrap: anywhere;
}

.wc-count {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
}

.wc-checks {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.wc-checks li {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 2px 8px;
  align-items: start;
}

.wc-checks small {
  grid-column: 2;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.wc-mark {
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 900;
  color: #fff;
  background: var(--muted);
}

.wc-pass .wc-mark { background: #1f9d55; }
.wc-warn .wc-mark { background: #d39b16; }
.wc-fail .wc-mark { background: #c0392b; }
.wc-info .wc-mark { background: var(--teal); }

@media (max-width: 520px) {
  .wc-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .wc-score {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* Image resizer */
.rs-tool {
  display: grid;
  gap: 14px;
}

.rs-grid {
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  align-items: start;
}

.rs-fit {
  display: grid;
  gap: 12px;
}

#rs-bg {
  width: 4rem;
  height: 2.6rem;
  padding: 2px;
}

/* Pressure converter */
.pr-panel {
  display: grid;
  gap: 10px;
}

.pr-top {
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  align-items: start;
}

.pr-tyre td {
  text-align: right;
}

/* Mechanical calculator */
.mt-top,
.mt-grid {
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  align-items: start;
}

.mt-panel {
  display: grid;
  gap: 10px;
}

.mt-formula {
  margin: 0;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: var(--soft);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

/* Distance calculator */
.dc-stops {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dc-stop {
  display: grid;
  gap: 4px;
}

.dc-stop-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}

.dc-note {
  color: var(--muted);
}

.dc-choices {
  display: grid;
  gap: 4px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.dc-choice {
  width: 100%;
  padding: 6px 10px;
  text-align: left;
  font: inherit;
  font-size: 0.9rem;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.dc-options {
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  align-items: end;
}

.dc-headlines {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 16px;
}

.dc-map {
  height: 420px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  z-index: 0;
}

@media (max-width: 520px) {
  .dc-map {
    height: 320px;
  }
}

/* PDF editor */
.pe-tool {
  display: grid;
  gap: 12px;
}

.pe-app {
  display: grid;
  gap: 10px;
}

.pe-toolbar {
  position: sticky;
  top: 72px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.pe-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
}

.pe-tool-btn {
  position: relative;
}

.pe-tool-btn input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.pe-tool-btn span[aria-hidden] {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  font-size: 1.05rem;
  font-weight: 800;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  cursor: pointer;
}

.pe-tool-btn input:checked + span {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.pe-tool-btn input:focus-visible + span {
  outline: 3px solid var(--amber);
}

.pe-props,
.pe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-size: 0.9rem;
}

.pe-prop input[type="number"] {
  width: 4.2rem;
  padding: 6px;
}

.pe-prop input[type="color"] {
  width: 2.4rem;
  height: 2.3rem;
  padding: 2px;
}

.pe-zoom {
  min-width: 3rem;
  text-align: center;
  font-weight: 800;
}

.pe-main {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 10px;
}

.pe-side {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 80vh;
  overflow: auto;
}

.pe-thumbs {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pe-thumb {
  display: grid;
  gap: 4px;
  padding: 6px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 8px;
}

.pe-thumb.is-current {
  border-color: var(--green);
}

.pe-thumb-view {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.pe-thumb-view canvas {
  max-width: 100%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.pe-thumb-n {
  position: absolute;
  right: 2px;
  bottom: 2px;
  padding: 0 5px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  background: rgba(23, 32, 28, 0.7);
  border-radius: 4px;
}

.pe-thumb-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
}

.pe-mini {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  font-size: 0.85rem;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
}

.pe-side-actions {
  display: grid;
  gap: 6px;
}

.pe-stage {
  min-height: 60vh;
  max-height: 85vh;
  overflow: auto;
  padding: 12px;
  background: #dde3e0;
  border-radius: 10px;
}

.pe-page {
  position: relative;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.pe-page canvas {
  display: block;
}

.pe-layer {
  position: absolute;
  inset: 0;
  touch-action: none;
  cursor: crosshair;
}

.pe-layer[data-tool="select"] {
  cursor: default;
}

.pe-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pe-obj-path {
  pointer-events: stroke;
  cursor: move;
}

.pe-obj-path.is-selected {
  filter: drop-shadow(0 0 2px #1a56db);
}

.pe-obj {
  position: absolute;
  box-sizing: border-box;
  cursor: move;
}

.pe-highlight {
  opacity: 0.35;
  mix-blend-mode: multiply;
}

.pe-ellipse {
  border-radius: 50%;
}

.pe-obj img,
.pe-obj svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pe-obj.is-selected {
  outline: 2px dashed #1a56db;
  outline-offset: 2px;
}

.pe-handle {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: #1a56db;
  border: 2px solid #fff;
  border-radius: 3px;
  cursor: nwse-resize;
}

.pe-grip {
  position: absolute;
  left: -16px;
  top: -16px;
  width: 14px;
  height: 14px;
  background: #1a56db;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: move;
}

.pe-text {
  cursor: text;
}

.pe-text-edit {
  min-width: 1ch;
  padding: 0 2px;
  line-height: 1.25;
  white-space: pre;
  outline: none;
}

.pe-name input {
  min-width: 14rem;
}

.pe-dialog {
  width: min(640px, 94vw);
  padding: 18px;
  border: 0;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.pe-dialog h2 {
  margin-top: 0;
}

.pe-sign-pad {
  display: block;
  width: 100%;
  height: auto;
  margin: 12px 0 0;
  background: #fff;
  border: 2px dashed var(--line);
  border-radius: 10px;
  touch-action: none;
}

#pe-sign-text {
  width: 100%;
  margin-top: 12px;
  font-size: 1.4rem;
  font-style: italic;
}

.pe-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 10px;
  margin: 10px 0;
}

@media (max-width: 720px) {
  .pe-main {
    grid-template-columns: 1fr;
  }

  .pe-side {
    max-height: none;
  }

  .pe-thumbs {
    display: flex;
    overflow-x: auto;
  }

  .pe-thumb {
    flex: 0 0 7.5rem;
  }
}

/* Merge PDF */
.mg-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.mg-range {
  display: grid;
  gap: 2px;
  font-size: 0.78rem;
  font-weight: 700;
}

.mg-range[hidden] {
  display: none;
}

.mg-range input {
  min-height: 32px;
  padding: 2px 6px;
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.mg-range input[aria-invalid="true"] {
  border-color: #c0392b;
  outline: 2px solid rgba(192, 57, 43, 0.25);
}

.mg-list .i2p-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.mg-item {
  align-content: start;
}

/* HTML viewer */
.tool-status[data-kind="warning"] {
  color: #7a4b00;
  background: #fff7e0;
  border-color: #f0d48a;
}

.hv-layout {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.hv-pane {
  display: grid;
  gap: 8px;
  min-width: 0;
  align-content: start;
}

.hv-box[hidden] {
  display: none;
}

.hv-editor {
  display: flex;
  height: 460px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.5;
  background: #fff;
  border: 1px solid #cbd8d1;
  border-radius: 8px;
  resize: vertical;
}

.hv-editor:focus-within {
  outline: 3px solid var(--teal);
  outline-offset: 1px;
}

.hv-gutter {
  flex: 0 0 auto;
  min-width: 3em;
  margin: 0;
  padding: 12px 8px 12px 6px;
  overflow: hidden;
  color: var(--muted);
  font: inherit;
  text-align: right;
  background: var(--soft);
  border-right: 1px solid var(--line);
  user-select: none;
}

.hv-code {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 12px;
  font: inherit;
  white-space: pre;
  tab-size: 2;
  border: 0;
  border-radius: 0;
  outline: none;
  resize: none;
}

.hv-stage {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid #cbd8d1;
  border-radius: 8px;
}

.hv-stage:fullscreen {
  overflow: auto;
}

.hv-stage:fullscreen iframe {
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
}

.hv-stage iframe {
  display: block;
  max-width: none;
  border: 0;
  background: #fff;
  transform-origin: 0 0;
}

.hv-run-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.hv-panels {
  display: grid;
  gap: 12px;
}

.hv-badge {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 6px;
  font-size: 0.8rem;
  text-align: center;
  background: var(--soft);
  border-radius: 99px;
}

.hv-log {
  max-height: 260px;
  margin: 0 0 8px;
  padding: 0;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.84rem;
  list-style: none;
}

.hv-log:empty {
  display: none;
}

.hv-log li {
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  white-space: pre-wrap;
  word-break: break-word;
}

.hv-log .hv-error {
  color: #9a291f;
  background: #fff0ed;
}

.hv-log .hv-warning {
  color: #7a4b00;
  background: #fff7e0;
}

.hv-log .hv-ok {
  color: #0f5d3a;
}

.hv-line {
  padding: 0 6px;
  color: var(--green);
  font: inherit;
  font-weight: 800;
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

@media (min-width: 900px) {
  .hv-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .hv-panels {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

/* Schema validator */
.sv-input {
  min-height: 420px;
}

.sv-results {
  display: grid;
  gap: 12px;
}

.sv-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
}

.sv-item.is-bad {
  border-left-color: #c0392b;
}

.sv-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.sv-type {
  margin: 0;
  font-size: 1.05rem;
}

.sv-source {
  color: var(--muted);
  font-size: 0.82rem;
}

.sv-badge {
  justify-self: start;
  margin: 0;
  padding: 2px 10px;
  font-size: 0.86rem;
  font-weight: 800;
  border-radius: 99px;
  background: var(--soft);
}

.sv-eligible {
  color: #0f5d3a;
  background: #e7f7ee;
}

.sv-invalid {
  color: #9a291f;
  background: #fff0ed;
}

.sv-limited,
.sv-deprecated {
  color: #7a4b00;
  background: #fff7e0;
}

.sv-issues {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  list-style: none;
}

.sv-issues li {
  padding: 4px 8px;
  border-radius: 6px;
}

.sv-issues .hv-error {
  color: #9a291f;
  background: #fff0ed;
}

.sv-issues .hv-warning {
  color: #7a4b00;
  background: #fff7e0;
}

.sv-issues .hv-tip {
  background: var(--soft);
}

.sv-issues .hv-ok {
  color: #0f5d3a;
}

.sv-path {
  color: var(--muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.sv-msg code {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  word-break: break-word;
}

.sv-raw pre {
  max-height: 300px;
  margin: 6px 0 0;
  padding: 8px;
  overflow: auto;
  font-size: 0.8rem;
  background: var(--soft);
  border-radius: 6px;
}

/* Seating chart generator */
.sc-top,
.sc-quick,
.sc-lists {
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  align-items: end;
}

.sc-lists {
  align-items: start;
}

.sc-lists textarea {
  width: 100%;
  min-height: 220px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.9rem;
}

.sc-setup[hidden] {
  display: none;
}

.sc-btn-field .button {
  width: 100%;
}

.sc-table-list {
  display: grid;
  gap: 6px;
  margin: 8px 0;
  padding-left: 1.6em;
}

.sc-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8.5rem 4.5rem 2.4rem;
  gap: 6px;
  align-items: center;
}

.sc-table-row input,
.sc-table-row select {
  min-height: 36px;
}

.sc-unseated {
  display: grid;
  gap: 6px;
}

.sc-unseated[hidden] {
  display: none;
}

.sc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sc-chip {
  padding: 4px 10px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  background: #fff7e0;
  border: 1px solid #f0d48a;
  border-radius: 99px;
  cursor: pointer;
}

.sc-chip.is-selected {
  outline: 3px solid #e0a800;
}

.sc-chart-wrap {
  display: grid;
  gap: 12px;
}

.sc-print-title {
  margin: 0;
  text-align: center;
}

.sc-print-title:empty {
  display: none;
}

.sc-chart {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  touch-action: none;
}

.sc-chart svg {
  display: block;
  max-width: none;
  height: auto;
  margin: 0 auto;
  user-select: none;
}

.sc-seat {
  cursor: grab;
}

.sc-seat:focus {
  outline: none;
}

.sc-seat:focus-visible circle:first-child {
  stroke: #e0a800;
  stroke-width: 4;
}

.sc-body {
  cursor: move;
}

.sc-ghost {
  position: fixed;
  z-index: 50;
  padding: 3px 10px;
  color: #fff;
  font-weight: 700;
  background: var(--green);
  border-radius: 99px;
  pointer-events: none;
}

.sc-conflicts {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 8px 8px 8px 2em;
  color: #7a4b00;
  background: #fff7e0;
  border: 1px solid #f0d48a;
  border-radius: 8px;
}

.sc-conflicts[hidden] {
  display: none;
}

.sc-by-table {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 10px;
}

.sc-table-card {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sc-table-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.sc-table-card ol,
.sc-by-name {
  margin: 0;
  padding-left: 1.6em;
}

.sc-by-name {
  columns: 2 14rem;
}

@media print {
  body.sc-printing * {
    visibility: hidden;
  }

  body.sc-printing #sc-sheet,
  body.sc-printing #sc-sheet * {
    visibility: visible;
  }

  body.sc-printing #sc-sheet {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  }

  body.sc-printing .sc-chart {
    overflow: visible;
    border: 0;
  }

  body.sc-printing .sc-chart svg {
    width: 100% !important;
  }

  body.sc-printing .sc-conflicts {
    display: none;
  }
}

.sc-plain {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Online jigsaw puzzle */
.pz-controls {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  align-items: end;
}

.pz-controls [hidden] {
  display: none;
}

.pz-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.pz-stat {
  padding: 4px 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--soft);
  border-radius: 99px;
}

.pz-stat:empty {
  display: none;
}

.pz-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.pz-tools [hidden] {
  display: none;
}

.pz-stage {
  position: relative;
  overflow: hidden;
  background: #22403a;
  border-radius: 12px;
}

.pz-stage:fullscreen {
  border-radius: 0;
}

.pz-stage canvas {
  display: block;
  touch-action: none;
  outline: none;
  user-select: none;
}

.pz-stage canvas:focus-visible {
  box-shadow: inset 0 0 0 3px #e0a800;
}

.pz-done {
  position: absolute;
  left: 50%;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  color: #10241f;
  text-align: center;
  background: #fff8dc;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%);
}

.pz-done[hidden] {
  display: none;
}

/* PDF to Word */
.pw-options {
  display: grid;
  gap: 12px;
}

.pw-options[hidden],
.pw-checks[hidden] {
  display: none;
}

.pw-file-name {
  margin: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.pw-pass-row {
  display: flex;
  gap: 8px;
}

.pw-pass-row input {
  flex: 1;
  min-width: 0;
}

.pw-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.pw-preview {
  max-height: 480px;
  padding: 16px 20px;
  overflow: auto;
  font-family: Calibri, Carlito, system-ui, sans-serif;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pw-preview h1,
.pw-preview h2,
.pw-preview h3 {
  margin: 0.6em 0 0.3em;
  line-height: 1.25;
}

.pw-preview p,
.pw-preview li {
  margin: 0 0 0.5em;
}

.pw-preview li {
  list-style: none;
}

.pw-preview li::before {
  content: attr(data-marker) "  ";
}

.pw-preview img {
  display: block;
  max-width: 100%;
  margin: 8px auto;
}

.pw-preview table {
  margin: 8px 0;
  border-collapse: collapse;
}

.pw-preview td {
  padding: 3px 8px;
  border: 1px solid #bbb;
}

/* Base64 decoder */
.b64-tool [hidden] {
  display: none !important;
}

.b64-area {
  min-height: 300px;
  word-break: break-all;
}

.b64-options {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 16px;
}

.b64-options .fin-field {
  min-width: 13rem;
}

.b64-out {
  min-height: 300px;
  white-space: pre-wrap;
  word-break: break-word;
}

.b64-preview {
  display: grid;
  place-items: center;
  padding: 10px;
  background: repeating-conic-gradient(#eef1ef 0% 25%, #fff 0% 50%) 50% / 20px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.b64-preview img,
.b64-preview video {
  max-width: 100%;
  max-height: 320px;
}

.b64-preview audio {
  width: 100%;
}

/* SQL formatter */
.sq-options {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.sq-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.sq-input,
.sq-output {
  min-height: 360px;
}

.sq-output {
  white-space: pre;
}

.sq-issues[hidden] {
  display: none;
}

.sq-code {
  min-height: 44px;
}

.sq-kw {
  color: #0b5cad;
  font-weight: 700;
}

.sq-fn {
  color: #8a2be2;
}

.sq-str {
  color: #a3361b;
}

.sq-num {
  color: #0f7b4f;
}

.sq-com {
  color: #6b7a73;
  font-style: italic;
}

.sq-id {
  color: #7a4b00;
}

.sq-param {
  color: #b5006a;
}

.sq-op {
  color: #445;
}

/* Fill PDF form */
.ff-work {
  display: grid;
  gap: 12px;
}

.ff-work[hidden],
.ff-tool [hidden] {
  display: none !important;
}

.ff-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.ff-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.ff-size input {
  width: 4.5rem;
  min-height: 36px;
}

.ff-zoom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
}

.ff-zoom .i2p-btn {
  width: 36px;
}

.ff-layout {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.ff-pages {
  display: grid;
  gap: 14px;
  justify-items: center;
  min-width: 0;
  max-height: 80vh;
  padding: 10px;
  overflow: auto;
  background: #e7ebe9;
  border-radius: 10px;
}

.ff-page {
  position: relative;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.ff-page canvas {
  display: block;
}

.ff-layer {
  position: absolute;
  inset: 0;
}

.ff-pages[data-mode="text"] .ff-layer {
  cursor: text;
}

.ff-pages[data-mode="tick"] .ff-layer {
  cursor: crosshair;
}

.ff-field {
  position: absolute;
  box-sizing: border-box;
  min-height: 0;
  margin: 0;
  padding: 0 2px;
  color: #0b2a6f;
  font-family: Helvetica, Arial, sans-serif;
  line-height: 1.15;
  background: rgba(70, 130, 255, 0.13);
  border: 1px solid rgba(70, 130, 255, 0.45);
  border-radius: 2px;
  resize: none;
}

.ff-field:focus {
  outline: 2px solid #2f6fe0;
  background: rgba(255, 255, 255, 0.92);
}

.ff-field.is-required.is-empty {
  border-color: #d9480f;
}

.ff-field[type="checkbox"] {
  accent-color: #0b2a6f;
  cursor: pointer;
}

.ff-radio {
  border-radius: 50%;
  cursor: pointer;
}

.ff-radio.is-on::after {
  content: "";
  position: absolute;
  inset: 25%;
  background: #0b2a6f;
  border-radius: 50%;
}

.ff-pages[data-mode="text"] .ff-field,
.ff-pages[data-mode="tick"] .ff-field {
  pointer-events: none;
}

.ff-free {
  position: absolute;
  min-width: 40px;
  margin: 0;
  padding: 0 2px;
  overflow: hidden;
  color: #000;
  font-family: Helvetica, Arial, sans-serif;
  line-height: 1.2;
  white-space: pre;
  background: rgba(255, 245, 160, 0.35);
  border: 1px dashed #b38600;
  resize: none;
}

.ff-tick {
  position: absolute;
  padding: 0;
  color: #000;
  font-weight: 700;
  line-height: 1;
  background: none;
  border: 0;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.ff-side {
  display: grid;
  gap: 10px;
  align-content: start;
}

.ff-progress {
  margin: 0;
  font-weight: 800;
}

.ff-list {
  display: grid;
  gap: 2px;
  max-height: 50vh;
  margin: 0;
  padding: 0 0 0 1.4em;
  overflow: auto;
}

.ff-list-item {
  width: 100%;
  padding: 3px 6px;
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.ff-list-item:hover {
  background: var(--soft);
}

.ff-list-item.is-done {
  color: #0f5d3a;
}

.ff-list-item.is-done::after {
  content: " ✓";
}

.ff-list-item.is-missing {
  color: #b23c0a;
}

.ff-save {
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  align-items: end;
}

@media (min-width: 1000px) {
  .ff-layout {
    grid-template-columns: minmax(0, 1fr) 17rem;
  }
}

/* Font preview */
.fp-tool [hidden] {
  display: none !important;
}

.fp-tool #fp-text {
  font-size: 1.15rem;
}

.fp-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fp-controls {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  align-items: end;
}

.fp-controls input[type="range"] {
  width: 100%;
}

.fp-colors span:last-child {
  display: flex;
  gap: 8px;
}

.fp-colors input[type="color"] {
  width: 52px;
  height: 40px;
  padding: 2px;
}

.fp-consent {
  padding: 12px 14px;
  background: #fff7e0;
  border: 1px solid #f0d48a;
  border-radius: 8px;
}

.fp-consent p {
  margin: 0 0 8px;
}

.fp-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.fp-filter input[type="search"] {
  flex: 1 1 12rem;
  min-height: 40px;
}

.fp-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 12px;
}

.fp-results[data-view="lines"] {
  grid-template-columns: 1fr;
  gap: 4px;
}

.fp-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  color: var(--fp-fg, #1d2b25);
  background: var(--fp-bg, #fff);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.fp-card.is-missing {
  opacity: 0.6;
}

.fp-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  font-family: system-ui, sans-serif;
}

.fp-name {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: var(--fp-fg, inherit);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: none;
  border: 0;
  cursor: pointer;
}

.fp-name:hover {
  text-decoration: underline;
}

.fp-meta {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--fp-fg, var(--muted));
  font-size: 0.75rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0.7;
}

.fp-star,
.fp-copy {
  flex: none;
  min-width: 32px;
  min-height: 30px;
  padding: 0 6px;
  color: var(--fp-fg, inherit);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  background: none;
  border: 1px solid currentColor;
  border-radius: 6px;
  opacity: 0.75;
  cursor: pointer;
}

.fp-star {
  font-size: 1rem;
  border: 0;
}

.fp-star.is-on {
  color: #e0a800;
  opacity: 1;
}

.fp-sample,
.fp-wf-text,
.fp-glyph {
  font-size: var(--fp-size, 40px);
  font-weight: var(--fp-weight, 400);
  font-style: var(--fp-style, normal);
  letter-spacing: var(--fp-spacing, 0);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.fp-results[data-view="lines"] .fp-card {
  grid-template-columns: 14rem minmax(0, 1fr);
  align-items: center;
}

.fp-results[data-view="lines"] .fp-sample {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.fp-detail {
  display: grid;
  gap: 12px;
  padding: 14px;
  color: var(--fp-fg, #1d2b25);
  background: var(--fp-bg, #fff);
  border: 2px solid var(--green);
  border-radius: 12px;
}

.fp-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fp-detail-head h3 {
  margin: 0;
}

.fp-wf-row {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
}

.fp-wf-row > span:first-child {
  font: 0.75rem system-ui, sans-serif;
  opacity: 0.6;
}

.fp-wf-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.fp-glyphs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3.2rem, 1fr));
  gap: 4px;
}

.fp-glyph {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  font-size: 1.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}

@media (max-width: 600px) {
  .fp-results[data-view="lines"] .fp-card {
    grid-template-columns: 1fr;
  }
}

/* Remove password from PDF */
.rp-tool [hidden] {
  display: none !important;
}

.rp-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rp-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.rp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.rp-head strong {
  overflow-wrap: anywhere;
}

.rp-meta,
.rp-perms {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.rp-state {
  margin: 0;
  font-weight: 700;
}

.rp-state[data-kind="ok"] {
  color: #0f5d3a;
}

.rp-state[data-kind="lock"] {
  color: #7a4b00;
}

.rp-state[data-kind="error"] {
  color: #9a291f;
}

.rp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rp-row input {
  flex: 1 1 12rem;
  min-height: 40px;
}

.rp-row input[aria-invalid="true"] {
  border-color: #c0392b;
}

/* Image cropper */
.ic-tool [hidden] {
  display: none !important;
}

.ic-work {
  display: grid;
  gap: 12px;
}

.ic-controls,
.ic-out {
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  align-items: end;
}

.ic-controls input[type="range"],
.ic-out input[type="range"] {
  width: 100%;
}

.ic-turn {
  display: flex;
  gap: 6px;
}

.ic-turn .i2p-btn {
  width: 44px;
  font-size: 1.1rem;
}

.ic-stage {
  display: grid;
  place-items: center;
  padding: 8px;
  background: repeating-conic-gradient(#dfe5e2 0% 25%, #f4f6f5 0% 50%) 50% / 20px 20px;
  border-radius: 10px;
}

.ic-stage canvas {
  display: block;
  max-width: 100%;
  touch-action: none;
  outline: none;
}

.ic-stage canvas:focus-visible {
  box-shadow: 0 0 0 3px #e0a800;
}

.ic-nums {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.ic-num {
  display: grid;
  gap: 2px;
  font-size: 0.82rem;
  font-weight: 700;
}

.ic-num input {
  width: 6.5rem;
  min-height: 38px;
}

.ic-resize {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ic-resize input {
  width: 6rem;
  min-height: 40px;
}

.ic-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ic-thumb {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  padding: 3px;
  background: var(--soft);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.ic-thumb.is-current {
  border-color: var(--green);
}

.ic-thumb canvas {
  max-width: 100%;
  max-height: 100%;
}

/* Format questionnaire */
.fq-input {
  min-height: 460px;
}

.fq-syntax {
  margin: 6px 0 0;
  white-space: pre-wrap;
  font-size: 0.85rem;
}

.fq-preview {
  max-height: 640px;
  padding: 20px 24px;
  overflow: auto;
  color: #111;
  line-height: 1.45;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.fq-font-sans {
  font-family: Arial, Helvetica, "Hiragino Sans", "Microsoft YaHei", sans-serif;
}

.fq-font-serif {
  font-family: Georgia, "Times New Roman", "Yu Mincho", "SimSun", serif;
}

.fq-title {
  margin: 0 0 8px;
  text-align: center;
}

.fq-intro {
  margin: 0 0 12px;
  color: #333;
}

.fq-resp {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 8px 0 16px;
  font-size: 0.92rem;
}

.fq-section {
  margin: 22px 0 8px;
  padding-bottom: 2px;
  border-bottom: 2px solid #333;
}

.fq-q {
  margin: 14px 0;
  break-inside: avoid;
}

.fq-text {
  margin: 0 0 6px;
  font-weight: 700;
}

.fq-num {
  margin-right: 4px;
}

.fq-req {
  color: #b00;
}

.fq-hint,
.fq-type {
  color: #555;
  font-size: 0.82em;
  font-weight: 400;
}

.fq-type {
  padding: 0 6px;
  background: #eef3f0;
  border-radius: 99px;
}

.fq-options {
  margin: 0;
  padding: 0 0 0 22px;
  list-style: none;
}

.fq-options.is-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
}

.fq-mark {
  font-size: 1.1em;
}

.fq-scale {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: center;
  table-layout: fixed;
}

.fq-scale th {
  padding: 3px;
  font-weight: 400;
}

.fq-scale td {
  font-size: 1.2rem;
}

.fq-rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding-left: 22px;
}

.fq-box {
  min-width: 26px;
  padding: 1px 4px;
  text-align: center;
  border: 1px solid #333;
}

.fq-end {
  color: #555;
  font-size: 0.82rem;
}

.fq-lines {
  padding-left: 22px;
}

.fq-line {
  display: block;
  height: 24px;
  border-bottom: 1px solid #999;
}

.fq-empty {
  color: var(--muted);
}

.fq-settings {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.fq-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.fq-issues[hidden] {
  display: none;
}

@media print {
  body.fq-printing * {
    visibility: hidden;
  }

  body.fq-printing #fq-preview,
  body.fq-printing #fq-preview * {
    visibility: visible;
  }

  body.fq-printing #fq-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-height: none;
    overflow: visible;
    border: 0;
    box-shadow: none;
  }
}

/* Fuel cost calculator */
.fc-tool .fc-compare-toggle { font-weight: 600; margin: 0; }
.fc-tool .fc-unit-select { min-width: 0; }
.fc-compare-result { margin-top: 1rem; }
.fc-compare-result h3 { font-size: 1rem; margin: 0 0 0.5rem; }
.fc-table th, .fc-table td { text-align: left; }
.fc-table td { font-variant-numeric: tabular-nums; }

/* Shipping cost calculator */
.sc-row { display: grid; grid-template-columns: 1.5rem repeat(4, minmax(0, 1fr)) minmax(0, 0.7fr) auto; gap: 0.5rem; align-items: end; margin-bottom: 0.6rem; }
.sc-num { font-weight: 700; padding-bottom: 0.7rem; color: var(--muted, #667); }
.sc-cell { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.sc-cell-label { font-size: 0.8rem; font-weight: 600; }
.sc-cell .unit-field input { min-width: 0; width: 100%; }
.sc-remove { margin-bottom: 0.15rem; }
.sc-table th, .sc-table td { text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sc-warnings { margin: 0.75rem 0 0; padding-left: 1.2rem; color: #9a4b00; }
.sc-tip { margin-top: 0.5rem; }
@media (max-width: 640px) {
  .sc-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sc-num { grid-column: 1 / -1; padding: 0; }
}
