@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;400;500;600&display=swap');

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

:root {
    --accent: #222;
    --accent-soft: #ececec;
    --line: #e7e7e7;
    --muted: #999;
    --paper: #fff;
    --lists: #f7f8fa;
}

body.theme-red {
    --accent: #e12d39;
    --accent-soft: #fde5e7;
}

body.theme-purple {
    --accent: #6d25ff;
    --accent-soft: #eadfff;
}

body {
    background: var(--paper);
    color: #444;
    font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
    font-size: 14px;
    font-weight: 300;
}

.login-screen {
    align-items: center;
    background: #f4f4f4;
    display: flex;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 100;
}

.login-card {
    background: white;
    box-shadow: 0 10px 40px #0002;
    max-width: 360px;
    padding: 35px;
    width: calc(100% - 30px);
}

.login-card > p { color: var(--muted); margin: 12px 0 24px; }
.login-card label,
#passwordForm > label { display: block; margin: 14px 0; }
.login-card input,
#passwordForm > label input { border: 0; border-bottom: 1px solid var(--line); display: block; outline: 0; padding: 9px 2px; width: 100%; }
.login-card input:focus,
#passwordForm > label input:focus { border-bottom-color: var(--accent); }
.login-card > button { background: var(--accent); border: 0; color: white; margin-top: 10px; padding: 10px; width: 100%; }
.login-error { color: #b42318 !important; min-height: 18px; }

button,
input {
    color: inherit;
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    height: 100vh;
    overflow: hidden;
    padding-bottom: 35px;
}

.topbar {
    align-items: center;
    border-top: 2px solid var(--accent);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    height: 43px;
    padding: 0 10px;
    position: relative;
}

.logo {
    color: #555;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -.5px;
    line-height: 1;
}

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

.icon-button,
.week-nav button {
    background: none;
    border: 0;
}

.search-button {
    font-size: 22px;
    line-height: 1;
}

.header-tools {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-self: start;
}

.notification-toggle {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 4px;
}

.notification-toggle span {
    font-size: 15px;
    line-height: 1;
}

.notification-toggle .notification-label {
    font-size: 11px;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.notification-toggle input {
    accent-color: var(--accent);
    height: 13px;
    width: 13px;
}

.data-button {
    background: none;
    border: 0;
    color: #777;
    font-size: 11px;
    letter-spacing: .4px;
    padding: 4px 2px;
    text-transform: uppercase;
}

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

.week-nav {
    align-items: center;
    display: flex;
    gap: 15px;
    justify-self: end;
}

.week-nav button {
    color: #555;
    font-size: 18px;
    line-height: 1;
}

.week-nav .today-button {
    border: 1px solid var(--line);
    font-size: 10px;
    letter-spacing: .4px;
    padding: 4px 7px;
    text-transform: uppercase;
}

.week-nav h1 {
    color: var(--muted);
    font-size: 16px;
    font-weight: 500;
    min-width: 145px;
    text-align: center;
    text-transform: uppercase;
}

.planner {
    display: grid;
    grid-auto-columns: minmax(230px, 20vw);
    grid-auto-flow: column;
    height: calc((100vh - 78px) / 2);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 31px 28px 18px;
    scrollbar-width: thin;
}

.day-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    overflow-y: auto;
    padding: 0 19px;
}

.day-header {
    margin-bottom: 20px;
    order: 0;
}

.day-column > .task-list {
    order: 1;
}

.day-column > .add-task {
    order: 2;
}

.day-column::after {
    background: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 30px,
        var(--line) 30px,
        var(--line) 31px
    );
    content: "";
    flex: 1;
    min-height: 31px;
    order: 3;
}

