/* Junkbox.tools — Workout Generator styles (shared by RU + EN pages) */
:root {
  --bg: #111214; --surface: #1a1b1e; --surface-2: #23252a; --border: #2a2c30; --border-2: #3a3d42;
  --text: #f2f2ef; --dim: #9a9c9f; --shot: #2a2c30;
  --accent: #c8f24a; --on-accent: #111214;
  --ink: #c8f24a;                     /* accent used as text/lines */
  --dose-bg: rgba(200, 242, 74, .12); --dose-fg: #c8f24a;
  --strong: #c8f24a; --strong-fg: #111214;   /* main buttons */
  --done-bg: #c8f24a; --done-fg: #111214;
  --mark: rgba(200, 242, 74, .35);
  --shadow: none;
  --ui: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f6f3; --surface: #ffffff; --surface-2: #f0efea; --border: #e7e6e1; --border-2: #d6d5cf;
    --text: #111214; --dim: #6b6d70; --shot: #ecebe6;
    --ink: #111214;
    --dose-bg: #c8f24a; --dose-fg: #111214;
    --strong: #111214; --strong-fg: #ffffff;
    --done-bg: #111214; --done-fg: #c8f24a;
    --mark: #c8f24a;
    --shadow: 0 6px 20px rgba(17, 18, 20, .06);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f6f3; --surface: #ffffff; --surface-2: #f0efea; --border: #e7e6e1; --border-2: #d6d5cf;
  --text: #111214; --dim: #6b6d70; --shot: #ecebe6;
  --ink: #111214;
  --dose-bg: #c8f24a; --dose-fg: #111214;
  --strong: #111214; --strong-fg: #ffffff;
  --done-bg: #111214; --done-fg: #c8f24a;
  --mark: #c8f24a;
  --shadow: 0 6px 20px rgba(17, 18, 20, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--ui); min-height: 100vh; padding: 0 16px 120px;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font-family: inherit; }
.wrap { max-width: 720px; margin: 0 auto; }

h1 { font-weight: 800; font-size: clamp(26px, 7vw, 34px); margin: 8px 0 6px; letter-spacing: -.02em; line-height: 1.08; }
.sub { color: var(--dim); font-size: 14px; margin-bottom: 18px; line-height: 1.5; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--dim); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.field { margin-top: 16px; }
.field:first-child { margin-top: 0; }

/* goal chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 999px; padding: 0 14px; height: 40px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.chip.on { background: var(--strong); border-color: var(--strong); color: var(--strong-fg); }

/* segmented controls */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; }
.seg button {
  height: 40px; border: none; border-radius: 10px; background: transparent; color: var(--dim);
  font-size: 14px; font-weight: 600; cursor: pointer; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }

