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

/* ---------------------------------------------------------------- Návaznost let */
.page-wide {
  width: min(1480px, calc(100% - 40px));
}

.small {
  font-size: 14px;
}

.job-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.job-head h2 {
  margin-bottom: 4px;
  word-break: break-word;
}

.notice-box {
  margin: 0 0 16px;
  border: 1px solid #efd3a6;
  background: #fff7ea;
  border-radius: 14px;
  padding: 10px 14px;
}

.notice-box summary {
  cursor: pointer;
  font-weight: 800;
  color: #8a5a14;
}

.notice-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 14px;
}

.notice {
  border-left: 3px solid var(--accent);
  padding: 6px 10px;
  background: #fffaf2;
  border-radius: 6px;
  font-size: 14px;
}

.app-message {
  position: sticky;
  top: 10px;
  z-index: 5;
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(42, 33, 25, .12);
}

.app-message.info { background: #eef5ea; color: #2f5a1f; border: 1px solid #c8dfbd; }
.app-message.warning { background: #fff2df; color: #8a4f0a; border: 1px solid #efcf9d; }
.app-message.error { background: var(--danger-soft); color: var(--danger); border: 1px solid #e9b8ad; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 22px;
  align-items: start;
}

.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-toolbar input[type="search"] {
  flex: 1 1 260px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.toggle input,
.parts input[type="checkbox"],
.option-row input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  padding: 0;
  accent-color: var(--accent-dark);
}

.groups {
  display: grid;
  gap: 10px;
}

.group {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf8;
  overflow: hidden;
}

.group > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  cursor: pointer;
  background: var(--soft);
  list-style: none;
}

.group > summary::-webkit-details-marker { display: none; }

.group > summary::before {
  content: "▸";
  color: var(--accent-dark);
  font-weight: 900;
  margin-right: 4px;
}

.group[open] > summary::before { content: "▾"; }

.group-title {
  flex: 1 1 180px;
  min-width: 0;
  font-weight: 900;
  font-size: 17px;
}

.group-meta {
  color: var(--muted);
  font-size: 14px;
}

.group.locked > summary {
  opacity: .6;
}

.table-wrap {
  overflow-x: auto;
}

table.parts {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

table.parts th,
table.parts td {
  padding: 8px 12px;
  border-top: 1px solid #eee5d8;
  text-align: left;
  vertical-align: middle;
}

table.parts th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  background: #fffaf2;
}

table.parts .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.parts .check {
  width: 44px;
  text-align: center;
}

table.parts tr.assigned td {
  background: #f3ead9;
}

table.parts tr.other td {
  color: var(--muted);
}

.part-name {
  font-weight: 700;
  word-break: break-word;
}

table.parts small {
  display: block;
}

.badge {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
  box-shadow: none;
  background: #2a2119;
}

.navaznost-panel .panel-sticky {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(248, 242, 232, .9);
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.panel-head h2 {
  margin: 0;
}

.save-state {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.save-state.ok { color: #2f5a1f; }
.save-state.pending { color: #8a5a14; }
.save-state.error { color: var(--danger); }

.new-button {
  width: 100%;
  margin: 14px 0 8px;
  letter-spacing: .04em;
}

.hint {
  margin: 0 0 14px;
  line-height: 1.45;
}

.navaznosti {
  display: grid;
  gap: 12px;
}

.nav-card {
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fffdf8;
  padding: 12px 14px;
}

.nav-card.active {
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(122, 85, 40, .18);
}

.nav-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.nav-title {
  min-height: 36px;
  padding: 0 12px;
  font-size: 15px;
  background: #e6dccd;
  color: var(--ink);
  box-shadow: none;
  gap: 8px;
}

.nav-card.active .nav-title {
  background: linear-gradient(135deg, #c99343, #9e6e32);
  color: #fff;
}

.nav-title .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  opacity: .6;
}

.nav-material {
  margin: 8px 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.members {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 4px;
}

.members li {
  font-size: 14px;
}

.members li > * {
  vertical-align: middle;
}

.member-name {
  font-weight: 700;
  word-break: break-word;
}

.member-size {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
  white-space: nowrap;
}

.member-actions {
  display: inline-flex;
  gap: 2px;
  margin-left: 4px;
}

button.icon {
  min-height: 26px;
  width: 26px;
  padding: 0;
  font-size: 13px;
  border-radius: 8px;
  background: #e6dccd;
  color: var(--ink);
  box-shadow: none;
}

button.icon:hover {
  transform: none;
  background: #d8c8b4;
}

button.icon:disabled {
  opacity: .35;
  cursor: default;
}

button.danger-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #1f6feb;
  outline-offset: 2px;
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.preview-wrap {
  margin-top: 24px;
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table.preview {
  border-collapse: collapse;
  font-size: 13px;
  min-width: 100%;
}

table.preview th,
table.preview td {
  border: 1px solid #eee5d8;
  padding: 5px 8px;
  white-space: nowrap;
}

table.preview th {
  position: sticky;
  top: 0;
  background: #f3ead9;
}

table.preview tr.is-header td {
  background: #fff2df;
  font-weight: 800;
}

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .navaznost-panel .panel-sticky {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .page,
  .page-wide {
    width: calc(100% - 24px);
    margin: 16px auto;
  }

  .card {
    padding: 22px 16px;
  }

  .topbar-inner {
    width: calc(100% - 24px);
    flex-wrap: wrap;
    min-height: 0;
  }

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

  .meta-card {
    min-width: 0;
  }

  .brand {
    flex-direction: column;
  }

  table.parts th,
  table.parts td {
    padding: 7px 8px;
  }
}

.sources-box {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  padding: 10px 14px;
}

.sources-box summary {
  cursor: pointer;
  font-weight: 800;
}

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

.source-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-top: 1px solid #eee5d8;
}

.source-list small {
  display: block;
}

.add-files {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid #eee5d8;
}

.add-files input[type="file"] {
  flex: 1 1 260px;
  padding: 8px;
}

.part-source {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.alert.alert-ok {
  border-color: #c8dfbd;
  background: #eef5ea;
  color: #2f5a1f;
}

/* ---------------------------------------------------------------- skladba navaznosti */
.composer {
  margin: 0 0 20px;
  padding: 18px 20px;
  border: 2px solid var(--accent);
  border-radius: 20px;
  background: #fffdf8;
  box-shadow: 0 12px 30px rgba(122, 85, 40, .12);
}

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

.composer-head h3 {
  margin: 0;
  font-size: 20px;
}

.size-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 8px 14px;
  background: #2a2119;
  color: #fff6e8;
  font-weight: 800;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.composer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.formula-field {
  flex: 1 1 240px;
}

.formula-field input {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 17px;
  letter-spacing: .02em;
}

.kerf-field {
  flex: 0 0 120px;
}

.formula-status {
  margin: 8px 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.formula-status.error {
  color: var(--danger);
  font-weight: 800;
}

.tree-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 6px 0 12px;
}

.tree {
  overflow-x: auto;
  padding: 4px 0 10px;
}

.tree-group {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border: 1.5px dashed #b69a72;
  border-radius: 12px;
  background: rgba(247, 239, 227, .7);
  vertical-align: top;
}

.tree-group.selected {
  border-style: solid;
  border-color: #1f6feb;
  background: #eaf2ff;
}

.tree-children {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.tree-group.col > .tree-children {
  flex-direction: column;
}

.group-label {
  align-self: flex-start;
  min-height: 24px;
  padding: 0 10px;
  font-size: 12px;
  background: #e6dccd;
  color: var(--accent-dark);
  box-shadow: none;
}

.tree-group.selected > .group-label {
  background: #1f6feb;
  color: #fff;
}

button.leaf {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "n name" "n size";
  column-gap: 8px;
  row-gap: 1px;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px 6px 6px;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  border: 1.5px solid #cdbcaa;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

button.leaf:hover {
  background: #fff7ea;
  transform: none;
}

button.leaf.selected {
  border-color: #1f6feb;
  background: #eaf2ff;
  box-shadow: 0 0 0 2px rgba(31, 111, 235, .25);
}

.leaf-n {
  grid-area: n;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2a2119;
  color: #fff;
  font-weight: 900;
}

.leaf-name { grid-area: name; }

.leaf-size {
  grid-area: size;
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.svg-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 6px;
}

.layout-svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.layout-svg .outline-rect {
  fill: none;
  stroke: #2a2119;
  stroke-width: 1.5;
}

.layout-svg .part-rect {
  fill: #ead8ba;
  stroke: #2a2119;
  stroke-width: 1.2;
}

.layout-svg .waste-rect {
  fill: url(#waste-hatch);
  stroke: #b69a72;
  stroke-width: .8;
}

.layout-svg .hatch {
  stroke: #c9b79e;
  stroke-width: 2;
}

.layout-svg .grain {
  stroke: #b43b28;
  stroke-width: 2;
}

.layout-svg .grain.unknown {
  stroke-dasharray: 5 4;
  opacity: .7;
}

.layout-svg .grain-head {
  fill: #b43b28;
}

.layout-svg .part-label {
  fill: #18130f;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: "Segoe UI", Arial, sans-serif;
}

.layout-svg .part-sub,
.layout-svg .dim-label {
  fill: #5c554c;
  text-anchor: middle;
  dominant-baseline: middle;
  font-size: 12px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

.nav-size {
  margin: -2px 0 8px;
  font-size: 13px;
}

.nav-size code {
  font-family: ui-monospace, Consolas, monospace;
  background: #f3ead9;
  border-radius: 6px;
  padding: 1px 5px;
}

.alert.alert-warning {
  border-color: #efcf9d;
  background: #fff2df;
  color: #8a4f0a;
}

.format-note {
  margin: 12px 0 0;
}

#ptx-warning {
  margin-top: 12px;
}

/* ---------------------------------------------------------------- formaty desek */
.format-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 18px;
  border-top: 1px solid #eee5d8;
  background: #fffaf2;
  font-size: 14px;
}

.format-bar.editing {
  display: grid;
  gap: 10px;
}

.format-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.format-fields input,
.format-fields select {
  min-height: 38px;
}

.format-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.custom-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: #2a2119;
  color: #fff6e8;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}

.fit {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 800;
}

.fit.ok, .fit-ok { color: #2f5a1f; }
.fit.bad, .fit-bad { color: var(--danger); }

.plain-list {
  margin: 6px 0 0;
  padding-left: 20px;
}

table.parts tr.row-nav td {
  background: #ead8ba;
  font-weight: 700;
}

table.parts tr.row-in-nav td {
  background: #f7efe3;
}

.vykres-item {
  margin: 14px 0 18px;
}

.vykres-item h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

/* ---- 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;
  }
}
