/* Listy — laware.de inspired design system */

:root {
  --bg: #f5f6fa;
  --fg: #1f2937;
  --heading: #0f172a;
  --primary: #4a90e2;
  --primary-dark: #2c61e0;
  --accent: #3ed1a2;
  --muted: #6b7280;
  --border: #e5e7eb;
  --surface: #ffffff;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --duration: 0.35s;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 64px;
  --status-unique: #94a3b8;
  --status-similar: #f59e0b;
  --status-duplicate: #ef4444;
  --status-drop: #3ed1a2;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100%;
  overflow-x: clip;
  max-width: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Navigation ── */

.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}

.app-nav__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
  transition: opacity var(--duration) var(--ease);
}

.app-nav__brand:hover {
  opacity: 0.82;
}

.app-nav__byline {
  color: var(--primary-dark);
  font-weight: 500;
  font-size: 0.82rem;
  margin-left: 0.35rem;
}

.app-nav__laware-logo {
  width: 36px;
  height: auto;
  display: block;
  flex-shrink: 0;
}

.app-nav__brand-text {
  min-width: 0;
}

.app-nav__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--heading);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.app-nav__subtitle {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.25;
}

.app-nav__subtitle--short {
  display: none;
}

.app-nav__links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.app-nav__actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.tooltips-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: color var(--duration) var(--ease), border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}

.tooltips-toggle:hover {
  color: var(--heading);
  border-color: rgba(74, 144, 226, 0.25);
}

.tooltips-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.tooltips-toggle span {
  line-height: 1;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid var(--border);
  gap: 0.15rem;
}

.lang-switch__btn {
  min-width: 2.35rem;
  padding: 0.35rem 0.55rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.lang-switch__btn:hover {
  color: var(--heading);
}

.lang-switch__btn.is-active {
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

@media (max-width: 640px) {
  .app-nav__actions {
    gap: 0.5rem;
  }

  .app-nav__subtitle--full {
    display: none;
  }

  .app-nav__subtitle--short {
    display: block;
  }

  .tooltips-toggle span {
    display: none;
  }
}

@media (max-width: 480px) {
  :root {
    --nav-height: 84px;
  }

  .app-nav {
    height: auto;
    min-height: 84px;
    flex-direction: column;
    align-items: stretch;
    padding: 0.45rem 0.75rem 0.5rem;
    gap: 0.4rem;
  }

  .app-nav__brand {
    gap: 0.5rem;
    min-width: 0;
  }

  .app-nav__laware-logo {
    width: 28px;
  }

  .app-nav__title {
    font-size: 0.92rem;
  }

  .app-nav__byline,
  .app-nav__subtitle--full,
  .app-nav__subtitle--short {
    display: none !important;
  }

  .tooltips-toggle {
    display: none;
  }

  .app-nav__actions {
    width: 100%;
    justify-content: space-between;
    gap: 0.35rem;
  }

  .app-nav__links {
    flex: 1 1 auto;
    min-width: 0;
  }

  .app-nav__link {
    padding: 0.35rem 0.55rem;
    font-size: 0.8rem;
  }

  .lang-switch__btn {
    min-width: 2rem;
    padding: 0.3rem 0.45rem;
    font-size: 0.72rem;
  }
}

.app-nav__link {
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease), transform var(--duration) var(--ease);
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
}

.app-nav__link:hover {
  color: var(--heading);
  background: rgba(74, 144, 226, 0.08);
}

.app-nav__link.is-active {
  color: var(--primary-dark);
  background: rgba(74, 144, 226, 0.12);
}

/* ── Main layout ── */

.app-main {
  padding-top: 1.75rem;
  padding-bottom: 3rem;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: clamp(1rem, 3vw, 2rem);
  padding-right: clamp(1rem, 3vw, 2rem);
  min-width: 0;
  box-sizing: border-box;
}

.app-section {
  display: none;
  animation: sectionIn 0.45s var(--ease) forwards;
  min-width: 0;
  max-width: 100%;
}

#listy_page,
#compare_page {
  min-width: 0;
  max-width: 100%;
}

.app-section.is-active {
  display: block;
}

@keyframes sectionIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── App intro ── */

.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;
}

