
/* =========================================
   HabitFlow - Main Styles
========================================= */

/* =========================================
   Theme Variables
========================================= */

:root {
    --background: #121412;
    --surface: #1c211d;
    --surface-secondary: #1b201c;
    --border: #2c342e;
    --text: #ffffff;
    --muted: #929b93;
    --accent: #A8E6B0;
    --accent-text: #121412;

    /* Compatibility aliases for existing components */
    --primary: var(--accent);
    --primary-color: var(--accent);
    --card-bg: var(--surface);
    --border-color: var(--border);
    --input-bg: var(--background);
    --text-color: var(--text);
}

body[data-theme="light"] {
    --background: #f4f6f4;
    --surface: #ffffff;
    --surface-secondary: #ffffff;
    --border: #dce3dc;
    --text: #202720;
    --muted: #737d74;
    --accent: #347d48;
    --accent-text: #ffffff;
}

/* =========================================
   Global Styles
========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--background);
    color: var(--text);
    font-family: Arial, sans-serif;
    min-height: 100vh;
}

.app-container {
    max-width: 850px;
    margin: 0 auto;
    padding: 35px 25px;
}

/* =========================================
   Header
========================================= */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 65px;
}

.topbar h1 {
    font-size: 25px;
    letter-spacing: -1px;
}

.topbar h1 span {
    color: var(--accent);
}

.profile {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #26382a;
    color: var(--accent);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

/* =========================================
   Welcome Section
========================================= */

.welcome {
    margin-bottom: 35px;
}

.date,
.section-label {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 1.5px;
    font-weight: bold;
}

.welcome h2 {
    font-size: 38px;
    margin: 12px 0;
    letter-spacing: -1.5px;
}

.subtitle {
    color: var(--muted);
    font-size: 15px;
}

/* =========================================
   Daily Progress Card
========================================= */

.progress-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    padding: 25px;
    border-radius: 14px;
    margin-bottom: 45px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-info h3 {
    margin-top: 10px;
    font-size: 19px;
}

.percentage {
    color: var(--accent);
    font-size: 27px;
    font-weight: bold;
}

.progress-track {
    width: 100%;
    height: 8px;
    background-color: #343b35;
    border-radius: 10px;
    margin: 22px 0 12px;
    overflow: hidden;
}

.progress-fill {
    width: 60%;
    height: 100%;
    background-color: var(--accent);
    border-radius: 10px;
}

.progress-caption {
    color: var(--muted);
    font-size: 12px;
}

/* =========================================
   Habits / Recurring Tasks
========================================= */

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-heading h2 {
    font-size: 23px;
    margin-top: 8px;
}

.add-button {
    background-color: var(--accent);
    color: var(--accent-text);
    border: none;
    padding: 11px 16px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

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

.habit-card {
    display: flex;
    align-items: center;
    background-color: var(--surface);
    border: 1px solid var(--border);
    padding: 17px;
    border-radius: 12px;
    gap: 15px;
}

.habit-icon {
    width: 43px;
    height: 43px;
    background-color: #29312a;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.habit-details {
    flex: 1;
}

.habit-details h3 {
    font-size: 15px;
    margin-bottom: 5px;
}

.habit-details p {
    color: var(--muted);
    font-size: 12px;
}

.check-button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #59645a;
    background: transparent;
    color: var(--text);
    font-size: 17px;
    cursor: pointer;
}

.completed .check-button {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text);
}

.check-button:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.check-button.unscheduled {
    background: transparent;
}

/* Habit Actions */

.habit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-button,
.delete-button {
    border: none;
    background: transparent;
    font-size: 12px;
    cursor: pointer;
    padding: 6px;
}

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

.delete-button {
    color: #e58b8b;
}

.edit-button:hover {
    color: var(--text);
}

.delete-button:hover {
    color: #ff5555;
}

/* Habit Statistics */

.habit-stats {
    color: #999999;
    font-size: 12px;
    margin-top: 8px;
    line-height: 1.5;
}

/* =========================================
   Add Habit Form
========================================= */

.add-habit-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.add-habit-form[hidden] {
    display: none;
}

.add-habit-form input {
    flex: 1;
    min-width: 180px;
    background-color: var(--surface);
    border: 1px solid #39443b;
    border-radius: 8px;
    padding: 12px;
    color: var(--text);
    outline: none;
}

