/* =============================================================
   Cesitar Workout Tracker — Public/Frontend Styles
   Mobile-first dark theme matching mockups #01, #03, #04.
   ============================================================= */

.cwt-app {
    --cwt-bg: #0a0a0a;
    --cwt-surface: #141414;
    --cwt-surface-2: #1f1f1f;
    --cwt-border: #2a2a2a;
    --cwt-text: #fafafa;
    --cwt-muted: #737373;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--cwt-bg);
    color: var(--cwt-text);
    min-height: 100vh;
    margin: 0 auto;
    max-width: 480px;
    padding-bottom: 80px;
    position: relative;
    box-sizing: border-box;
}
.cwt-app *, .cwt-app *::before, .cwt-app *::after { box-sizing: border-box; }

/* ============================
   LOGIN SCREEN
   ============================ */
.cwt-login-screen {
    min-height: 100vh; padding: 0; padding-bottom: 0;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at top, #1a1a1a 0%, var(--cwt-bg) 60%);
}
.cwt-login-card {
    width: 100%; padding: 40px 24px; max-width: 400px;
    text-align: center;
}
.cwt-login-head { margin-bottom: 32px; }
.cwt-login-logo, .cwt-login-logo-fallback {
    width: 80px; height: 80px; margin: 0 auto 16px;
    background: var(--cwt-primary); border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
}
.cwt-login-logo { object-fit: cover; padding: 0; }
.cwt-login-logo-fallback span {
    font-family: 'Anton', sans-serif; font-size: 32px;
    color: var(--cwt-on-primary); letter-spacing: 0.02em;
}
.cwt-login-card h1 {
    font-family: 'Anton', sans-serif; font-size: 32px;
    margin: 0 0 8px; letter-spacing: 0.04em;
}
.cwt-login-tag { color: var(--cwt-primary); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin: 0; }

.cwt-login-form { text-align: left; }
.cwt-login-form .cwt-field { margin-bottom: 16px; }
.cwt-login-form label {
    display: block; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--cwt-muted); margin-bottom: 6px;
}
.cwt-login-form input[type=text],
.cwt-login-form input[type=password] {
    width: 100%; padding: 14px 16px;
    background: var(--cwt-surface); color: var(--cwt-text);
    border: 2px solid var(--cwt-border); border-radius: 10px;
    font-size: 15px; font-family: inherit;
}
.cwt-login-form input:focus {
    outline: none; border-color: var(--cwt-primary);
}
.cwt-login-form .cwt-checkbox {
    color: var(--cwt-muted); font-size: 13px;
    display: flex; align-items: center; gap: 8px; margin: 8px 0 16px;
}
.cwt-login-form .cwt-checkbox input { accent-color: var(--cwt-primary); }

.cwt-login-error {
    background: rgba(248, 113, 113, 0.1); color: var(--cwt-error);
    border: 1px solid var(--cwt-error); border-radius: 8px;
    padding: 10px 12px; font-size: 13px; margin: 8px 0 16px;
}

.cwt-login-submit {
    width: 100%; padding: 16px; font-size: 16px; font-weight: 800;
    background: var(--cwt-primary); color: var(--cwt-on-primary);
    border: none; border-radius: 10px; cursor: pointer;
    text-transform: uppercase; letter-spacing: 0.04em;
    font-family: inherit;
}
.cwt-login-submit:hover { background: var(--cwt-hover); }
.cwt-login-submit:disabled { opacity: 0.6; cursor: wait; }

.cwt-login-foot {
    margin-top: 24px; text-align: center;
    font-size: 13px; color: var(--cwt-muted);
}
.cwt-login-foot a { color: var(--cwt-muted); text-decoration: none; }
.cwt-login-foot a:hover { color: var(--cwt-text); }
.cwt-login-foot .sep { margin: 0 8px; }

/* ============================
   TOP BAR
   ============================ */
