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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #121212;
    color: #e0e0e0;
    min-height: 100vh;
}

/* Install Banner */
#install-banner {
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-install {
    background: #bb86fc;
    color: #121212;
    font-weight: 600;
    padding: 8px 20px;
    font-size: 0.85rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-install:hover {
    background: #ce9efc;
}

.btn-dismiss {
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 6px;
    flex-shrink: 0;
}

.btn-dismiss:hover {
    color: #999;
}

/* iOS Install Guide */
.ios-guide-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
}

.ios-guide-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e1e1e;
    border-radius: 16px 16px 0 0;
    padding: 24px 20px;
    z-index: 1000;
    max-width: 500px;
    margin: 0 auto;
}

.ios-guide-sheet h2 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-align: center;
}

.ios-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ios-step {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ios-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #bb86fc;
    color: #121212;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ios-step-text {
    font-size: 0.95rem;
    color: #e0e0e0;
    line-height: 1.4;
}

.ios-step-text strong {
    color: #fff;
}

.ios-share-icon {
    vertical-align: middle;
    margin: 0 2px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

h1 {
    font-size: 1.4rem;
    color: #fff;
}

/* Calendar View Layout */
#calendar-view {
    text-align: center;
}

/* Calendar Top Row */
.calendar-top-row {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-top-row .profile-wrapper {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.profile-wrapper {
    position: relative;
}

.btn-profile {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #bb86fc;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    overflow: hidden;
}

.btn-profile:hover {
    background: #ce9efc;
}

.btn-profile:active {
    transform: scale(0.95);
}

.profile-menu {
    position: absolute;
    top: 44px;
    right: 0;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 100;
}

.profile-email {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 10px;
    word-break: break-all;
}

.btn-logout-menu {
    width: 100%;
    background: #2c2c2c;
    color: #cf6679;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout-menu:hover {
    background: #3a3a3a;
}

.btn-profile-page {
    width: 100%;
    background: #2c2c2c;
    color: #bb86fc;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 6px;
}

.btn-profile-page:hover {
    background: #3a3a3a;
}

/* Calendar Actions */
.calendar-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-calendar-action {
    background: #2c2c2c;
    color: #bb86fc;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-calendar-action:hover {
    background: #3a3a3a;
}

.month-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.btn:active {
    opacity: 0.8;
}

.btn-nav {
    background: #2c2c2c;
    color: #bb86fc;
    font-size: 1rem;
    padding: 6px 12px;
    border-radius: 6px;
}

.btn-nav:hover {
    background: #3a3a3a;
}

.btn-back {
    background: #2c2c2c;
    color: #bb86fc;
    font-weight: 500;
}

.btn-back:hover {
    background: #3a3a3a;
}

/* Centered header with absolute back/add buttons */
.header-centered {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-back-abs {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    padding: 4px 10px;
}

.btn-add-abs {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #bb86fc;
    color: #121212;
    border: none;
    font-size: 1.5rem;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-add-abs:hover {
    background: #ce9efc;
}

/* Weekday header */
.weekday-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 4px;
}

.weekday-header span {
    font-size: 0.75rem;
    color: #888;
    padding: 8px 0;
    font-weight: 600;
    text-transform: uppercase;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 10px;
    background: #1e1e1e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    position: relative;
    border: 2px solid transparent;
    gap: 3px;
}

.calendar-day:hover {
    background: #2a2a2a;
    transform: scale(1.04);
}

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

.calendar-day.empty:hover {
    transform: none;
}

.calendar-day .day-number {
    font-size: 1rem;
    font-weight: 500;
    color: #ccc;
}

.calendar-day.today {
    border-color: #bb86fc;
}

.calendar-day.today .day-number {
    color: #fff;
    font-weight: 700;
}

.calendar-day.has-records .day-number {
    color: #81c784;
}

.day-indicator {
    display: flex;
    align-items: center;
    gap: 3px;
}

.day-indicator .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4caf50;
}

.day-indicator .count {
    font-size: 0.65rem;
    color: #81c784;
    font-weight: 600;
}

/* Day View */
#day-view {
    text-align: center;
}

.section-title {
    font-size: 1rem;
    color: #888;
    margin-bottom: 12px;
    margin-top: 24px;
    font-weight: 600;
}

/* Habit Selector Row */
.habit-selector-row {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 400px;
    margin: 0 auto;
}

/* Custom Select */
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-btn {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #444;
    border-radius: 10px;
    background: #1e1e1e;
    color: #e0e0e0;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    transition: border-color 0.2s;
}

.custom-select-btn:hover,
.custom-select-btn:focus {
    border-color: #bb86fc;
    outline: none;
}

.cs-icon {
    display: inline-flex;
    flex-shrink: 0;
    color: #aaa;
}

.cs-icon-empty {
    width: 18px;
    flex-shrink: 0;
}

.cs-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
}