.add-habit-form input:focus {
    border-color: var(--accent);
}

.cancel-button {
    background-color: #303630;
    color: white;
    border: none;
    padding: 11px 16px;
    border-radius: 8px;
    cursor: pointer;
}

/* =========================================
   Habit Dialogs
========================================= */

.habit-dialog {
    width: min(420px, calc(100% - 32px));
    margin: auto;
    padding: 28px;
    background-color: var(--surface);
    color: var(--text);
    border: 1px solid #39443b;
    border-radius: 16px;
}

.habit-dialog::backdrop {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.habit-dialog h2 {
    font-size: 22px;
    margin-bottom: 10px;
}

.habit-dialog p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 22px;
}

.habit-dialog input {
    width: 100%;
    background-color: var(--background);
    border: 1px solid #39443b;
    border-radius: 8px;
    padding: 13px;
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.habit-dialog input:focus {
    border-color: var(--accent);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.dialog-actions button {
    cursor: pointer;
}

.dialog-actions button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* =========================================
   Habit Schedule
========================================= */

.schedule-options {
    margin: 16px 0;
}

.schedule-options p {
    color: #999;
    font-size: 13px;
    margin-bottom: 10px;
}

.schedule-days {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.schedule-days label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #ccc;
    font-size: 13px;
    cursor: pointer;
}

.schedule-days input {
    accent-color: var(--accent);
}

/* =========================================
   Weekly Overview
========================================= */

.weekly-overview {
    background: #1c1c1c;
    border: 1px solid #303030;
    border-radius: 16px;
    padding: 22px;
    margin: 24px 0;
}

.weekly-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.weekly-header h2 {
    font-size: 18px;
    margin: 0 0 5px;
}

.weekly-header p {
    color: #999;
    font-size: 13px;
    margin: 0;
}

#weekly-percentage {
    color: var(--accent);
    font-size: 22px;
    font-weight: 600;
}

.weekly-progress-track {
    height: 6px;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
}

#weekly-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.weekly-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.weekly-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 10px 2px;
    border-radius: 10px;
    background: #252525;
}

.weekly-day.today {
    border: 1px solid var(--accent);
}

.weekly-day.future {
    opacity: 0.4;
}

.day-name {
    color: #999;
    font-size: 11px;
}

.day-date {
    font-size: 14px;
    font-weight: 600;
}

/* Weekly Square Indicators */

.day-progress {
    width: 18px;
    height: 18px;
    min-height: 18px;
    flex: 0 0 18px;
    background: #383838;
    border-radius: 4px;
    overflow: hidden;
}

.day-progress-fill {
    width: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: height 0.3s ease;
}

.day-result {
    color: #999;
    font-size: 10px;
}

/* =========================================
   Monthly Activity Heatmap
========================================= */

.monthly-overview {
    width: 100%;
    background-color: #1c1c1c;
    border: 1px solid #303030;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 24px;
}

.monthly-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.monthly-header h2 {
    font-size: 17px;
    margin-bottom: 4px;
}

.monthly-header p {
    color: #888;
    font-size: 12px;
}

#monthly-label {
    color: #aaa;
    font-size: 12px;
}

.heatmap-weekdays,
.monthly-heatmap {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    width: 100%;
    gap: 9px 0;
}

.heatmap-weekdays {
    margin-bottom: 12px;
}

.heatmap-weekdays span {
    text-align: center;
    color: #888;
    font-size: 11px;
}

.heatmap-cell {
    width: 30px;
    height: 30px;
    justify-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    font-size: 11px;
    color: #bbb;
    background-color: #292929;
}

.heatmap-cell.empty {
    visibility: hidden;
}

/* Activity Levels */

.heatmap-cell.activity-0 {
    background-color: #292929;
}

.heatmap-cell.activity-1 {
    background-color: #244b38;
    color: #c6f2d8;
}

.heatmap-cell.activity-2 {
    background-color: #28734b;
    color: #d5f5e2;
}

.heatmap-cell.activity-3 {
    background-color: #35a467;
    color: #ffffff;
}

.heatmap-cell.activity-4 {
    background-color: #55d68b;
    color: #10291b;
}

/* Global Activity Classes, also used by the legend */

