* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    min-height: 100dvh;
    margin: 0;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 26rem),
        #050505;
    color: #f7f7f7;
    font-family: Arial, Helvetica, sans-serif;
}

html {
    scroll-behavior: smooth;
}

button,
input,
select {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100dvh;
    border: 1px solid #262626;
    border-radius: 8px;
    overflow: hidden;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 36px;
    padding: 48px 24px 52px;
    border-right: 1px solid #292929;
    background: rgba(0, 0, 0, 0.74);
}

.mobile-topbar {
    display: none;
}

.mobile-hero,
.mobile-tabs,
.mobile-bottom-nav {
    display: none !important;
}

.mobile-only-hidden {
    display: none !important;
}

.brand,
.nav-item,
.stat-card,
.dashboard-header,
.table-row,
.set-row {
    display: flex;
    align-items: center;
}

.brand {
    gap: 14px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-logo-frame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.28);
    overflow: hidden;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
}

.brand-logo {
    display: block;
    width: auto;
    height: 52px;
    object-fit: contain;
    border-radius: 12px;
    filter: brightness(0) invert(1);
}

.brand-icon,
.stat-icon {
    display: grid;
    place-items: center;
    color: #050505;
    background: #ffffff;
    font-weight: 900;
}

.brand-icon {
    position: relative;
    width: 44px;
    height: 32px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1;
    overflow: visible;
}

.brand-icon::after {
    content: "BETA";
    position: absolute;
    top: -2px;
    right: -14px;
    padding: 2px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff3b1f, #ff1200);
    color: #ffffff;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.9px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
    transform: rotate(45deg);
    transform-origin: center;
    pointer-events: none;
}

.nav-menu {
    display: grid;
    gap: 14px;
}

.nav-item {
    min-height: 56px;
    padding: 0 20px;
    border-radius: 8px;
    color: #cfcfcf;
    text-decoration: none;
    font-size: 16px;
}

.nav-item.active,
.nav-item:hover {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
}

.mini-card,
.panel,
.stat-card {
    border: 1px solid #2b2b2b;
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.mini-card {
    margin-top: auto;
    padding: 24px;
}

.account-card {
    display: grid;
    gap: 8px;
    padding: 18px 20px;
    border: 1px solid #2b2b2b;
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.mini-card span,
.mini-card small,
.account-card span,
.account-card small,
.panel-heading p,
.stat-card span,
.stat-card p,
label {
    color: #c8c8c8;
}

.mini-card strong {
    display: block;
    margin-top: 16px;
    font-size: 36px;
}

.mini-card small {
    display: block;
    margin-top: 6px;
}

.sparkline {
    height: 42px;
    margin-top: 22px;
    background:
        linear-gradient(135deg, transparent 9%, #fff 10%, #fff 11%, transparent 12%) 0 80% / 26px 24px repeat-x;
    opacity: 0.9;
}

.dashboard {
    padding: 42px 56px 54px;
}

.dashboard > section,
.dashboard > header {
    scroll-margin-top: 18px;
}

.dashboard-header {
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 34px;
    line-height: 1.1;
}

h2 {
    font-size: 22px;
}

.dashboard-header p,
.panel-heading p {
    margin-top: 8px;
    font-size: 16px;
}

.date-pill {
    padding: 18px 28px;
    border: 1px solid #303030;
    border-radius: 8px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.35);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 22px;
}

.stat-card {
    min-height: 150px;
    gap: 28px;
    padding: 30px;
}

.stat-icon {
    flex: 0 0 46px;
    height: 46px;
    border-radius: 8px;
    font-size: 22px;
}

.stat-card p {
    font-size: 16px;
}

.stat-card strong {
    display: block;
    margin: 10px 0 6px;
    font-size: 34px;
}

.stat-card small {
    font-size: 20px;
    font-weight: 400;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(360px, 0.85fr) minmax(520px, 1.3fr);
    gap: 22px;
    margin-bottom: 22px;
}

.panel {
    padding: 28px;
}

.panel-heading {
    margin-bottom: 26px;
}

.split-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.workout-form {
    display: grid;
    gap: 18px;
}

.template-tools,
.form-actions {
    display: grid;
    gap: 14px;
}

.template-tools {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(132px, auto);
    align-items: end;
}

.form-actions {
    grid-template-columns: 1fr 1fr;
}

.exercise-list {
    display: grid;
    gap: 16px;
}

.exercise-block {
    padding: 16px;
    border: 1px solid #2c2c2c;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.exercise-block-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 12px;
    align-items: end;
}

.exercise-mobile-summary {
    display: none;
}

.exercise-actions {
    margin: 14px 0;
}

.cardio-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}

label {
    display: block;
    margin-bottom: 8px;
}

input,
select,
button {
    border-radius: 8px;
}

input,
select {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    color: #ffffff;
    border: 1px solid #383838;
    background: rgba(0, 0, 0, 0.35);
}

select {
    appearance: auto;
}

.primary-button,
.secondary-button,
.compact-button,
.icon-button {
    min-height: 52px;
    border: 1px solid #333333;
    font-weight: 700;
    cursor: pointer;
}

.primary-button:disabled,
.secondary-button:disabled,
.compact-button:disabled,
.icon-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.primary-button {
    color: #ffffff;
    background: rgba(0, 0, 0, 0.24);
}

.secondary-button {
    color: #090909;
    background: #ffffff;
}

.compact-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    color: #090909;
    background: #ffffff;
    border-radius: 12px !important;
    overflow: hidden;
    text-decoration: none;
    white-space: nowrap;
}

