:root {
  color-scheme:dark;
  --bg:#151615;
  --side:#101110;
  --surface:#1e201e;
  --line:#333532;
  --text:#f3f2ea;
  --muted:#a4a69e;
  --accent:#ff7847;
  --soft:#292c28;
  --radius:17px;
  font-family:"Inter","Segoe UI",Arial,sans-serif;
  color:var(--text);
  background:var(--bg);
  font-size:15px;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
}

[hidden] { display:none !important; }
main.access-screen {
  display:grid;
  min-height:100vh;
  min-height:100dvh;
  width:100%;
  max-width:none;
  place-items:center;
  padding:24px;
}
.access-card {
  width:min(100%, 370px);
  padding:32px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--surface);
}
.access-card .brand { padding:0; }
.access-card h1 { margin:32px 0 22px; font-size:1.8rem; }
.access-card form { display:grid; gap:10px; }
.access-card label { color:var(--muted); }
.access-card input { width:100%; min-height:46px; padding:10px; color:var(--text); background:var(--bg); border:1px solid var(--line); border-radius:8px; }
.access-card input:focus { outline:2px solid var(--accent); }
.access-card .primary { margin-top:8px; }
#access-message { line-height:1.5; color:var(--muted); margin:14px 0 0; }
#access-message:empty { display:none; }
#continue-local { margin-top:12px; padding:4px 0; }
.account-actions { display:flex; align-items:center; gap:12px; }
.logout { min-height:42px; padding:4px; font-size:.86rem; color:var(--muted); }
@media(max-width:420px) { .account-actions { gap:4px; } }

a {
  color:inherit;
  text-decoration:none;
}

button,input,select,textarea {
  font:inherit;
}

button {
  cursor:pointer;
  color:inherit;
}

button,a,input,select,textarea {
  touch-action:manipulation;
}

button {
  border:0;
  background:transparent;
}

button:focus-visible,a:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:3px;
}

button:hover {
  filter:brightness(1.13);
}

.layout {
  min-height:100vh;
  display:grid;
  grid-template-columns:210px minmax(0,1fr);
}

aside {
  position:sticky;
  top:0;
  height:100vh;
  background:var(--side);
  border-right:1px solid var(--line);
  padding:34px 18px;
  display:flex;
  flex-direction:column;
}

.brand {
  display:flex;
  align-items:center;
  font-size:28px;
  letter-spacing:-1.5px;
  font-weight:900;
  padding:0 7px;
  line-height:1;
}

.branddot {
  color:var(--accent);
}

.brandmark {
  display:inline-flex;
  align-items:center;
  gap:3px;
  transform:skew(-16deg);
  margin:0 12px 0 1px;
}

.brandmark i {
  width:5px;
  height:23px;
  background:var(--accent);
  border-radius:1px;
}

.brandmark i:nth-child(2) {
  height:30px;
}

.sidecaption {
  font-size:12px;
  color:var(--muted);
  margin:10px 0 50px 8px;
}

.sidefoot {
  margin-top:auto;
  color:var(--muted);
  border-top:1px solid var(--line);
  padding:20px 9px 0;
  font-size:12px;
}

.signal,.herolabel i {
  display:inline-block;
  background:var(--accent);
  width:7px;
  height:7px;
  border-radius:50%;
  margin-right:8px;
}

nav a {
  display:flex;
  align-items:center;
  gap:13px;
  color:#aaa;
  font-weight:550;
  padding:14px 15px;
  border-radius:9px;
  margin-bottom:5px;
}

nav a[aria-current] {
  background:#34271f;
  color:#ff966b;
}

main {
  max-width:1610px;
  width:100%;
  margin:auto;
  padding:0 clamp(20px,3.8vw,68px) 45px;
  align-self:start;
  margin-top:0;
}

header {
  height:70px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  gap:8px;
}

.crumb {
  font-size:13px;
  color:var(--muted);
}

.crumb strong {
  font-weight:500;
  color:var(--text);
}

.crumb span {
  margin:0 10px;
  color:#666;
}

.status {
  display:flex;
  align-items:center;
  gap:8px;
  background:#242622;
  border:1px solid #343831;
  border-radius:25px;
  padding:7px 12px;
  color:#c4c9be;
  font-size:12px;
}

.status i {
  width:6px;
  height:6px;
  border-radius:50%;
  background:#d4ae75;
}

.status.online i {
  background:#a4c794;
}

.pageheading {
  padding:33px 0 24px;
}

