/* Workspace layout: quiet chrome, strong primary action, room for image work. */
.ui-shell {
  background: #fff;
  color: #101114;
}
.ui-shell header {
  min-height: 80px;
  padding: 16px 32px;
  gap: 32px;
  flex-wrap: nowrap;
  box-shadow: none;
}
.ui-shell header .brand {
  font-size: 26px;
  margin: 0;
  flex-shrink: 0;
}
/* Brand mark: single shared rule for the header logo image. */
.ui-shell header .brand img {
  height: 36px;
  width: auto;
  display: block;
}
.ui-shell .brand .logo {
  width: 36px;
  height: 36px;
}
.local-indicator {
  color: #686b82;
  font-size: 12px;
  white-space: nowrap;
}
.return-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #dedee5;
  border-radius: 999px;
  background: #fff;
  color: #101114;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.return-link:hover {
  background: rgba(133, 91, 251, 0.08);
  border-color: #7132f5;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  padding: 12px;
  background: #fff;
  z-index: 1000;
  border: 2px solid #7132f5;
  border-radius: 12px;
}
.skip-link:focus {
  top: 12px;
}
.ui-shell main {
  padding: 32px;
  max-width: 1536px;
}
.ui-shell .intro {
  margin-bottom: 24px;
}
.ui-shell h1 {
  font-size: 36px;
  line-height: 1.22;
  letter-spacing: -0.5px;
  margin: 0 0 8px;
}
.ui-shell .intro p {
  font-size: 16px;
  margin: 0;
  max-width: 70ch;
}
.hub-intro {
  max-width: 800px;
  margin-bottom: 40px;
}
.hub-intro .eyebrow {
  margin: 0 0 12px;
}
.hub-intro > p {
  max-width: 66ch;
}
.hub-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  margin: 24px 0 16px;
  list-style: none;
}
.hub-benefits li {
  padding: 16px;
  border: 1px solid #dedee5;
  border-radius: 12px;
  color: #686b82;
  font-size: 14px;
  line-height: 1.5;
}
.hub-benefits strong {
  display: block;
  color: #101114;
  font-size: 14px;
}
.hub-caveat {
  font-size: 12px;
  line-height: 1.6;
}
.tool-catalog {
  margin-bottom: 48px;
}
.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}
.catalog-heading h2,
.optimizer-intro h2 {
  margin: 0;
  color: #101114;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.catalog-heading p {
  margin: 6px 0 0;
  font-size: 14px;
}
.tool-catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 24px;
}