/* ── Promo bar (full-width ad header) ── */

.app-promo-bar {
  margin-top: var(--nav-height);
  border-bottom: 1px solid rgba(44, 97, 224, 0.12);
  background: linear-gradient(90deg, rgba(244, 248, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 45%, rgba(236, 253, 247, 0.95) 100%);
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  box-sizing: border-box;
}

.app-promo-bar__item {
  display: none;
}

.app-promo-bar__item.is-active {
  display: block;
}

.promo-bar__inner {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.55rem clamp(1rem, 3vw, 2rem);
  min-height: 3.5rem;
}

.promo-bar__message {
  flex: 0 1 16rem;
  min-width: 0;
}

.promo-bar__headline {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--heading);
  letter-spacing: -0.01em;
}

.promo-bar__lead {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.promo-bar__links {
  display: flex;
  align-items: stretch;
  flex: 1 1 auto;
  justify-content: flex-end;
  gap: 0.45rem;
  min-width: 0;
}

.promo-bar__link {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  flex: 1 1 0;
  max-width: 12.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(44, 97, 224, 0.12);
  background: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.promo-bar__link-name {
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary-dark);
}

.promo-bar__link-desc {
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--muted);
}

.promo-bar__link:hover {
  background: #fff;
  border-color: rgba(74, 144, 226, 0.24);
  box-shadow: 0 2px 10px rgba(44, 97, 224, 0.08);
}

.promo-bar__link:hover .promo-bar__link-name {
  color: var(--heading);
}

.promo-bar__link--accent {
  border-color: rgba(62, 209, 162, 0.28);
}

.promo-bar__link--accent .promo-bar__link-name {
  color: #0f766e;
}

.promo-bar__link--accent:hover {
  background: rgba(236, 253, 247, 0.95);
  border-color: rgba(62, 209, 162, 0.45);
}

.promo-bar__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--primary-dark);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(44, 97, 224, 0.22);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), filter var(--duration) var(--ease);
}

.promo-bar__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(44, 97, 224, 0.28);
  filter: brightness(1.04);
}

.promo-bar__cta-icon {
  transition: transform var(--duration) var(--ease);
}

.promo-bar__cta:hover .promo-bar__cta-icon {
  transform: translateX(2px);
}

@media (max-width: 960px) {
  .promo-bar__links {
    display: none;
  }
}

.app-intro {
  margin-bottom: 2.5rem;
}

.app-intro__panel {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 247, 252, 0.92) 100%);
  box-shadow: var(--shadow-sm);
}

.app-intro__hero {
  margin-bottom: 1.5rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.app-intro__badge {
  display: inline-block;
  margin-bottom: 0.65rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(74, 144, 226, 0.1);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.app-intro__heading {
  margin: 0 0 0.4rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.app-intro__tagline {
  margin: 0;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.app-intro__modes-label {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-intro__parts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.app-intro__part {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 0.85rem 1rem;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease), background var(--duration) var(--ease);
}

.app-intro__part:hover {
  border-color: rgba(74, 144, 226, 0.35);
  box-shadow: 0 8px 24px rgba(44, 97, 224, 0.1);
  transform: translateY(-2px);
}

.app-intro__part:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.app-intro__part.is-active {
  border-color: rgba(74, 144, 226, 0.5);
  background: linear-gradient(180deg, rgba(74, 144, 226, 0.07) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: 0 8px 24px rgba(44, 97, 224, 0.12);
}

.app-intro__part-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: rgba(74, 144, 226, 0.12);
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.app-intro__part-body {
  min-width: 0;
}

.app-intro__part-title {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--heading);
  letter-spacing: -0.02em;
}

.app-intro__part-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-intro__part-list li {
  position: relative;
  padding-left: 0.95rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.app-intro__part-list li + li {
  margin-top: 0.35rem;
}

.app-intro__part-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: var(--accent);
}

.app-intro__part-cta {
  align-self: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}

.app-intro__part:hover .app-intro__part-cta,
.app-intro__part.is-active .app-intro__part-cta {
  background: rgba(74, 144, 226, 0.14);
  color: var(--primary-dark);
}

.app-intro__privacy {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 1.15rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.app-intro__privacy-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--primary);
  opacity: 0.85;
}

@media (max-width: 860px) {
  .app-intro__part {
    grid-template-columns: auto 1fr;
  }

  .app-intro__part-cta {
    grid-column: 2;
    justify-self: start;
    margin-top: 0.15rem;
  }
}

@media (max-width: 720px) {
  .app-intro__parts {
    grid-template-columns: 1fr;
  }
}

/* ── Section marker & footer ── */

.section-marker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.section-marker::before,
.section-marker::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.1), transparent);
}