.cs-cat {
    font-size: 0.75rem;
    color: #888;
    flex-shrink: 0;
}

.cs-arrow {
    color: #888;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-left: 4px;
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 10px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 50;
    padding: 4px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.cs-group-label {
    font-size: 0.7rem;
    color: #bb86fc;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 14px 4px;
}

.cs-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 0.9rem;
}

.cs-option:hover {
    background: #2c2c2c;
}

.cs-option.active {
    background: rgba(187, 134, 252, 0.1);
}

.cs-option .cs-name {
    color: #e0e0e0;
}

.cs-option.active .cs-name {
    color: #bb86fc;
    font-weight: 500;
}

/* Timer Area */
#timer-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 0 24px;
}

.big-timer {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 3.5rem;
    color: #bb86fc;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.timer-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.big-timer-btn {
    padding: 12px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
}

.big-timer-btn.btn-start {
    background: #03dac6;
    color: #121212;
}

.big-timer-btn.btn-start:hover {
    background: #04f0d9;
}

.big-timer-btn.btn-stop {
    background: #cf6679;
    color: #121212;
}

.big-timer-btn.btn-stop:hover {
    background: #e07689;
}

/* Manual Add Area */
#manual-add-area {
    max-width: 400px;
    margin: 16px auto 0;
}

.btn-manual-toggle {
    width: 100%;
    background: #2c2c2c;
    color: #bb86fc;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-manual-toggle:hover {
    background: #3a3a3a;
}

#manual-add-form {
    background: #1e1e1e;
    border: 1px solid #2c2c2c;
    border-radius: 10px;
    padding: 16px;
    margin-top: 8px;
}

.manual-form-fields {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.manual-field {
    flex: 1;
}

.manual-field label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.manual-field input[type="time"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #444;
    border-radius: 8px;
    background: #2c2c2c;
    color: #e0e0e0;
    font-size: 1rem;
    outline: none;
}

.manual-field input[type="time"]:focus {
    border-color: #bb86fc;
}

.manual-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Day Summary */
#day-summary {
    margin-top: 8px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.summary-item {
    background: #1e1e1e;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid #2c2c2c;
}

.summary-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-item .habit-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-item .duration {
    flex-shrink: 0;
    margin-left: 12px;
}

/* Session entries within day summary */
.session-entries {
    margin-top: 8px;
    padding-left: 12px;
    border-left: 2px solid #333;
}

.session-entry {
    display: flex;
    align-items: center;
    padding: 4px 0;
    font-size: 0.8rem;
    gap: 8px;
}

.session-time {
    color: #777;
}

.session-duration {
    color: #6aaa6d;
}

.btn-delete-session {
    background: transparent;
    border: none;
    color: #555;
    font-size: 1.1rem;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: auto;
    line-height: 1;
    transition: color 0.2s, background 0.2s;
}

.btn-delete-session:hover {
    color: #cf6679;
    background: rgba(207, 102, 121, 0.1);
}

.summary-item .duration {
    font-size: 0.9rem;
    color: #81c784;
    font-weight: 600;
}

.summary-item .sessions-count {
    font-size: 0.75rem;
    color: #888;
}

.no-records {
    text-align: center;
    color: #555;
    padding: 24px 0;
    font-size: 0.9rem;
}

/* Habits View */

.habits-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 16px;
    margin-bottom: 8px;
    padding-left: 4px;
}

.habits-group-title:first-child {
    margin-top: 0;
}

.habit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1e1e1e;
    border: 1px solid #2c2c2c;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 6px;
}

