:root {
    color-scheme: light;
    --text: #1a1a1a;
    --text-muted: #9a9a9a;
    --border: #eaeaea;
    --accent: #2563eb;
    --bg: #ffffff;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 1.25rem;
}

.app-header {
    border-bottom: 1px solid var(--border);
}

.app-nav {
    max-width: 640px;
    margin: 0 auto;
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.app-nav .brand {
    font-weight: 700;
    margin-right: auto;
}

.app-nav a:not(.brand) {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.app-nav a:not(.brand):hover {
    color: var(--text);
}

.app-nav .current-user {
    font-size: 0.95rem;
    font-weight: 500;
}

.app-main {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

.empty-state {
    color: var(--text-muted);
}

/* Daily view */

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
}

.activity-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.activity-name {
    font-size: 1rem;
    font-weight: 500;
}

.activity-description {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.activity-row.is-complete .activity-name,
.activity-row.is-complete .activity-description {
    color: var(--text-muted);
    text-decoration: line-through;
}

.activity-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex-shrink: 0;
}

.activity-checkboxes input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Config page */

.config-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.config-form label {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    color: var(--text-muted);
    gap: 0.25rem;
}

.weekday-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    border: none;
    margin: 0;
    padding: 0;
}

.weekday-picker legend {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0;
}

.config-form .weekday-picker label {
    flex-direction: row;
    align-items: center;
    gap: 0.3rem;
}

.config-form input {
    font: inherit;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.config-form input[name="Input.TargetCount"] {
    width: 5rem;
}

.config-form button,
.config-table button {
    font: inherit;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--text);
    border-radius: 4px;
    background: var(--text);
    color: var(--bg);
    cursor: pointer;
}

.config-table button {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.config-table {
    width: 100%;
    border-collapse: collapse;
}

.config-table th,
.config-table td {
    text-align: left;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.config-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
}

/* History page */

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 400;
    margin-left: 0.4rem;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.stats-card {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.stats-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.6rem;
}

.stats-numbers {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.stats-rate {
    font-size: 1.1rem;
    font-weight: 600;
}

.stats-streak {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.progress-bar {
    height: 0.5rem;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
}

.stats-detail {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

/* Select user page */

.select-user-main {
    max-width: 420px;
}

.form-error {
    color: #b91c1c;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.user-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.user-select-form {
    margin: 0;
}

.user-button {
    font: inherit;
    padding: 0.6rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.user-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.new-user-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.new-user-form label {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    color: var(--text-muted);
    gap: 0.25rem;
}

.new-user-form input {
    font: inherit;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.new-user-form button {
    font: inherit;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--text);
    border-radius: 4px;
    background: var(--text);
    color: var(--bg);
    cursor: pointer;
}