.section-marker__label {
  flex-shrink: 0;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.section-header {
  margin-bottom: 1.75rem;
}

.section-header h1,
.section-header h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--heading);
  letter-spacing: -0.03em;
}

.section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 640px;
}

.section-header__privacy {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 640px;
}

/* ── Panels & cards ── */

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 960px) {
  .panel-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(226, 232, 240, 0.9);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.panel:hover {
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

.panel__header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--heading);
}

.panel__body {
  padding: 1.25rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

/* ── Toolbar ── */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  max-width: 100%;
  min-width: 0;
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.tool-link {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg);
  background: transparent;
  border: 1px solid transparent;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
}

.tool-link:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.tool-link--primary {
  background: rgba(74, 144, 226, 0.1);
  color: var(--primary-dark);
}

.tool-link--primary:hover {
  background: rgba(74, 144, 226, 0.18);
}

.tool-link.is-copy-success,
.tool-link.is-copy-success:hover {
  background: rgba(62, 209, 162, 0.18);
  color: #047857;
  border-color: rgba(62, 209, 162, 0.45);
  transform: scale(1);
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(62, 209, 162, 0.35);
  animation: copyBtnPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.copy-btn-feedback {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.copy-btn-feedback__burst {
  position: absolute;
  inset: -0.35rem -0.55rem;
  border-radius: 10px;
  border: 2px solid rgba(62, 209, 162, 0.55);
  opacity: 0;
  pointer-events: none;
  animation: copyBtnBurst 0.7s ease-out forwards;
}

.copy-btn-feedback__icon {
  flex-shrink: 0;
  animation: copyBtnIconIn 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s both;
}

.copy-btn-feedback__check {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: copyBtnCheckDraw 0.45s ease 0.15s forwards;
}

.copy-btn-feedback__label {
  animation: copyBtnLabelIn 0.35s ease 0.1s both;
}

@keyframes copyBtnPop {
  0% {
    transform: scale(0.94);
    box-shadow: 0 0 0 0 rgba(62, 209, 162, 0.45);
  }

  45% {
    transform: scale(1.07);
    box-shadow: 0 0 0 10px rgba(62, 209, 162, 0);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes copyBtnBurst {
  0% {
    transform: scale(0.8);
    opacity: 0.85;
  }

  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

@keyframes copyBtnIconIn {
  from {
    transform: scale(0) rotate(-20deg);
    opacity: 0;
  }

  to {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

@keyframes copyBtnCheckDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes copyBtnLabelIn {
  from {
    transform: translateX(-8px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-link.is-copy-success {
    animation: none;
  }

  .copy-btn-feedback__burst,
  .copy-btn-feedback__icon,
  .copy-btn-feedback__check,
  .copy-btn-feedback__label {
    animation: none;
  }

  .copy-btn-feedback__check {
    stroke-dashoffset: 0;
  }
}

/* ── Form elements ── */

.form-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  min-width: 0;
  max-width: 100%;
}

.form-row label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  min-width: 80px;
}

.form-row--add {
  align-items: stretch;
}

.form-row__controls {
  flex: 1;
  display: flex;
  gap: 0.5rem;
  min-width: 0;
}

.form-row__controls .form-input {
  flex: 1;
  min-width: 0;
}

.btn-add {
  flex-shrink: 0;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  box-shadow: 0 2px 8px rgba(44, 97, 224, 0.2);
}

.btn-add:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(44, 97, 224, 0.28);
}

.btn-add:active {
  transform: translateY(0);
}

.form-input {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--fg);
  background: var(--surface);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.form-textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 420px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--fg);
  background: var(--surface);
  resize: vertical;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

/* ── List editor ── */

.list-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.06) 0%, rgba(62, 209, 162, 0.05) 100%);
  border: 1px solid rgba(74, 144, 226, 0.12);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--muted);
}

.list-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.list-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.list-legend__dot--unique { background: var(--status-unique); }
.list-legend__dot--similar { background: var(--status-similar); }
.list-legend__dot--duplicate { background: var(--status-duplicate); }

.list-hint {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

#listy_list_panel {
  position: relative;
  transition: opacity 0.2s var(--ease);
}

#listy_list_panel.is-syncing {
  opacity: 0.72;
  pointer-events: none;
}