.cwt-topbar {
    position: sticky; top: 0; z-index: 50;
    background: var(--cwt-bg); border-bottom: 1px solid var(--cwt-border);
    padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
}
.cwt-topbar-brand { display: flex; align-items: center; gap: 8px; }
.cwt-topbar-logo {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--cwt-primary); object-fit: cover;
    display: flex; align-items: center; justify-content: center;
}
.cwt-topbar-logo-fb {
    color: var(--cwt-on-primary); font-family: 'Anton', sans-serif;
    font-size: 14px; letter-spacing: 0.04em;
}
.cwt-topbar-name {
    font-family: 'Anton', sans-serif; letter-spacing: 0.04em; font-size: 16px;
}
.cwt-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--cwt-primary); color: var(--cwt-on-primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 12px;
}

/* ============================
   MAIN VIEWS
   ============================ */
.cwt-main { padding: 0; }
.cwt-view { display: none; padding: 16px; }
.cwt-view.active { display: block; }
.cwt-loading { padding: 48px 16px; text-align: center; color: var(--cwt-muted); }

/* ============================
   WORKOUT VIEW
   ============================ */
.cwt-week-banner {
    background: var(--cwt-primary); color: var(--cwt-on-primary);
    border-radius: 16px; padding: 20px;
    margin-bottom: 20px; position: relative; overflow: hidden;
}
.cwt-week-banner-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.cwt-week-num { font-family: 'Anton', sans-serif; font-size: 36px; line-height: 1; letter-spacing: 0.04em; }
.cwt-week-num span { font-size: 14px; opacity: 0.7; display: block; }
.cwt-week-progress {
    width: 64px; height: 64px; position: relative;
}
.cwt-week-progress svg { transform: rotate(-90deg); }
.cwt-week-progress-text {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px;
}
.cwt-week-meta { font-size: 12px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.04em; }

.cwt-session-pills {
    display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto;
    padding: 4px 0;
}
.cwt-session-pill {
    flex-shrink: 0; padding: 10px 16px; border-radius: 100px;
    background: var(--cwt-surface); color: var(--cwt-muted);
    border: 1px solid var(--cwt-border); cursor: pointer;
    font-weight: 700; font-size: 13px; font-family: inherit;
    white-space: nowrap;
}
.cwt-session-pill.active { background: var(--cwt-primary); color: var(--cwt-on-primary); border-color: var(--cwt-primary); }

.cwt-exercise-card {
    background: var(--cwt-surface); border: 1px solid var(--cwt-border);
    border-radius: 12px; margin-bottom: 12px; overflow: hidden;
}
.cwt-exercise-head { padding: 14px 16px; border-bottom: 1px solid var(--cwt-border); }
.cwt-exercise-head-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.cwt-tag-muscle {
    background: var(--cwt-surface-2); color: var(--cwt-primary);
    border-radius: 100px; padding: 2px 8px;
    font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
}
.cwt-exercise-name { font-size: 15px; font-weight: 700; flex: 1; min-width: 200px; }
.cwt-exercise-target { font-size: 12px; color: var(--cwt-muted); display: flex; gap: 8px; flex-wrap: wrap; }
.cwt-exercise-target span { display: inline-flex; align-items: center; gap: 4px; }
.cwt-video-link { color: var(--cwt-primary); font-size: 12px; text-decoration: none; }

.cwt-sets-table { padding: 8px 12px; }
.cwt-sets-row {
    display: grid;
    grid-template-columns: 110px 1fr 1fr;
    gap: 8px;
    padding: 8px 4px;
    align-items: center;
    border-bottom: 1px solid var(--cwt-border);
}
.cwt-sets-row:last-child { border-bottom: none; }
.cwt-sets-row.is-header {
    font-size: 10px;
    color: var(--cwt-muted);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 4px 8px;
}
.cwt-sets-h-num    { padding-left: 4px; }
.cwt-sets-h-input  { text-align: center; }

/* Set number block: pill + target line in one column */
.cwt-set-num-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding-left: 2px;
}
.cwt-set-num-pill {
    background: var(--cwt-surface-2);
    color: var(--cwt-primary);
    border-radius: 50%;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Anton', sans-serif;
    font-size: 14px;
    line-height: 1;
}
.cwt-set-num-pill.has-pr {
    background: var(--cwt-success);
    color: #064e3b;
}
.cwt-set-target-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--cwt-muted);
    letter-spacing: 0.02em;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.cwt-sets-row input {
    width: 100%;
    padding: 10px 10px;
    background: var(--cwt-surface-2);
    color: var(--cwt-text);
    border: 1px solid var(--cwt-border);
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    text-align: center;
    font-weight: 600;
}
.cwt-sets-row input::placeholder {
    color: var(--cwt-muted);
    opacity: 0.5;
    font-weight: 500;
}
.cwt-sets-row input:focus {
    outline: none;
    border-color: var(--cwt-primary);
    box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.18);
}
.cwt-sets-row input.cwt-saved { border-color: var(--cwt-success); }

