:root {
  --bg: #7ecfff;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #f8fcff;
  --accent: #2d8a5e;
  --accent-hover: #3aa872;
  --text: #1a2838;
  --muted: #5a7088;
  --border: rgba(255, 255, 255, 0.9);
  --danger: #c94444;
}

* { box-sizing: border-box; }

#sky-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

body.convert-page {
  margin: 0;
  font-family: system-ui, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #4db3ff 0%, #7ecfff 42%, #b8e8ff 78%, #dff4ff 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
}

body.convert-page.page-dragover {
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
}

.convert-header,
.convert-main,
.convert-footer {
  position: relative;
  z-index: 1;
}

.convert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(120, 170, 210, 0.15);
  z-index: 5;
}
.convert-logo {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 1.15rem;
}
.convert-nav {
  margin-left: auto;
}
.convert-header nav a {
  color: var(--muted);
  margin-left: 1rem;
  text-decoration: none;
}
.convert-header nav a:hover { color: var(--text); }
.convert-header nav a[aria-current="page"] { color: var(--accent); }

/* Identity + balance chrome, shared by every convert page. */
.convert-account {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.fis-static-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem 0.25rem 0.35rem;
  border: 1px solid rgba(45, 138, 94, 0.35);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
}
.fis-static-link:hover {
  background: #fff;
  border-color: var(--accent);
}
.fis-static-icon {
  display: flex;
  width: 28px;
  height: 28px;
}
.fis-static-icon svg {
  width: 28px;
  height: 28px;
}

.convert-main {
  max-width: 820px;
  margin: 0 auto;
  padding: 1.5rem;
}

.hero h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.hero .muted { color: var(--muted); margin: 0 0 1rem; }

.upload-zone {
  border: 2px dashed rgba(90, 140, 180, 0.45);
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--surface);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.upload-zone.dragover,
body.page-dragover .upload-zone {
  border-color: var(--accent);
  background: rgba(45, 138, 94, 0.1);
}
.upload-zone input[type="file"] { display: none; }
.upload-zone .btn-choose {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 500;
}

#upload-progress {
  height: 4px;
  background: rgba(26, 40, 56, 0.08);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
  display: none;
}
#upload-progress .bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.15s;
}

#files-table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  table-layout: auto;
}
#files-table th,
#files-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
#files-table th:first-child,
#files-table td:first-child {
  width: 1%;
  white-space: nowrap;
  padding-left: 0.65rem;
  padding-right: 0.35rem;
}
#files-table th:first-child .fiv-cla,
#files-table td:first-child .fiv-cla {
  font-size: 1.35rem;
  vertical-align: middle;
}
#files-table th:nth-child(3),
#files-table td:nth-child(3) {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  padding-left: 0.75rem;
  padding-right: 0.5rem;
}
#files-table th:last-child,
#files-table td:last-child {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  padding-left: 0.35rem;
  padding-right: 0.65rem;
}
#files-table .delete {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.15rem 0.25rem;
  margin: 0;
}

#convert-panel {
  margin-top: 1.25rem;
}

.convert-step {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}
.convert-step-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 650;
}
.convert-step-help {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}
.host-capability-note,
.host-dependency-notice {
  margin: 0 0 1rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.88rem;
  line-height: 1.35;
  border-left: 3px solid rgba(45, 138, 94, 0.45);
  background: rgba(45, 138, 94, 0.06);
}
.host-dependency-notice {
  border-left-color: rgba(180, 120, 40, 0.55);
  background: rgba(180, 120, 40, 0.08);
}
.start-format-summary {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}
.end-format-row {
  margin-bottom: 0.65rem;
}
.end-format-input {
  font-size: 1.05rem;
  padding: 0.65rem 0.85rem;
}
.popular-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}
.popular-target-btn {
  border: 1px solid rgba(45, 138, 94, 0.35);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.popular-target-btn:hover,
.popular-target-btn.selected {
  background: rgba(45, 138, 94, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}
.format-browser {
  margin-top: 0.35rem;
}
.format-browser > summary,
.path-customize > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.path-summary {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  padding: 0.55rem 0.75rem;
  background: rgba(45, 138, 94, 0.08);
  border-radius: 8px;
}
.examples-section--compact .example-cards {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.formats-filter-label {
  display: block;
  margin: 0.75rem 0 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.formats-filter {
  max-width: 36rem;
}
.formats-filter-count {
  min-height: 1.25em;
  margin: 0.35rem 0 0.75rem;
}
.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;
}


#convert-panel[hidden] {
  display: none !important;
}

.conversion-path-section {
  margin-bottom: 0.5rem;
}

.path-help {
  font-size: 0.82rem;
  margin: 0.25rem 0 0.75rem;
}

.conversion-path {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.35rem 0.5rem;
  padding: 0.85rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface);
  backdrop-filter: blur(6px);
  min-height: 4.5rem;
}

.path-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  min-width: 3.5rem;
}