#cat-imagenes .tool-catalog-grid {
  gap: 10px 24px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  min-height: 124px;
  padding: 20px;
  border: 1px solid #dedee5;
  border-radius: 12px;
  color: #101114;
  text-decoration: none;
}
.tool-card:hover {
  border-color: #5741d8;
}
.tool-card strong {
  font-size: 16px;
}
.tool-card span {
  margin-top: 8px;
  color: #686b82;
  font-size: 14px;
  line-height: 1.5;
}
.optimizer-intro {
  padding-top: 8px;
}
.ui-shell main > nav {
  max-width: 100%;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #dedee5;
  border-radius: 0;
  padding: 0 0 12px;
  gap: 8px;
  margin-bottom: 24px;
  justify-content: flex-start;
}
.ui-shell main > nav button {
  flex: 0 1 auto;
  border: 1px solid transparent;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  white-space: normal;
}
.ui-shell main > nav button.active {
  background: #7132f5;
  color: #fff;
  border-color: #5741d8;
  box-shadow: none;
}
.ui-shell main > nav button:not(.active):hover {
  background: rgba(148, 151, 169, 0.08);
}
.ui-shell .workspace {
  grid-template-columns: minmax(0, 1fr) 376px;
  gap: 24px;
}
.ui-shell .files-panel {
  box-shadow: none;
  padding: 24px;
  border: 1px solid #dedee5;
  min-height: 530px;
}
.ui-shell .panel-heading {
  margin-bottom: 20px;
}
.ui-shell .panel-heading h2 span {
  font-size: 18px;
  margin: 0;
  font-weight: 600;
}
.ui-shell .tiny-badge {
  font-size: 12px;
}
.ui-shell #drop {
  min-height: 290px;
  background: rgba(148, 151, 169, 0.04);
  border: 1.5px dashed rgba(104, 107, 130, 0.3);
}
.ui-shell #drop:hover {
  border-color: #7132f5;
}
.ui-shell #drop.drag {
  background: rgba(133, 91, 251, 0.16);
}
.ui-shell #drop h3 {
  font-size: 24px;
  letter-spacing: -0.5px;
  margin-top: 16px;
}
.ui-shell #drop p {
  font-size: 14px;
}
.ui-shell #drop .upload-icon {
  width: 56px;
  height: 56px;
  background: rgba(133, 91, 251, 0.16);
}
.ui-shell #choose {
  background: #7132f5;
  color: white;
  border-color: #5741d8;
}
.ui-shell #choose:hover {
  background: #5b1ecf;
}
.ui-shell #drop small {
  max-width: 54ch;
  line-height: 1.6;
}
.ui-shell .paste-controls {
  justify-content: flex-start;
  margin-top: 16px;
}
.ui-shell .paste-controls .secondary {
  font-size: 14px;
  padding: 10px 14px;
}
.ui-shell .paste-controls span {
  font-size: 12px;
}
.ui-shell .empty-note {
  border: 0;
  background: none;
  border-top: 1px solid #dedee5;
  padding: 20px 0 0;
  margin: 24px 0 0;
}
.ui-shell .empty-note strong {
  font-size: 14px;
  color: #101114;
}
.ui-shell .empty-note p {
  font-size: 14px;
  max-width: 60ch;
}
.ui-shell .mobile-paste {
  border: 0;
  padding: 12px 0 0;
}
.ui-shell .mobile-paste summary {
  color: #686b82;
  font-size: 12px;
}
.settings-panel {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 16px;
  max-height: 800px;
  min-height: 480px;
  padding: 0 !important;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.03);
}
.settings-panel > .panel-heading {
  padding: 20px 24px;
  margin: 0;
  border-bottom: 1px solid #dedee5;
  flex-shrink: 0;
}
.settings-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 20px 24px;
  flex: 1;
}
.settings-scroll .web-note {
  padding: 12px 14px;
  margin: 0 0 20px;
}
.settings-scroll .web-note p {
  font-size: 12px;
  line-height: 1.5;
}
.settings-scroll .field {
  margin: 16px 0;
}
.settings-scroll .label-row {
  margin-top: 16px;
}
.settings-scroll select,
.settings-scroll input[type="number"] {
  font-size: 14px;
  padding: 11px 10px;
}
.settings-scroll .hint {
  font-size: 12px;
  line-height: 1.6;
}
.settings-scroll details summary {
  font-size: 14px;
}
.settings-scroll .advanced-group {
  margin-top: 16px;
  padding: 16px 0;
  border-top: 1px solid #dedee5;
}
.settings-scroll .format-help {
  border: 0;
  padding: 0 0 12px;
}
.settings-scroll .format-help summary {
  font-size: 12px;
  color: #686b82;
}
.action-dock {
  flex-shrink: 0;
  border-top: 1px solid #dedee5;
  background: white;
  padding: 16px 24px;
}
.action-dock .primary {
  margin: 0;
  justify-content: center;
  min-height: 48px;
}
.action-dock .hint {
  font-size: 12px;
  margin: 8px 0 0;
}
.ui-shell .level-buttons button {
  font-size: 14px;
}
.ui-shell .level-buttons small {
  font-size: 12px;
}
.ui-shell .row {
  gap: 10px;
}
.ui-shell .row img {
  width: 72px;
  height: 72px;
}
.ui-shell .row .edit {
  padding: 8px 10px;
  border-color: #dedee5;
  font-size: 13px;
}
.ui-shell .row .edit:hover {
  border-color: #5741d8;
}
.ui-shell .row .remove {
  padding: 8px;
  color: #686b82;
  background: transparent;
}
.ui-shell .secondary-settings {
  box-shadow: none;
}
.ui-shell #effect-stage {
  height: 500px;
  border-radius: 12px;
}
.ui-shell dialog {
  padding: 24px;
}
.ui-shell dialog .panel-heading {
  position: sticky;
  top: -24px;
  background: white;
  padding: 16px 0;
  border-bottom: 1px solid #dedee5;
  z-index: 2;
}
.ui-shell dialog h2 {
  font-size: 22px;
  color: #101114;
  font-weight: 600;
}
.ui-shell dialog .editor-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}
#crop-dialog .editor-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
}
#crop-dialog .editor-grid canvas {
  width: 100% !important;
  max-width: 100%;
  height: auto;
  display: block;
}
#crop-dialog #reset-crop,
#crop-dialog #save-crop {
  flex: 1 1 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  min-height: 44px !important;
  padding: 10px 16px !important;
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
}
@media (max-width: 768px) {
  #crop-dialog .editor-grid {
    grid-template-columns: 1fr !important;
  }
}
.ui-shell footer {
  font-size: 12px;
  margin-top: 24px;
  padding-top: 20px;
  color: #686b82;
}
.ui-shell #vp-process,
.ui-shell #export-effect {
  justify-content: center;
}
.ui-shell #vp-list:empty {
  min-height: 150px;
}
.ui-shell #vp-list:empty:after {
  content: "Tus imágenes aparecerán acá después de seleccionarlas.";
  display: block;
  margin: 48px auto;
  text-align: center;
  max-width: 30ch;
  color: #686b82;
  font-size: 14px;
}
@media (min-width: 1536px) {
  .ui-shell main {
    padding-top: 40px;
  }
}
@media (max-width: 1280px) {
  .local-indicator {
    display: none;
  }
  .ui-shell header {
    gap: 24px;
  }
  .ui-shell .workspace {
    grid-template-columns: minmax(0, 1fr) 350px;
  }
  .settings-scroll {
    padding: 18px 20px;
  }
  .settings-panel > .panel-heading,
  .action-dock {
    padding: 18px 20px;
  }
}
@media (max-width: 1024px) {
  .ui-shell main {
    padding: 24px;
  }
  .ui-shell header {
    padding: 16px 24px;
  }
  .ui-shell .workspace {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
  }
  .ui-shell .files-panel {
    padding: 20px;
  }
  .ui-shell .row {
    flex-wrap: wrap;
  }
  .ui-shell .row-info {
    min-width: 120px;
  }
  .ui-shell #drop {
    min-height: 270px;
    padding: 20px;
  }
  .ui-shell #drop h3 {
    font-size: 22px;
  }
}
@media (max-width: 768px) {
  .ui-shell header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
  }
  .ui-shell header .brand {
    width: 100%;
  }
  .ui-shell .workspace {
    grid-template-columns: 1fr;
  }
  .settings-panel {
    position: static;
    height: auto;
    max-height: none;
    min-height: 0;
  }
  .settings-scroll {
    overflow: visible;
  }
  .ui-shell .files-panel {
    min-height: 0;
  }
  .ui-shell dialog .editor-grid {
    grid-template-columns: 1fr;
  }
  .ui-shell main > nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .ui-shell main > nav button {
    padding: 11px 14px;
  }
  .ui-shell h1 {
    font-size: 32px;
  }
  .ui-shell .intro p {
    font-size: 14px;
  }
  .ui-shell .action-dock {
    position: static;
  }
}
@media (max-width: 640px) {
  .ui-shell main {
    padding: 24px 16px;
  }
  .ui-shell header {
    padding: 16px;
  }
  .ui-shell main > nav button {
    flex: 1 1 calc(50% - 8px);
  }
  .ui-shell #effect-stage {
    height: 360px;
  }
  .ui-shell dialog {
    padding: 16px;
  }
  .ui-shell dialog .panel-heading {
    top: -16px;
  }
  .ui-shell .row img {
    width: 60px;
    height: 60px;
  }
}
@media (max-width: 425px) {
  .ui-shell h1 {
    font-size: 28px;
  }
  .ui-shell .files-panel {
    padding: 16px;
  }
  .settings-panel > .panel-heading,
  .settings-scroll,
  .action-dock {
    padding: 16px;
  }
  .ui-shell #drop {
    padding: 20px 12px;
  }
}

