/* Aplikace: navazuje na style.css (stejné barvy a písmo). Mobile-first. */
.app-nav { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.app-nav ul { display: flex; flex-wrap: nowrap; gap: .35rem; list-style: none; margin: 0; padding: .55rem 1.25rem; overflow-x: auto; max-width: 62rem; margin-inline: auto; scrollbar-width: thin; }
.app-nav a { display: block; white-space: nowrap; padding: .4rem .85rem; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; border: 1px solid var(--line); }
.app-nav a:hover { background: #f3ead6; color: var(--ink); }
.app-nav a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.app-note { margin: 0; padding: .5rem 1.25rem; text-align: center; font-size: .88rem; color: var(--ink-soft); background: #fff6e0; }

.app-head { padding-top: 1.6rem; padding-bottom: .2rem; }
.app-head h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
.app-main { padding-top: .6rem; padding-bottom: 2rem; max-width: 46rem; }
.app-card { margin: 0 0 1rem; }
.app-card:hover { transform: none; box-shadow: var(--shadow); }
.app-card.center, .center { text-align: center; justify-content: center; }
.app-main h2 { font-size: 1.35rem; }
.app-main h3 { font-size: 1.05rem; }

.banner { border-radius: var(--radius); padding: .9rem 1.1rem; margin: 0 0 1rem; border: 1px solid var(--line); background: var(--surface); }
.banner h2, .banner h3 { margin: 0 0 .4rem; }
.banner ul { margin: .3rem 0; padding-left: 1.2rem; }
.banner-ok { background: #e8f6ee; border-color: #9fd3b6; }
.banner-soft { background: #eef2fb; border-color: #b9c6ea; }
.banner-warn { background: #fff3cd; border-color: #e3c25a; }
.banner-crisis { background: #fdecec; border-color: #e59a9a; }
.banner-crisis a { font-weight: 800; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: 1rem 0; }
.tile { display: flex; flex-direction: column; gap: .2rem; padding: 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform .2s; }
.tile:hover { transform: translateY(-3px); color: var(--ink); }
.tile span { font-size: .88rem; color: var(--ink-soft); }
.principle { background: linear-gradient(135deg, #fff3d1, #ffe9d6); }

.progress { height: 8px; border-radius: 99px; background: #e7dfcf; overflow: hidden; margin: .3rem 0 1rem; }
.progress span { display: block; height: 100%; background: var(--rainbow); transition: width .3s; }

.chips { border: 0; padding: 0; margin: 1rem 0; min-width: 0; }
.chips legend { font-weight: 600; padding: 0; margin-bottom: .4rem; }
.chip { display: inline-block; margin: 0 .4rem .4rem 0; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: .5rem 1rem; border: 2px solid var(--ink); border-radius: 999px; cursor: pointer; font-weight: 600; background: var(--surface); }
.chip input:checked + span { background: var(--ink); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.btn-sm { min-height: 2.3rem; padding: .35rem .9rem; font-size: .9rem; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; }
.linklike:hover { color: var(--link-hover); }

.ladder { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .6rem; }
.rung { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between; align-items: center; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.rung.is-active { border: 2px solid var(--ink); }
.rung.is-done { opacity: .65; }
.rung-main { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
.rung-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.score { font-weight: 800; color: var(--ink); background: #ffe9b0; border-radius: 99px; padding: .05rem .6rem; font-size: .9rem; }
.tag { font-size: .78rem; font-weight: 700; padding: .1rem .55rem; border-radius: 99px; background: #e8eefb; color: var(--ink); }
.tag-active { background: var(--ink); color: #fff; }
.tag-done { background: #dff3e8; }

.timer { --pct: 0%; width: 13rem; height: 13rem; margin: 1rem auto; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--o) var(--pct), #ece4d3 0); position: relative; }
.timer::before { content: ""; position: absolute; inset: .7rem; border-radius: 50%; background: var(--surface); }
.clock { position: relative; font-size: 2.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.actions.center { justify-content: center; }

.big-actions { display: grid; gap: .8rem; margin: 1rem 0; }
.btn.big { min-height: 4rem; font-size: 1.2rem; }
.btn.resisted { background: linear-gradient(135deg, #bfe9cf, #7fd0a0); }

.bars { display: flex; align-items: flex-end; gap: .5rem; height: 9rem; margin: 1rem 0 .4rem; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .3rem; }
.bar-stack { width: 100%; display: flex; flex-direction: column-reverse; border-radius: 8px 8px 0 0; overflow: hidden; min-height: 2px; background: #ece4d3; }
.seg-res { background: var(--g); }
.seg-did { background: #b7c0d8; }
.bar-label { font-size: .75rem; color: var(--ink-soft); }

.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #e7dfcf; stroke-width: 1; }
.chart .tick { fill: var(--ink-soft); font-size: 10px; }
.chart .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.chart .s-before, .legend .s-before { stroke: var(--b); fill: var(--b); background: var(--b); }
.chart .s-peak, .legend .s-peak { stroke: var(--o); fill: var(--o); background: var(--o); }
.chart .s-after, .legend .s-after { stroke: var(--g); fill: var(--g); background: var(--g); }
.chart .s-acc, .legend .s-acc { stroke: var(--i); fill: var(--i); background: var(--i); }
.chart .s-trust, .legend .s-trust { stroke: #2a7f5b; fill: #2a7f5b; background: #2a7f5b; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem 1rem; padding: 0; margin: .4rem 0 0; font-size: .85rem; color: var(--ink-soft); }
.legend .sw { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; margin-right: .35rem; vertical-align: -1px; }
.chart-wrap { margin: .5rem 0 1rem; }
.log { padding-left: 1.1rem; }
.log li { margin-bottom: .4rem; }

.reading .read-text { font-size: 1.35rem; line-height: 1.6; margin: 1rem 0 1.5rem; }
.suggest { border: 2px solid var(--b); }

.principles { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.principles li { display: flex; gap: 1rem; align-items: flex-start; }
.principles h3 { margin: 0 0 .2rem; }
.principles p { margin: 0; }
.num { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; }

/* SOS */
.sos-btn { position: fixed; right: 1rem; bottom: 1rem; z-index: 30; min-width: 3.4rem; height: 3.4rem; padding: 0 1rem; border-radius: 999px; border: 3px solid #fff; background: #b3261e; color: #fff; font: inherit; font-weight: 800; letter-spacing: .04em; box-shadow: 0 8px 22px rgba(0, 0, 0, .3); cursor: pointer; }
.sos-btn:hover { background: #8f1d17; }
dialog#sos { border: 0; border-radius: 22px; padding: 1.5rem; width: calc(100% - 2rem); max-width: 26rem; color: var(--ink); background: var(--surface); }
dialog#sos::backdrop { background: rgba(27, 42, 65, .6); }
dialog#sos h2 { margin-top: 0; }
dialog#sos ul { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .6rem; }
dialog#sos li a { display: block; padding: .8rem 1rem; border-radius: 14px; border: 2px solid var(--ink); font-weight: 700; text-decoration: none; color: var(--ink); }
dialog#sos li a:hover { background: var(--ink); color: #fff; }

/* Kruh OCD */
.ring-wrap { position: relative; width: min(100%, 24rem); aspect-ratio: 1; margin: 1rem auto; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-weight: 800; color: var(--ink-soft); }
.node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: .15rem; width: 5.6rem; padding: .35rem .2rem; border-radius: 14px; border: 2px solid var(--ink); background: var(--surface); font: inherit; font-size: .78rem; font-weight: 700; color: var(--ink); cursor: pointer; line-height: 1.15; }
.node .n { width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: .75rem; }
.node.on { background: var(--ink); color: #fff; }
.node.on .n { background: var(--sun); color: var(--ink); }

.lessons details { cursor: pointer; }
.lessons summary { font-weight: 700; }
.timeline { padding-left: 1.2rem; }
.timeline li { margin-bottom: .5rem; }
.rep-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: .5rem 0 1rem; }
.rep-table th, .rep-table td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--line); }
.report { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-top: 1rem; }

@media (min-width: 40rem) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .big-actions { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 36rem) { .app-main { padding-bottom: 5rem; } }
@media print {
  .notice, .site-header, .site-footer, .app-nav, .sos-btn, .app-note, .app-head, .no-print, .skip { display: none !important; }
  body { background: #fff; }
  .report { border: 0; padding: 0; }
  .app-main { max-width: none; padding: 0; }
}