.kicker,.herolabel {
  text-transform:uppercase;
  font-size:10px;
  font-weight:700;
  letter-spacing:1.7px;
}

.kicker {
  color:var(--muted);
  margin-bottom:7px;
}

h1,h2,h3,p {
  margin:0;
}

h1 {
  font-size:clamp(34px,3.7vw,55px);
  letter-spacing:-.055em;
  line-height:1.05;
}

h2 {
  font-size:23px;
  letter-spacing:-.04em;
  line-height:1.15;
}

h3 {
  font-size:16px;
  font-weight:650;
  letter-spacing:-.02em;
}

small,.quiet,.period {
  color:var(--muted);
}

small,.quiet {
  font-size:12px;
}

.dashboard,.worklayout {
  display:grid;
  grid-template-columns:minmax(0,1.94fr) minmax(235px,1fr);
  gap:18px;
}

.primarycol,.sidecol {
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:18px;
}

.hero {
  isolation:isolate;
  position:relative;
  overflow:hidden;
  min-height:255px;
  display:flex;
  align-items:center;
  border-radius:var(--radius);
  border:1px solid #534337;
  background:#27241f url(/img/hero.webp) 69% center/cover no-repeat;
}

.hero:before {
  content:"";
  position:absolute;
  z-index:-1;
  inset:0;
  background:linear-gradient(90deg,rgba(15,16,13,.90),rgba(20,19,15,.60) 45%,transparent 78%);
}

.herocontent {
  padding:28px clamp(18px,2.4vw,38px);
}

.herolabel {
  color:#ffab81;
  display:flex;
  align-items:center;
}

.hero h2 {
  font-size:clamp(35px,3.65vw,61px);
  letter-spacing:-.065em;
  margin:15px 0;
}

.hero em {
  color:var(--accent);
  font-style:normal;
}

.herometa {
  display:flex;
  gap:16px;
  align-items:center;
  flex-wrap:wrap;
  color:#e0ddd3;
  font-size:13px;
}

.herometa span {
  display:flex;
  align-items:center;
  gap:6px;
}

.herometa svg {
  color:#c8b6a5;
}

.primary,.soft,.tiny {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  border-radius:9px;
  padding:12px 17px;
  min-height:44px;
  font-weight:650;
  font-size:14px;
}

.primary {
  background:var(--accent);
  color:#20150f;
}

.arrowbtn {
  margin-top:25px;
  flex-direction:row-reverse;
  gap:22px;
}

.soft,.tiny {
  background:var(--soft);
  border:1px solid #3b3d38;
}

.full {
  width:100%;
}

.panel {
  border-radius:var(--radius);
  background:var(--surface);
  border:1px solid var(--line);
  padding:22px;
  min-width:0;
}

.panelhead,.cardtitle,.linefoot,.histrow,.exrow,.rest,.setrow,.exports {
  display:flex;
  align-items:center;
}

.panelhead {
  justify-content:space-between;
  gap:10px;
  margin-bottom:18px;
}

.cardtitle {
  gap:11px;
}

.cardtitle svg {
  color:var(--accent);
}

.weightnum {
  font-size:48px;
  font-weight:680;
  letter-spacing:-.065em;
  margin:18px 0 4px;
  line-height:1;
}

.weightnum small {
  font-size:17px;
  letter-spacing:0;
  font-weight:430;
}

.period {
  font-size:12px;
}

.weight .soft {
  margin-top:20px;
}

.week .period {
  margin-top:9px;
}

.weekdays {
  display:grid;
  grid-template-columns:repeat(7,1fr);
  margin:20px 0;
  gap:2px;
}

.weekdays div {
  text-align:center;
}

.weekdays small {
  font-size:10px;
  display:block;
  margin-bottom:6px;
}

.weekdays b {
  display:inline-grid;
  place-items:center;
  font-weight:550;
  font-size:12px;
  width:27px;
  height:29px;
  border-radius:8px;
}

.today b {
  border:1px solid var(--accent);
  color:var(--accent);
}

.weekdays .trained {
  background:var(--accent);
  color:#191713;
}

.linefoot {
  border-top:1px solid var(--line);
  padding-top:13px;
  justify-content:space-between;
  font-size:12px;
  color:var(--muted);
}

.linefoot strong {
  color:var(--text);
}

.plans {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
}

.planoption {
  background:#252724;
  border:1px solid #383a36;
  border-radius:11px;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:7px;
  text-align:left;
  padding:13px 12px;
}

.planoption b,.planbadge {
  width:29px;
  height:29px;
  display:grid;
  place-items:center;
  border-radius:7px;
  background:#363932;
  font-size:15px;
}