#listy_list_panel.is-syncing::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.04), transparent);
  animation: syncShimmer 1s var(--ease) infinite;
}

@keyframes syncShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.list-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.list-search .form-input {
  flex: 1;
}

.list-search__reset {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--duration) var(--ease);
  flex-shrink: 0;
  cursor: pointer;
}

.list-search__reset:hover {
  border-color: var(--primary);
  background: rgba(74, 144, 226, 0.06);
}

.list-search__reset-icon {
  display: block;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: color var(--duration) var(--ease);
}

.list-search__reset:hover .list-search__reset-icon {
  color: var(--primary);
}

#listy_list,
.listy-sortable {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  min-height: 60px;
}

.listy-drop-slot {
  height: 3px;
  margin: 2px 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  box-shadow: 0 0 0 4px rgba(62, 209, 162, 0.18);
  pointer-events: none;
  flex-shrink: 0;
}

.listy_element {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-width: 0;
  max-width: 100%;
  transition:
    box-shadow var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    opacity var(--duration) var(--ease);
  animation: itemIn 0.35s var(--ease) backwards;
}

.listy_element::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--status-unique);
  pointer-events: none;
}

.listy_element:hover {
  box-shadow: var(--shadow-sm);
  border-color: rgba(74, 144, 226, 0.25);
}

.listy_element.is-dragging {
  opacity: 0.35;
  box-shadow: none;
}

.listy-sortable.is-sorting .listy_element {
  transition: none;
}

.listy_element.is-flip-animating {
  transition: transform 0.42s cubic-bezier(0.33, 1, 0.68, 1) !important;
  z-index: 2;
  will-change: transform;
}

.listy-sortable.is-reordering .listy_element.is-flip-animating {
  pointer-events: none;
}

#listy_list_panel.is-syncing:has(.listy-sortable.is-reordering) {
  opacity: 1;
}

#listy_list_panel.is-syncing:has(.listy-sortable.is-reordering)::after {
  opacity: 0.35;
}

.listy_element.is-highlighted {
  animation: highlightFlash 1.2s var(--ease);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

@keyframes highlightFlash {
  0% { box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.35); }
  100% { box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2); }
}

.listy_element--similar {
  background: #fffbf5;
}

.listy_element--similar::before {
  background: var(--status-similar);
}

.listy_element--similar.is-linked-highlight,
.listy_element--duplicate.is-linked-highlight {
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.35);
}

.listy_element--duplicate {
  background: #fff8f8;
}

.listy_element--duplicate::before {
  background: var(--status-duplicate);
}

.listy_element--similar.listy_element--duplicate {
  background: #fff9f4;
}

.listy_element--similar.listy_element--duplicate::before {
  background: linear-gradient(180deg, var(--status-duplicate) 0%, var(--status-duplicate) 50%, var(--status-similar) 50%, var(--status-similar) 100%);
}

.listy_element__statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.listy_element__status {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  max-width: 100%;
  text-align: left;
}

.listy_element__handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 36px;
  margin-top: 0.1rem;
  border-radius: 8px;
  color: #cbd5e1;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
}

body.is-sorting-list {
  cursor: grabbing;
  user-select: none;
  touch-action: none;
  -webkit-user-select: none;
}

body.is-sorting-list .listy-sortable {
  touch-action: none;
}

body.is-sorting-list .listy_element__handle {
  cursor: grabbing;
}

.listy_element__handle:hover {
  color: var(--primary);
  background: rgba(74, 144, 226, 0.08);
}

.listy_element__handle:active {
  cursor: grabbing;
}

.listy_element__content {
  min-width: 0;
}

