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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

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

header {
    margin-bottom: 24px;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

/* Add form */
.add-form {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
}

.add-form input {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    background: #151515;
    color: #e0e0e0;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.add-form input:focus {
    border-color: #4a9eff;
}

.add-form input::placeholder {
    color: #555;
}

.add-form button[type="submit"] {
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    background: #4a9eff;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.add-form button[type="submit"]:active {
    background: #3a8eef;
}

/* Mic button */
.mic-btn {
    padding: 14px;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    background: #1a1a1a;
    color: #aaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mic-btn:active {
    border-color: #4a9eff;
    color: #4a9eff;
}

.mic-btn.mic-disabled {
    opacity: 0.3;
    cursor: default;
}

.mic-btn.listening {
    border-color: #ff4a4a;
    color: #ff4a4a;
    background: rgba(255, 74, 74, 0.1);
    animation: pulse 1.5s infinite;
}

/* Task list */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    border-radius: 10px;
    transition: background 0.15s;
}

.task:active {
    background: #1a1a1a;
}

/* Checkbox */
.check-form, .check-done {
    flex-shrink: 0;
}

.check-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
}

.checkbox {
    display: block;
    width: 22px;
    height: 22px;
    border: 2px solid #3a3a3a;
    border-radius: 50%;
    transition: all 0.2s;
}

.check-btn:active .checkbox {
    border-color: #4a9eff;
    background: rgba(74, 158, 255, 0.1);
}

.checkbox.checked {
    border-color: #4a9eff;
    background: #4a9eff;
}

/* Task content */
.task-content {
    flex: 1;
    min-width: 0;
}

.task-text {
    display: block;
    font-size: 16px;
    line-height: 1.4;
    word-wrap: break-word;
}

.task-time {
    display: block;
    font-size: 12px;
    color: #555;
    margin-top: 2px;
}

/* Done tasks */
.done-section {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #1a1a1a;
}

.done-section h2 {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.task.done .task-text {
    color: #555;
    text-decoration: line-through;
}

.delete-btn {
    background: none;
    border: none;
    color: #3a3a3a;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.delete-btn:active {
    color: #ff4a4a;
    background: rgba(255, 74, 74, 0.1);
}

/* Category groups */
.category-group {
    margin-bottom: 20px;
}

.category-header {
    font-size: 13px;
    font-weight: 600;
    color: #6abf6a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px 4px;
}

/* Snooze button */
.snooze-form {
    flex-shrink: 0;
}

.snooze-btn {
    background: #1a1a2a;
    border: 1px solid #2a2a3a;
    font-size: 16px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    opacity: 0.7;
    transition: all 0.15s;
}

.snooze-btn:active {
    opacity: 1;
    background: #2a2a3a;
}

/* Tags */
.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tag-cat {
    background: #1a2a1a;
    color: #6abf6a;
}

.tag-high {
    background: #2a1a1a;
    color: #ff6b6b;
}

.tag-low {
    background: #1a1a2a;
    color: #6b8aff;
}

.tag-due {
    background: #1a1a1a;
    color: #888;
}

.tag-due.due-today {
    background: #2a2a1a;
    color: #ffc107;
}

.tag-due.due-soon {
    background: #2a2510;
    color: #e0a800;
}

.tag-due.overdue {
    background: #2a1a1a;
    color: #ff4a4a;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Header row */
.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.summary-link {
    font-size: 14px;
    color: #4a9eff;
    text-decoration: none;
    padding: 8px 14px;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    transition: all 0.2s;
}

.summary-link:active {
    background: rgba(74, 158, 255, 0.1);
}

/* Summary page */
.summary-date {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

.summary-content {
    margin: 24px 0;
}

.summary-content p {
    font-size: 15px;
    line-height: 1.5;
    color: #ccc;
    margin-bottom: 6px;
}

.briefing-label {
    font-size: 12px;
    font-weight: 700;
    color: #4a9eff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 20px;
    margin-bottom: 8px;
}

.briefing-label:first-child {
    margin-top: 0;
}

.briefing-bullet {
    padding-left: 4px;
}

.back-link {
    display: inline-block;
    color: #4a9eff;
    text-decoration: none;
    font-size: 15px;
    padding: 12px 0;
}

/* Empty state */
.empty {
    text-align: center;
    color: #555;
    padding: 40px 0;
    font-size: 16px;
}

/* Login page */
.login-container {
    padding-top: 80px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.login-form input {
    padding: 14px 16px;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    background: #151515;
    color: #e0e0e0;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.login-form input:focus {
    border-color: #4a9eff;
}

.login-form button {
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: #4a9eff;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
}

.login-error {
    color: #ff4a4a;
    font-size: 14px;
    margin-top: 16px;
}

/* Header links */
.header-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.logout-link {
    font-size: 14px;
    color: #555;
    text-decoration: none;
    padding: 8px 12px;
}

/* Floating action button */
.fab {
    position: fixed;
    bottom: 28px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #4a9eff;
    color: #fff;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(74, 158, 255, 0.3);
    transition: all 0.2s;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.fab:active {
    transform: scale(0.92);
}

.fab-active {
    background: #333;
    box-shadow: none;
}

/* Safe area for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
    .container {
        padding-top: calc(20px + env(safe-area-inset-top));
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}