.ui-shell .row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}
.ui-shell .row-actions .edit {
  margin: 0;
}
.ui-shell .row-actions .remove {
  min-width: 32px;
}
.ui-shell #list .row-info {
  flex-basis: 180px;
}
.settings-file-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #dedee5;
}
.settings-file-actions[hidden] {
  display: none !important;
}
.settings-file-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid #dedee5;
  border-radius: 10px;
  background: rgba(148, 151, 169, 0.04);
}
.settings-file-name {
  min-width: 0;
  flex: 1 1 120px;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-file-actions .row-actions {
  margin-left: 0;
  flex-shrink: 0;
}
@media (max-width: 1024px) {
  .ui-shell .row-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .settings-file-actions .row-actions {
    width: auto;
    justify-content: flex-end;
  }
}

@media (max-width: 768px) {
  .hub-benefits,
  .tool-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hub-intro,
  .tool-catalog {
    margin-bottom: 32px;
  }
}

@media (max-width: 540px) {
  .ui-shell header {
    gap: 10px;
  }
  .local-indicator {
    width: 100%;
  }
  .hub-benefits,
  .tool-catalog-grid {
    grid-template-columns: 1fr;
  }
  .catalog-heading h2,
  .optimizer-intro h2 {
    font-size: 24px;
  }
}

/* ---- Foundational batch: Home, catalog, search, containment ---- */

/* Home container stays near 1200px; tool workspaces keep their own width. */
.home-page main {
  max-width: 1200px;
}

.home-page .hub-intro {
  max-width: 68ch;
  margin-bottom: 24px;
}

.home-page .hub-intro h1 {
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin: 0 0 8px;
}

.home-page .hub-intro > p {
  font-size: 16px;
  max-width: 60ch;
}

.trust-line {
  font-size: 14px;
  line-height: 1.6;
  color: #686b82;
}

/* Category anchors wrap instead of clipping horizontally. */
.category-anchors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 16px;
}