.path-node-source {
  border-color: rgba(45, 138, 94, 0.45);
  background: rgba(45, 138, 94, 0.08);
}

.path-node .fiv-cla,
.path-hop-head .fiv-cla {
  font-size: 1.75rem;
  line-height: 1;
}

.path-node-label,
.path-hop-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: lowercase;
}

.path-node-tag {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.path-source-sep {
  align-self: center;
  font-size: 0.9rem;
}

.path-arrow {
  align-self: center;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0 0.1rem;
}

.path-hop {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  min-width: 7rem;
  max-width: 14rem;
}

.path-hop-spring-in {
  animation: hop-spring-in 0.38s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes hop-spring-in {
  from {
    opacity: 0;
    transform: scale(0.55) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.path-hop-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.path-hop-label {
  flex: 1;
}

.path-hop-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.15rem;
}
.path-hop-remove:hover {
  color: var(--danger);
}

.path-hop-action {
  font-size: 0.68rem;
  line-height: 1.3;
  word-break: break-word;
}

.path-hop-config,
.palette-config-panel {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hop-config-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hop-config-label {
  font-size: 0.68rem;
}

.hop-config-control {
  font-size: 0.78rem;
  padding: 0.25rem 0.35rem;
  margin-bottom: 0;
  max-width: 100%;
}

.path-drop-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 6.5rem;
  min-height: 3.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 2px dashed rgba(45, 138, 94, 0.35);
  background: rgba(45, 138, 94, 0.04);
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
  cursor: copy;
}

.path-drop-slot.path-drop-active,
.path-hop.path-drop-active {
  border-color: var(--accent);
  background: rgba(45, 138, 94, 0.14);
  box-shadow: 0 0 0 2px rgba(45, 138, 94, 0.2);
}

.palette-config-panel {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
}

.palette-config-panel[hidden] {
  display: none !important;
}

.palette-config-title {
  font-size: 0.82rem;
  margin: 0 0 0.35rem;
}

.format-icon-btn.format-icon-dragging {
  opacity: 0.55;
  transform: scale(0.92);
}

.btn-convert {
  display: block;
  width: 100%;
  max-width: 20rem;
  margin: 1rem 0;
  padding: 0.85rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #3cb371 0%, #2d8a5e 100%);
  border: 1px solid #267a52;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(45, 138, 94, 0.35);
}
.btn-convert:hover:not(:disabled) {
  background: linear-gradient(180deg, #45c47b 0%, #329966 100%);
}
.btn-convert:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.output-format-row {
  margin-top: 0.5rem;
}

.output-ext-hint {
  font-size: 0.82rem;
  margin: 0.35rem 0 0;
}

.output-format-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.format-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.4rem 0.55rem;
  min-width: 3.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.72rem;
  backdrop-filter: blur(6px);
}
.format-icon-btn:hover {
  border-color: var(--accent);
  background: rgba(45, 138, 94, 0.1);
}
.format-icon-btn.selected {
  border-color: var(--accent);
  background: rgba(45, 138, 94, 0.18);
  box-shadow: 0 0 0 1px var(--accent);
}
.format-icon-btn .fiv-cla {
  font-size: 1.75rem;
  line-height: 1;
}

#recommended_actions {
  display: none;
}

.convert-action-option {
  margin-top: 1rem;
}
.convert-action-option[hidden] {
  display: none !important;
}
.convert-option-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}
.convert-option-control {
  display: block;
  margin-bottom: 0.5rem;
  padding: 0.35rem;
  border-radius: 6px;
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid var(--border);
  max-width: 100%;
}
.convert-option-control--wide {
  max-width: 20rem;
  width: 100%;
}

.action-pill {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  backdrop-filter: blur(6px);
}
.action-pill:hover {
  border-color: var(--accent);
  background: rgba(45, 138, 94, 0.12);
}

#convert-result {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 8px;
  background: var(--surface);
  backdrop-filter: blur(8px);
  display: none;
}
#convert-result.visible { display: block; }

