:root {
    --bg: #111113;
    --surface: #1c1c1f;
    --surface-2: #2a2a2e;
    --border: #38383d;
    --text: #f2f2f7;
    --muted: #9a9aa1;
    --accent: #ff6a00;
    --accent-2: #ff3d00;
    --blue: #0a84ff;
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --radius: 14px;
    --tab-height: 64px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: clip;
}

h1, h2, h3 {
    margin: 0 0 12px;
    line-height: 1.2;
}

h1 {
    font-size: 1.5rem;
}

h2 {
    font-size: 1.15rem;
}

h3 {
    font-size: 1rem;
}

h1:focus {
    outline: none;
}

p {
    margin: 0 0 12px;
}

a {
    color: var(--accent);
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
}

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

.small {
    font-size: 0.85rem;
}

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

.app-shell {
    min-height: 100vh;
}

.app-shell.signed-in .app-content {
    padding: calc(56px + var(--safe-top) + 12px) 16px calc(var(--tab-height) + var(--safe-bottom) + 24px);
    max-width: 640px;
    margin: 0 auto;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: calc(56px + var(--safe-top));
    padding: var(--safe-top) 16px 0;
    background: rgba(17, 17, 19, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.app-title {
    font-weight: 700;
    color: var(--accent);
    font-size: 1.1rem;
}

.help-button {
    margin-left: 8px;
    margin-right: auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-2);
    font-size: 1rem;
}

.help-signed-out {
    padding: calc(16px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
    max-width: 640px;
    margin: 0 auto;
}

.link-button {
    border: none;
    background: transparent;
    text-align: left;
    padding: 0;
    cursor: pointer;
}

.help-intro {
    color: var(--muted);
}

.help-section {
    margin-bottom: 10px;
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.help-section > summary {
    padding: 14px 16px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

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

.help-section > summary::after {
    content: "›";
    float: right;
    color: var(--muted);
    transition: transform 0.2s;
}

.help-section[open] > summary::after {
    transform: rotate(90deg);
}

.help-section > :not(summary) {
    margin: 0 16px 14px;
}

.help-section ol,
.help-section ul {
    padding-left: 20px;
    line-height: 1.5;
}

.help-section li {
    margin-bottom: 6px;
}

.help-section code {
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--accent);
}

.help-table {
    width: calc(100% - 32px);
    border-collapse: collapse;
    font-size: 0.85rem;
}

.help-table th,
.help-table td {
    padding: 6px 4px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.help-table th {
    color: var(--muted);
    font-weight: 500;
}

.client-chip {
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.9rem;
}

.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    height: calc(var(--tab-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(28, 28, 31, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
}

.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--muted);
    font-size: 0.75rem;
}

.tab-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.tab.active {
    color: var(--accent);
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.page-head h1 {
    margin: 0;
    flex: 1;
}

.back-link {
    width: 100%;
    color: var(--muted);
    font-size: 0.95rem;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.empty-state {
    text-align: center;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.form-row.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.meal-edit {
    margin: 8px 0;
    padding: 12px;
    border-radius: 12px;
    background: var(--surface-2);
}

.form-row.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--muted);
}

.field {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
}

select.field {
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    padding-right: 32px;
}

.field:focus {
    outline: none;
    border-color: var(--accent);
}

.field:disabled {
    opacity: 0.5;
}

.field.readonly {
    display: flex;
    align-items: center;
    color: var(--text);
}

.field::placeholder {
    color: var(--muted);
}

textarea.field {
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 46px;
    padding: 10px 18px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
}

.btn:disabled {
    opacity: 0.45;
}

.btn-accent {
    background: linear-gradient(to right, var(--accent), var(--accent-2));
    color: #fff;
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
}

.btn-ghost {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-danger {
    background: rgba(255, 69, 58, 0.14);
    border: 1px solid var(--red);
    color: var(--red);
    margin-top: 8px;
}

.btn-block {
    width: 100%;
}

.btn-small {
    min-height: 38px;
    padding: 6px 14px;
    font-size: 0.9rem;
}

.btn-icon {
    min-width: 46px;
    padding: 0;
    font-size: 1.3rem;
}

.btn-tile {
    background: var(--surface);
    color: var(--text);
    min-height: 56px;
}

.icon-btn {
    min-width: 40px;
    min-height: 40px;
    border: none;
    border-radius: 10px;
    background: var(--surface-2);
    font-size: 1.05rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.icon-btn.danger {
    color: var(--red);
}

.error-msg {
    color: var(--red);
    font-size: 0.9rem;
}

.pill {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 0.8rem;
}

.pill.good {
    background: rgba(48, 209, 88, 0.18);
    color: var(--green);
}

.pill.bad {
    background: rgba(255, 69, 58, 0.18);
    color: var(--red);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-row {
    margin-bottom: 12px;
}

.chip {
    min-height: 36px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
}

.chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    margin-bottom: 12px;
    background: var(--surface);
    border-radius: 12px;
}

.segmented button {
    min-height: 40px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.segmented button.active {
    background: var(--surface-2);
    color: var(--text);
    font-weight: 600;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.list-row:last-child {
    border-bottom: none;
}

.list-row-main {
    flex: 1;
    min-width: 0;
}

.list-row-title {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.list-button {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.client-card {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}

.client-card.selected {
    border-color: var(--accent);
}

.client-card-main {
    flex: 1;
}

.client-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.logout {
    margin-top: 8px;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
    background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.75)), url('../Images/backround.jpg') center / cover;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 28px 22px;
    border-radius: 20px;
    background: rgba(20, 20, 22, 0.85);
    backdrop-filter: blur(8px);
}

.auth-title {
    text-align: center;
    color: var(--accent);
    font-size: 2rem;
    margin: 0;
}

.auth-subtitle,
.auth-note {
    text-align: center;
    color: var(--muted);
    margin: 0;
}

.date-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 12px;
    margin-bottom: 4px;
    scrollbar-width: none;
}

.date-strip::-webkit-scrollbar {
    display: none;
}

.date-chip {
    flex: 0 0 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 0;
    border: none;
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.date-chip.active {
    background: var(--accent);
    color: #fff;
}

.date-chip.future {
    background: transparent;
    border: 1px dashed var(--border);
}

.date-chip.future.active {
    background: var(--accent);
    border-color: var(--accent);
}

.date-chip-picker {
    flex-basis: 52px;
}

.date-chip-month {
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.7;
}

.date-picker-row {
    margin-bottom: 12px;
}

.date-chip-day {
    font-size: 0.72rem;
    opacity: 0.85;
}

.date-chip-number {
    font-size: 1.2rem;
    font-weight: 700;
}

.calorie-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.big-number {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
}

.calorie-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.macro-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.progress-track {
    height: 8px;
    margin-bottom: 12px;
    border-radius: 8px;
    background: var(--surface-2);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s ease;
}

.progress-fill.calories {
    background: var(--orange);
}

.progress-fill.protein {
    background: var(--green);
}

.progress-fill.carbs {
    background: var(--blue);
}

.progress-fill.fats {
    background: #ffd60a;
}

.progress-fill.over {
    background: var(--red);
}

.meal-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.meal-group {
    margin-bottom: 12px;
}

.meal-group-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.meal-group-head h3 {
    margin-bottom: 4px;
}

.search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.search-row .field {
    flex: 1;
    min-width: 0;
}

.result-list {
    display: flex;
    flex-direction: column;
    max-height: 320px;
    overflow-y: auto;
    border-radius: 10px;
    background: var(--surface-2);
}

.result-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.result-item.active {
    background: rgba(255, 106, 0, 0.2);
}

.list-heading {
    margin: 12px 0 6px;
    font-size: 0.9rem;
    color: var(--muted);
}

.result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.source-badge {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.7rem;
    white-space: nowrap;
}

.favorite-btn {
    font-size: 1.5rem;
}

.favorite-btn.on {
    color: #ffd60a;
}

.result-name {
    font-weight: 600;
}

.macro-grid,
.stat-row,
.targets-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 12px 0;
    text-align: center;
}

.stat-row,
.targets-preview {
    grid-template-columns: repeat(3, 1fr);
}

.macro-grid div,
.stat-row div,
.targets-preview div {
    display: flex;
    flex-direction: column;
    padding: 10px 4px;
    border-radius: 10px;
    background: var(--surface-2);
}

.macro-grid span,
.stat-row span {
    color: var(--muted);
    font-size: 0.75rem;
}

.workout-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.workout-head h2 {
    margin: 2px 0;
}

.exercise-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exercise-head h3 {
    margin: 0;
}

.set-table {
    width: 100%;
    margin: 8px 0;
    border-collapse: collapse;
    text-align: center;
}

.set-table th {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
    padding-bottom: 4px;
}

.set-table td {
    padding: 4px 0;
    border-top: 1px solid var(--border);
}

.set-input {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    align-items: end;
    margin-top: 8px;
}

.set-input label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--muted);
}

.chart-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.chart-box {
    position: relative;
    height: 220px;
}

.chart-small {
    height: 180px;
}

.chart-small canvas {
    max-height: 150px;
}

.info-msg {
    color: var(--green);
    font-size: 0.9rem;
}

.code-field {
    text-align: center;
    font-size: 1.4rem;
    letter-spacing: 0.3em;
}

.form-section {
    margin: 8px 0 0;
    font-size: 1rem;
}

.chip.danger-chip {
    background: var(--red);
    border-color: var(--red);
}

.warning-box {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 159, 10, 0.15);
    color: var(--orange);
    font-size: 0.9rem;
}

.warning-text {
    color: var(--orange);
    font-size: 0.8rem;
}

.small-chip {
    min-height: 30px;
    padding: 4px 10px;
    font-size: 0.8rem;
}

.shop-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-bottom: 8px;
    scrollbar-width: none;
}

.shop-row .chip {
    flex: 0 0 auto;
}

.food-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.picked {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    background: var(--surface-2);
}

.unit {
    align-self: center;
    color: var(--muted);
}

.grams-field {
    width: 76px;
    min-height: 38px;
    padding: 6px 8px;
    text-align: right;
}

.list-card {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.steps {
    white-space: pre-wrap;
}

.chip-remove {
    margin-left: 4px;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.month-title {
    text-align: center;
    font-size: 1.2rem;
    text-transform: capitalize;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 12px;
}

.month-grid-head {
    text-align: center;
    color: var(--muted);
    font-size: 0.75rem;
}

.month-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.month-cell.today {
    border-color: var(--accent);
}

.month-cell.active {
    background: var(--accent);
    color: #fff;
}

.month-cell-day {
    font-weight: 700;
}

.month-cell-kcal {
    font-size: 0.65rem;
    opacity: 0.8;
}

.day-title {
    text-transform: capitalize;
}

.day-totals {
    margin-bottom: 12px;
}

.creator-tag {
    display: inline-block;
    margin-top: 4px;
    color: var(--blue);
    font-size: 0.78rem;
}

.pill + .pill {
    margin-left: 6px;
}

.pill.linked {
    background: rgba(10, 132, 255, 0.18);
    color: var(--blue);
}

fieldset.form {
    border: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.role-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.role-option span:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.role-option:active {
    border-color: var(--accent);
}

.role-icon {
    font-size: 2rem;
}

.invite-card {
    text-align: center;
}

.invite-code {
    margin: 12px 0;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: var(--accent);
}

.error-card {
    border: 1px solid var(--red);
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.6rem 1.25rem calc(0.7rem + var(--safe-bottom));
    background: #ffd60a;
    color: #000;
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    cursor: pointer;
}

.blazor-error-boundary {
    padding: 1rem;
    background: #b32121;
    color: #fff;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.link-plain {
    color: inherit;
}

.tab {
    position: relative;
}

.unread-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 22px);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--red);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.comment-thread h2 {
    margin-bottom: 8px;
}

.comment {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--surface-2);
}

.comment.mine {
    margin-left: 24px;
    background: rgba(255, 106, 0, 0.14);
}

.comment.theirs {
    margin-right: 24px;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.comment-delete {
    margin-left: auto;
    min-width: 28px;
    min-height: 28px;
}

.comment-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.comment-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.comment-form .field {
    flex: 1;
}

.rest-timer {
    position: sticky;
    top: calc(56px + var(--safe-top) + 8px);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: var(--blue);
    color: #fff;
}

.rest-timer.done {
    background: var(--green);
}

.rest-timer .chip {
    background: rgba(255, 255, 255, 0.2);
    border-color: transparent;
    color: #fff;
}

.rest-label {
    flex: 1;
    font-weight: 600;
}

.rest-time {
    font-size: 1.4rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.rest-setting {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 2px 0 6px;
}

.rest-select {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    padding: 2px 6px;
}

.record-msg {
    padding: 10px 14px;
    border-radius: var(--radius);
    background: rgba(255, 214, 10, 0.16);
    color: #ffd60a;
    font-weight: 600;
}

.tutorial-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.tutorial-photos img {
    width: 100%;
    border-radius: 12px;
    background: #fff;
}

.tutorial-steps {
    padding-left: 20px;
    line-height: 1.5;
}

.tutorial-steps li {
    margin-bottom: 8px;
}

.coach-card {
    border: 1px solid var(--accent);
}

.library-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-top: 8px;
}

.library-filter .chip {
    flex: 0 0 auto;
}

.attribution {
    text-align: center;
}

.score-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
}

.score-buttons {
    display: flex;
    gap: 4px;
}

.score-buttons button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
}

.score-buttons button.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.check-in-photos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.check-in-photos img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 10px;
}

.check-in-due {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--accent);
    color: var(--text);
}

.check-in-entry {
    border-top: 1px solid var(--border);
    padding: 8px 0;
}

.check-in-entry > summary {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    list-style: none;
}

.check-in-entry > summary::-webkit-details-marker {
    display: none;
}

.check-in-entry .comment-thread {
    margin-top: 8px;
    background: var(--surface-2);
}

.legal-page {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 140px);
}