.grid4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; margin-top: 16px; }
@media (min-width: 600px) { .grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grid4 .lbl { margin-bottom: 6px; }
select, input[type=number] {
  width: 100%; height: 48px; border: 1px solid var(--border); border-radius: 14px; padding: 0 12px;
  background: var(--surface-2); color: var(--text); font-size: 15px; font-weight: 600; appearance: none; -webkit-appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px;
}
.grid4 .seg button { height: 38px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  height: 54px; border-radius: 16px; font-size: 16px; font-weight: 700; cursor: pointer; border: none;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--strong); color: var(--strong-fg); margin-top: 18px; }
.btn-sec { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); margin-top: 8px; }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.iconBtn {
  width: 44px; height: 44px; flex: none; border-radius: 22px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.iconBtn svg { width: 20px; height: 20px; }

/* plan summary */
.sum h2 { margin: 0 0 14px; font-size: 26px; line-height: 1.12; font-weight: 800; letter-spacing: -.02em; }
.sum h2 .hl { background: linear-gradient(transparent 58%, var(--mark) 58%); padding: 0 2px; }
.sumTop { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.stat b { display: block; font-size: 20px; font-weight: 700; }
.stat b small { font-size: 13px; font-weight: 500; }
.stat span { font-size: 12px; color: var(--dim); }
.params { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.params span { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; color: var(--dim); }
.note { margin: 12px 0 0; color: var(--dim); font-size: 13.5px; line-height: 1.5; }
.warn { color: #f59e0b; }
:root[data-theme="light"] .warn { color: #b45309; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .warn { color: #b45309; } }

/* blocks */
.block { margin: 22px 0 0; }
.blockHead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 4px 10px; }
.blockHead h3 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.blockHead span { font-size: 13px; color: var(--dim); font-weight: 600; white-space: nowrap; }
.block > .note { margin: -4px 4px 12px; }
.found { font-size: 14px; color: var(--dim); margin: 6px 4px 12px; line-height: 1.5; }
.found b { color: var(--text); }

/* exercise card */
.ex { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; margin-bottom: 10px; box-shadow: var(--shadow); }
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; background: var(--surface); }
.shot { position: relative; background: var(--shot); aspect-ratio: 3 / 2; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.shot.noimg img { visibility: hidden; }
.shot span {
  position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 6px;
  background: var(--surface); color: var(--text); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.ex:not(.open) .shots, .ex:not(.open) .exBody { display: none; }

.exHead {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border: none; background: transparent;
  color: inherit; text-align: left; cursor: pointer;
}
.ex.open .exHead { padding: 14px 16px 4px; align-items: flex-start; }
.thumb { width: 64px; height: 64px; flex: none; border-radius: 14px; background: var(--shot); overflow: hidden; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex.open .thumb { display: none; }
.exTitle { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.kicker { font-size: 12px; font-weight: 600; color: var(--dim); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exName { font-size: 17px; font-weight: 700; line-height: 1.25; }
.ex.open .exName { font-size: 21px; letter-spacing: -.01em; }
.orig { font-size: 12px; color: var(--dim); }
.dose { flex: none; font-size: 17px; font-weight: 800; padding: 5px 9px; border-radius: 9px; background: var(--dose-bg); color: var(--dose-fg); white-space: nowrap; }
.ex.open .dose { font-size: 22px; padding: 6px 10px; }
.ex.done .exName { text-decoration: line-through; color: var(--dim); }
.ex.done .thumb::after {
  content: ""; position: absolute; inset: 0; background: rgba(17, 18, 20, .55)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24' fill='none' stroke='%23c8f24a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center no-repeat;
}

.exBody { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--dim); }
.facts b { color: var(--text); font-weight: 600; }
.cue { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); }
.ctrls { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.dots { display: flex; gap: 8px; flex-wrap: wrap; }
.dot {
  width: 36px; height: 36px; border-radius: 18px; border: 2px solid var(--border-2); background: transparent;
  color: var(--dim); font-size: 13px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.dot[aria-pressed="true"] { background: var(--done-bg); border-color: var(--done-bg); color: var(--done-fg); }
.dot svg { width: 16px; height: 16px; }
.swap {
  height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.swap svg { width: 14px; height: 14px; }
.tech { font-size: 13.5px; border-top: 1px solid var(--border); padding-top: 10px; }
.tech summary { cursor: pointer; color: var(--text); font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 28px; }
.tech summary::-webkit-details-marker { display: none; }
.tech summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--dim); border-bottom: 2px solid var(--dim); transform: rotate(45deg) translateY(-3px); }
.tech[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.tech ol { margin: 8px 0 0; padding-left: 20px; color: var(--dim); line-height: 1.55; }
.techNote { font-size: 11px; color: var(--dim); margin-top: 6px; }
#moreWrap .btn { margin-top: 4px; }

/* sticky start bar */
.startBar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 24px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 62%, transparent);
  pointer-events: none;
}
.startBar .in { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; pointer-events: auto; }
.startBar .btn { margin: 0; height: 56px; border-radius: 18px; font-size: 17px; }
.startBar .btn svg path { fill: currentColor; }
:root[data-theme="light"] .startBar .btn-primary svg path { fill: var(--accent); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .startBar .btn-primary svg path { fill: var(--accent); } }
.startBar .iconBtn { width: 56px; height: 56px; border-radius: 18px; background: var(--surface); }

/* workout mode */
.wm { position: fixed; inset: 0; z-index: 1000; background: var(--bg); color: var(--text); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.wm[hidden] { display: none; }
.wmIn {
  max-width: 520px; min-height: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 16px;
  padding: calc(14px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
}
.wmTop { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wmTop .meta { font-size: 14px; font-weight: 600; color: var(--dim); text-align: center; font-variant-numeric: tabular-nums; }
.segs { display: flex; gap: 4px; }
.segs i { flex: 1; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; display: block; }
.segs i b { display: block; height: 100%; background: var(--ink); }
.wmShot { position: relative; border-radius: 24px; background: var(--shot); aspect-ratio: 3 / 2; overflow: hidden; flex: none; }
.wmShot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .25s; }
.wmShot .tog { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.tog button { height: 30px; padding: 0 12px; border: none; border-radius: 8px; background: transparent; color: var(--dim); font-size: 12px; font-weight: 700; cursor: pointer; }
.tog button.on { background: var(--strong); color: var(--strong-fg); }
.wmKicker { font-size: 13px; font-weight: 600; color: var(--dim); letter-spacing: .06em; text-transform: uppercase; }
.wmName { margin: 4px 0 0; font-size: clamp(26px, 7.5vw, 32px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.wmCue { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: var(--dim); }
.wmCard {
  border-radius: 24px; background: var(--surface); border: 1px solid var(--border); padding: 16px;
  display: flex; align-items: center; gap: 18px; min-height: 164px;
}
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { display: block; }
.ring .bg { stroke: var(--border); }
.ring .fg { stroke: var(--ink); transition: stroke-dashoffset .25s linear; }
.ring .c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .c b { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ring .c span { font-size: 12px; color: var(--dim); }
.wmInfo { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wmInfo .small { font-size: 14px; color: var(--dim); }
.wmInfo .big { font-size: 40px; font-weight: 800; line-height: 1.05; }
.wmInfo .big .hl { display: inline-block; line-height: 1; background: linear-gradient(transparent 62%, var(--mark) 62%); padding: 0 3px; }
.wmInfo .big small { font-size: 16px; font-weight: 600; }
.wmInfo .w { font-size: 14px; color: var(--text); }
.wmInfo .row { display: flex; gap: 8px; }
.wmInfo .row button { height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.wmSpacer { flex: 1; }
.wmBottom { display: flex; gap: 10px; align-items: center; }
.wmBottom .btn { height: 60px; border-radius: 20px; font-size: 18px; font-weight: 800; flex: 1; }
.wmBottom .iconBtn { width: 52px; height: 60px; border-radius: 18px; }
.wmBottom .iconBtn:disabled { opacity: .35; cursor: default; }
.wmDone { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 40px 0; }
.wmDone .badge { width: 96px; height: 96px; border-radius: 48px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }
.wmDone .badge svg { width: 44px; height: 44px; }
.wmDone h2 { margin: 8px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.wmDone p { margin: 0; color: var(--dim); font-size: 16px; }

/* history */
.hist[hidden] { display: none; }
.histHead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.histHead .lbl { margin: 0; }
.histClear { border: none; background: none; color: var(--dim); font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 8px 0; min-height: 36px; }
.histList { list-style: none; margin: 6px 0 0; padding: 0; }
.histList li { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14px; }
.histList li:first-child { border-top: none; }
.histList b { flex: none; min-width: 92px; font-weight: 700; }
.histList span { flex: 1; min-width: 0; }
.histList em { font-style: normal; color: var(--dim); font-size: 13px; white-space: nowrap; }
.histTip { color: var(--text); margin-top: 8px; }
.histNote { margin: 8px 0 0; font-size: 12px; color: var(--dim); }

footer { text-align: center; font-size: 12px; color: var(--dim); margin-top: 30px; line-height: 1.6; }
footer a { color: var(--dim); }
#plan, #out { scroll-margin-top: 70px; }
@media (prefers-reduced-motion: reduce) { .ring .fg, .wmShot img { transition: none; } }