.danger-button {
    color: #ffffff;
    background: #c73b2e;
    border-color: #c73b2e;
}

.danger-button:hover,
.danger-button:focus-visible {
    background: #d84a3c;
    border-color: #d84a3c;
}

.danger-icon-button {
    color: #ffffff;
    background: #c73b2e;
    border-color: #c73b2e;
    font-size: 20px;
    line-height: 1;
}

.danger-icon-button svg {
    width: 14px;
    height: 14px;
    display: block;
    fill: currentColor;
}

.danger-icon-button:hover,
.danger-icon-button:focus-visible {
    background: #d84a3c;
    border-color: #d84a3c;
}

.icon-button {
    display: grid;
    place-items: center;
    width: 42px;
    min-height: 42px;
    padding: 0;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
}

.sets-table {
    overflow: hidden;
    border: 1px solid #2c2c2c;
    border-radius: 8px;
}

.set-row {
    display: grid;
    grid-template-columns: 34px 1fr 1fr 34px 42px;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #252525;
}

.set-row.reps-only {
    grid-template-columns: 34px minmax(0, 1fr) 42px;
}

.set-row:last-child {
    border-bottom: 0;
}

.set-row input {
    min-height: 36px;
}

.set-row span {
    align-self: center;
}

.recent-table {
    display: grid;
}

.table-row {
    display: grid;
    grid-template-columns: 1.15fr 0.7fr 0.9fr 1fr 28px;
    gap: 18px;
    min-height: 68px;
    border-bottom: 1px solid #262626;
}

.workout-history .table-row {
    grid-template-columns: 1.05fr 0.68fr 0.56fr 0.76fr 0.84fr 0.9fr;
}

.workout-card-row {
    border-bottom: 1px solid #262626;
}

.workout-card-row .table-row {
    border-bottom: 0;
}

.workout-card-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 0 16px;
}

.workout-card-actions .compact-button {
    width: auto;
    min-width: 132px;
}

.workout-card-actions form {
    display: flex;
    margin: 0;
    margin-left: auto;
}

.workout-card-actions form .compact-button {
    width: auto;
    margin: 0;
}

.workout-exercise-summary {
    display: grid;
    gap: 8px;
    padding: 0 0 18px;
    color: #c8c8c8;
    font-size: 14px;
}

.workout-performance-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 10px;
    color: #c8c8c8;
    font-size: 13px;
    line-height: 1.4;
}

.workout-performance-line strong {
    color: #f7f7f7;
}

.pr-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(112, 216, 124, 0.16);
    color: #98e4a0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.workout-performance-line .performance-pr {
    color: #98e4a0;
}

.workout-details {
    margin: 0;
}

.workout-details > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0 14px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

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

.workout-details > summary::after {
    content: "+";
    margin-left: auto;
    color: #c8c8c8;
    font-size: 20px;
    font-weight: 400;
}

.workout-details[open] > summary::after {
    content: "–";
}

.workout-details[open] .workout-exercise-item:last-child {
    margin-bottom: 2px;
}