.category-anchors a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #101114;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background: #fff;
}

.category-anchors a:hover {
  border-color: #7132f5;
  background: #fff;
}

/* Home-only local search. */
.catalog-search {
  margin: 0 0 24px;
  max-width: 560px;
}

.catalog-search label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  border: 1px solid #dedee5;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  background: #fff;
  color: #101114;
}

.search-row .secondary {
  white-space: nowrap;
}

#catalog-count {
  font-size: 14px;
  margin: 8px 0 0;
}

/* Anchor offset for sticky top bar header.
   html scroll-padding only; no scroll-behavior added. */
html {
  scroll-padding-top: 76px;
}

/* Grouped catalog. */
.catalog-group {
  margin: 0 0 32px;
}

.catalog-group > h3 {
  font-size: 24px;
  letter-spacing: -0.4px;
  margin: 0 0 12px;
  color: #101114;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
}

.card-top svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 8px;
  box-sizing: content-box;
  border-radius: 10px;
  background: #f0e9ff;
  color: #5b1ecf;
}

.tool-card strong {
  display: block;
}

.card-desc {
  display: block;
}

.cross-link {
  font-size: 14px;
  margin: 12px 0 0;
}

.catalog-empty {
  font-size: 14px;
  border: 1px dashed #dedee5;
  border-radius: 12px;
  padding: 20px;
  max-width: 60ch;
}

/* Info sections below the catalog. */
.info-section {
  margin: 0 0 40px;
  max-width: 72ch;
}

.info-section h2 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #101114;
  margin: 0 0 12px;
}

.info-section h3 {
  font-size: 18px;
  color: #101114;
  margin: 24px 0 8px;
}

.info-section p,
.info-section li {
  font-size: 14px;
  line-height: 1.6;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
  counter-reset: step;
}

.how-steps li {
  border: 1px solid #dedee5;
  border-radius: 12px;
  padding: 16px;
}

.how-steps strong {
  display: block;
  font-size: 14px;
  color: #101114;
  margin-bottom: 4px;
}

.privacy-list {
  padding-left: 20px;
  margin: 12px 0;
}

.info-section details {
  border-top: 1px solid #dedee5;
  padding: 12px 0;
}

.info-section summary {
  font-size: 14px;
  font-weight: 600;
}

/* Accessible file acquisition: the drop zone is a passive container; the
   native button inside is the single keyboard entry. */
.file-drop {
  cursor: default;
}

.drop-hint {
  font-size: 14px;
  line-height: 1.6;
  color: #686b82;
  max-width: 52ch;
}

/* Containment guards so controls, names and previews fit 390px and 320px
   viewports without a global overflow-x workaround. */