.habit-item-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.habit-item-name {
    flex: 1;
    font-size: 0.95rem;
    color: #fff;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.habit-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-habit-edit {
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.btn-habit-edit:hover {
    color: #bb86fc;
    background: rgba(187, 134, 252, 0.1);
}

.btn-habit-delete {
    background: transparent;
    border: none;
    color: #555;
    font-size: 1.3rem;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.btn-habit-delete:hover {
    color: #cf6679;
    background: rgba(207, 102, 121, 0.1);
}

/* Stats View */

.stats-tabs {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
    margin-bottom: 16px;
}

.stats-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: #2c2c2c;
    color: #888;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.stats-tab.active {
    background: #bb86fc;
    color: #121212;
    font-weight: 600;
}

.stats-period-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.stats-period-nav span {
    font-size: 1rem;
    color: #fff;
    font-weight: 500;
    min-width: 180px;
    text-align: center;
}

.stats-total {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    border: 1px solid #2c2c2c;
    text-align: center;
}

.stats-total .stats-total-time {
    font-size: 2rem;
    font-weight: 700;
    color: #bb86fc;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.stats-total .stats-total-label {
    font-size: 0.8rem;
    color: #888;
    margin-top: 4px;
}

/* Stats Grouping Tabs */
.stats-group-tabs {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
    margin-bottom: 12px;
}

.stats-group-tab {
    flex: 1;
    padding: 8px;
    border: none;
    background: #2c2c2c;
    color: #888;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.stats-group-tab.active {
    background: #3a3a3a;
    color: #fff;
    font-weight: 600;
}

/* Stats Cards */
.stats-card {
    background: #1e1e1e;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 8px;
    border: 1px solid #2c2c2c;
}

.stats-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-card-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.stats-card-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
}

.stats-card-meta {
    font-size: 0.75rem;
    color: #888;
}

.stats-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    margin-left: 12px;
}

.stats-card-time {
    font-size: 1.15rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: #fff;
}

.stats-card-pct {
    font-size: 0.7rem;
    color: #888;
}

/* Dialog */
dialog {
    background: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: calc(100% - 32px);
    margin: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

#congrats-dialog {
    max-width: 360px;
}

dialog h2 {
    margin-bottom: 16px;
    font-size: 1.2rem;
    color: #fff;
}

.dialog-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.dialog-name-row input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #444;
    border-radius: 8px;
    background: #2c2c2c;
    color: #e0e0e0;
    font-size: 1rem;
    outline: none;
    margin-bottom: 0;
}

.dialog-name-row input[type="text"]:focus {
    border-color: #bb86fc;
}

.icon-picker-btn {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border: 2px dashed #555;
    border-radius: 10px;
    background: #2c2c2c;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
}

.icon-picker-btn:hover {
    border-color: #bb86fc;
    background: #333;
}

.icon-picker-btn.has-icon {
    border-style: solid;
    border-color: #bb86fc;
    color: #e0e0e0;
}

dialog input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #444;
    border-radius: 8px;
    background: #2c2c2c;
    color: #e0e0e0;
    font-size: 1rem;
    margin-bottom: 12px;
    outline: none;
}

dialog input[type="text"]:focus {
    border-color: #bb86fc;
}

.dialog-section-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Icon Picker Overlay */
.icon-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.icon-picker-sheet {
    background: #1e1e1e;
    border-radius: 16px;
    padding: 16px;
    width: 100%;
    max-width: 440px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.icon-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.icon-picker-header h3 {
    color: #fff;
    font-size: 1.1rem;
    margin: 0;
}

.icon-picker-close {
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.icon-picker-close:hover {
    color: #fff;
}

.icon-search {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #444;
    border-radius: 8px;
    background: #2c2c2c;
    color: #e0e0e0;
    font-size: 0.95rem;
    outline: none;
    margin-bottom: 12px;
}

.icon-search:focus {
    border-color: #bb86fc;
}

.icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    overflow-y: auto;
    padding-bottom: 8px;
    align-content: flex-start;
}

.icon-category-label {
    width: 100%;
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 0 4px;
    font-weight: 600;
}

.icon-category-label:first-child {
    padding-top: 0;
}

.icon-option {
    width: 42px;
    height: 42px;
    border: 2px solid transparent;
    border-radius: 10px;
    background: #2c2c2c;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
    color: #e0e0e0;
}

.icon-option:hover {
    background: #3a3a3a;
}

.icon-option.active {
    border-color: #bb86fc;
    background: rgba(187, 134, 252, 0.15);
    color: #bb86fc;
}

.color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.color-option {
    width: 32px;
    height: 32px;
    border: 3px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
}

.color-option:hover {
    transform: scale(1.15);
}

.color-option.active {
    border-color: #fff;
}

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

.btn-cancel {
    background: #333;
    color: #999;
}

.btn-cancel:hover {
    background: #444;
}

.btn-confirm {
    background: #bb86fc;
    color: #121212;
    font-weight: 600;
}

.btn-confirm:hover {
    background: #ce9efc;
}

/* Auth Screen */
#auth-view {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.auth-card {
    background: #1e1e1e;
    border-radius: 16px;
    padding: 32px 24px;
    width: 100%;
    max-width: 360px;
    border: 1px solid #2c2c2c;
}