.cwt-empty-state {
    text-align: center; padding: 48px 16px;
    color: var(--cwt-muted);
}

/* ============================
   PROGRESS VIEW
   ============================ */
.cwt-progress-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    margin-bottom: 20px;
}
.cwt-progress-stat {
    background: var(--cwt-surface); border: 1px solid var(--cwt-border);
    border-radius: 12px; padding: 14px; text-align: center;
}
.cwt-progress-stat .v { font-family: 'Anton', sans-serif; font-size: 26px; color: var(--cwt-primary); display: block; line-height: 1; }
.cwt-progress-stat .l { font-size: 10px; color: var(--cwt-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; display: block; }

.cwt-chart-card {
    background: var(--cwt-surface); border: 1px solid var(--cwt-border);
    border-radius: 12px; padding: 16px; margin-bottom: 16px;
}
.cwt-chart-card h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--cwt-muted); font-weight: 700; }
.cwt-chart-canvas-wrap { position: relative; height: 220px; }

/* ============================
   ROUTINE VIEW
   ============================ */
.cwt-routine-overview {
    background: var(--cwt-surface); border: 1px solid var(--cwt-border);
    border-radius: 12px; padding: 16px; margin-bottom: 16px;
}
.cwt-routine-overview h2 { margin: 0 0 4px; font-size: 18px; }
.cwt-routine-overview .meta { font-size: 12px; color: var(--cwt-muted); margin-bottom: 12px; }
.cwt-routine-overview .notes { font-size: 13px; line-height: 1.5; color: var(--cwt-muted); }

.cwt-day-section { margin-bottom: 16px; }
.cwt-day-title {
    font-family: 'Anton', sans-serif; font-size: 18px;
    letter-spacing: 0.04em; margin: 16px 0 8px;
    display: flex; align-items: center; justify-content: space-between;
}
.cwt-day-list {
    background: var(--cwt-surface); border: 1px solid var(--cwt-border);
    border-radius: 12px; overflow: hidden;
}
.cwt-day-item {
    display: flex; gap: 8px; padding: 12px 16px;
    border-bottom: 1px solid var(--cwt-border); align-items: center;
}
.cwt-day-item:last-child { border-bottom: none; }
.cwt-day-item .name { flex: 1; font-size: 14px; }
.cwt-day-item .target { font-size: 12px; color: var(--cwt-muted); white-space: nowrap; }

/* ============================
   PROFILE VIEW
   ============================ */
.cwt-profile { padding: 16px; text-align: center; }
.cwt-profile-avatar {
    width: 96px; height: 96px; border-radius: 50%;
    background: var(--cwt-primary); color: var(--cwt-on-primary);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Anton', sans-serif; font-size: 36px;
    margin: 32px auto 16px; letter-spacing: 0.04em;
}
.cwt-profile h2 { margin: 0 0 4px; font-size: 22px; }
.cwt-muted-fg { color: var(--cwt-muted); font-size: 13px; }
.cwt-profile-actions { margin: 32px 0; display: flex; flex-direction: column; gap: 8px; }
.cwt-action-link {
    display: block; padding: 14px;
    background: var(--cwt-surface); color: var(--cwt-text);
    border: 1px solid var(--cwt-border); border-radius: 10px;
    text-decoration: none; font-weight: 600; font-size: 14px;
}
.cwt-action-link:hover { background: var(--cwt-surface-2); color: var(--cwt-text); }
.cwt-action-link.cwt-action-danger { color: var(--cwt-error); }
.cwt-profile-footer { margin-top: 48px; }

/* ============================
   BOTTOM NAV
   ============================ */