.day-date {
    color: #909090;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.day-name,
.someday-list h3 {
    color: #171717;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.15;
    text-transform: uppercase;
}

.day-column.today .day-name {
    color: var(--accent);
}

.add-task input,
.task-edit-input {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    outline: 0;
    height: 31px;
    padding: 5px 2px;
    width: 100%;
}

.add-task input::placeholder {
    color: #bbb;
}

.add-task input:focus,
.task-edit-input:focus {
    border-bottom-color: var(--accent);
}

.task-list {
    list-style: none;
}

.task-item {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    min-height: 31px;
    padding: 5px 2px;
    position: relative;
}

.task-item.dragging { opacity: .3; }
.day-column.drag-over { background: var(--accent-soft); }
.someday-list.drag-over { background: var(--accent-soft); }

.drop-indicator {
    background: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
    height: 2px;
    list-style: none;
    margin: -1px 0;
    pointer-events: none;
}

.task-item.section-task {
    background: #e9eaec !important;
    border: 0;
    border-radius: 5px;
    margin: 8px 0 3px;
    min-height: 22px;
    padding: 4px 8px;
}

.section-task .task-checkbox { display: none; }
.section-task .task-text { color: #000; font-size: 15px; font-weight: 700; letter-spacing: .4px; text-align: center; text-transform: none; }
.task-text a { color: inherit; text-decoration: underline; }
.task-text b,
.task-text strong,
.reminder-popup b,
.reminder-popup strong { font-weight: 700; }

.task-checkbox {
    border: 1px solid #bbb;
    border-radius: 1px;
    height: 13px;
    margin-right: 7px;
    opacity: 0;
    width: 13px;
}

.task-item:hover .task-checkbox,
.task-item.completed .task-checkbox {
    opacity: 1;
}

.task-item.completed .task-checkbox {
    background: transparent;
    border-color: #777;
    position: relative;
}

.task-item.completed .task-checkbox::after {
    color: #555;
    content: "✓";
    font-size: 11px;
    font-weight: 700;
    left: 1px;
    line-height: 10px;
    position: absolute;
    top: 0;
}

.task-item.completed .task-text {
    color: #aaa;
    text-decoration: line-through;
}

.task-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.task-actions {
    align-items: center;
    background: var(--paper);
    display: flex;
    gap: 7px;
    opacity: 0;
    padding-left: 6px;
}

.task-item:hover .task-actions {
    opacity: 1;
}

.task-settings,
.task-delete {
    color: #aaa;
    font-size: 15px;
}

.task-settings:hover,
.task-delete:hover {
    color: var(--accent);
}

.task-item.recurring .task-text::before {
    color: var(--accent);
    content: "↻ ";
}

.color-option {
    border: 1px solid #ccc;
    border-radius: 50%;
    height: 17px;
    width: 17px;
}

.color-option[data-color=""] { background: white; }
.color-option[data-color="#ffe4e4"] { background: #ffe4e4; }
.color-option[data-color="#fff4cc"] { background: #fff4cc; }
.color-option[data-color="#e4f4e4"] { background: #e4f4e4; }
.color-option[data-color="#e4e4ff"] { background: #e4e4ff; }
.color-option[data-color="#ffe4ff"] { background: #ffe4ff; }

.someday-lists {
    background: var(--lists);
    border-top: 1px solid #eee;
    height: calc((100vh - 78px) / 2);
    overflow: auto;
    padding: 0 38px 35px;
}

.someday-header {
    background: white;
    display: flex;
    gap: 0;
    margin: 0 -38px 38px;
    min-height: 38px;
    overflow-x: auto;
    padding-left: 38px;
}

.list-tab {
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: #888;
    font-size: 10px;
    letter-spacing: 1px;
    padding: 12px 13px 9px;
    text-transform: uppercase;
    white-space: nowrap;
}

.list-tab.active {
    border-bottom-color: var(--accent);
    color: #111;
}

.clear-completed {
    color: #a22;
    margin-left: auto;
    margin-right: 20px;
}

.completed-view {
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.completed-group h3 {
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    margin-bottom: 5px;
    padding-bottom: 7px;
    text-transform: uppercase;
}

.completed-empty {
    color: var(--muted);
    padding: 20px 0;
}

.tab-count {
    color: #aaa;
    margin-left: 5px;
}

.someday-content {
    align-items: stretch;
    display: grid;
    gap: 48px;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.someday-list {
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

.someday-list > .list-title-row { order: 0; }
.someday-list > .task-list { order: 1; }
.someday-list > .add-task { order: 2; }

.someday-list::after {
    background: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 30px,
        var(--line) 30px,
        var(--line) 31px
    );
    content: "";
    flex: 1;
    min-height: 155px;
    order: 3;
}

.someday-list h3 {
    margin-bottom: 13px;
}

.list-title-row {
    align-items: center;
    display: flex;
    gap: 8px;
}

.list-title-row h3 {
    cursor: text;
    flex: 1;
}

.delete-list {
    background: none;
    border: 0;
    color: #aaa;
    font-size: 18px;
    opacity: 0;
}

.someday-list:hover .delete-list { opacity: 1; }
.delete-list:hover { color: var(--accent); }
.list-title-input { border: 0; border-bottom: 1px solid var(--accent); font-size: 20px; font-weight: 500; outline: 0; text-transform: uppercase; width: 100%; }

.someday-list .add-task input {
    font-size: 13px;
}

.utility-bar {
    align-items: center;
    background: white;
    border-top: 1px solid #aaa;
    bottom: 0;
    display: flex;
    height: 35px;
    justify-content: flex-start;
    padding: 0 12px;
    position: fixed;
    width: 100%;
    z-index: 20;
}

.theme-selector {
    display: flex;
    gap: 7px;
}

.theme-btn {
    border: 1px solid #aaa;
    border-radius: 50%;
    height: 12px;
    width: 12px;
}

.theme-btn.black { background: #222; }
.theme-btn.red { background: #e12d39; }
.theme-btn.purple { background: #6d25ff; }
.theme-btn.active { outline: 2px solid var(--accent-soft); }

#undo-notification {
    background: #222;
    bottom: 50px;
    color: white;
    display: none;
    left: 50%;
    padding: 10px 16px;
    position: fixed;
    transform: translateX(-50%);
    z-index: 30;
}

#undo-btn {
    background: none;
    border: 0;
    color: white;
    font-weight: 500;
    margin-left: 15px;
    text-decoration: underline;
}

.modal {
    align-items: center;
    background: #0007;
    display: none;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 40;
}

.modal.show { display: flex; }

.modal-content {
    background: white;
    max-width: 420px;
    padding: 28px;
    width: calc(100% - 30px);
}

.modal-content h3 { margin-bottom: 18px; }
.modal-content > input { border: 0; border-bottom: 1px solid var(--line); padding: 9px 2px; width: 100%; }
.rich-task-editor {
    border-bottom: 1px solid var(--line);
    min-height: 38px;
    outline: 0;
    padding: 9px 2px;
    width: 100%;
}

.rich-task-editor:focus { border-bottom-color: var(--accent); }
.rich-task-editor b, .rich-task-editor strong { font-weight: 700; }
.format-toolbar {
    display: flex;
    gap: 4px;
    margin-top: 10px;
}

.format-toolbar button {
    background: white;
    border: 1px solid var(--line);
    height: 30px;
    width: 32px;
}

.format-toolbar button:hover,
.format-toolbar button:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
}

.highlight-options {
    align-items: center;
    display: flex;
    gap: 7px;
    margin-top: 12px;
}

.highlight-options > span {
    color: var(--muted);
    font-size: 12px;
    margin-right: 3px;
    text-transform: uppercase;
}

.highlight-options .color-option.selected {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.repeat-toggle { display: block; margin-top: 20px; }
[hidden] { display: none !important; }
#repeatOptions { margin-top: 15px; }
#repeatOptions > p { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.interval-field { align-items: center; display: flex; gap: 8px; }
.interval-field input { border: 1px solid var(--line); padding: 5px; width: 55px; }
.confirm-dialog p { margin: 0 0 20px; }

.reminder-popup {
    background: white;
    border-left: 4px solid var(--accent);
    bottom: 50px;
    box-shadow: 0 4px 18px #0003;
    max-width: 320px;
    padding: 14px 35px 14px 16px;
    position: fixed;
    right: 18px;
    z-index: 50;
}

.reminder-popup strong { display: block; margin-bottom: 3px; }
.reminder-popup button { background: none; border: 0; font-size: 18px; position: absolute; right: 9px; top: 7px; }
.recurring-days { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.modal-buttons { display: flex; gap: 8px; justify-content: flex-end; }
.modal-buttons button { border: 0; padding: 8px 15px; }
#save-recurring { background: var(--accent); color: white; }

@media (max-width: 700px) {
    .topbar { grid-template-columns: 30px 1fr auto; }
    .logo { font-size: 20px; justify-self: center; }
    .week-nav { gap: 7px; }
    .week-nav h1, #todayButton, #nextNextWeek { display: none; }
    .planner { grid-auto-columns: 82vw; padding: 25px 10px 15px; scroll-snap-type: x mandatory; }
    .day-column { padding: 0 16px; scroll-snap-align: start; }
    .someday-lists { padding-inline: 22px; }
    .someday-header { margin-inline: -22px; padding-left: 12px; }
    .someday-content { grid-template-columns: 1fr; }
}

@page {
    size: landscape;
    margin: 8mm;
}

@media print {
    :root {
        --accent: #000;
        --line: #bbb;
        --paper: #fff;
        --lists: #fff;
    }

    html,
    body {
        background: white;
        color: #000;
        height: auto;
        overflow: visible;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    body {
        font-size: 9pt;
    }

    .container {
        height: auto;
        overflow: visible;
        padding: 0;
    }

    .topbar {
        border-top: 0;
        display: block;
        height: auto;
        padding: 0 0 5mm;
        text-align: center;
    }

    .logo {
        font-size: 18pt;
    }

    .week-nav {
        display: block;
        margin-top: 1mm;
    }

    .week-nav h1 {
        color: #333;
        display: block;
        font-size: 11pt;
        min-width: 0;
    }

    .search-button,
    .notification-toggle,
    .data-button,
    .week-nav button,
    .add-task,
    .task-actions,
    .task-checkbox,
    .someday-header,
    .utility-bar,
    .modal,
    #undo-notification,
    .reminder-popup,
    .delete-list {
        display: none !important;
    }

    .planner {
        display: grid;
        grid-auto-flow: initial;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        height: auto;
        min-height: 90mm;
        overflow: visible;
        padding: 0 0 5mm;
    }

    .day-column {
        border-right: 1px dotted #bbb;
        height: auto;
        min-width: 0;
        overflow: visible;
        padding: 0 2.5mm;
    }

    .day-column::after {
        min-height: 50mm;
    }

    .day-column:last-child {
        border-right: 0;
    }

    .day-header {
        margin-bottom: 3mm;
    }

    .day-date {
        font-size: 6.5pt;
    }

    .day-name {
        color: #000 !important;
        font-size: 12pt;
    }

    .task-item {
        break-inside: avoid;
        min-height: 6mm;
        padding: 1.2mm 0;
    }

    .task-text {
        color: #000;
        font-size: 8.5pt;
        line-height: 1.2;
    }

    .task-item.completed .task-text {
        color: #777;
    }

    .task-item.section-task {
        background: #ddd !important;
        margin-top: 2mm;
        padding: 1mm 1.5mm;
    }

    .section-task .task-text {
        color: #000;
        font-size: 8pt;
        font-weight: 700;
    }

    .someday-lists {
        background: white;
        border-top: 1px solid #777;
        height: auto;
        overflow: visible;
        padding: 5mm 0 0;
    }

    .someday-content {
        display: grid;
        gap: 5mm;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .someday-list {
        break-inside: avoid;
        min-height: 75mm;
        min-width: 0;
    }

    .someday-list::after {
        min-height: 35mm;
    }

    .someday-list h3 {
        color: #000;
        font-size: 12pt;
        margin-bottom: 2mm;
    }

    a {
        color: #000 !important;
        text-decoration: underline;
    }
}
