*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --color-danger: #f16464;
    --color-success: #16a34a;
    --color-accent: #c2410c;
}

body {
    margin: 0;
    background: #fff;
    color: #111;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

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

h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

h2 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
}

form {
    margin: 0;
}

input,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #111;
    font: inherit;
    appearance: none;
}

input:focus,
select:focus {
    outline: none;
    border-color: #111;
}

input::placeholder {
    color: #aaa;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23999' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: #888;
    font-size: 13px;
}

button {
    font: inherit;
    cursor: pointer;
}

.page {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 20px 64px;
}

.nav {
    position: sticky;
    top: 0;
    z-index: 10;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-links {
    display: flex;
    gap: 12px;
}

.nav-link {
    margin-bottom: -1px;
    padding: 14px 8px 12px;
    border-bottom: 2px solid transparent;
    color: #999;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.15s, border-color 0.15s;
}

.nav-link:hover {
    color: #111;
}

.nav-link[aria-current="page"] {
    border-bottom-color: var(--color-accent);
    color: var(--color-accent);
}

.nav-account {
    display: inline-flex;
    padding: 8px;
    margin-right: -8px;
    border-radius: 8px;
    color: #999;
    transition: background 0.15s;
}

.nav-account:hover {
    color: #111;
}

.nav-account[aria-current="page"] {
    background: #fbede6;
    color: var(--color-accent);
}

.button {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #111;
    text-align: center;
}

.button-quiet {
    padding: 0;
    border: 0;
    background: none;
    color: #999;
    font-size: 14px;
}

.button-danger {
    color: var(--color-danger);
}

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

.muted {
    color: #888;
}

.text-danger {
    color: var(--color-danger);
}

.stack > * + * {
    margin-top: 12px;
}

.row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 8px;
}

.item-actions {
    display: flex;
    gap: 14px;
}

.flash {
    margin-bottom: 24px;
    padding: 12px 14px;
    border: 1px solid var(--color-danger);
    border-radius: 8px;
    font-size: 14px;
    color: var(--color-danger);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.details summary {
    color: #999;
    font-size: 14px;
    cursor: pointer;
    list-style: none;
}

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

.details[open] form {
    margin-top: 16px;
}

.section {
    padding: 28px 0;
    border-top: 1px solid #eee;
}

.sets {
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.set {
    display: flex;
    align-items: center;
    padding: 8px 0;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.set-number {
    width: 28px;
    color: #bbb;
    font-size: 14px;
}

.set-main {
    flex: 1;
}

.set-rpe {
    width: 64px;
    color: #888;
    font-size: 14px;
}

.workouts {
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
}

.workouts a {
    display: block;
    padding: 18px 0;
    border-top: 1px solid #eee;
}

.workouts .muted {
    font-size: 14px;
}

.login {
    max-width: 360px;
    margin: 20vh auto 0;
}

.login h1 {
    margin-bottom: 32px;
}

.footer {
    margin-top: 48px;
    text-align: center;
}

h1 + p {
    margin: 4px 0 0;
}

.details {
    margin: 8px 0 28px;
}

.set-target {
    display: block;
    color: #999;
    font-size: 13px;
}

.card {
    margin-top: 16px;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.card h2 {
    margin: 0;
    color: #888;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.card header a {
    color: var(--color-accent);
    font-size: 14px;
}

.card p {
    margin: 2px 0 0;
    color: #888;
    font-size: 14px;
}

.card strong {
    color: #111;
    font-size: 36px;
    font-weight: 600;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.card form,
.card details {
    margin-top: 16px;
}

.card summary {
    list-style: none;
    cursor: pointer;
}

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

.set-action {
    width: 16px;
    text-align: right;
}

.history {
    width: 100%;
    margin-top: 24px;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.history th {
    padding: 0 0 10px;
    color: var(--color-accent);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
}

.history td {
    padding: 14px 0;
    border-top: 1px solid #eee;
}

.history tr.group th {
    padding: 24px 0 10px;
    border-top: 1px solid #eee;
    color: #111;
    text-align: left;
}

.history th:last-child,
.history td:last-child {
    text-align: right;
}

.history.grid thead th:not(:first-child),
.history.grid td:not(:first-child) {
    text-align: right;
}

.segmented {
    display: inline-flex;
    padding: 3px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fafafa;
}

.segmented a {
    padding: 6px 12px;
    border-radius: 7px;
    color: #888;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
}

.segmented a:hover {
    color: #111;
}

.segmented a[aria-current="page"] {
    background: #fbede6;
    color: var(--color-accent);
}

.text-success {
    color: var(--color-success);
}

.history .change {
    margin-right: 6px;
    font-size: 12px;
}

.filter {
    margin-top: 24px;
}

.filter + .workouts {
    margin-top: 16px;
}

.history .weekday {
    margin-left: 6px;
    color: #999;
    font-size: 12px;
}

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