body { background: #f5f8f7; }
.tools-hero-grid, .tool-layout, .tool-panel, .tool-card, .result-card, .tool-note, .image-preview, .structural-tool-link, .tools-feature-grid { min-width: 0; }
.tools-hero { background: linear-gradient(135deg, rgba(15, 77, 58, .95), rgba(23, 102, 78, .86)), radial-gradient(circle at 82% 18%, rgba(217, 197, 41, .26), transparent 30%); color: #fff; }
.tools-hero .eyebrow, .tools-hero h1, .tools-hero .lead { color: #fff; }
.tools-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: center; gap: 36px; }
.tools-hero-panel { border: 1px solid rgba(255,255,255,.24); border-radius: 8px; padding: 28px; background: rgba(255,255,255,.12); box-shadow: 0 24px 60px rgba(0,0,0,.16); }
.tools-hero-panel span { display: block; font-size: 72px; line-height: 1; font-weight: 900; color: #f0dd43; }
.tools-hero-panel strong { display: block; margin-top: 8px; font-size: 24px; }
.tools-hero-panel p { margin: 8px 0 0; color: rgba(255,255,255,.82); }
.tools-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; margin-bottom: 22px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 10px 28px rgba(15,77,58,.08); }
.tool-tab { border: 0; border-radius: 8px; padding: 13px 14px; background: transparent; color: var(--muted); font-weight: 900; cursor: pointer; transition: .2s; }
.tool-tab:hover, .tool-tab.active { background: var(--primary); color: #fff; }
.tool-panel { display: none; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 28px; box-shadow: var(--shadow); }
.tool-panel.active { display: block; }
.tool-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.tool-header > div { display: flex; align-items: center; gap: 14px; }
.tool-header h2 { margin: 0; color: var(--primary); font-size: clamp(24px, 3vw, 38px); line-height: 1.08; }
.tool-header p { max-width: 520px; margin: 0; color: var(--muted); }
.tool-code { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 8px; background: var(--soft); color: var(--primary); font-weight: 900; flex: 0 0 auto; }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .85fr); gap: 22px; align-items: stretch; }
.tool-card { padding: 22px; box-shadow: none; }
.tool-card label { display: block; margin: 0 0 8px; color: var(--primary); font-size: 14px; font-weight: 900; }
.tool-card .inline-check { display: flex; align-items: flex-start; gap: 10px; margin: -2px 0 16px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f9fcfb; color: var(--ink); line-height: 1.45; }
.tool-card .inline-check input { width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--primary); }
.tool-card .control { width: 100%; max-width: 100%; margin-bottom: 16px; }
.tool-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.kml-format-grid { align-items: end; }
.full-btn { width: 100%; }
.tool-card .action-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.result-card, .tool-note, .image-preview { border: 1px solid var(--line); border-radius: 8px; padding: 24px; background: linear-gradient(180deg, #f9fcfb, #edf4f1); }
.result-card span, .small-text { color: var(--muted); font-size: 14px; }
.result-card strong { display: block; margin: 10px 0; color: var(--primary); font-size: clamp(28px, 4vw, 48px); line-height: 1.08; overflow-wrap: anywhere; }
.result-card p, .tool-note p, .image-preview p { margin: 0; color: var(--muted); }
.tool-note h3 { margin: 0 0 10px; color: var(--primary); font-size: 24px; }
.geo-preview pre { width: 100%; max-height: 220px; overflow: auto; margin: 14px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; line-height: 1.55; white-space: pre; }
.spectrum-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.spectrum-summary-grid span { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--primary); font-weight: 900; overflow-wrap: anywhere; }
.spectrum-download-actions { margin-top: 10px; }
.spectrum-download-actions .btn:disabled { opacity: .48; cursor: not-allowed; }
.spectrum-output { display: grid; gap: 16px; margin-top: 18px; }
.spectrum-chart-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.spectrum-chart-wrap canvas { display: block; width: 100%; height: auto; min-height: 260px; }
.spectrum-table-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.spectrum-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.spectrum-table th, .spectrum-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.spectrum-table th { position: sticky; top: 0; z-index: 1; background: #f4faf7; color: var(--primary); font-weight: 900; text-transform: uppercase; letter-spacing: 0; }
.spectrum-table th:first-child, .spectrum-table td:first-child { text-align: left; }
.textarea { min-height: 230px; resize: vertical; }
.compact-textarea { min-height: 120px; }
.file-control { min-height: 52px; padding: 12px; background: #f9fcfb; }
.file-list { display: grid; gap: 8px; min-height: 96px; margin: 2px 0 16px; padding: 14px; border: 1px dashed #bfd1cb; border-radius: 8px; background: #f9fcfb; }
.file-list p { margin: 0; color: var(--muted); }
.file-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; background: #fff; color: var(--ink); font-weight: 700; flex-wrap: wrap; overflow-wrap: anywhere; }
.file-item small { color: var(--muted); font-weight: 600; white-space: nowrap; }
.merge-file-item {
  align-items: center;
}

.tool-verification-panel {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: start;
  margin: 22px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15, 77, 58, .06), rgba(207, 176, 36, .08));
}

.tool-verification-panel h2 {
  margin: 6px 0 8px;
  color: var(--primary);
}

.tool-verification-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.tool-verification-panel ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.tool-verification-panel li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 820px) {
  .tool-verification-panel {
    grid-template-columns: 1fr;
  }

  .tool-layout,
  .tools-hero-grid {
    grid-template-columns: 1fr;
  }

  .tool-header {
    display: grid;
  }

  .tool-card .action-row,
  .tool-grid-2 {
    grid-template-columns: 1fr;
  }

  .tools-tabs {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .tool-tab {
    min-width: 180px;
    scroll-snap-align: start;
  }
}

.file-order-controls {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}

.file-order-controls button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(15, 77, 58, .14);
  border-radius: 8px;
  background: var(--soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.file-order-controls button:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
}

.file-order-controls button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.image-preview { min-height: 320px; display: grid; align-content: center; justify-items: center; gap: 16px; overflow-x: auto; overflow-y: hidden; }
.image-preview img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.download-link { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 900; }
@media (max-width: 860px) { .tools-hero-grid, .tool-layout { grid-template-columns: 1fr; } .tool-header { display: grid; } .tool-panel { padding: 18px; } }
@media (max-width: 520px) { .tools-tabs, .tool-grid-2, .tool-card .action-row, .spectrum-summary-grid { grid-template-columns: 1fr; } .tools-tabs { position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; } .tool-tab { min-width: 168px; scroll-snap-align: start; } .tools-hero-panel span { font-size: 54px; } .tool-header > div { align-items: flex-start; } .tool-panel, .tool-card, .result-card, .tool-note, .image-preview { padding: 16px; } .download-link, .full-btn { width: 100%; } }
.pdf-image-results { width: 100%; display: grid; gap: 16px; align-content: start; }
.pdf-image-item { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pdf-image-item div { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pdf-image-item strong { color: var(--primary); }
.pdf-image-item img { width: 100%; max-height: 520px; object-fit: contain; }
.image-page-fields input:disabled { opacity: .55; cursor: not-allowed; }

.tools-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.structural-tool-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 10px 28px rgba(15,77,58,.08); }
.structural-tool-link strong { display: block; color: var(--primary); font-size: 20px; }
.structural-tool-link span { color: var(--muted); }
@media (max-width: 1080px) { .tools-feature-grid { grid-template-columns: 1fr; } .tools-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .structural-tool-link { display: grid; } }
@media (max-width: 520px) { .tools-tabs { grid-template-columns: 1fr; } }
