/* Versão 0.2: aparência intencionalmente neutra, seguindo os wireframes do Figma.
   Tokens facilitam aplicar a identidade visual definitiva futuramente. */
:root {
  color-scheme: light;
  --canvas: #343434;
  --background: #e2e2e2;
  --surface: #f6f6f6;
  --panel: #a4a4a4;
  --panel-strong: #8d8d8d;
  --ink: #252525;
  --ink-soft: #5b5b5b;
  --ink-inverse: #fff;
  --stroke: #c8c8c8;
  --focus: #505050;
  --radius-lg: 26px;
  --shadow: 0 5px 14px rgb(0 0 0 / .13);
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--canvas); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, .upload-label:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.app-shell { min-height: 100dvh; display: grid; align-content: center; justify-items: center; padding: 20px 12px; gap: 14px; }
.phone { width: min(100%, 410px); height: min(860px, 94dvh); min-height: 620px; background: var(--background); border-radius: 38px; position: relative; overflow: hidden; box-shadow: 0 28px 70px rgb(0 0 0 / .23); display: flex; flex-direction: column; isolation: isolate; }
.desktop-caption { margin: 0; font-size: 10px; color: #b9b9b9; text-transform: uppercase; letter-spacing: .15em; text-align: center; }
.topbar { min-height: 94px; padding: 25px 25px 15px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 8px; }
.topbar > :first-child { justify-self: start; }
.topbar > :nth-child(2) { justify-self: center; }
.topbar > :last-child { justify-self: end; }
.brand { font-size: 16px; font-weight: 900; letter-spacing: -.05em; padding-top: 9px; }
.brand-dot { color: #777; }
.icon { flex-shrink: 0; display: inline-block; }
.icon-button, .small-icon { border: 0; padding: 0; display: grid; place-items: center; background: transparent; color: var(--ink); min-width: 44px; min-height: 44px; border-radius: 50%; }
.icon-button.profile { background: #cfcfcf; }
.main-content { overflow-y: auto; scrollbar-width: thin; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; width: 100%; margin: 0 auto; padding: 24px 18px 19px; flex-shrink: 0; }
.weekdays::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.weekday { min-width: 0; width: 100%; min-height: 48px; padding: 8px 0; display: grid; place-items: center; background: #757575; color: white; border: 2px solid transparent; border-radius: 11px; font-size: 13px; }
.weekday.selected { background: #313131; border-color: #313131; box-shadow: 0 0 0 2px #fafafa inset; }
.workout-panel { margin-top: 18px; padding: 28px 20px; background: var(--panel); flex: 1; border-radius: 24px 24px 0 0; }
.section-intro { display: flex; justify-content: space-between; align-items: center; gap: 7px; margin-bottom: 24px; }
.section-intro h1 { font-size: 26px; letter-spacing: -.045em; line-height: 1.1; margin: 2px 0 0; }
.eyebrow { font-size: 12px; margin: 0 0 3px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.week-pill { border-radius: 15px; background: #dddddd; font-size: 11px; padding: 7px 9px; white-space: nowrap; }
.workout-list { display: flex; flex-direction: column; gap: 12px; }
.workout-row { display: flex; align-items: stretch; gap: 10px; }
.workout-main { min-height: 58px; border: 0; border-radius: 12px; background: #ececec; display: flex; align-items: center; justify-content: space-between; flex: 1; min-width: 0; padding: 9px 14px; gap: 8px; box-shadow: var(--shadow); color: var(--ink); text-align: left; }
.workout-name { font-weight: 700; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { background: #d3d3d3; border-radius: 7px; padding: 6px 8px; font-size: 13px; color: #3c3c3c; }
.edit-button { border: 0; min-width: 50px; background: #ededed; border-radius: 12px; box-shadow: var(--shadow); display: grid; place-items: center; }
.add-workout, .outline-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; border-radius: 12px; border: 1px solid #b9b9b9; background: #e5e5e5; min-height: 49px; padding: 11px 14px; color: var(--ink); font-weight: 700; text-decoration: none; }
.add-workout { margin-top: 27px; box-shadow: var(--shadow); }
.panel-hint { font-size: 12px; line-height: 1.5; color: #414141; margin: 20px 2px 0; }
.bottom-nav { flex-shrink: 0; background: #e7e7e7; display: flex; justify-content: space-around; gap: 12px; padding: 7px 14px max(13px, env(safe-area-inset-bottom)); min-height: 72px; border-top: 1px solid #ccc; }
.bottom-nav button { color: #686868; border: 0; background: none; min-width: 70px; min-height: 48px; display: grid; justify-items: center; align-content: center; gap: 4px; }
.bottom-nav button[aria-current="page"] { color: #1f1f1f; }
.bottom-nav span { font-size: 11px; }
.overlay { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; justify-content: end; }
.scrim { position: absolute; inset: 0; border: 0; background: rgb(35 35 35 / .18); width: 100%; }
.training-sheet { position: relative; min-height: 0; max-height: 83%; display: flex; flex-direction: column; background: #a5a5a5; border-radius: 28px 28px 0 0; box-shadow: 0 -8px 32px rgb(0 0 0 / .22); animation: sheet-in .18s ease-out; overflow: hidden; }
@keyframes sheet-in { from { transform: translateY(20px); opacity: .5 } to { transform: translateY(0); opacity: 1 } }
.handle-area { padding: 12px 0 7px; display: grid; place-items: center; cursor: grab; touch-action: none; min-height: 30px; }
.handle { display: block; width: 58px; height: 6px; background: #ebebeb; border-radius: 99px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 22px 0; }
.sheet-head h2 { font-size: 23px; line-height: 1.2; letter-spacing: -.04em; margin: 0; }
.sheet-head .eyebrow { color: #3d3d3d; }
.sheet-helper { font-size: 12px; margin: 8px 22px 16px; color: #363636; }
.sheet-content { overflow-y: auto; flex: 0 1 auto; min-height: 0; padding: 0 18px 5px; overscroll-behavior: contain; scrollbar-width: thin; }
.exercise-row { min-height: 76px; background: #e2e2e2; border-radius: 12px; padding: 12px; display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.exercise-row.is-done { background: #cbcbcb; }
.exercise-row.is-done .exercise-copy strong { text-decoration: line-through; opacity: .55; }
.exercise-copy { min-width: 0; flex: 1; display: grid; gap: 5px; }
.exercise-copy strong { font-size: 14px; line-height: 1.15; }
.exercise-copy span { font-size: 11px; color: #626262; }
.info-button { width: 34px; height: 44px; flex-shrink: 0; background: none; border: 0; display: grid; place-items: center; color: #4a4a4a; }
.square-check { width: 38px; height: 38px; background: #f7f7f7; border: 2px solid #727272; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center; color: #fff; }
.square-check.checked { background: #383838; border-color: #383838; }
.sheet-bottom { flex-shrink: 0; padding: 8px 18px max(16px, env(safe-area-inset-bottom)); background: #a5a5a5; box-shadow: 0 -7px 16px #a5a5a5; }
.done-label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.primary-button { min-height: 52px; background: #303030; color: #fff; border: 0; border-radius: 13px; padding: 13px 17px; width: 100%; font-weight: 700; font-size: 15px; }
.tiny-note { color: #515151; font-size: 11px; line-height: 1.55; margin: 8px 0 0; }
.celebrate-layer { background: #9c9c9c; justify-content: center; align-items: center; }
.celebrate { width: 100%; text-align: center; padding: 34px 28px; }
.big-check { width: 210px; height: 210px; background: #e5e5e5; color: #fff; display: grid; place-items: center; border-radius: 50%; margin: 0 auto 40px; }
.celebrate h2 { color: #fff; font-size: 27px; font-weight: 600; margin: 0 0 12px; }
.celebrate p { margin: 0 0 50px; color: #363636; }
.celebrate .primary-button { max-width: 300px; margin: auto; }
.info-layer { z-index: 30; }
.info-sheet { position: relative; background: #e0e0e0; border-radius: 26px 26px 0 0; height: min(82%, 700px); padding: 16px 24px max(24px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; overflow-y: auto; }
.back-btn { align-self: flex-start; }
.info-sheet h2 { font-size: 27px; margin: 6px 0 18px; }
.image-placeholder { background: #a9a9a9; border: 2px dashed #747474; border-radius: 13px; flex: 1; min-height: 190px; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; color: #484848; }
.image-placeholder span { font-size: 14px; line-height: 1.5; }
.info-sheet > p { line-height: 1.5; }
.info-sheet .primary-button { margin-top: 14px; }
.full-page { padding: 4px 24px 36px; overflow-y: auto; flex: 1; }
.page-heading { display: flex; align-items: center; gap: 8px; margin: 10px 0 24px; }
.page-heading h1 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.form-content { display: grid; gap: 14px; }
.field-label { font-size: 13px; font-weight: 700; }
.form-content > input { width: 100%; border: 1px solid var(--stroke); border-radius: 11px; padding: 14px; background: #fff; color: var(--ink); }
.subheading { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 0; }
.subheading h2 { font-size: 18px; margin: 0; }
.subheading span { color: var(--ink-soft); font-size: 12px; }
.editable-exercise { background: #f1f1f1; padding: 14px; border-radius: 12px; }
.editable-title { display: flex; align-items: center; justify-content: space-between; }
.editable-title strong { font-size: 14px; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two-fields label { display: grid; gap: 4px; color: #565656; font-size: 12px; }
.two-fields input { border: 1px solid var(--stroke); min-width: 0; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--ink); background: white; }
.danger-text { background: transparent; border: 0; color: #4c4c4c; font-size: 13px; text-decoration: underline; padding: 12px; }
.search-wrap { display: flex; align-items: center; gap: 8px; border: 1.5px solid #5f5f5f; border-radius: 30px; background: #ececec; padding: 0 12px; min-height: 43px; }
.search-wrap input { flex: 1; outline: none; border: 0; background: transparent; min-width: 0; font-size: 14px; }
.chips { display: flex; gap: 7px; overflow-x: auto; padding: 15px 0 15px; scrollbar-width: none; }
.chip { min-height: 35px; background: #d1d1d1; border: 1px solid #bdbdbd; border-radius: 99px; padding: 5px 12px; color: #3a3a3a; font-size: 12px; white-space: nowrap; }
.chip.active { background: #3b3b3b; color: white; border-color: #3b3b3b; }
.library-results { display: grid; align-content: start; gap: 12px; margin-bottom: 20px; }
.library-item { display: flex; justify-content: space-between; align-items: center; gap: 6px; background: #d4d4d4; border-radius: 13px; padding: 10px 10px 10px 16px; min-height: 60px; box-shadow: var(--shadow); }
.library-item > div { min-width: 0; display: grid; gap: 3px; }
.library-item strong { font-size: 14px; }
.library-item span { font-size: 11px; color: #626262; }
.library-add { min-width: 44px; min-height: 44px; display: grid; place-items: center; border: 0; background: none; }
.library-add.added { color: #4b4b4b; }
.empty { padding: 25px 15px; text-align: center; font-size: 14px; color: #4b4b4b; }
.settings-page { padding-bottom: 40px; }
.settings-card { background: #f3f3f3; border-radius: 15px; padding: 17px; margin-bottom: 16px; }
.settings-card h2 { font-size: 17px; margin: 0 0 12px; }
.settings-card p { font-size: 13px; line-height: 1.6; color: #555; }
.settings-card .outline-button { font-size: 13px; margin-top: 11px; }
.upload-label { cursor: pointer; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; border-top: 1px solid #d2d2d2; padding: 13px 0; font-size: 13px; }
.history-row small { font-size: 11px; color: #777; }
.toast { position: absolute; z-index: 50; bottom: 85px; left: 15px; right: 15px; padding: 15px; text-align: center; border-radius: 12px; color: white; background: #333; box-shadow: 0 8px 22px rgb(0 0 0 / .23); font-size: 13px; }
@media (max-width: 480px) { body { background: var(--background); } .app-shell { padding: 0; display: block; } .phone { width: 100%; height: 100dvh; min-height: 0; border-radius: 0; box-shadow: none; } .desktop-caption { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; scroll-behavior: auto !important; } }

/* Semana inteira visível, centralizada, inclusive em telas compactas. */
@media (max-width: 360px) {
  .weekdays { padding-inline: 10px; gap: 4px; }
  .weekday { font-size: 12px; min-height: 45px; }
}