.legal-frame {
    flex: 1;
    width: 100%;
    min-height: 70vh;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
}

.legal-sheet {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--bg);
}

.legal-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.consent-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 6px 0;
    font-size: 0.9rem;
    color: var(--muted);
    text-align: left;
}

.consent-row input {
    margin-top: 3px;
    flex-shrink: 0;
}

.disclaimer {
    color: var(--muted);
    font-size: 0.8rem;
    margin: 6px 0 0;
}

.about-list li {
    margin-bottom: 8px;
}

.reminder-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.reminder-row .toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reminder-row .toggle-label > span {
    display: flex;
    flex-direction: column;
}

.reminder-row input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--accent);
}

.time-field {
    width: 110px;
    flex-shrink: 0;
}

.next-reminder {
    margin: 4px 0 0 32px;
    color: var(--accent);
    font-size: 0.85rem;
}

.delete-account {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.delete-account .btn-danger {
    margin-top: 0;
}

.checklist h2,
.quick-add h2 {
    margin-bottom: 6px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}

.check-item:first-of-type {
    border-top: none;
}

.check-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border: 2px solid var(--border);
    border-radius: 50%;
    font-weight: 700;
    color: #fff;
}

.check-item.done .check-mark {
    background: var(--green, #30d158);
    border-color: var(--green, #30d158);
}

.check-item.done .check-text strong {
    color: var(--muted);
}

.check-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.meal-done {
    color: var(--green, #30d158);
}

.quick-weight {
    display: flex;
    gap: 6px;
    align-items: center;
}

.quick-weight .field {
    width: 80px;
    min-height: 38px;
}

.quick-row-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.quick-row {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 46px;
    margin-top: 8px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.quick-row-wrap .icon-btn {
    margin-top: 8px;
}

.template-form {
    margin: 6px 0 10px;
}

.last-time {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 4px 0 8px;
}

.last-time .chip {
    min-height: 32px;
    padding: 4px 12px;
    font-size: 0.85rem;
}

.list-heading {
    margin: 16px 4px 8px;
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.client-status {
    margin-top: 6px;
}

.attention-reason {
    display: inline-block;
    margin: 6px 6px 0 0;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 159, 10, 0.16);
    color: #ffb340;
    font-size: 0.8rem;
}

.review-scores {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin: 12px 0;
    text-align: center;
}

.review-scores div {
    display: flex;
    flex-direction: column;
    padding: 8px 2px;
    border-radius: 10px;
    background: var(--surface-2);
}

.review-scores span {
    color: var(--muted);
    font-size: 0.7rem;
}

.head-actions {
    display: flex;
    gap: 6px;
}

.language-switch {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.tour-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.7);
}

.tour-card {
    width: 100%;
    max-width: 420px;
    padding: 24px 20px;
    border-radius: 20px;
    background: var(--surface);
    text-align: center;
}

.tour-icon {
    font-size: 3rem;
}

.tour-card p {
    color: var(--muted);
    line-height: 1.5;
}

.tour-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 16px 0;
}

.tour-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.tour-dot.active {
    background: var(--accent);
}

.tab > span:nth-child(2) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.field {
    min-width: 0;
    max-width: 100%;
}