.workout-exercise-item {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.workout-exercise-item strong {
    color: #ffffff;
    font-size: 14px;
}

.workout-exercise-item span {
    color: #c8c8c8;
    font-size: 13px;
}

.workout-share-action {
    display: flex;
    align-items: center;
}

.workout-share-action .compact-button {
    min-width: 160px;
}

.template-delete-control {
    display: flex;
    flex-direction: column;
    justify-content: end;
}

.template-delete-control label {
    visibility: hidden;
    margin-bottom: 6px;
}

.template-delete-control .compact-button {
    width: auto;
    min-width: 132px;
}

.table-row:last-child {
    border-bottom: 0;
}

.empty-state {
    padding: 30px 0;
    color: #c8c8c8;
}

.stats-heading {
    display: flex;
    justify-content: space-between;
    gap: 22px;
}

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

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

.summary-tile {
    padding: 18px;
    border: 1px solid #2c2c2c;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.2));
}

.summary-tile .muted {
    display: block;
    color: #c8c8c8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.summary-tile strong {
    display: block;
    margin-top: 10px;
    font-size: 30px;
    line-height: 1;
}

.summary-tile small {
    display: block;
    margin-top: 8px;
    color: #bdbdbd;
    font-size: 13px;
    line-height: 1.45;
}

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

.chart-card {
    padding: 18px;
    border: 1px solid #2c2c2c;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    overflow: hidden;
    min-width: 0;
}

.chart-card h3 {
    margin: 0;
    font-size: 18px;
}

.chart-card p {
    margin-top: 6px;
    color: #c8c8c8;
    font-size: 14px;
}

.chart-container {
    position: relative;
    height: 220px;
    overflow: hidden;
    margin-top: 18px;
}

.chart-card canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.chart-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0 14px;
    color: #c8c8c8;
    font-size: 14px;
    text-align: center;
    pointer-events: none;
    box-sizing: border-box;
}

.template-overview-block {
    margin-bottom: 18px;
}

.template-overview-heading {
    margin-bottom: 12px;
}

.template-overview-heading h3 {
    margin: 0;
    font-size: 18px;
}

.template-overview-heading p {
    margin-top: 6px;
    color: #c8c8c8;
    font-size: 14px;
}

.template-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.template-overview-card {
    padding: 18px;
    border: 1px solid #2c2c2c;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.18));
}

.template-overview-card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.template-overview-card-head strong {
    font-size: 16px;
}

.template-overview-card-head span {
    color: #c8c8c8;
    font-size: 13px;
    white-space: nowrap;
}

.template-overview-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.template-overview-metrics span {
    display: block;
    color: #c8c8c8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.template-overview-metrics strong {
    display: block;
    margin-top: 6px;
    font-size: 20px;
}

.template-overview-note {
    margin-top: 14px;
    color: #d7d7d7;
    font-size: 13px;
    line-height: 1.45;
}

.mobile-hero-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid #2b2b2b;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
}

.mobile-avatar {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    color: #050505;
    background: linear-gradient(135deg, #ffffff, #d9d9d9);
    font-size: 18px;
    font-weight: 900;
}

.mobile-hero-copy {
    display: grid;
    gap: 4px;
}

.mobile-eyebrow {
    color: #a8a8a8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mobile-hero-copy strong {
    font-size: 18px;
}

.mobile-hero-copy small {
    color: #c8c8c8;
    font-size: 13px;
}

.mobile-account-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.mobile-account-meta span {
    padding: 5px 8px;
    border: 1px solid #2a2a2a;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: #bfc7d6;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.mobile-quick-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.mobile-quick-stats span {
    padding: 6px 10px;
    border: 1px solid #2a2a2a;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #ececec;
    font-size: 12px;
}

.mobile-shortcuts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mobile-shortcut-card {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid #2b2b2b;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    text-decoration: none;
}

.mobile-shortcut-card strong {
    font-size: 14px;
}

.mobile-shortcut-card span {
    color: #c8c8c8;
    font-size: 12px;
    line-height: 1.35;
}

.mobile-tabs {
    gap: 8px;
    margin: 16px 0 18px;
}

.mobile-tab {
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid #2b2b2b;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #d8d8d8;
    font-weight: 700;
}

.mobile-tab.active {
    color: #050505;
    background: #ffffff;
}

.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 10px 12px 12px;
    border-top: 1px solid #252525;
    background: rgba(6, 6, 6, 0.96);
    backdrop-filter: blur(18px);
}

.mobile-bottom-link {
    display: grid;
    place-items: center;
    min-height: 42px;
    border: 1px solid #2a2a2a;
    border-radius: 14px;
    color: #cfcfcf;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
}

