@import url('/shared/page-shell.css');
@import url('/shared/theme-header.css');

.tool-page {
  max-width: 40rem;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2rem);
}

.tool-page--narrow {
  max-width: 40rem;
}

.tool-page--wide {
  max-width: 45rem;
}

.tool-nav {
  margin-bottom: 1rem;
}

.tool-nav a {
  font-weight: 700;
  color: var(--header-accent);
  text-decoration: none;
}

.tool-nav a:hover {
  text-decoration: underline;
}

.tool-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tool-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tool-lede {
  margin: 0.35rem 0 0;
  color: var(--page-fg-muted);
  font-weight: 600;
}

.tool-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1rem;
}

.tool-panel:last-child {
  margin-bottom: 0;
}

.tool-panel__title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 1rem;
  color: var(--page-fg);
}

.tool-field {
  margin-bottom: 1rem;
}

.tool-field label {
  display: block;
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}

.tool-field input:not([type='checkbox']):not([type='radio']):not([type='file']),
.tool-field select,
.tool-field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface-strong);
  color: var(--page-fg);
}

.tool-field input[type='file'] {
  width: 100%;
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface-strong);
  color: var(--page-fg);
  cursor: pointer;
}

.tool-field input[type='file']::file-selector-button {
  font-family: inherit;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  margin-right: 0.75rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.tool-field input[type='checkbox'] {
  accent-color: var(--accent);
  width: 1.1rem;
  height: 1.1rem;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.tool-field input:focus-visible,
.tool-field select:focus-visible,
.tool-field textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.tool-dropzone {
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-strong));
  border: 2px dashed var(--border);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tool-dropzone:hover,
.tool-dropzone:focus {
  outline: none;
  border-color: var(--border-strong);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-strong));
}

.tool-dropzone--drag {
  border-color: var(--accent);
  border-style: solid;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tool-btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 0.9375rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.tool-btn:hover:not(:disabled) {
  opacity: 0.92;
}

.tool-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tool-btn--secondary {
  background: var(--surface-strong);
  color: var(--page-fg);
  border: 1px solid var(--border);
}

.tool-btn--ghost {
  background: transparent;
  color: var(--header-accent);
  border: 1px solid var(--border);
}

.tool-result {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--mint-soft);
  color: #1a3d32;
  font-weight: 700;
}

[data-theme='dark'] .tool-result {
  background: rgba(94, 201, 168, 0.15);
  color: var(--page-fg);
}

.tool-error,
.tool-status {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.tool-error {
  background: rgba(255, 123, 107, 0.15);
  color: #8b2e24;
}

[data-theme='dark'] .tool-error {
  color: #ffc4bc;
}

.tool-status {
  background: color-mix(in srgb, var(--mint) 20%, var(--surface));
  color: var(--page-fg);
}

.tool-error[hidden],
.tool-status[hidden] {
  display: none;
}

.tool-disclaimer {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--page-fg-muted);
}

.tool-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tool-preset {
  font-family: inherit;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  cursor: pointer;
  color: var(--page-fg);
}

.tool-preset:hover {
  border-color: var(--border-strong);
}

.tool-canvas-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.tool-canvas-wrap canvas {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-strong);
}

.tool-qr-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.tool-qr-preview canvas {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #fff;
}

.tool-qr-hint {
  font-size: 0.875rem;
  color: var(--page-fg-muted);
  text-align: center;
  margin: 0;
}

.ad-slot--tool {
  min-height: 60px;
  margin: 1rem 0;
}

.tool-breadcrumb {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--page-fg-muted);
  margin-bottom: 0.75rem;
}

.tool-breadcrumb a {
  color: var(--header-accent);
  text-decoration: none;
}

.tool-breadcrumb a:hover {
  text-decoration: underline;
}

.tool-privacy-badge {
  font-size: 0.9rem;
  color: var(--page-fg-muted);
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.tool-guide h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 1.25rem 0 0.5rem;
}

.tool-guide__intro {
  margin: 0 0 0.75rem;
  line-height: 1.55;
}

.tool-guide__example {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface-strong);
  border-radius: 0.5rem;
  font-size: 0.95rem;
}

.tool-guide__steps {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  line-height: 1.55;
}

.tool-guide__faqs {
  margin: 0;
}

.tool-guide__faq dt {
  font-weight: 800;
  margin-top: 0.75rem;
}

.tool-guide__faq dd {
  margin: 0.25rem 0 0;
  color: var(--page-fg-muted);
  line-height: 1.5;
}

.tool-guide__updated {
  font-size: 0.85rem;
  color: var(--page-fg-muted);
  margin: 1rem 0 0;
}

.tool-ymyl {
  margin-top: 1rem;
  padding: 0.75rem;
  border-left: 3px solid var(--accent);
  font-size: 0.9rem;
  color: var(--page-fg-muted);
}

.tool-related__list {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.6;
}

.tool-related__list a {
  font-weight: 800;
  color: var(--header-accent);
}

.hub-noscript {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-card);
}

.hub-tools-link {
  margin: 0 0 1rem;
  font-weight: 700;
}

.hub-tools-link a {
  color: var(--header-accent);
}

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