.files-panel,
.secondary-settings {
  min-width: 0;
}

.files-panel input,
.files-panel select,
.files-panel textarea,
.secondary-settings input,
.secondary-settings select,
.secondary-settings textarea {
  max-width: 100%;
}

.files-panel canvas,
.files-panel img,
.secondary-settings canvas,
.secondary-settings img {
  max-width: 100%;
  height: auto;
}

.pdf-row div,
.transfer-file div,
.row-info,
.incoming-file,
.received-item div {
  min-width: 0;
}

.pdf-row strong,
.transfer-file strong,
.row-info strong,
.ocr-file {
  overflow-wrap: anywhere;
}

@media (max-width: 768px) {
  .how-steps {
    grid-template-columns: 1fr;
  }
  .info-section h2 {
    font-size: 24px;
  }
  .catalog-group > h3 {
    font-size: 22px;
  }
}

@media (max-width: 390px) {
  .ui-shell main {
    padding: 20px 12px;
  }
  .ui-shell .files-panel,
  .ui-shell .secondary-settings {
    padding: 14px;
    min-width: 0;
  }
  .tool-card {
    padding: 16px;
  }
  .search-row {
    flex-wrap: wrap;
  }
  .search-row .secondary {
    width: 100%;
  }
  .ui-shell header.site-header {
    width: 100%;
  }
}

/* ---- Advanced batch: honest result meaning ----
   Green (.result-ok, #summary default) only signals true weight
   reduction or successful completion. A larger output stays neutral
   with an explicit warning; originals remain untouched. */
.ui-shell .row .result-ok {
  color: var(--success);
}
.ui-shell .row .result-neutral {
  color: var(--muted);
  font-weight: 600;
}
.ui-shell .row .result-warn {
  color: #9a6700;
  font-size: 13px;
  line-height: 1.5;
  margin-top: 4px;
}
.ui-shell #summary.summary-warn {
  background: #fff8e6;
  border: 1px solid #e8c547;
  color: #7a5200;
}

/* ---- Home header: Mac-like floating centered pill ---- */
/* Shared pill base: Home + tool pages (same Mac design). Home visuals unchanged. */
.home-page .site-header,
.ui-shell:not(.home-page) header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 24px;
  min-height: 0;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 0;
  border-bottom: 1px solid #dedee5;
  border-radius: 0;
  box-shadow: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .home-page .site-header,
  .ui-shell:not(.home-page) header.site-header {
    background: #ffffff;
  }
}

/* Home: logo arranca alineado con el h1 (contenedor 1200px + padding del main) */
.home-page .site-header {
  justify-content: flex-start;
  padding-left: max(22px, calc(50% - 600px + 32px));
  padding-right: max(22px, calc(50% - 600px + 32px));
}
/* Enlaces centrados en el espacio restante de la nav */
.home-page .site-header .category-anchors {
  flex: 1;
  justify-content: center;
}
@media (max-width: 1024px) {
  .home-page .site-header {
    padding-left: max(24px, calc(50% - 600px + 24px));
    padding-right: max(24px, calc(50% - 600px + 24px));
  }
}
@media (max-width: 640px) {
  .home-page .site-header {
    padding-left: max(16px, calc(50% - 600px + 16px));
    padding-right: max(16px, calc(50% - 600px + 16px));
  }
}
@media (max-width: 390px) {
  .home-page .site-header {
    padding-left: max(12px, calc(50% - 600px + 12px));
    padding-right: max(12px, calc(50% - 600px + 12px));
  }
}

.home-page .site-header .brand,
.ui-shell:not(.home-page) header.site-header .brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  width: auto;
}

.home-page .site-header .brand img,
.ui-shell:not(.home-page) header.site-header .brand img {
  height: 32px;
  width: auto;
  display: block;
}

.home-page .site-header .category-anchors,
.ui-shell:not(.home-page) header.site-header .category-anchors {
  margin-top: 0;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 24px;
}

.home-page .site-header .category-anchors a,
.ui-shell:not(.home-page) header.site-header .category-anchors a {
  min-height: 40px;
  padding: 8px 14px;
  border-color: transparent;
  background: #fff;
}

.home-page .site-header .category-anchors a:hover,
.ui-shell:not(.home-page) header.site-header .category-anchors a:hover {
  background: #fff;
  border-color: #7132f5;
}