.cwt-bottomnav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px;
    background: var(--cwt-bg); border-top: 1px solid var(--cwt-border);
    display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 100;
}
.cwt-nav-btn {
    background: none; border: none; color: var(--cwt-muted);
    padding: 8px 4px; cursor: pointer; font-family: inherit;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.cwt-nav-btn svg { width: 22px; height: 22px; }
.cwt-nav-btn.active { color: var(--cwt-primary); }

/* ============================
   SAVE BAR
   ============================ */
.cwt-savebar {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    width: calc(100% - 32px); max-width: 448px;
    background: var(--cwt-on-primary); color: var(--cwt-text);
    border: 1px solid var(--cwt-border); border-radius: 12px;
    padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5); z-index: 90;
}
.cwt-savebar[hidden] { display: none; }
.cwt-savebar .cwt-btn-primary {
    background: var(--cwt-primary); color: var(--cwt-on-primary);
    border: none; padding: 8px 16px; border-radius: 8px;
    font-weight: 800; font-size: 13px; cursor: pointer; font-family: inherit;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.cwt-savebar .cwt-btn-primary:hover { background: var(--cwt-hover); }
.cwt-savebar #cwt-savebar-msg { font-size: 13px; color: var(--cwt-muted); }

/* =============================================================
   ADDITIONS — login polish, video button on workout
   ============================================================= */

/* Corner tag (top-right of login card) */
.cwt-login-card { position: relative; }
.cwt-corner-tag {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--cwt-primary);
    color: var(--cwt-on-primary);
    font-family: 'Anton', sans-serif;
    font-size: 11px;
    letter-spacing: 0.12em;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 2;
}

.cwt-platform-name {
    font-family: 'Anton', sans-serif;
    font-size: 32px;
    letter-spacing: 0.04em;
    text-align: center;
    margin: 16px 0 4px;
}
.cwt-platform-tag {
    text-align: center;
    color: var(--cwt-muted);
    font-size: 12px;
    letter-spacing: 0.12em;
    margin: 0 0 24px;
}

/* Inputs with icon prefix */
.cwt-input-wrap {
    position: relative;
}
.cwt-field-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--cwt-muted);
    pointer-events: none;
    z-index: 1;
}
.cwt-field-icon svg { width: 16px; height: 16px; }
.cwt-input-wrap input {
    padding-left: 42px !important;
}
.cwt-input-wrap input:focus ~ .cwt-field-icon,
.cwt-input-wrap input:focus + .cwt-field-icon {
    color: var(--cwt-primary);
}

/* Login row with checkbox + forgot link side by side */
.cwt-login-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.cwt-forgot {
    font-size: 12px;
    color: var(--cwt-primary);
    text-decoration: none;
    font-weight: 600;
}
.cwt-forgot:hover {
    text-decoration: underline;
}

.cwt-login-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    font-family: 'Anton', sans-serif;
    font-size: 16px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.cwt-login-submit svg {
    width: 18px;
    height: 18px;
}

/* Help contact at bottom of login */
.cwt-help-contact {
    margin-top: 24px;
    padding: 14px;
    text-align: center;
    background: rgba(250, 204, 21, 0.06);
    border: 1px solid rgba(250, 204, 21, 0.2);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
.cwt-help-text {
    font-size: 12px;
    color: var(--cwt-muted);
}
.cwt-help-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cwt-primary);
    text-decoration: none;
}
.cwt-help-link svg {
    width: 14px;
    height: 14px;
}
.cwt-help-link:hover {
    text-decoration: underline;
}

/* Video button on workout exercise cards */
.cwt-btn-video {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    padding: 5px 10px;
    background: var(--cwt-surface-2);
    border: 1px solid var(--cwt-border);
    border-radius: 6px;
    color: var(--cwt-text);
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    transition: all 0.15s;
}
.cwt-btn-video:hover {
    background: var(--cwt-primary);
    color: var(--cwt-on-primary);
    border-color: var(--cwt-primary);
}
.cwt-btn-video svg {
    width: 10px;
    height: 10px;
}

/* =============================================================
   END
   ============================================================= */