.activity-0 {
    background-color: #292929;
}

.activity-1 {
    background-color: #244b38;
}

.activity-2 {
    background-color: #28734b;
}

.activity-3 {
    background-color: #35a467;
}

.activity-4 {
    background-color: #55d68b;
}

/* Future and Current Dates */

.heatmap-cell.future {
    background-color: #181818;
    color: #555;
}

.heatmap-cell.current-day {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Heatmap Legend */

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    margin-top: 18px;
    color: #888;
    font-size: 10px;
}

.heatmap-legend span:not(:first-child):not(:last-child) {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* Clickable Heatmap */

.heatmap-cell.clickable {
    cursor: pointer;
    transition: transform 0.15s ease, border 0.15s ease;
}

.heatmap-cell.clickable:hover {
    transform: scale(1.12);
    outline: 1px solid var(--accent);
}

/* =========================================
   Daily Activity Dialog
========================================= */

.day-details-dialog {
    width: min(420px, calc(100% - 32px));
    margin: auto;
    padding: 0;
    background: var(--surface);
    color: var(--text);
    border: 1px solid #39443b;
    border-radius: 16px;
}

.day-details-dialog::backdrop {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.day-details-content {
    padding: 24px;
}

.day-details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
}

.day-details-header p {
    color: var(--accent);
    font-size: 10px;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.day-details-header h2 {
    font-size: 19px;
}

#details-close {
    background: transparent;
    border: none;
    color: #999;
    font-size: 26px;
    cursor: pointer;
}

.day-details-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

#details-percentage {
    color: var(--accent);
    font-size: 25px;
    font-weight: bold;
}

#details-count {
    color: #999;
    font-size: 12px;
}

.details-progress-track {
    height: 7px;
    background: #343b35;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
}

#details-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.details-habit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid #303830;
    font-size: 13px;
}

.details-completed {
    color: var(--accent);
    white-space: nowrap;
}

.details-missed {
    color: #d58b8b;
    white-space: nowrap;
}

.no-habits-message {
    color: #999;
    font-size: 13px;
    padding: 12px 0;
}

/* Clickable Weekly Overview */

.weekly-day.clickable-day {
    cursor: pointer;
    transition: transform 0.15s ease, border 0.15s ease;
}

.weekly-day.clickable-day:hover {
    transform: translateY(-3px);
    border: 1px solid var(--accent);
}

/* =========================================
   Page Navigation
========================================= */

.page {
    display: none;
}

.page.active {
    display: block;
}

/* =========================================
   Statistics Page
========================================= */