.planoption span {
  order:1;
  width:100%;
  font-size:13px;
  font-weight:650;
}

.planoption small,.histrow small,.empty small {
  display:block;
  margin-top:5px;
  font-weight:400;
}

.nextplan {
  border-color:#89553a;
  background:#302720;
}

.nextplan b,.planbadge {
  background:#593923;
  color:#ffa274;
}

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

.textlink,.backlink {
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:#ffa47b;
  font-size:13px;
}

.empty,.histrow {
  display:flex;
  align-items:center;
  gap:14px;
}

.empty {
  color:#d0d0c8;
  padding:10px 0;
  font-size:14px;
}

.empty>svg {
  color:#8c8d82;
}

.histrow {
  padding:13px 0;
  border-top:1px solid var(--line);
}

.histrow>svg {
  margin-left:auto;
}

.narrow {
  max-width:740px;
}

.worklayout .controls {
  position:sticky;
  top:14px;
}

.exercise+.exercise,.detailrow {
  border-top:1px solid var(--line);
}

.exrow {
  gap:14px;
  padding:12px 0;
}

.exrow img {
  width:75px;
  height:55px;
  object-fit:contain;
  background:#272925;
  border-radius:9px;
}

.exname {
  flex:1;
}

.exname h3 {
  margin-bottom:4px;
}

.square,.setrow button {
  display:grid;
  place-items:center;
  background:var(--soft);
  border-radius:8px;
  width:42px;
  height:42px;
}

.setrow {
  font-size:13px;
  gap:10px;
  justify-content:space-between;
  padding:4px 0;
}

.setrow button {
  width:40px;
  height:40px;
}

.actual-count {
  margin:18px 0 5px;
}
.actual-count b {
  color:var(--accent);
  font-size:1.45em;
  font-variant-numeric:tabular-nums;
}
.tech-link {
  padding:3px 0;
  text-align:left;
  line-height:1.35;
  font:inherit;
}
.tech-link svg {
  margin-left:6px;
  vertical-align:-1px;
  color:var(--accent);
}
.tech-link:hover { color:var(--accent); }
#technique-modal { width:min(510px,94vw); }
#technique-modal .panelhead { margin-bottom:12px; }
.tech-motion {
  width:100%;
  height:auto;
  display:block;
  border-radius:10px;
  background:#161916;
}
.tech-notes { margin:14px 0 0; }
.tech-notes dt { font-weight:650; }
.tech-notes dd { margin:4px 0 12px; color:#c7c9c1; line-height:1.45; }
.tech-notes dd:last-child { margin-bottom:0; }
.rule-note { margin:8px 0 4px; color:var(--muted); font-size:13px; }
.recorded-set,.row-actions { display:flex; align-items:center; gap:8px; }
.recorded-set { justify-content:space-between; flex-wrap:wrap; }
#editform { border-top:1px solid var(--line); margin-top:18px; padding-top:18px; }
.status.failed i { background:var(--accent); }
.conflict { margin-bottom:12px; color:var(--accent); }
.compare { margin-top:14px; }
.compare pre { white-space:pre-wrap; font:inherit; font-size:13px; }
#setform .pair label { display:flex; flex-direction:column; justify-content:flex-end; }
.metrics>div { min-width:0; overflow-wrap:anywhere; }
.metrics b { font-variant-numeric:tabular-nums; }
@media(max-width:420px){
  .metrics>div { padding:10px; }
  .metrics b { font-size:19px; }
}

.rest {
  min-height:52px;
  gap:8px;
  font-size:13px;
  margin-bottom:10px;
}

.rest b {
  font-variant-numeric:tabular-nums;
}

.tiny {
  font-size:11px;
  min-height:35px;
  margin-left:auto;
  padding:4px 8px;
}

.metrics {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  margin:20px 0;
  gap:8px;
}

.metrics>div {
  background:#292b27;
  border-radius:10px;
  padding:13px;
}

.metrics b,.metrics small {
  display:block;
}

.metrics b {
  font-size:23px;
}

.detailrow {
  margin-top:15px;
  padding-top:15px;
}

.detailrow h3 {
  margin-bottom:7px;
}

.detailrow div {
  padding:5px 0;
}

.usernote {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  color:#c9ccc2;
  margin-top:5px;
}

.exports {
  gap:10px;
  margin-top:20px;
}

.backlink {
  margin-top:16px;
}

dialog {
  width:min(420px,94vw);
  border:1px solid #494c45;
  border-radius:20px;
  color:var(--text);
  background:var(--surface);
  padding:24px;
  max-height:88dvh;
}

dialog::backdrop {
  background:rgba(0,0,0,.68);
}

form label {
  display:block;
  font-size:14px;
  margin-bottom:16px;
  font-weight:550;
}

form input,select,textarea {
  display:block;
  width:100%;
  padding:12px;
  border:1px solid #494c45;
  border-radius:9px;
  background:#151714;
  color:var(--text);
  font-size:16px;
  margin-top:6px;
}

textarea {
  resize:vertical;
  min-height:70px;
}

.formhint,.prior {
  color:var(--muted);
  font-size:14px;
  margin-bottom:14px;
}

.pair {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

#notice {
  position:fixed;
  bottom:25px;
  left:50%;
  transform:translate(-50%,15px);
  opacity:0;
  pointer-events:none;
  transition:.15s;
  max-width:90vw;
  width:max-content;
  background:#373a32;
  color:white;
  border:1px solid #565a4f;
  padding:12px 16px;
  border-radius:12px;
  z-index:10;
}

#notice.show {
  opacity:1;
  transform:translate(-50%,0);
}