/* Paused client notice */
.cwt-paused-app { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.cwt-paused-notice { max-width: 520px; margin: 40px auto; text-align: center; }
.cwt-paused-notice h2 { margin: 0 0 10px; font-size: 28px; }
.cwt-paused-notice p { color: var(--cwt-muted-fg, #737373); }

/* ============================
   PROFILE 4.2.0: photo, history, documents, measurements
   ============================ */
.cwt-profile-rich { text-align: left; }
.cwt-profile-rich > h2,
.cwt-profile-rich > .cwt-muted-fg { text-align: center; }
.cwt-profile-photo { overflow: hidden; }
.cwt-profile-photo-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cwt-profile-card {
    background: var(--cwt-surface);
    border: 1px solid var(--cwt-border);
    border-radius: 14px;
    padding: 16px;
    margin: 16px 0;
}
.cwt-profile-card h3 {
    margin: 0 0 12px;
    font-family: 'Anton', sans-serif;
    font-size: 18px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.cwt-profile-label,
.cwt-measure-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: var(--cwt-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 10px;
}
.cwt-profile-input,
.cwt-profile-card input[type="file"] {
    width: 100%;
    background: var(--cwt-surface-2);
    color: var(--cwt-text);
    border: 1px solid var(--cwt-border);
    border-radius: 10px;
    padding: 12px;
    font-family: inherit;
}
.cwt-profile-btn {
    width: 100%;
    margin-top: 10px;
    padding: 13px 14px;
    background: var(--cwt-primary);
    color: var(--cwt-on-primary);
    border: none;
    border-radius: 10px;
    font-weight: 900;
    cursor: pointer;
    font-family: inherit;
}
.cwt-profile-status { min-height: 18px; color: var(--cwt-primary); font-size: 12px; margin: 8px 0 0; }
.cwt-doc-list ul { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.cwt-doc-list li {
    display: flex; justify-content: space-between; gap: 8px; align-items: center;
    padding: 10px; background: var(--cwt-surface-2); border-radius: 10px;
    font-size: 13px;
}
.cwt-doc-list a { color: var(--cwt-primary); text-decoration: none; font-weight: 800; overflow-wrap: anywhere; }
.cwt-doc-list span { color: var(--cwt-muted); font-size: 11px; white-space: nowrap; }
.cwt-measure-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cwt-measure-form label:first-child { grid-column: 1 / -1; }
.cwt-measure-table-wrap { overflow-x: auto; margin-top: 14px; }
.cwt-measure-table { width: 100%; border-collapse: collapse; min-width: 860px; font-size: 12px; }
.cwt-measure-table th,
.cwt-measure-table td { border-bottom: 1px solid var(--cwt-border); padding: 8px; text-align: left; white-space: nowrap; }
.cwt-measure-table th { color: var(--cwt-muted); text-transform: uppercase; letter-spacing: .05em; font-size: 10px; }
.cwt-history-list { display: flex; flex-direction: column; gap: 8px; }
.cwt-history-item { background: var(--cwt-surface-2); border-radius: 10px; padding: 10px; }
.cwt-history-item strong { display: block; font-size: 13px; }
.cwt-history-item span { display: block; color: var(--cwt-muted); font-size: 12px; margin-top: 3px; }
@media (max-width: 380px) { .cwt-measure-form { grid-template-columns: 1fr; } }

/* 4.2.8: private document/measurement delete controls */
.cwt-doc-list li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
}
.cwt-profile-delete,
.cwt-measure-table .cwt-profile-delete,
.cwt-measure-delete,
button.cwt-profile-delete {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid #f87171 !important;
    background: #3a3a3a !important;
    color: #ff8a8a !important;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 900;
    font-size: 13px;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    box-shadow: none;
}
.cwt-profile-delete:hover,
.cwt-profile-delete:focus,
.cwt-measure-table .cwt-profile-delete:hover,
.cwt-measure-table .cwt-profile-delete:focus,
.cwt-measure-delete:hover,
.cwt-measure-delete:focus {
    background: #4a2f2f !important;
    border-color: #ff8a8a !important;
    color: #ff9f9f !important;
    outline: none;
}
.cwt-measure-table td:last-child {
    text-align: left;
}

/* Progress advanced 4.2.6 */
.cwt-progress-filter-card,
.cwt-progress-month-card {
    background: var(--cwt-surface);
    border: 1px solid var(--cwt-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}
.cwt-progress-filter-card h3,
.cwt-progress-month-card h3 {
    margin: 0 0 12px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cwt-muted);
    font-weight: 700;
}
.cwt-progress-range-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}
.cwt-progress-range-row label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--cwt-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}
.cwt-progress-range-row input[type="date"] {
    background: #0b0b0b;
    border: 1px solid var(--cwt-border);
    color: var(--cwt-text);
    border-radius: 10px;
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
}
.cwt-progress-apply {
    cursor: pointer;
    text-align: center;
    margin: 0;
}
.cwt-progress-quick-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.cwt-progress-quick-row button {
    background: #0b0b0b;
    color: var(--cwt-text);
    border: 1px solid var(--cwt-border);
    border-radius: 10px;
    padding: 10px 8px;
    font-family: inherit;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
}
.cwt-progress-quick-row button:hover,
.cwt-progress-cal-day:hover {
    border-color: var(--cwt-primary);
}
.cwt-progress-stats-advanced {
    grid-template-columns: repeat(3, 1fr);
}
.cwt-progress-mini-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.cwt-progress-compare {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.cwt-compare-box {
    background: #0b0b0b;
    border: 1px solid var(--cwt-border);
    border-radius: 12px;
    padding: 14px;
}
.cwt-compare-title {
    display: block;
    color: var(--cwt-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.cwt-compare-box strong {
    display: block;
    font-family: 'Anton', sans-serif;
    color: var(--cwt-primary);
    font-size: 28px;
    line-height: 1;
}
.cwt-compare-box small {
    display: block;
    color: var(--cwt-muted);
    margin-top: 6px;
    font-size: 12px;
}
.cwt-progress-cal-title {
    color: var(--cwt-text);
    font-weight: 800;
    margin-bottom: 10px;
    text-transform: uppercase;
}
.cwt-progress-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.cwt-progress-cal-head {
    margin-bottom: 6px;
    color: var(--cwt-muted);
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}
.cwt-progress-cal-day {
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid var(--cwt-border);
    background: #0b0b0b;
    color: var(--cwt-text);
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    position: relative;
}
.cwt-progress-cal-day.empty {
    border: none;
    background: transparent;
    cursor: default;
}
.cwt-progress-cal-day.in-range {
    background: rgba(250, 204, 21, 0.08);
}
.cwt-progress-cal-day.has-training::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cwt-primary);
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
}
.cwt-top-exercises {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cwt-top-exercise {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: #0b0b0b;
    border: 1px solid var(--cwt-border);
    border-radius: 10px;
}
.cwt-top-exercise .rank {
    color: var(--cwt-primary);
    font-family: 'Anton', sans-serif;
}
.cwt-top-exercise .name strong,
.cwt-top-exercise .name small {
    display: block;
}
.cwt-top-exercise .name small {
    color: var(--cwt-muted);
    font-size: 11px;
    margin-top: 2px;
}
.cwt-top-exercise .metric {
    color: var(--cwt-primary);
    font-family: 'Anton', sans-serif;
    font-size: 18px;
}
@media (max-width: 640px) {
    .cwt-progress-range-row,
    .cwt-progress-compare {
        grid-template-columns: 1fr;
    }
    .cwt-progress-quick-row,
    .cwt-progress-mini-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .cwt-progress-stats-advanced {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* Progress advanced 4.2.7: mobile calendar, date picker buttons and brand-color inner accents */
.cwt-progress-filter-card,
.cwt-progress-month-card,
.cwt-progress-calendar-card,
.cwt-view-progress .cwt-chart-card {
    max-width: 100%;
    overflow: hidden;
}
.cwt-progress-date-label {
    min-width: 0;
}
.cwt-progress-date-field {
    display: grid;
    grid-template-columns: 1fr 44px;
    align-items: stretch;
    min-width: 0;
    background: #0b0b0b;
    border: 1px solid var(--cwt-border);
    border-radius: 10px;
    overflow: hidden;
}
.cwt-progress-date-field input[type="date"] {
    width: 100%;
    min-width: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    padding-right: 6px;
}
.cwt-progress-date-field input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    display: none;
}
.cwt-date-picker-btn {
    width: 44px;
    min-width: 44px;
    height: 100%;
    border: 0;
    border-left: 1px solid var(--cwt-border);
    background: transparent;
    color: var(--cwt-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.cwt-date-picker-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.cwt-date-picker-btn:hover,
.cwt-date-picker-btn:focus-visible {
    background: rgba(var(--cwt-primary-rgb, 250, 204, 21), 0.12);
    outline: none;
}
.cwt-progress-quick-row button,
.cwt-progress-apply {
    color: var(--cwt-primary);
}
.cwt-progress-quick-row button:hover,
.cwt-progress-quick-row button:focus-visible,
.cwt-progress-apply:hover,
.cwt-progress-apply:focus-visible {
    color: var(--cwt-primary);
    border-color: var(--cwt-primary);
    outline: none;
}
.cwt-progress-cal-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cwt-progress-cal-head span,
.cwt-progress-cal-day {
    min-width: 0;
}
.cwt-progress-cal-day {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 0.72;
    min-height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.cwt-progress-cal-day.in-range {
    background: rgba(var(--cwt-primary-rgb, 250, 204, 21), 0.14);
    border-color: rgba(var(--cwt-primary-rgb, 250, 204, 21), 0.55);
}
.cwt-progress-cal-day.has-training {
    color: var(--cwt-primary);
}
.cwt-progress-cal-day.empty {
    aspect-ratio: 1 / 0.72;
}
.cwt-progress-cal-day.has-training::after {
    background: var(--cwt-primary);
}
@media (max-width: 640px) {
    .cwt-view-progress {
        overflow-x: hidden;
    }
    .cwt-progress-range-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .cwt-progress-apply {
        width: 100%;
    }
    .cwt-progress-calendar-card {
        padding-left: 12px;
        padding-right: 12px;
    }
    .cwt-progress-cal-grid {
        gap: 5px;
    }
    .cwt-progress-cal-day {
        border-radius: 9px;
        font-size: clamp(13px, 3.6vw, 16px);
        min-height: 40px;
    }
    .cwt-progress-cal-head {
        font-size: 10px;
    }
    .cwt-progress-cal-day.has-training::after {
        width: 5px;
        height: 5px;
        bottom: 5px;
    }
}
@media (max-width: 380px) {
    .cwt-progress-filter-card,
    .cwt-progress-month-card,
    .cwt-view-progress .cwt-chart-card {
        padding: 12px;
    }
    .cwt-progress-cal-grid {
        gap: 4px;
    }
    .cwt-progress-cal-day {
        min-height: 36px;
        border-radius: 8px;
    }
}


/* 4.2.9: branded calendar selector in profile measurement date field */
.cwt-profile-date-field {
    background: var(--cwt-surface-2);
    border-color: var(--cwt-border);
    border-radius: 10px;
}
.cwt-profile-date-field input[type="date"].cwt-profile-input {
    border: 0;
    background: transparent;
    padding: 12px;
}
.cwt-profile-date-field input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    display: none;
}
.cwt-profile-date-field .cwt-date-picker-btn {
    color: var(--cwt-primary);
    border-left-color: var(--cwt-border);
}
.cwt-profile-date-field .cwt-date-picker-btn:hover,
.cwt-profile-date-field .cwt-date-picker-btn:focus-visible {
    background: rgba(var(--cwt-primary-rgb, 250, 204, 21), 0.12);
    color: var(--cwt-primary);
}


/* 4.3.0: branded calendar selector in profile history date field */
.cwt-history-date-field {
    width: 100%;
    margin-top: 8px;
}
.cwt-history-date-field .cwt-date-picker-btn {
    color: var(--cwt-primary);
}
.cwt-history-date-field .cwt-date-picker-btn:hover,
.cwt-history-date-field .cwt-date-picker-btn:focus-visible {
    background: rgba(var(--cwt-primary-rgb, 250, 204, 21), 0.12);
    color: var(--cwt-primary);
}

/* 4.3.9: profile workout-history delete zone */
.cwt-danger-zone {
    border-color: rgba(248, 113, 113, 0.45) !important;
}
.cwt-danger-zone h3 {
    color: #fff;
}
.cwt-profile-workouts-delete[disabled] {
    opacity: 0.55;
    cursor: wait;
}