.mobile-bottom-link span {
    line-height: 1;
}

.mobile-bottom-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    opacity: 0.96;
}

.mobile-bottom-link.active {
    color: #050505;
    background: #ffffff;
}

.mobile-profile {
    display: grid;
    gap: 16px;
}

.profile-grid {
    display: grid;
    gap: 14px;
}

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

.mobile-profile-hint {
    display: none;
    padding: 12px 14px;
    border: 1px solid #2b2b2b;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: #c8c8c8;
    font-size: 13px;
    line-height: 1.45;
}

.profile-card {
    padding: 16px 18px;
}

.profile-card strong {
    font-size: 22px;
}

.hamburger-button {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 9px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.hamburger-button span {
    display: block;
    width: 22px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: transform 0.22s ease, opacity 0.15s ease;
}

.hamburger-button.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-button.open span:nth-child(2) {
    opacity: 0;
}

.hamburger-button.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    width: 280px;
    height: 100%;
    padding: 32px 20px;
    border-right: 1px solid #292929;
    background: rgba(8, 8, 8, 0.98);
    backdrop-filter: blur(18px);
    transform: translateX(-100%);
    transition: transform 0.26s ease;
}

.nav-drawer.open {
    transform: translateX(0);
}

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.55);
}

.nav-overlay.open {
    display: block;
}

.drawer-brand {
    padding-bottom: 24px;
    border-bottom: 1px solid #2a2a2a;
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    margin-top: 20px;
}

.drawer-link {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 18px;
    border-radius: 8px;
    color: #cfcfcf;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
}

.drawer-link:hover,
.drawer-link:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.drawer-signout {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #2a2a2a;
    color: #a0a0a0;
}

.drawer-signout:hover,
.drawer-signout:focus {
    color: #ffffff;
}

@media (max-width: 900px) {
    html {
        scroll-behavior: auto;
    }

    body {
        background: #050505;
    }

    .app-shell {
        display: block;
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        overflow: visible;
    }

    .sidebar {
        display: none;
    }

    .hamburger-button {
        display: flex;
    }

    .mobile-topbar {
        position: sticky;
        top: 0;
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin: -28px -18px 18px;
        padding: 10px 14px 10px 10px;
        border-bottom: 1px solid #242424;
        background: rgba(5, 5, 5, 0.94);
        backdrop-filter: blur(14px);
    }

    .dashboard {
        padding: 12px 12px calc(124px + env(safe-area-inset-bottom));
    }

    .stats-grid,
    .content-grid,
    .chart-grid {
        grid-template-columns: 1fr;
    }

    .stats-heading,
    .stats-controls {
        display: grid;
        grid-template-columns: 1fr;
    }

    .content-grid {
        gap: 18px;
    }

    .mobile-hero,
    .mobile-tabs,
    .mobile-bottom-nav {
        display: grid !important;
    }

    .dashboard-header {
        display: none !important;
    }

    .stats-grid {
        margin-bottom: 16px;
    }

    .panel {
        padding: 14px;
    }

    .profile-actions {
        display: none;
    }

    .mobile-profile-hint {
        display: block;
    }
}