.home-page .site-header a:focus-visible,
.ui-shell:not(.home-page) header.site-header a:focus-visible {
  outline: 3px solid #7132f5;
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .home-page .site-header,
  .ui-shell:not(.home-page) header.site-header {
    width: 100%;
    border-radius: 0;
    padding: 10px 14px;
    gap: 10px 24px;
  }
  .home-page .site-header .category-anchors,
  .ui-shell:not(.home-page) header.site-header .category-anchors {
    width: 100%;
  }
  .home-page .site-header .category-anchors a,
  .ui-shell:not(.home-page) header.site-header .category-anchors a {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
    font-size: 13px;
    padding: 8px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-page .site-header,
  .home-page .site-header a,
  .ui-shell:not(.home-page) header.site-header,
  .ui-shell:not(.home-page) header.site-header a {
    transition: none;
  }
}

/* Cómo funciona: use full container width on large screens. */
@media (min-width: 1024px) {
  .home-page #como-funciona {
    max-width: none;
  }
  .home-page #como-funciona .how-steps {
    gap: 20px;
  }
  .home-page #como-funciona .how-steps li {
    min-width: 0;
    padding: 24px;
  }
}
@media (min-width: 1024px) {
  .home-page .hub-intro {
    width: 100%;
    max-width: 1200px;
    margin-bottom: 40px;
    padding: 40px 0 16px;
  }
  .home-page .hub-intro h1 {
    font-size: clamp(40px, 4.5vw, 60px);
    line-height: 1.08;
    max-width: none;
  }
  .home-page .hub-intro > p {
    max-width: none;
    font-size: 19px;
    line-height: 1.6;
  }
  .home-page .hub-intro .trust-line {
    font-size: 15px;
  }
}

/* Shared drop-zone base: common dashed-surface pattern reused by the
   per-tool drop surfaces (#transfer-drop, #ocr-drop, #creative-drop,
   #pdf-drop). Tool files keep only their size/layout differences. */
#transfer-drop,
#ocr-drop,
#creative-drop,
#pdf-drop {
  border: 1.5px dashed rgba(104, 107, 130, 0.35);
  border-radius: 16px;
  background: rgba(148, 151, 169, 0.04);
  text-align: center;
  cursor: pointer;
}
#transfer-drop .upload-icon,
#ocr-drop .upload-icon,
#creative-drop .upload-icon,
#pdf-drop .upload-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  background: var(--purple-subtle);
  border-radius: 16px;
  color: var(--purple);
  font-size: 30px;
}

/* ---- Tool pages: return-link right, local-indicator centered ---- */
/* Scoped with :not(.home-page) so the Home Mac pill header is unchanged.
   Tool headers reuse the shared .site-header pill base above; rules below
   only arrange tool-specific content inside the pill. */
.ui-shell:not(.home-page) header.site-header {
  justify-content: center;
  gap: 10px 24px;
}
.ui-shell:not(.home-page) header .brand {
  order: 0;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  width: auto;
}
.ui-shell:not(.home-page) header .local-indicator {
  order: 1;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 220px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ui-shell:not(.home-page) header .return-link {
  order: 2;
  flex-shrink: 0;
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  border-color: #dedee5;
  line-height: 1.4;
}
.ui-shell:not(.home-page) header .return-link:focus-visible {
  outline: 3px solid #7132f5;
  outline-offset: 2px;
}
@media (max-width: 1280px) {
  .ui-shell:not(.home-page) header .local-indicator {
    display: block;
  }
}
@media (max-width: 768px) {
  .ui-shell:not(.home-page) header .local-indicator {
    flex-basis: 100%;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
  }
}
/* 390px guard: pill wraps instead of overflowing; brand image never exceeds pill. */
.ui-shell:not(.home-page) header.site-header .brand img {
  height: 32px;
  max-width: 100%;
}
@media (max-width: 560px) {
  .ui-shell:not(.home-page) header.site-header .local-indicator {
    flex-basis: 100%;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-align: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ui-shell:not(.home-page) header .return-link,
  .ui-shell:not(.home-page) header .local-indicator {
    transition: none;
  }
}

:root {
  --error: #b42318;
}

.result-error {
  color: var(--error, #b42318);
}