.statistics-section {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.page-heading {
    margin-bottom: 28px;
}

.page-heading .section-label {
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.page-heading h2 {
    font-size: 25px;
    margin: 8px 0;
    margin-bottom: 8px;
}

.page-heading > p:last-child {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

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

.stat-card {
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
}

.stat-card > p {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 12px;
}

.stat-card h3 {
    font-size: 27px;
    font-weight: 600;
}

.completion-card {
    width: 100%;
    padding: 24px;
}

.completion-card > p {
    margin-bottom: 14px;
}

.completion-card h3 {
    font-size: 32px;
    margin-bottom: 4px;
}

.completion-card .progress-track {
    height: 9px;
    margin-top: 20px;
    margin-bottom: 14px;
}

.completion-card .progress-caption {
    font-size: 12px;
}

.habit-performance {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.habit-performance h2 {
    font-size: 19px;
}

.habit-performance > p {
    color: var(--muted);
    font-size: 13px;
    margin-top: -12px;
}

.performance-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
}

.performance-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.performance-info span:last-child {
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
}

.performance-track {
    width: 100%;
    height: 8px;
    background: #303630;
    border-radius: 20px;
    overflow: hidden;
}

.performance-fill {
    height: 100%;
    background: #8bc49a;
    border-radius: 20px;
    transition: width 0.3s ease;
}

/* Consistency Trend Chart */

.consistency-chart-section {
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    width: 100%;
}

.chart-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.chart-heading h2 {
    font-size: 19px;
    margin-bottom: 7px;
}

.chart-heading p {
    color: var(--muted);
    font-size: 13px;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 260px;
}

#consistency-chart {
    display: block;
    width: 100%;
    height: 100%;
}

/* Statistics Period Selector */

.statistics-period {
    background-color: var(--surface);
    color: var(--accent);
    border: 1px solid #39443b;
    border-radius: 8px;
    padding: 9px 32px 9px 12px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
    margin-top: 18px;
}

.statistics-period:hover,
.statistics-period:focus {
    border-color: var(--accent);
}

.statistics-period option {
    background-color: var(--surface);
    color: var(--text);
}

/* Statistics Empty State */

.statistics-empty-state {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 35px 20px;
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.statistics-empty-state[hidden] {
    display: none;
}

.statistics-empty-icon {
    font-size: 35px;
    color: var(--accent);
    margin-bottom: 18px;
}

.statistics-empty-state h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.statistics-empty-state p {
    max-width: 340px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

/* Insights Navigation */

.insights-header {
    margin-bottom: 28px;
}

.insights-header .page-heading {
    margin-bottom: 22px;
}

.insights-tabs {
    display: flex;
    gap: 8px;
    padding: 5px;
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: fit-content;
}

.insights-tab {
    padding: 9px 22px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.insights-view[hidden],
#statistics-content[hidden] {
    display: none;
}

/* =========================================
   Dashboard Date Navigator
========================================= */

.date-navigator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 16px;
    position: relative;
}

.date-nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1px solid #3b493d;
    border-radius: 8px;
    background-color: #29352c;
    color: var(--accent);
    font-family: Arial, sans-serif;
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.date-nav-button:hover:not(:disabled) {
    background-color: #3a4b3d;
}

.date-nav-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.selected-date {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.selected-date:hover {
    color: var(--accent);
}

#selected-day {
    color: var(--accent);
}

.calendar-icon {
    font-size: 17px;
    margin-left: 3px;
}

#today-habits-button {
    cursor: pointer;
    transition: color 0.2s ease;
}

#today-habits-button:hover {
    color: var(--accent);
}

/* Custom Dashboard Calendar */

.calendar-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 290px;
    padding: 16px;
    background: #202720;
    border: 1px solid #354438;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    z-index: 100;
}

.calendar-dropdown.active {
    display: block;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.calendar-header h3 {
    color: white;
    font-size: 15px;
}

.calendar-header button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: #29352c;
    color: var(--accent);
    font-size: 18px;
    cursor: pointer;
}

.calendar-header button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.calendar-weekdays,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

.calendar-weekdays {
    margin-bottom: 10px;
}

.calendar-weekdays span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
}

.calendar-day:hover:not(:disabled) {
    background: #354438;
}

.calendar-day.today {
    border: 1px solid var(--accent);
    color: var(--accent);
}

.calendar-day.selected {
    background: var(--accent);
    color: var(--accent-text);
    font-weight: 700;
}

.calendar-day:disabled {
    color: #505750;
    cursor: not-allowed;
}

.calendar-day.empty {
    cursor: default;
}

/* =========================================
   Settings Page
========================================= */

.settings-container {
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin-top: 28px;
}

.settings-section {
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
}

.settings-section-heading {
    margin-bottom: 22px;
}

.settings-section-heading h2 {
    font-size: 18px;
    margin-bottom: 7px;
}

.settings-section-heading p {
    color: var(--muted);
    font-size: 13px;
}

.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.settings-option-info h3 {
    font-size: 14px;
    margin-bottom: 6px;
}

.settings-option-info p {
    color: var(--muted);
    font-size: 12px;
}

.settings-select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid #39443a;
    border-radius: 8px;
    padding: 9px 13px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.settings-select:focus {
    border-color: var(--accent);
}

/* Edit Limit Warning */

.edit-limit-warning {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
    margin: 22px 0;
}

.edit-limit-warning strong {
    display: block;
    font-size: 14px;
    margin-bottom: 12px;
}

.edit-limit-warning p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.edit-limit-warning p + p {
    margin-top: 14px;
}

.edit-limit-warning p:last-child {
    color: var(--accent);
    font-weight: 600;
}

/* =========================================
   Profile Settings
========================================= */

.profile-settings-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 0;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.profile-settings-avatar {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #26382a;
    color: var(--accent);
    font-size: 21px;
    font-weight: bold;
}

.profile-settings-info h3 {
    font-size: 15px;
    margin-bottom: 5px;
}