.auth-title {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.5rem;
    color: #bb86fc;
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: #2c2c2c;
    color: #888;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.auth-tab.active {
    background: #bb86fc;
    color: #121212;
    font-weight: 600;
}

#auth-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #444;
    border-radius: 8px;
    background: #2c2c2c;
    color: #e0e0e0;
    font-size: 1rem;
    margin-bottom: 12px;
    outline: none;
}

#auth-form input:focus {
    border-color: #bb86fc;
}

.auth-error {
    color: #cf6679;
    font-size: 0.85rem;
    margin-bottom: 12px;
    min-height: 20px;
}

.btn-auth {
    width: 100%;
    background: #bb86fc;
    color: #121212;
    font-weight: 600;
    padding: 12px;
    font-size: 1rem;
    border-radius: 8px;
}

.btn-auth:hover {
    background: #ce9efc;
}

.btn-auth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Profile View */

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 0;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-email-large {
    font-size: 1rem;
    color: #aaa;
    word-break: break-all;
}

.profile-section-label {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 4px;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 320px;
}

.avatar-option {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, transform 0.1s;
}

.avatar-option:hover {
    transform: scale(1.1);
}

.avatar-option.active {
    border-color: #fff;
    box-shadow: 0 0 12px rgba(255,255,255,0.2);
}

/* Inline SVG Icons */
.summary-icon,
.stats-icon {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 4px;
    color: #aaa;
}

/* Session Comments */
.session-comment {
    font-size: 0.8rem;
    color: #aaa;
    font-style: italic;
    padding: 2px 0 2px 0;
    line-height: 1.3;
}

/* Congrats Dialog */
.congrats-content {
    text-align: center;
}

.congrats-emoji {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.congrats-detail {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 16px;
}

.congrats-prompt {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 10px;
}

.congrats-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #444;
    border-radius: 8px;
    background: #2c2c2c;
    color: #e0e0e0;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    resize: vertical;
    margin-bottom: 12px;
    min-height: 60px;
}

.congrats-textarea:focus {
    border-color: #bb86fc;
}

/* Feed View */
.feed-date-group {
    margin-bottom: 16px;
}

.feed-date-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 0 8px;
}

.feed-item {
    background: #1e1e1e;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 6px;
    border: 1px solid #2c2c2c;
}

.feed-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feed-item-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.feed-item-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-item-time {
    font-size: 0.8rem;
    color: #777;
    margin-top: 4px;
}

.feed-item-duration {
    font-size: 0.9rem;
    color: #81c784;
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 12px;
}

.feed-item-comment {
    font-size: 0.85rem;
    color: #aaa;
    font-style: italic;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #2c2c2c;
    line-height: 1.4;
}

/* Type Selector */
.type-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.type-option {
    padding: 6px 12px;
    border: 1px solid #444;
    border-radius: 8px;
    background: #2c2c2c;
    color: #888;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.type-option:hover {
    border-color: #bb86fc;
    color: #e0e0e0;
}

.type-option.active {
    background: #bb86fc;
    color: #121212;
    border-color: #bb86fc;
    font-weight: 600;
}

/* Type Fields */
.type-fields {
    margin-bottom: 4px;
}

.type-field {
    margin-bottom: 8px;
}

