:root {
  --primary-color: #007aff;
  --primary-gradient: linear-gradient(135deg, #007aff 0%, #00c6ff 100%);
  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.45);
  --text-main: #1d1d1f;
  --text-secondary: #86868b;
  --shadow-soft: 0 8px 32px rgba(31, 38, 135, 0.07);
  --shadow-float: 0 18px 45px rgba(0, 122, 255, 0.12);
  --border-radius-lg: 24px;
  --border-radius-md: 18px;
  --page-top-offset: calc(86px + env(safe-area-inset-top));
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family:
    "Poppins",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text-main);
  background: #f5f7fb;
}

body.modal-open {
  overflow: hidden;
}

#background {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(
      circle at 8% 12%,
      rgba(0, 122, 255, 0.08) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 92% 78%,
      rgba(0, 198, 255, 0.08) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 50% 60%,
      rgba(255, 45, 85, 0.04) 0%,
      transparent 70%
    ),
    linear-gradient(180deg, #f8fbff 0%, #f5f7fb 100%);
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 14px 24px;
  background-color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
}

.navbarLeft,
.navbarRight {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
}

.navbarLeft {
  left: 24px;
}

.navbarRight {
  right: 24px;
}

.logo,
.desktop-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.logo img {
  height: 30px;
}

.desktop-logo img,
.desktop-logo-mark {
  height: 30px;
}

.navIconButton {
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  cursor: pointer;
}

.navIconButton img {
  width: 20px;
  height: 20px;
}

body.iframe-embed .navbar {
  display: none;
}

body.iframe-embed {
  --page-top-offset: 0px;
  background: transparent;
}

#toolsMain {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: var(--page-top-offset) 16px calc(24px + env(safe-area-inset-bottom));
}

body.iframe-embed #toolsMain {
  max-width: none;
  min-height: 100dvh;
  padding: 0;
}

.tools-shell {
  min-height: calc(100dvh - var(--page-top-offset) - 24px);
  padding: 18px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: var(--shadow-soft);
}

body.iframe-embed .tools-shell {
  min-height: 100dvh;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.tools-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.tools-search {
  flex: 1 1 320px;
  max-width: 480px;
  min-height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.tools-search svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.tools-search input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-main);
  font: inherit;
}

.tools-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tools-filter {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.tools-filter.is-active {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
}

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

.tools-columns {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 20px 0 0 auto;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
}

.tools-columns select {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text-main);
  font: inherit;
}

.tool-card {
  padding: 24px 14px 14px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
}

.tool-card.is-hidden {
  display: none;
}

.tool-number-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e3efff;
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
}

.tools-balanced-text {
  max-inline-size: var(--balance-width, none);
  text-wrap: pretty;
}

.tool-card-title.tools-balanced-text,
.tool-modal-title.tools-balanced-text {
  text-wrap: balance;
}

.tool-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  padding: 22px 12px 12px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.04);
  overflow: visible;
}

.tool-card-media-pill {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
}

.tool-card-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  border-radius: 14px;
  background: #ffffff;
}

.tool-card-zones {
  position: absolute;
  inset: 0;
  display: flex;
}

.tool-card-zone {
  flex: 1;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.tool-card-title {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
  font-weight: 600;
  min-width: 0;
  text-align: center;
}

.tools-empty {
  grid-column: 1 / -1;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.tool-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2000;
}

.tool-modal.is-open {
  display: block;
}

.tool-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 16, 32, 0.38);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.tool-modal-dialog {
  position: relative;
  width: min(96vw, 1440px);
  height: min(92dvh, 940px);
  margin: max(20px, env(safe-area-inset-top)) auto;
  padding: 20px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.18);
}

.tool-modal-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tool-modal-close svg {
  width: 24px;
  height: 24px;
  display: block;
}

.tool-modal-layout {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 26%);
  gap: 14px;
  min-height: 0;
}