@media (max-width: 680px) {
    .brand {
        font-size: 17px;
    }

    .brand-logo {
        height: 42px;
    }

    .brand-icon {
        width: 40px;
        height: 30px;
        font-size: 13px;
    }

    .dashboard-header,
    .form-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        gap: 14px;
        margin-bottom: 18px;
    }

    h1 {
        font-size: 30px;
    }

    h2 {
        font-size: 21px;
    }

    .dashboard-header p,
    .panel-heading p {
        font-size: 15px;
    }

    .date-pill {
        justify-self: start;
        padding: 12px 16px;
        font-size: 14px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .mobile-shortcuts {
        grid-template-columns: 1fr;
    }

    .profile-actions {
        grid-template-columns: 1fr;
    }

    .mobile-hero-card {
        grid-template-columns: 42px minmax(0, 1fr);
        padding: 14px;
        border-radius: 16px;
    }

    .mobile-avatar {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        font-size: 16px;
    }

    .stat-card {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 0;
        min-height: 82px;
        padding: 10px 10px 11px;
    }

    .stat-icon {
        display: none;
    }

    .stat-card p {
        font-size: 7px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .stat-card strong {
        margin: 4px 0 2px;
        font-size: 18px;
        line-height: 1;
    }

    .stat-card small {
        font-size: 9px;
        line-height: 1.25;
    }

    .panel {
        padding: 14px;
        border-radius: 8px;
    }

    .panel-heading {
        margin-bottom: 18px;
    }

    .split-heading {
        display: grid;
        grid-template-columns: 1fr;
    }

    .compact-button,
    .primary-button,
    .secondary-button {
        width: 100%;
    }

    .template-tools,
    .form-actions {
        grid-template-columns: 1fr;
    }

    .template-tools {
        gap: 10px;
    }

    .template-delete-control {
        display: grid;
        gap: 6px;
    }

    .template-delete-control label {
        display: none;
    }

    .template-delete-control .compact-button {
        width: 100%;
        min-width: 0;
    }

    input,
    select {
        min-height: 46px;
    }

    .exercise-block {
        padding: 12px;
    }

    .exercise-block-header {
        grid-template-columns: 1fr 42px;
    }

    .exercise-mobile-summary {
        display: grid;
        gap: 6px;
        padding: 0 0 10px;
    }

    .exercise-type-chip {
        display: inline-flex;
        align-items: center;
        width: fit-content;
        min-height: 24px;
        padding: 0 9px;
        border-radius: 999px;
        border: 1px solid #2a2a2a;
        background: rgba(255, 255, 255, 0.05);
        color: #d7d7d7;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .exercise-summary-text {
        color: #f7f7f7;
        font-size: 13px;
        line-height: 1.4;
    }

    .exercise-actions {
        margin: 8px 0 10px;
    }

    .cardio-fields {
        grid-template-columns: 1fr;
        margin: 10px 0;
    }

    .set-row {
        grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr) 24px 36px;
        gap: 6px;
        padding: 8px 10px;
    }

    .set-row.reps-only {
        grid-template-columns: 28px minmax(0, 1fr) 36px;
    }

    .set-row input {
        min-height: 38px;
        padding: 0 8px;
        font-size: 13px;
    }

    .set-row .icon-button {
        width: 36px;
        min-height: 38px;
    }

    .workout-history {
        gap: 12px;
    }

    .workout-card-row {
        padding: 14px;
        border: 1px solid #2c2c2c;
        border-radius: 8px;
        background: rgba(0, 0, 0, 0.2);
    }

    .workout-card-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 10px;
        padding: 0 0 12px;
    }

    .workout-card-actions .compact-button,
    .workout-card-actions form {
        width: auto;
        flex: 0 0 auto;
    }

    .workout-card-actions .compact-button {
        min-width: 96px;
    }

    .workout-history .table-row {
        grid-template-columns: 1fr;
        gap: 8px;
        min-height: auto;
        padding: 0;
    }

    .workout-history .table-row span {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        color: #ffffff;
    }

    .workout-history .table-row span::before {
        content: attr(data-label);
        color: #a9a9a9;
    }

    .workout-head {
        display: none;
    }

    .workout-exercise-summary {
        margin-top: 12px;
        padding: 10px 0 0;
        border-top: 1px solid #252525;
        font-size: 14px;
        line-height: 1.45;
    }

    .workout-details > summary {
        padding: 10px 0 12px;
    }

    .workout-exercise-item {
        gap: 2px;
        padding: 10px;
    }

    .stats-controls {
        gap: 12px;
    }

    .chart-grid {
        gap: 14px;
    }

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

    .chart-card {
        padding: 14px;
    }

    .chart-container {
        height: 168px;
    }

    .template-overview-grid {
        grid-template-columns: 1fr;
    }

    .mobile-bottom-nav {
        gap: 4px;
        padding-left: 8px;
        padding-right: 8px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .mobile-bottom-link {
        min-height: 46px;
        gap: 4px;
        padding: 6px 8px 7px;
        font-size: 10px;
    }

    .dashboard {
        padding-bottom: calc(130px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 420px) {
    .dashboard {
        padding-left: 12px;
        padding-right: 12px;
        padding-bottom: calc(138px + env(safe-area-inset-bottom));
    }

    .mobile-topbar {
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 8px;
        padding-right: 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .mobile-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stats-controls {
        gap: 10px;
    }

    .set-row {
        grid-template-columns: 24px 1fr 1fr 22px;
    }

    .set-row .remove-set {
        grid-column: 1 / -1;
        width: 100%;
    }

    .workout-card-actions {
        gap: 8px;
    }
}
