:root {
  color-scheme: light;
  --bg: #f6f1e8;
  --card: #fffaf1;
  --card-strong: #ffffff;
  --text: #181510;
  --muted: #776f64;
  --line: #e6dccd;
  --accent: #f08a24;
  --accent-strong: #d96d09;
  --positive: #207a4b;
  --danger: #b33434;
  --shadow: 0 24px 70px rgba(67, 47, 25, 0.13);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 6%, rgba(240, 138, 36, 0.2), transparent 28rem),
    linear-gradient(180deg, #fbf6ee 0%, var(--bg) 48%, #eee5d8 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
.drop-zone:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(240, 138, 36, 0.7);
  outline-offset: 4px;
}

.site-header,
.app-shell,
.footer {
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 10px;
}

.site-header p,
.footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--text);
  font-weight: 850;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 35%, #fff7de 0 16%, transparent 17%),
    conic-gradient(from 35deg, #f6c36b, #ff6f59, #7658ff, #75d99f, #f6c36b);
  box-shadow: 0 8px 26px rgba(240, 138, 36, 0.3);
}

.app-shell {
  padding: 16px 0 28px;
}

.hero-card {
  padding: clamp(20px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 250, 241, 0.88);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 680px;
  margin-bottom: 16px;
  font-size: clamp(2.55rem, 12vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
}

h2 {
  margin-bottom: 6px;
  font-size: clamp(1.2rem, 4vw, 1.7rem);
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: 650px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.drop-zone {
  position: relative;
  display: grid;
  min-height: 240px;
  place-items: center;
  padding: 28px 18px;
  border: 2px dashed rgba(240, 138, 36, 0.55);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(240, 138, 36, 0.12), rgba(117, 217, 159, 0.08)),
    var(--card-strong);
  text-align: center;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragover {
  border-color: var(--accent);
  background: #fff6e7;
  transform: translateY(-1px);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  width: 82px;
  height: 82px;
  margin-bottom: 18px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, transparent 58%, rgba(32, 122, 75, 0.35) 59%),
    radial-gradient(circle at 35% 35%, rgba(240, 138, 36, 0.95) 0 12%, transparent 13%),
    #f3eadc;
  box-shadow: inset 0 0 0 1px rgba(24, 21, 16, 0.08);
}

.drop-title {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #ffbc73);
  color: #231303;
  font-size: 1.08rem;
  font-weight: 850;
  box-shadow: 0 16px 32px rgba(240, 138, 36, 0.22);
}

.drop-help {
  display: block;
  max-width: 420px;
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.status-card {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card-strong);
}

.yandex-card {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(70, 101, 180, 0.2);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(236, 243, 255, 0.9), rgba(255, 255, 255, 0.66));
}

.yandex-heading,
.yandex-path-row,
.yandex-batch-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.yandex-heading h2 {
  margin-bottom: 0;
}

.cloud-badge {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 999px;
  background: #e9edf7;
  color: #52607d;
  font-size: 0.84rem;
  font-weight: 850;
}

.cloud-badge[data-status="connected"] {
  background: rgba(32, 122, 75, 0.12);
  color: var(--positive);
}

.cloud-status {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.yandex-actions {
  margin-top: 14px;
}

.yandex-browser {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.yandex-path-row,
.yandex-batch-row {
  padding: 10px;
  border: 1px solid rgba(70, 101, 180, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.yandex-batch-row {
  padding: 0;
  border: 0;
  background: transparent;
}

.yandex-path-row strong {
  min-width: 0;
  overflow: hidden;
  color: #30394d;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yandex-list {
  display: grid;
  max-height: 430px;
  gap: 10px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.yandex-item {
  border: 1px solid rgba(70, 101, 180, 0.12);
  border-radius: 18px;
  background: var(--card-strong);
}

.yandex-entry {
  display: flex;
  width: 100%;
  min-height: 68px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.yandex-folder {
  cursor: pointer;
}

.yandex-item input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.yandex-entry-details,
.yandex-entry-title {
  min-width: 0;
}

.yandex-entry-details {
  display: grid;
  gap: 3px;
}

.yandex-entry-title {
  overflow: hidden;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yandex-entry-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.yandex-folder-icon,
.yandex-thumb {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.yandex-folder-icon {
  position: relative;
  background: linear-gradient(135deg, #ffcc76, #f08a24);
  box-shadow: inset 0 -12px 20px rgba(166, 90, 8, 0.18);
}

.yandex-folder-icon::before {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 20px;
  height: 8px;
  border-radius: 7px 7px 0 0;
  background: #ffe0a3;
  content: "";
}

.yandex-thumb {
  object-fit: cover;
  background: #edf1f8;
}

.yandex-thumb-empty {
  position: relative;
  border: 1px solid rgba(70, 101, 180, 0.16);
  background:
    linear-gradient(135deg, transparent 56%, rgba(32, 122, 75, 0.26) 57%),
    radial-gradient(circle at 36% 36%, rgba(240, 138, 36, 0.9) 0 12%, transparent 13%),
    #eef3fb;
}

.yandex-main-action {
  min-height: 58px;
  font-size: 1.02rem;
}

.status-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

#status-detail {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

#status-count {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 999px;
  background: #f2eadf;
  color: var(--muted);
  font-size: 0.9rem;
}

.progress-track {
  height: 9px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee3d5;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #75d99f);
  transition: width 180ms ease;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

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

.button-primary {
  background: var(--text);
  color: #fffaf1;
}

.button-secondary {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.advanced-panel,
.results-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.54);
}

summary {
  min-height: 52px;
  padding: 15px 16px;
  cursor: pointer;
  color: var(--text);
  font-weight: 820;
}

.control-grid {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.field span {
  font-size: 0.9rem;
}

select,
input[type="range"] {
  width: 100%;
}

select {
  min-height: 50px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffaf1;
  color: var(--text);
}

input[type="range"] {
  accent-color: var(--accent);
}

output {
  color: var(--text);
  font-weight: 800;
}

.support-note,
.settings-note {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
  line-height: 1.5;
}

.settings-note {
  font-size: 0.9rem;
}

.result-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 16px 16px;
  list-style: none;
}

.result-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: var(--card-strong);
}

.result-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.result-item a {
  color: var(--accent-strong);
  font-weight: 850;
  text-decoration: none;
}

.result-item[data-status="error"] {
  border: 1px solid rgba(179, 52, 52, 0.2);
}

.result-item[data-status="error"] p {
  color: var(--danger);
}

.footer {
  padding: 0 0 26px;
  text-align: center;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-card {
    padding: 18px;
  }

  .drop-zone {
    min-height: 220px;
  }

  .status-row,
  .yandex-heading,
  .yandex-path-row,
  .yandex-batch-row,
  .result-item {
    grid-template-columns: 1fr;
  }

  .status-row,
  .yandex-heading,
  .yandex-path-row,
  .yandex-batch-row {
    display: grid;
  }

  #status-count {
    justify-self: start;
  }

  .action-row .button,
  .yandex-batch-row .button {
    width: 100%;
  }

  .yandex-path-row strong {
    order: -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