.profile-settings-info p {
    color: var(--muted);
    font-size: 12px;
}

.profile-settings-preview .edit-button {
    margin-left: auto;
    font-size: 13px;
    padding: 8px 12px;
}

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

.profile-form[hidden] {
    display: none;
}

.profile-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-input-group label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.profile-input-group input {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.profile-input-group input:focus {
    border-color: var(--accent);
}

.profile-form .add-button {
    align-self: flex-start;
    margin-top: 5px;
}

.profile-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.profile-form-actions button {
    font-size: 12px;
}

/* =========================================
   First Launch Welcome Dialog
========================================= */

.welcome-dialog {
    width: min(430px, calc(100% - 32px));
    margin: auto;
    padding: 0;
    background: var(--surface-secondary);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.welcome-dialog::backdrop {
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(6px);
}

.welcome-dialog-content {
    padding: 34px;
}

.welcome-dialog .welcome-label {
    color: var(--accent);
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 18px;
}

.welcome-dialog h2 {
    font-size: 27px;
    letter-spacing: -0.8px;
    margin-bottom: 10px;
}

.welcome-dialog .welcome-description {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 28px;
}

.welcome-dialog .profile-input-group {
    margin-bottom: 20px;
}

.welcome-dialog .add-button {
    width: 100%;
    padding: 13px;
    font-size: 14px;
    margin-top: 5px;
}

.welcome-dialog .add-button:hover,
.profile-form .add-button:hover {
    filter: brightness(1.08);
}

/* =========================================
   Bottom Navigation
========================================= */

.bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 500px;
    margin: 50px auto 15px;
    padding: 12px 20px;
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 5px;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.nav-item span {
    font-size: 22px;
}

.nav-item small {
    font-size: 11px;
    font-weight: 600;
}

.nav-item.active,
.nav-item:hover {
    color: var(--accent);
}

/* =========================================
   Reminder Settings
========================================= */

.reminder-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 25px;
    flex-shrink: 0;
}

.reminder-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.reminder-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.reminder-toggle-slider::before {
    content: "";
    position: absolute;
    width: 19px;
    height: 19px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.reminder-toggle input:checked + .reminder-toggle-slider {
    background: var(--accent);
}

.reminder-toggle input:checked + .reminder-toggle-slider::before {
    transform: translateX(21px);
}

.reminder-toggle input:focus-visible + .reminder-toggle-slider {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.reminder-time-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.reminder-message {
    margin-top: 20px;
    padding: 13px 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--muted);
    font-size: 12px;
}

.reminder-time-option input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* =========================================
   Partners Page
========================================= */

#partners-page .settings-section {
    margin-top: 0;
}

#connect-partner-button {
    margin-top: 4px;
}

/* Accountability Partners */

.partner-id-section,
.partner-connect-section,
.incoming-request-section,
.outgoing-request-section {
    margin-bottom: 22px;
}

.partner-id-display {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 65px;
    padding: 16px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 10px;
    text-align: center;
}

.partner-id-display span {
    color: var(--accent);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
}

.partner-note {
    margin-top: 13px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

#connect-partner-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#connect-partner-form label {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

#partner-id-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

#partner-id-input:focus {
    border-color: var(--accent);
}

#partner-id-input::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

#connect-partner-form button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Incoming Partner Request */

.empty-request-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.empty-request-icon {
    font-size: 28px;
    margin-bottom: 14px;
    opacity: 0.75;
}

.empty-request-state h3 {
    font-size: 14px;
    margin-bottom: 7px;
}

.empty-request-state p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
    max-width: 280px;
}

/* Connected Partner */

.connected-partner-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.connected-partner-avatar {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    font-size: 18px;
    font-weight: 700;
}

.connected-partner-info h3 {
    font-size: 14px;
    margin-bottom: 5px;
}

.connected-partner-info p {
    color: var(--muted);
    font-size: 12px;
}

.partner-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
}