.listy_element__text {
  width: 100%;
  min-height: 2.4rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--heading);
  background: transparent;
  resize: none;
  overflow: hidden;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.listy_element__text:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.7);
}

.listy_element__text:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.12);
}

.listy_element__status--similar {
  border: none;
  cursor: pointer;
  font-family: inherit;
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
  transition: background var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.listy_element__status--similar:hover {
  background: rgba(245, 158, 11, 0.24);
  transform: translateY(-1px);
}

.listy_element__status--duplicate {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.listy_element__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.listy_element__index {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.listy_element__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
  transition: all var(--duration) var(--ease);
}

.listy_element__remove:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--status-duplicate);
}

@keyframes itemIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.listy_empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Compare section ── */

.compare-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 768px) {
  .compare-inputs {
    grid-template-columns: minmax(0, 1fr);
  }
}

.compare-inputs .form-textarea {
  min-height: 280px;
}

.compare-inputs .panel__header {
  padding: 0.85rem 1.25rem;
}

.compare-results.is-syncing {
  opacity: 0.72;
  transition: opacity 0.2s var(--ease);
  pointer-events: none;
}

.diff-panel {
  margin-bottom: 1.5rem;
}

.diff-content {
  padding: 1.25rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-height: 60px;
  max-width: 100%;
  overflow-x: auto;
}

.diff-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 900px) {
  .diff-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.diff-column h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--heading);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.diff-column h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.diff-column--deleted h3::before { background: var(--status-duplicate); }
.diff-column--added h3::before { background: var(--accent); }
.diff-column--changed h3::before { background: var(--primary); }

.diff-column ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.diff-column li {
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.4rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.45;
  animation: itemIn 0.35s var(--ease) backwards;
}

.diff-column--deleted li {
  border-left: 3px solid var(--status-duplicate);
}

.diff-column--added li {
  border-left: 3px solid var(--accent);
}

.diff-column--changed li {
  border-left: 3px solid var(--primary);
}

.diff-empty {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.5rem 0;
}

/* FineDiff output */
.del {
  text-decoration: line-through;
  color: var(--status-duplicate);
  background: rgba(239, 68, 68, 0.08);
  padding: 0 2px;
  border-radius: 2px;
}

.ins {
  text-decoration: none;
  color: var(--primary-dark);
  background: rgba(74, 144, 226, 0.12);
  padding: 0 2px;
  border-radius: 2px;
  border-bottom: 2px solid var(--primary);
}

/* Simple text compare: added / changed / removed */
#compare_simple_diff .del {
  text-decoration: line-through;
  color: var(--status-duplicate);
  background: rgba(239, 68, 68, 0.1);
  border-bottom: none;
}

#compare_simple_diff .ins--added {
  color: #047857;
  background: rgba(62, 209, 162, 0.16);
  border-bottom: 2px solid var(--status-drop);
}

#compare_simple_diff .ins--changed,
#compare_changed .ins--changed {
  color: var(--primary-dark);
  background: rgba(74, 144, 226, 0.12);
  border-bottom: 2px solid var(--primary);
}

/* ── Toast ── */

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 0.75rem 1.25rem;
  background: var(--heading);
  color: #fff;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
  z-index: 200;
}

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

/* ── Rich tooltips ── */

.app-tooltip {
  position: fixed;
  z-index: 300;
  max-width: min(320px, calc(100vw - 24px));
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transition:
    opacity 0.22s var(--ease),
    transform 0.28s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.app-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app-tooltip.is-below {
  transform: translateY(-6px) scale(0.97);
}

.app-tooltip.is-below.is-visible {
  transform: translateY(0) scale(1);
}

.app-tooltip__inner {
  position: relative;
  padding: 0.85rem 1rem 0.95rem;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  border-radius: 12px;
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-tooltip__arrow {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: rgba(15, 23, 42, 0.94);
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.12);
}

.app-tooltip.is-below .app-tooltip__arrow {
  top: -6px;
  bottom: auto;
  box-shadow: -2px -2px 6px rgba(0, 0, 0, 0.08);
}

.app-tooltip__badge {
  display: inline-block;
  margin-bottom: 0.45rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(74, 144, 226, 0.22);
  color: #93c5fd;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-tooltip__title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
}

.app-tooltip__body {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(248, 250, 252, 0.88);
}

.app-tooltip__list {
  margin: 0 0 0.55rem;
  padding: 0 0 0 1.05rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(248, 250, 252, 0.82);
}

.app-tooltip__list li {
  margin-bottom: 0.25rem;
}

.app-tooltip__list li:last-child {
  margin-bottom: 0;
}

.app-tooltip__note {
  margin: 0;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.76rem;
  line-height: 1.45;
  color: rgba(148, 163, 184, 0.95);
  font-style: italic;
}

/* ── Footer ── */

.app-footer {
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 2rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.5);
}