.examples-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.examples-section h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.examples-hint {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.example-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.example-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  backdrop-filter: blur(6px);
  overflow: hidden;
}
.example-card-hit {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 1rem;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  box-sizing: border-box;
}
a.example-card-hit:visited {
  color: inherit;
}
.example-card-hit:hover,
.example-card-hit:focus-visible {
  background: rgba(45, 138, 94, 0.1);
  outline: none;
}
.example-card-hit:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.example-card-title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.example-card-desc {
  display: block;
  flex: 1;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.35;
}
.example-card-cta {
  display: block;
  margin-top: 0.4rem;
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--accent);
  text-align: center;
  font-size: 0.9rem;
}
.example-card-hit:hover .example-card-cta,
.example-card-hit:focus-visible .example-card-cta {
  background: rgba(45, 138, 94, 0.12);
}
/* Legacy examples.php / landing buttons still use data-example on a plain button */
.example-card > button:not(.example-card-hit) {
  width: calc(100% - 2rem);
  margin: 0 1rem 1rem;
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
.example-card > button:not(.example-card-hit):hover {
  background: rgba(45, 138, 94, 0.1);
}
.example-card h3 { margin: 1rem 1rem 0.35rem; font-size: 1rem; }
.example-card > p { margin: 0 1rem 0.75rem; font-size: 0.85rem; color: var(--muted); }

.fis-panel { margin-bottom: 1rem; }
.fis-panel summary { cursor: pointer; list-style: none; }

/* Legacy details panel (unused — vote-style #fis-panel in fis_widget.css). */

.pricing-grid .plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  backdrop-filter: blur(6px);
  overflow: hidden;
}
.plan-card-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.plan-card-test {
  margin-top: 1.5rem;
  max-width: 320px;
}
.billing-current {
  background: rgba(45, 138, 94, 0.12);
  border: 1px solid rgba(45, 138, 94, 0.3);
}
.plan-card-hit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 1.25rem;
  box-sizing: border-box;
  color: inherit;
  text-decoration: none;
  font: inherit;
}
a.plan-card-hit:visited {
  color: inherit;
}
.plan-card-clickable {
  cursor: pointer;
}
.plan-card-clickable:hover,
.plan-card-clickable:focus-within {
  border-color: var(--accent);
  background: rgba(45, 138, 94, 0.08);
}
.plan-card-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.plan-card-hit h2 {
  margin: 0;
  font-size: 1.15rem;
}
.plan-card-hit ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}
.plan-card-hit .btn-primary,
.plan-card-hit .btn-secondary {
  margin-top: auto;
  pointer-events: none;
}
.plan-price { font-size: 1.5rem; font-weight: 600; color: var(--accent); margin: 0; }
.btn-primary, .btn-secondary {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  margin-top: 0.5rem;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { border: 1px solid var(--border); color: var(--text); }
.notice { padding: 0.75rem; background: rgba(201, 68, 68, 0.12); border-radius: 8px; margin-bottom: 1rem; }
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.success-notice { background: rgba(45, 138, 94, 0.15); border: 1px solid rgba(45, 138, 94, 0.35); color: var(--accent); }
.minutes-badge {
  font-size: 0.8rem;
  color: var(--accent);
  white-space: nowrap;
}
.minutes-badge[hidden] { display: none; }

.formats-table-wrap { overflow-x: auto; margin-top: 1rem; }
.formats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--surface);
  border-radius: 8px;
}
.formats-table th,
.formats-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.formats-table th { color: var(--muted); font-weight: 500; }
.formats-table code { font-size: 0.85em; color: var(--accent); }

.convert-footer {
  margin-top: 3rem;
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  background: var(--surface);
  backdrop-filter: blur(8px);
}
.convert-footer a {
  color: var(--muted);
  margin: 0 0.75rem;
  text-decoration: none;
}
.convert-footer a:hover { color: var(--accent); }
.convert-error { color: var(--danger); }
.convert-error a { color: var(--accent); }
.convert-warnings {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted, #6b7280);
  font-size: 0.9rem;
}
.convert-warnings li { margin: 0.25rem 0; }
.example-links { font-size: 0.85rem; margin: 0.5rem 0 0.75rem; }
.example-links a { color: var(--accent); }

.landing-main { max-width: 920px; }
.landing-breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.landing-breadcrumb a { color: var(--accent); text-decoration: none; }
.landing-breadcrumb a:hover { text-decoration: underline; }
.landing-hero { margin-bottom: 1rem; }
.landing-sample-row { margin: 0.75rem 0 0; }
.btn-landing-sample {
  border: 1px solid var(--accent);
  background: rgba(255, 255, 255, 0.65);
  color: var(--accent);
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  cursor: pointer;
}
.btn-landing-sample:hover { background: rgba(255, 255, 255, 0.95); }
.landing-section {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.55);
}
.landing-section h2 {
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
}
.landing-steps {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text);
}
.landing-steps li { margin: 0.35rem 0; }
.landing-related {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.35rem 1rem;
}
.landing-related a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
}
.landing-related a:hover { text-decoration: underline; }
.landing-footer-links { margin-top: 2rem; }
.formats-table a { color: var(--accent); text-decoration: none; }
.formats-table a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .convert-main { padding: 1rem; }
}