.partner-stat {
    padding: 17px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.partner-stat span {
    display: block;
    color: var(--accent);
    font-size: 23px;
    font-weight: 700;
    margin-bottom: 6px;
}

.partner-stat p {
    color: var(--muted);
    font-size: 12px;
}

.remove-partner-button {
    width: 100%;
    margin-top: 20px;
    padding: 11px;
    background: transparent;
    border: 1px solid #a84c4c;
    border-radius: 9px;
    color: #e07878;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.remove-partner-button:hover {
    background: rgba(168, 76, 76, 0.12);
}

/* Outgoing Partner Request */

.outgoing-request-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 17px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.outgoing-request-icon {
    font-size: 27px;
}

.outgoing-request-info h3 {
    font-size: 14px;
    margin-bottom: 6px;
}

.outgoing-request-info p {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 5px;
}

.outgoing-request-info span {
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
}

.cancel-request-button {
    width: 100%;
    margin-top: 16px;
    padding: 11px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
}

.cancel-request-button:hover {
    color: var(--text);
    border-color: var(--muted);
}

/* Incoming Request Card */

.incoming-request-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.incoming-request-avatar {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--accent);
    color: var(--accent-text);
    border-radius: 50%;
    font-size: 17px;
    font-weight: 700;
}

.incoming-request-info h3 {
    font-size: 14px;
    margin-bottom: 5px;
}

.incoming-request-info p {
    color: var(--muted);
    font-size: 12px;
}

.request-actions {
    display: flex;
    gap: 12px;
    margin-top: 17px;
}

.request-actions button {
    flex: 1;
    padding: 11px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

#accept-request-button {
    background: var(--accent);
    color: var(--accent-text);
    border: 1px solid var(--accent);
}

#accept-request-button:hover {
    opacity: 0.85;
}

#decline-request-button {
    background: transparent;
    color: #e07878;
    border: 1px solid #a84c4c;
}

#decline-request-button:hover {
    background: rgba(168, 76, 76, 0.12);
}

/* =========================================
   One-Time Tasks
========================================= */

.one-time-tasks-section {
    margin-top: 36px;
}

.one-time-tasks-section .section-heading {
    margin-bottom: 16px;
}

.one-time-task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-tasks-message {
    padding: 22px 18px;
    background-color: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}

.one-time-task-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.one-time-task-details {
    flex: 1;
    min-width: 0;
}

.one-time-task-details h3 {
    font-size: 14px;
    margin-bottom: 5px;
}

.one-time-task-details p {
    color: var(--muted);
    font-size: 12px;
}

.one-time-task-date {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.one-time-task-card.overdue {
    border-color: #a84c4c;
}

.one-time-task-card.overdue .one-time-task-date {
    color: #e17b7b;
}

.one-time-task-card.completed {
    opacity: 0.65;
}

.one-time-task-card.completed h3,
.completed-task-name {
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.one-time-task-card.completed .check-button {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* One-Time Task Form */

#one-time-task-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 16px;
    margin-bottom: 20px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

#one-time-task-form[hidden] {
    display: none;
}

#one-time-task-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    color: var(--text);
    font: inherit;
    outline: none;
}

#one-time-task-form input:focus {
    border-color: var(--accent);
}

#one-time-task-form .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

#one-time-task-form .form-actions button {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition: 0.2s ease;
}

#one-time-task-form .add-button {
    background: var(--accent);
    color: var(--accent-text);
}

#one-time-task-form .cancel-button {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}

#one-time-task-form button:hover {
    opacity: 0.85;
}

/* Clear Completed Button */

.clear-completed-button {
    display: block;
    margin: 0 0 12px auto;
    padding: 8px 13px;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.clear-completed-button:hover {
    background: var(--surface);
    color: var(--text);
    border-color: var(--primary);
}

/* =========================================
   Authentication Screen
========================================= */

.auth-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--background);
}

.auth-screen[hidden] {
    display: none;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.auth-card > h1 {
    margin-bottom: 8px;
    font-size: 30px;
    text-align: center;
}

.auth-card > h1 span {
    color: var(--primary);
}

.auth-subtitle {
    margin-bottom: 28px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--background);
    border-radius: 10px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    cursor: pointer;
}

.auth-tab.active {
    background: var(--surface);
    color: var(--text);
}

#login-form,
#register-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#login-form[hidden],
#register-form[hidden] {
    display: none;
}

#login-form label,
#register-form label {
    font-size: 13px;
    font-weight: 600;
}

#login-form input,
#register-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    color: var(--text);
    font: inherit;
    font-size: 13px;
}

#login-form .add-button,
#register-form .add-button {
    width: 100%;
    margin-top: 10px;
}