.app-footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto 0.65rem;
}

.app-footer__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.app-footer__logo-link {
  display: inline-flex;
  flex-shrink: 0;
  text-decoration: none;
  transition: opacity var(--duration) var(--ease);
}

.app-footer__logo-link:hover {
  opacity: 0.82;
}

.app-footer__logo {
  width: 40px;
  height: auto;
  display: block;
}

.app-footer__brand-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.app-footer__sep {
  opacity: 0.45;
}

.app-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.app-footer__host {
  margin: 0;
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.85;
}

.app-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto 0.75rem;
  font-size: 0.78rem;
}

.app-footer a {
  color: var(--primary-dark);
  text-decoration: none;
  transition: opacity var(--duration) var(--ease);
}

.app-footer a:hover {
  opacity: 0.75;
}

/* ── Mobile unified layout ── */

@media (max-width: 768px) {
  :root {
    --page-gutter: 1rem;
    --mobile-gap: 0.75rem;
  }

  .app-promo-bar {
    padding: var(--mobile-gap) var(--page-gutter) 0;
    background: var(--bg);
    border-bottom: none;
  }

  .promo-bar {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: var(--shadow-sm);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 247, 252, 0.96) 100%);
  }

  .promo-bar__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding: 0.85rem;
    min-height: 0;
    max-width: none;
    width: 100%;
  }

  .promo-bar__message {
    flex: none;
    max-width: none;
  }

  .promo-bar__lead {
    white-space: normal;
  }

  .promo-bar__links {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
  }

  .promo-bar__link {
    max-width: none;
    width: 100%;
    flex: none;
  }

  .promo-bar__cta {
    align-self: stretch;
    justify-content: center;
  }

  .app-main {
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
    padding-top: var(--mobile-gap);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .app-section,
  #listy_page,
  #compare_page,
  .compare-results,
  .compare-inputs,
  .panel-grid {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .panel__body {
    padding: 0.85rem;
  }

  .panel__header {
    padding: 0.85rem;
  }

  .form-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .form-row label {
    min-width: 0;
  }

  .form-row--add .form-row__controls {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-add {
    width: 100%;
  }

  .form-textarea {
    min-height: 220px;
  }

  .compare-inputs .form-textarea {
    min-height: 180px;
  }

  .toolbar-group {
    width: 100%;
  }

  .tool-link {
    padding: 0.38rem 0.6rem;
    font-size: 0.78rem;
  }

  .listy_element {
    padding: 0.75rem 0.85rem;
    gap: 0.55rem;
  }

  .listy_element__handle {
    width: 36px;
    min-height: 44px;
    margin-top: 0;
  }

  .listy_element__status {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .app-intro {
    margin-left: 0;
    margin-right: 0;
    width: auto;
    margin-bottom: var(--mobile-gap);
  }

  .app-intro__panel {
    width: 100%;
    padding: 0.85rem;
    border-radius: var(--radius);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: var(--shadow-sm);
  }

  .app-intro__parts {
    gap: var(--mobile-gap);
  }

  .panel {
    width: 100%;
    box-shadow: var(--shadow-sm);
  }

  .panel-grid,
  .compare-inputs,
  .compare-results,
  .diff-panel {
    gap: var(--mobile-gap);
  }

  .compare-inputs,
  .diff-panel {
    margin-bottom: var(--mobile-gap);
  }

  .section-marker {
    margin-bottom: var(--mobile-gap);
  }

  .app-footer {
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
  }

  .tooltips-toggle {
    display: none;
  }

  .app-tooltip {
    display: none !important;
  }
}
