:root {
  color-scheme: light;
  --bg: #f4f0e7;
  --card: #fffaf2;
  --ink: #171411;
  --muted: #766f65;
  --line: #ded5c7;
  --accent: #c99343;
  --accent-dark: #7a5528;
  --wood: #2a2119;
  --soft: #f7efe3;
  --danger: #a83220;
  --danger-soft: #fff0ed;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(201, 147, 67, .18) 0, transparent 34rem),
    linear-gradient(180deg, #eceff2 0, #f5f1e9 44%, #ebe3d7 100%);
  color: var(--ink);
}

.topbar {
  background:
    linear-gradient(135deg, #110f0d 0, #2b2118 58%, #1a1511 100%);
  border-bottom: 4px solid var(--accent);
  color: #fff;
}

.topbar-inner {
  width: min(1320px, calc(100% - 48px));
  min-height: 112px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 18px 0;
}

.logo-wrap img {
  width: 260px;
  max-width: 48vw;
  display: block;
}

.system-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, auto));
  justify-content: flex-end;
  gap: 12px;
  font-size: 13px;
  color: #e8dfd0;
}

.meta-card {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  padding: 11px 14px;
  background: rgba(255,255,255,.075);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  min-width: 170px;
  text-align: right;
}

.meta-card span {
  display: block;
  color: #d6c7ae;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.meta-card strong {
  display: block;
  margin-top: 5px;
  color: #fffaf2;
  font-size: 14px;
  white-space: nowrap;
}

.page {
  width: min(1180px, calc(100% - 40px));
  margin: 42px auto;
}

.card {
  background: rgba(255, 250, 241, .96);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 36px 40px 40px;
  box-shadow: 0 28px 80px rgba(42, 33, 25, 0.16);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), #ead8ba, var(--wood));
}

.brand,
.section-title {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.02;
  letter-spacing: -.035em;
  color: #18130f;
}

h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

h3 {
  margin: 0 0 12px;
}

.lead {
  max-width: 820px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  margin-bottom: 28px;
}

.muted {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  white-space: nowrap;
  border-radius: 999px;
  padding: 10px 15px;
  background: #2a2119;
  color: #fff6e8;
  font-size: 14px;
  font-weight: 800;
}

.alerts {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.alert {
  border: 1px solid #e9b8ad;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 14px;
  padding: 12px 14px;
}

.file-inputs {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.file-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.dropzone {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 210px;
  padding: 28px;
  border: 2px dashed #b69a72;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(185,133,66,.10), transparent),
    var(--soft);
  cursor: pointer;
  text-align: center;
}

.dropzone.compact {
  min-height: 118px;
}

.dropzone span {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}

.dropzone small {
  color: var(--muted);
}

.dropzone input {
  width: min(440px, 100%);
  max-width: 440px;
  overflow: hidden;
  margin: 14px auto 0;
  padding: 10px;
  min-height: 48px;
  text-align: center;
}

button,
.download,
.button-link,
.small-download,
.back {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #c99343, #9e6e32);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  min-height: 48px;
  padding: 0 20px;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(122, 85, 40, .22);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

button:hover,
.download:hover,
.button-link:hover,
.small-download:hover,
.back:hover {
  background: linear-gradient(135deg, #b98238, #765126);
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(122, 85, 40, .28);
}

button.secondary,
.secondary-link,
button.ghost {
  background: #e6dccd;
  color: var(--ink);
  box-shadow: none;
}

button.secondary:hover,
.secondary-link:hover,
button.ghost:hover {
  background: #d8c8b4;
}

button.danger,
button.remove {
  background: linear-gradient(135deg, #b43b28, #8e281b);
  color: #fff;
}

.remove-upload {
  justify-self: start;
  white-space: nowrap;
  min-height: 42px;
  font-size: 14px;
}

.file-list,
.archive-panel {
  margin: 34px 0 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(248, 242, 232, .78);
}

.archive-panel .section-title {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.archive-panel h2 {
  margin-bottom: 0;
}

.file-list ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.pairs,
.results,
.archive-list {
  display: grid;
  gap: 14px;
}

.pair-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(180px, .6fr) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft);
}

label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

label span {
  font-size: 14px;
}

select,
input {
  width: 100%;
  border: 1px solid #cdbcaa;
  border-radius: 12px;
  min-height: 44px;
  padding: 0 12px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 15px;
  min-width: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.download {
  margin: 0;
}

.result,
.archive-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffdf8;
}

.archive-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.archive-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.small-download {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.small-button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.warning {
  display: inline-block;
  margin: 0 0 12px;
  padding: 8px 11px;
  border-radius: 999px;
  background: #fff2df;
  color: #9a5a10;
  font-weight: 900;
}

.status-panel {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(248, 242, 232, .86);
}

.status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.status-head h2 {
  margin-bottom: 0;
}

#status-percent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 54px;
  border-radius: 999px;
  background: #2a2119;
  color: #fff6e8;
  font-size: 22px;
  box-shadow: 0 12px 24px rgba(42, 33, 25, .16);
}

.progress-shell {
  width: 100%;
  height: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2d5c2;
  border: 1px solid #c9b79d;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #c99343, #7a5528);
  transition: width .35s ease;
}

.status-message {
  margin: 16px 0 8px;
  font-size: 18px;
  font-weight: 800;
}

dl {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 14px;
  margin: 0;
}

dt {
  color: var(--muted);
  font-weight: 900;
}

dd {
  margin: 0;
}

.back {
  margin-top: 22px;
}

@media (max-width: 840px) {
  .topbar-inner,
  .brand,
  .section-title,
  .archive-item,
  .file-picker {
    align-items: flex-start;
    flex-direction: column;
  }

  .system-meta {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .meta-card {
    text-align: left;
    width: 100%;
  }

  .pair-row,
  .file-picker {
    grid-template-columns: 1fr;
  }

  .pill {
    justify-self: start;
  }

  .remove-upload {
    width: 100%;
  }

  .status-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.option-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 18px 0 4px;
  cursor: pointer;
}

.option-row input {
  margin-top: 4px;
}

.option-row small {
  display: block;
  color: var(--muted, #6b6259);
  margin-top: 2px;
}

/* ---- Spolecna navigace mezi aplikacemi ---- */
.appnav {
  background: #1a1511;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.appnav-inner {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
}

.appnav a {
  color: #e8dfd0;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.appnav a:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.appnav a.active {
  background: var(--accent);
  color: #2a2119;
}

.appnav .appnav-home {
  margin-right: 6px;
  border-color: rgba(255, 255, 255, .22);
}

@media (max-width: 720px) {
  .appnav-inner {
    width: calc(100% - 28px);
  }

  .appnav a {
    padding: 7px 11px;
    font-size: 12.5px;
  }
}