#auth-message {
    margin-top: 16px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

/* Authentication Button States */

#login-form button:disabled,
#register-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* OTP Verification Buttons */

#login-otp-section button,
#register-otp-section button {
    padding: 10px 14px;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Primary Verification Buttons */

#login-otp-section button[type="submit"],
#register-otp-section #verify-register-otp {
    width: 100%;
    margin-top: 10px;
    background-color: var(--primary);
    color: white;
    border: none;
}

/* Resend Buttons */

#login-otp-section #resend-login-otp,
#register-otp-section #resend-register-otp {
    width: 100%;
    margin-top: 8px;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

#login-otp-section #resend-login-otp:hover,
#register-otp-section #resend-register-otp:hover {
    background-color: var(--primary);
    color: white;
}

/* Logout Button */

#logout-button {
    background-color: #fff1f1;
    color: #d64545;
    border: 1px solid #f3caca;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#logout-button:hover {
    background-color: #ffe0e0;
}

#logout-button:focus-visible {
    outline: 2px solid #d64545;
    outline-offset: 3px;
}

/* Keep hidden authentication sections hidden */

.auth-screen [hidden] {
    display: none !important;
}

/* =========================================
   Footer
========================================= */

footer {
    text-align: center;
    color: #687169;
    font-size: 12px;
    margin-top: 55px;
}

/* =========================================
   Responsive Layout
========================================= */