.tool-modal-sidebar,
.tool-modal-viewer {
  min-height: 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.tool-modal-sidebar {
  order: 2;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 0.9rem;
}

.tool-modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-modal-heading h2 {
  margin: 0;
  font-size: clamp(0.94rem, 1.42vw, 1.24rem);
  line-height: 1.16;
}

.tool-modal-heading {
  padding-bottom: 10px;
}

.tool-modal-description {
  margin: 14px 0 0;
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.42;
}

.tool-modal-pill-row {
  display: flex;
  justify-content: flex-start;
  flex: 1;
}

.tool-sidebar-section h3 {
  margin: 0 0 10px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.tool-key-concepts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-key-concept-chip {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(0, 122, 255, 0.16);
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.08);
  color: var(--primary-color);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.tool-versions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-version {
  min-height: 46px;
  padding: 10px 10px 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-version.is-active {
  border-color: rgba(0, 122, 255, 0.2);
  background: linear-gradient(
    135deg,
    rgba(0, 122, 255, 0.12),
    rgba(0, 198, 255, 0.08)
  );
}

.tool-version-button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.tool-version-download {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.tool-version-download svg {
  width: 18px;
  height: 18px;
}

.tool-sidebar-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-action-button {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 16px;
  background: var(--primary-gradient);
  color: #fff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

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

.external-link-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.external-link-action svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.tool-action-button.secondary {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-main);
}

.tool-modal-viewer {
  order: 1;
  position: relative;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: transparent;
  border: 0;
}

.tool-viewer-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-viewer-control {
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-main);
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.tool-viewer-control svg {
  width: 20px;
  height: 20px;
  display: block;
}

.tool-viewer-fit {
  padding: 0 14px;
  font-size: 0.8rem;
}

.tool-viewer-status {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

.tool-viewer-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(0, 122, 255, 0.05), transparent 50%),
    rgba(248, 250, 255, 0.92);
  cursor: grab;
}

.tool-viewer-overlay {
  position: absolute;
  left: 50%;
  bottom: 5%;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
  transform: translateX(-50%);
}

.tool-viewer-overlay .tool-viewer-controls,
.tool-viewer-overlay .tool-viewer-status {
  pointer-events: auto;
}

.tool-viewer-scroll.is-dragging {
  cursor: grabbing;
}

.tool-viewer-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: max-content;
  min-width: 100%;
  margin: 0 auto;
}

.tool-viewer-page {
  width: fit-content;
  max-width: none;
  padding: 14px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.tool-viewer-page canvas {
  display: block;
  max-width: none;
}

.tool-viewer-empty {
  position: absolute;
  inset: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

.tool-viewer-empty.is-visible {
  display: flex;
}

.tool-viewer-empty h3 {
  margin: 0 0 8px;
}

.tool-viewer-empty p {
  margin: 0;
  color: var(--text-secondary);
}

.tool-concept-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2100;
}

.tool-concept-modal.is-open {
  display: block;
}

.tool-concept-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 16, 32, 0.34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tool-concept-dialog {
  position: relative;
  width: min(92vw, 760px);
  max-height: min(86dvh, 920px);
  margin: max(48px, env(safe-area-inset-top)) auto;
  padding: 14px;
}

.tool-concept-shell {
  max-height: calc(min(86dvh, 920px) - 28px);
  overflow: auto;
  padding: 18px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.93)),
    radial-gradient(circle at top left, rgba(0, 122, 255, 0.1), transparent 42%);
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow: 0 28px 72px rgba(15, 23, 42, 0.18);
}

.tool-concept-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.tool-concept-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-concept-stage-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.tool-concept-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tool-concept-header {
  padding-bottom: 2px;
}

.tool-concept-title {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  line-height: 1.04;
  text-wrap: balance;
}

.tool-concept-section {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.tool-concept-section h3 {
  margin: 0 0 12px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.tool-concept-copy,
.tool-concept-list {
  margin: 0;
  color: var(--text-main);
  font-size: 0.92rem;
  line-height: 1.65;
}

.tool-concept-list {
  padding-left: 18px;
}

.tool-concept-list li + li {
  margin-top: 10px;
}

.tool-concept-figure {
  margin: 0;
}

.tool-concept-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.tool-concept-gallery.is-multi {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.tool-concept-gallery-item {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.tool-concept-image-frame {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.04);
}

.tool-concept-image-frame img {
  width: auto;
  max-width: 100%;
  max-height: 340px;
  height: auto;
  display: block;
  object-fit: contain;
}

.tool-concept-image-caption {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.tools-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  min-width: 180px;
  max-width: min(92vw, 360px);
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  font-size: 0.85rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  z-index: 2200;
}

.tools-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 920px) {
  .navbarLeft,
  .navbarRight {
    display: none;
  }

  .logo img {
    height: 28px;
  }

  .tool-modal-dialog {
    width: min(96vw, 960px);
    height: min(94dvh, 980px);
    padding: 16px;
  }

  .tool-modal-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .tool-modal-sidebar {
    order: 2;
    padding: 16px;
    gap: 12px;
  }

  .tool-modal-viewer {
    order: 1;
    min-height: min(48dvh, 420px);
  }

  .tools-columns {
    display: none;
  }

  .tool-viewer-overlay {
    bottom: 16px;
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
    justify-content: center;
  }

  .tool-concept-dialog {
    width: min(94vw, 720px);
    margin: max(18px, env(safe-area-inset-top)) auto;
  }

  .tool-concept-shell {
    max-height: calc(90dvh - 36px);
  }
}

@media (hover: none) {
  .tool-card-zones {
    display: none;
  }
}

@media (max-width: 640px) {
  #toolsMain {
    padding: calc(74px + env(safe-area-inset-top)) 10px
      calc(18px + env(safe-area-inset-bottom));
  }

  .tools-shell {
    padding: 10px;
    border-radius: 22px;
  }

  .tools-toolbar {
    gap: 10px;
    margin-bottom: 12px;
  }

  .tools-search {
    min-height: 48px;
    border-radius: 16px;
  }

  .tools-filters {
    gap: 6px;
  }

  .tools-filter {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.76rem;
  }

  .tools-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tool-card {
    padding: 10px;
    gap: 10px;
    border-radius: 18px;
  }

  .tool-card-media {
    padding: 18px 10px 10px;
    border-radius: 16px;
  }

  .tool-card-title {
    font-size: 0.86rem;
  }

  .tool-modal-dialog {
    width: calc(100vw - 10px);
    min-height: calc(100dvh - 10px);
    height: auto;
    margin: 6px auto;
    padding: 10px;
    border-radius: 20px;
    overflow: auto;
  }

  .tool-modal-sidebar,
  .tool-modal-viewer {
    border-radius: 18px;
  }

  .tool-modal-sidebar {
    padding: 14px;
    gap: 10px;
  }

  .tool-modal-topbar {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -4px -4px 0;
    padding: 4px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82));
  }

  .tool-modal-close {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .tool-modal-heading {
    padding-bottom: 4px;
  }

  .tool-modal-heading h2 {
    font-size: 1.18rem;
    line-height: 1.18;
  }

  .tool-modal-description {
    margin-top: 10px;
    font-size: 0.84rem;
    line-height: 1.52;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
  }

  .tool-sidebar-section h3 {
    margin-bottom: 8px;
    font-size: 0.7rem;
  }

  .tool-key-concepts {
    gap: 6px;
  }

  .tool-key-concept-chip {
    min-height: 28px;
    padding: 0 10px;
    font-size: 0.72rem;
  }

  .tool-versions {
    gap: 6px;
  }

  .tool-version {
    min-height: 42px;
    padding: 8px 8px 8px 10px;
    border-radius: 14px;
  }

  .tool-version-button {
    font-size: 0.78rem;
  }

  .tool-version-download {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }

  .tool-sidebar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .tool-action-button {
    min-height: 42px;
    border-radius: 14px;
    font-size: 0.8rem;
  }

  .tool-modal-viewer {
    min-height: min(44dvh, 360px);
  }

  .tool-viewer-scroll {
    padding: 8px;
    border-radius: 18px;
  }

  .tool-viewer-overlay {
    bottom: 10px;
    gap: 8px;
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
  }

  .tool-viewer-controls {
    width: 100%;
    gap: 6px;
    justify-content: center;
  }

  .tool-viewer-control {
    min-width: 36px;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  }

  .tool-viewer-fit {
    flex: 1 1 120px;
    min-width: 0;
    font-size: 0.76rem;
  }

  .tool-viewer-status {
    width: 100%;
    font-size: 0.76rem;
    text-align: center;
  }

  .tool-viewer-stack {
    gap: 10px;
  }

  .tool-viewer-page {
    padding: 10px;
    border-radius: 14px;
  }

  .tool-concept-dialog {
    width: calc(100vw - 10px);
    max-height: calc(100dvh - 10px);
    margin: 6px auto;
    padding: 6px;
  }

  .tool-concept-shell {
    max-height: calc(100dvh - 22px);
    padding: 14px;
    border-radius: 18px;
  }

  .tool-concept-section {
    padding: 14px;
    border-radius: 16px;
  }

  .tool-concept-title {
    font-size: 1.28rem;
    line-height: 1.08;
  }

  .tool-concept-copy,
  .tool-concept-list {
    font-size: 0.84rem;
    line-height: 1.55;
  }

  .tool-concept-image-frame {
    min-height: 180px;
    padding: 14px;
  }

  .tool-concept-gallery.is-multi {
    grid-template-columns: 1fr;
  }
}