.type-field input[type="text"],
.type-field input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #444;
    border-radius: 8px;
    background: #2c2c2c;
    color: #e0e0e0;
    font-size: 1rem;
    outline: none;
}

.type-field input:focus {
    border-color: #bb86fc;
}

/* Schedule Selector */
.schedule-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.schedule-option {
    padding: 6px 12px;
    border: 1px solid #444;
    border-radius: 8px;
    background: #2c2c2c;
    color: #888;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.schedule-option:hover {
    border-color: #bb86fc;
    color: #e0e0e0;
}

.schedule-option.active {
    background: #bb86fc;
    color: #121212;
    border-color: #bb86fc;
    font-weight: 600;
}

/* Custom Days */
.custom-days {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    justify-content: center;
}

.day-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #444;
    background: #2c2c2c;
    color: #888;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-btn:hover {
    border-color: #bb86fc;
    color: #e0e0e0;
}

.day-btn.active {
    background: #bb86fc;
    color: #121212;
    border-color: #bb86fc;
    font-weight: 600;
}

/* Interaction Area */
.interaction-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    gap: 16px;
}

.interaction-result {
    text-align: center;
    padding: 24px 0;
}

.interaction-value {
    font-size: 1.2rem;
    color: #81c784;
    font-weight: 600;
}

.interaction-btn {
    padding: 14px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.interaction-btn-active {
    background: #03dac6;
    color: #121212;
}

.interaction-btn-active:hover {
    background: #04f0d9;
}

.interaction-btn-done {
    background: #81c784;
    color: #121212;
}

.interaction-btn-done:hover {
    background: #a5d6a7;
}

/* Streak Badge */
.streak-badge {
    font-size: 0.9rem;
    color: #ffb74d;
    font-weight: 600;
}

/* Counter */
.counter-display {
    text-align: center;
}

.counter-value {
    font-size: 3rem;
    font-weight: 700;
    color: #bb86fc;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.counter-unit {
    font-size: 1rem;
    color: #888;
}

.counter-buttons {
    display: flex;
    gap: 10px;
}

.counter-btn {
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    background: #2c2c2c;
    color: #e0e0e0;
    cursor: pointer;
    transition: background 0.2s;
}

.counter-btn:hover {
    background: #3a3a3a;
}

.counter-btn-main {
    background: #03dac6;
    color: #121212;
}

.counter-btn-main:hover {
    background: #04f0d9;
}

/* Counter Goal Bar */
.counter-goal-bar {
    width: 200px;
    height: 6px;
    background: #2c2c2c;
    border-radius: 3px;
    overflow: hidden;
}

.counter-goal-fill {
    height: 100%;
    background: #03dac6;
    border-radius: 3px;
    transition: width 0.3s;
}

.counter-goal-label {
    font-size: 0.8rem;
    color: #888;
}

/* Rating Stars */
.rating-stars {
    display: flex;
    gap: 8px;
}

.rating-star {
    font-size: 2.5rem;
    background: transparent;
    border: none;
    color: #444;
    cursor: pointer;
    transition: color 0.15s, transform 0.1s;
    padding: 0;
    line-height: 1;
}

.rating-star:hover {
    transform: scale(1.2);
    color: #ffb74d;
}

.rating-star.active {
    color: #ffb74d;
}

/* Avoid */
.avoid-streak {
    font-size: 1.3rem;
    color: #ffb74d;
    font-weight: 700;
    text-align: center;
}

.avoid-streak em {
    color: #e0e0e0;
    font-style: normal;
}

.avoid-motivation {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

/* Habit Type Badge */
.habit-type-badge {
    display: inline-block;
    font-size: 0.65rem;
    color: #bb86fc;
    background: rgba(187, 134, 252, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 16px 8px;
    }

    h1 {
        font-size: 1.15rem;
    }

    .calendar-day .day-number {
        font-size: 0.85rem;
    }

    .day-indicator .dot {
        width: 5px;
        height: 5px;
    }

    .day-indicator .count {
        font-size: 0.6rem;
    }

    .big-timer {
        font-size: 2.8rem;
    }

    .big-timer-btn {
        padding: 10px 32px;
        font-size: 1rem;
    }

    .stats-total .stats-total-time {
        font-size: 1.6rem;
    }

    .btn-profile {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}