@media (max-width: 650px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .app-container {
        padding: 25px 18px;
    }

    .topbar {
        margin-bottom: 45px;
    }

    .welcome h2 {
        font-size: 31px;
    }

    .progress-card {
        padding: 20px;
    }

    .section-heading h2 {
        font-size: 20px;
    }

    .one-time-tasks-section {
        margin-top: 30px;
    }

    .one-time-task-card {
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .weekly-overview {
        padding: 16px 10px;
    }

    .weekly-days {
        gap: 4px;
    }

    .weekly-day {
        padding: 9px 1px;
    }

    .monthly-overview {
        padding: 16px 12px;
    }

    .heatmap-cell {
        width: 25px;
        height: 25px;
    }

    .heatmap-weekdays,
    .monthly-heatmap {
        row-gap: 7px;
    }

    .stats-grid {
        gap: 10px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card h3 {
        font-size: 23px;
    }

    .consistency-chart-section {
        padding: 16px 12px;
    }

    .chart-container {
        height: 220px;
    }

    .settings-section {
        padding: 18px;
    }

    .settings-option {
        align-items: flex-start;
        flex-direction: column;
    }

    .welcome-dialog-content {
        padding: 26px 22px;
    }

    .welcome-dialog h2 {
        font-size: 24px;
    }

    .profile-settings-preview {
        padding: 13px;
    }

    .profile-form-actions {
        flex-wrap: wrap;
    }

    .insights-tab {
        padding: 9px 18px;
    }

    .statistics-empty-state {
        min-height: 240px;
        padding: 25px 18px;
    }

    .reminder-time-option {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-card {
        padding: 24px;
    }
}

@media (max-width: 450px) {
    .habit-card {
        gap: 9px;
        padding: 12px;
    }

    .habit-actions {
        gap: 2px;
    }

    .edit-button,
    .delete-button {
        font-size: 11px;
        padding: 4px;
    }

    .date-navigator {
        padding: 9px 10px;
    }

    .selected-date {
        gap: 6px;
        font-size: 12px;
    }

    .date-nav-button {
        width: 32px;
        height: 32px;
    }
}

/* ============================= */
/* ONE-TIME TASK DIALOG           */
/* ============================= */

.one-time-task-dialog {
    width: min(440px, calc(100% - 32px));
    margin: auto;
    padding: 0;

    background: var(--surface);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 18px;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.one-time-task-dialog::backdrop {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.one-time-task-dialog form {
    padding: 30px;
}

.one-time-dialog-header {
    margin-bottom: 28px;
}

.one-time-dialog-header .section-label {
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.one-time-dialog-header h2 {
    font-size: 25px;
    font-weight: 650;
    margin: 0 0 8px;
    color: var(--text);
}

.one-time-dialog-header > p:last-child {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

.one-time-dialog-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.one-time-dialog-fields label {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
}

.one-time-dialog-fields input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;

    background: var(--background);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 9px;

    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.one-time-dialog-fields input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(168, 230, 176, 0.12);
}

.one-time-dialog-fields input::placeholder {
    color: var(--muted);
    opacity: 0.8;
}

.one-time-dialog-fields input[type="date"] {
    color-scheme: dark;
}

body[data-theme="light"] .one-time-dialog-fields input[type="date"] {
    color-scheme: light;
}

.one-time-dialog-fields input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

.one-time-dialog-dialog .form-actions {
    margin-top: 28px;
}

.one-time-task-dialog .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
}

.one-time-task-dialog .form-actions button {
    padding: 11px 18px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.one-time-task-dialog .cancel-button {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}

.one-time-task-dialog .cancel-button:hover {
    background: var(--background);
    color: var(--text);
}

.one-time-task-dialog .add-button {
    background: var(--accent);
    color: var(--accent-text);
    border: 1px solid var(--accent);
}

.one-time-task-dialog .add-button:hover {
    filter: brightness(1.08);
}

@media (max-width: 480px) {
    .one-time-task-dialog form {
        padding: 23px;
    }

    .one-time-task-dialog .form-actions button {
        flex: 1;
    }
}

/* ============================= */
/* RECURRING TASK SCHEDULE       */
/* ============================= */

.schedule-options {
    margin-top: 18px;
}

.schedule-title {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 12px;
}

.schedule-days {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
}

.schedule-days label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 10px 5px;

    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 9px;

    color: var(--muted);
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
    transition: 0.2s ease;
}

.schedule-days label:has(input:checked) {
    background: color-mix(in srgb, var(--accent) 13%, var(--surface));
    border-color: var(--accent);
    color: var(--accent);
}

.schedule-days input {
    width: 13px;
    height: 13px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

@media (max-width: 480px) {
    .schedule-days {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* Spacing for recurring Save Progress button */

#save-recurring-progress-button {
    margin-top: 20px;
    margin-bottom: 32px;
}
#save-one-time-progress-button {
    margin-top: 20px;
    margin-bottom: 32px;
}
/* Habits not scheduled on the selected date */

.unscheduled-group summary {
    padding: 8px 4px;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
}

.unscheduled-group .habit-card {
    margin-top: 12px;
    opacity: 0.7;
}

/* Secondary button on the login form */

.auth-secondary-button {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: transparent;
    color: var(--primary);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* "Show password" checkbox on the login and register forms */

#login-form .show-password-toggle,
#register-form .show-password-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-weight: 400;
    cursor: pointer;
}

#login-form .show-password-toggle input,
#register-form .show-password-toggle input {
    width: auto;
    padding: 0;
    accent-color: var(--accent);
}

/* Partners: shared information and privacy switches */

.partner-stats {
    grid-template-columns: repeat(3, 1fr);
}

.partner-shared-block {
    margin-top: 20px;
}

.partner-shared-block h3 {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
}

.partner-shared-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
}

.partner-shared-list li {
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    font-size: 13px;
}

.partner-privacy-section .settings-option + .settings-option {
    margin-top: 18px;
}

/* Partners: today's summary and the 7-day chart */

.partner-today-summary {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.partner-today-track {
    height: 8px;
    margin-top: 10px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.partner-today-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
}

.partner-habits-details {
    margin-top: 12px;
}

.partner-habits-details summary {
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
}

.partner-habits-details .partner-shared-list {
    margin-top: 10px;
}

.partner-week-chart {
    display: flex;
    gap: 8px;
    padding: 16px 14px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.partner-week-day {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.partner-week-count {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.partner-week-bar-area {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: 96px;
    border-bottom: 1px solid var(--border);
}

.partner-week-bar {
    width: 100%;
    max-width: 30px;
    background: var(--accent);
    border-radius: 4px 4px 0 0;
}

.partner-week-bar.empty {
    height: 0;
}

.partner-week-label {
    color: var(--muted);
    font-size: 11px;
}

/* Gap between My Partner and the section below it */

.my-partner-section {
    margin-bottom: 22px;
}

/* Login form: main fields and the "set a new password" step */

#login-main-fields {
    display: contents;
}

#login-main-fields[hidden] {
    display: none;
}

#login-reset-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#login-reset-section[hidden] {
    display: none;
}