#bottomnav {
  display:none;
}

@media(min-width:1450px) {
  .hero {
    min-height:295px;
  }
}

@media(max-width:1060px) {
  .layout {
    grid-template-columns:160px minmax(0,1fr);
  }
  aside {
    padding:28px 12px;
  }
  .brand {
    font-size:24px;
  }
  main {
    padding-left:20px;
    padding-right:20px;
  }
  .dashboard,.worklayout {
    grid-template-columns:minmax(0,1.6fr) minmax(215px,1fr);
    gap:12px;
  }
  .panel {
    padding:17px;
  }
  .primarycol,.sidecol {
    gap:12px;
  }
  .planoption {
    padding:9px;
  }
  .hero {
    min-height:234px;
  }
}

@media(max-width:780px) {
  .layout {
    display:block;
  }
  aside {
    display:none;
  }
  main {
    padding:0 16px calc(90px + env(safe-area-inset-bottom));
  }
  header {
    height:54px;
  }
  .crumb {
    font-size:0;
  }
  .crumb:before {
    content:"ПОВТОР.";
    font-size:19px;
    font-weight:900;
    color:var(--text);
    letter-spacing:-1px;
  }
  .crumb span,.crumb strong {
    display:none;
  }
  .status {
    font-size:11px;
  }
  .pageheading {
    padding:23px 0 17px;
  }
  .dashboard,.worklayout {
    grid-template-columns:1fr;
  }
  .hero {
    min-height:210px;
  }
  .hero h2 {
    font-size:39px;
  }
  .worklayout .sidecol {
    grid-row:1;
  }
  .worklayout .controls {
    position:static;
  }
  .controls h2 {
    font-size:18px;
  }
  .dashboard .sidecol {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .weekdays b {
    width:auto;
    min-width:18px;
  }
  .dashboard .primarycol,.dashboard .sidecol {
    display:contents;
  }
  .hero {
    grid-row:1;
  }
  .planpanel {
    grid-row:2;
  }
  .weight {
    grid-row:3;
  }
  .week {
    grid-row:4;
  }
  .dashboard {
    gap:12px;
  }
  .plans {
    gap:6px;
  }
  .planoption span {
    font-size:12px;
  }
  .planoption small {
    font-size:11px;
  }
  .herocontent {
    padding:20px;
  }
  .exrow img {
    width:61px;
    height:47px;
  }
  .exrow {
    gap:9px;
  }
  .exname h3 {
    font-size:15px;
  }
  #bottomnav {
    position:fixed;
    bottom:0;
    left:0;
    right:0;
    display:flex;
    justify-content:space-around;
    background:#171916f5;
    border-top:1px solid var(--line);
    padding:5px 0 calc(5px + env(safe-area-inset-bottom));
    z-index:3;
  }
  #bottomnav a {
    display:grid;
    justify-items:center;
    gap:2px;
    font-size:10px;
    padding:6px 12px;
    margin:0;
    min-width:65px;
  }
  #bottomnav a[aria-current] {
    background:transparent;
    color:var(--accent);
  }
  #notice {
    bottom:78px;
  }
  .weightnum {
    margin:12px 0 5px;
  }
  .setrow {
    gap:4px;
    font-size:12px;
  }
  .setrow small {
    font-size:11px;
  }
  dialog {
    padding:19px;
  }
  .weekdays b {
    width:30px;
  }
}
