/* =========================================================
   STYLE.CSS  v14
   =========================================================

   FONTS
   ========================================================= */

@font-face {
    font-family: "Source Sans 3";
    src: url("lib/fonts/SourceSans3-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Source Sans 3";
    src: url("lib/fonts/SourceSans3-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Source Sans 3";
    src: url("lib/fonts/SourceSans3-Italic%5Bwght%5D.ttf") format("truetype");
    font-weight: 400 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Libre Baskerville";
    src: url("lib/fonts/LibreBaskerville-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Libre Baskerville";
    src: url("lib/fonts/LibreBaskerville-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        "Source Sans 3",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    color: #1d1d1f;

    background: #D6D3CB;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Libre Baskerville", Georgia, "Times New Roman", serif;
}


/* =========================================================
   LOGIN SCREEN
   ========================================================= */

button, a, input, select, textarea, label, [onclick] {
    touch-action: manipulation;
}

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 100vh;

    padding: 20px;

    background: #D6D3CB;

    background-image: url('lib/images/CH Logo White Outline Large.svg');
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: top;
    background-size: 1400px 1400px;
    background-position-y: 100px;
    background-position-x: 600px;
}

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

.login-card {
    width: 100%;
    max-width: 360px;

    padding: 40px 32px;

    background: #ffffff;
    border-radius: 16px;

    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.08);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 32px;
}

.login-icon {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 46px;
    height: 46px;

    border-radius: 12px;

    background: #ffffff;

    border: 1px solid rgba(0, 0, 0, 0.07);

    overflow: hidden;
}

.login-icon canvas {
    width: 46px;
    height: 46px;
}

.login-brand h1 {
    margin: 0;

    color: #1c1c1e;

    font-size: 22px;
    font-weight: 600;
}

.login-input {
    display: block;
    width: 100%;

    padding: 12px 14px;

    margin-bottom: 12px;

    border: 1px solid #d1d1d6;
    border-radius: 10px;

    font-size: 15px;

    background: #fafafa;
    color: #1c1c1e;

    outline: none;

    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.login-input:focus {
    border-color: #007aff;
    background: #ffffff;
}

.login-error {
    min-height: 20px;

    margin-bottom: 8px;

    color: #ff3b30;
    font-size: 13px;

    text-align: center;
}

.login-button {
    display: block;
    width: 100%;

    padding: 12px;

    border: none;
    border-radius: 50px;

    background: #B88609;
    color: #ffffff;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;

    transition: background 0.2s ease;
}

.login-button:hover {
    background: #9e7308;
}

.login-button:active {
    background: #856006;
}

.login-footer {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: 16px;
    padding-top: 14px;

    border-top: 1px solid #e5e5ea;
}

.login-footer-logo {
    width: 22px;
    height: 22px;
}

.login-footer-text {
    font-family: "Libre Baskerville", Georgia, serif;

    font-size: 11px;
    color: #6e6e73;
}

.login-toggle {
    margin-top: 20px;

    text-align: center;

    color: #86868b;
    font-size: 13px;
}

.login-link {
    color: #007aff;
    text-decoration: none;

    font-weight: 500;
}

.login-link:hover {
    text-decoration: underline;
}


/* =========================================================
   APP
   ========================================================= */

.app {
    width: 900px;
    max-width: calc(100% - 40px);

    margin: 0 auto;

    padding: 42px 0 70px;
}


/* =========================================================
   HEADER
   ========================================================= */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;

    margin-bottom: 30px;
}

.brand {
    display: flex;
    align-items: center;

    gap: 13px;

    min-width: 0;
}

.brand-icon {
    width: 46px;
    height: 46px;

    flex: 0 0 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: #ffffff;

    color: #1d1d1f;

    border: 1px solid rgba(0, 0, 0, 0.07);

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.045);

    font-size: 21px;

    overflow: hidden;
    padding: 0;
}

.brand-icon canvas {
    width: 46px;
    height: 46px;
    border-radius: 12px;
}

h1 {
    margin: 0;

    color: #1d1d1f;

    font-size: 25px;
    font-weight: 700;

    letter-spacing: -0.6px;
}

.brand p {
    margin: 3px 0 0;

    color: #86868b;

    font-size: 13px;
}

.header-actions {
    display: flex;
    align-items: center;

    gap: 8px;
}


/* =========================================================
   TODAY CARD
   ========================================================= */

.today-card {
    min-width: 105px;

    display: flex;
    flex-direction: column;
    align-items: flex-end;

    padding: 8px 12px;

    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 10px;

    background: #ffffff;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.035);
}

.today-label {
    margin-bottom: 2px;

    color: #86868b;

    font-size: 9px;
    font-weight: 700;

    letter-spacing: 1px;
}

#todayTotal {
    color: #1d1d1f;

    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 15px;
    font-weight: 600;

    letter-spacing: -0.2px;
}


/* =========================================================
   BUTTONS
   ========================================================= */

button {
    border: 0;
    border-radius: 50px;

    padding: 9px 14px;

    cursor: pointer;

    font-family: inherit;
    font-size: 13px;
    font-weight: 500;

    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.12s ease;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(0, 122, 255, 0.16);
}


/* =========================================================
   ICON BUTTON
   ========================================================= */

.icon-button {
    width: 38px;
    height: 38px;

    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 50px;

    background: #ffffff;
    color: #6e6e73;

    font-size: 16px;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.035);
}

.icon-button:hover {
    color: #1d1d1f;
    background: #fafafa;
}


/* =========================================================
   SECONDARY BUTTON
   ========================================================= */

.secondary-button {
    border: 1px solid #d2d2d7;

    background: #ffffff;
    color: #3a3a3c;

    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.025);
}

.secondary-button:hover {
    background: #f8f8f8;
    border-color: #c7c7cc;
}


/* =========================================================
   PRIMARY BUTTON
   ========================================================= */

.primary-button {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    padding: 11px 16px;

    background: #B88609;
    color: #ffffff;

    box-shadow:
        0 2px 7px rgba(184, 134, 9, 0.16);
}

.primary-button:hover {
    background: #9e7308;
}

.danger-button {
    background: #ff3b30;
    color: #ffffff;
    box-shadow: 0 2px 7px rgba(255, 59, 48, 0.16);
}

.danger-button:hover {
    background: #d32f2f;
}

.button-icon {
    font-size: 17px;
    line-height: 1;
}


/* =========================================================
   ADD TASK CARD
   ========================================================= */

.add-task-card {
    padding: 22px;

    margin-bottom: 28px;

    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 15px;

    background: #ffffff;

    box-shadow:
        0 4px 18px rgba(0, 0, 0, 0.045);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;

    color: #1d1d1f;

    font-size: 16px;
    font-weight: 600;

    letter-spacing: -0.2px;
}

.section-heading p {
    margin: 4px 0 0;

    color: #86868b;

    font-size: 12px;
}


/* =========================================================
   COLLAPSIBLE ADD TASK
   ========================================================= */

.add-task-card {
    transition: padding 0.15s ease;
}

.add-task-card.collapsed {
    padding: 12px 16px;

    margin-bottom: 16px;
}

.add-task-card.collapsed .section-heading {
    margin-bottom: 0;
}

.add-task-card.collapsed .section-heading p {
    display: none;
}

.add-task-card.collapsed .add-task-fields {
    display: none;
}

.section-heading {
    cursor: pointer;

    -webkit-user-select: none;
    user-select: none;
}

.toggle-chevron {
    flex-shrink: 0;

    width: 26px;
    height: 26px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #f5f5f7;

    color: #6e6e73;

    font-size: 12px;

    transition: transform 0.2s ease;
}

.add-task-card.collapsed .toggle-chevron {
    transform: rotate(-90deg);
}

.add-task-card:not(.collapsed) .toggle-chevron {
    transform: rotate(180deg);
}


/* =========================================================
   TASK SELECTORS
   ========================================================= */

.task-selectors {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 12px;

    margin-bottom: 12px;
}

.field-group {
    min-width: 0;
}

.field-group label,
.task-date-field label {
    display: block;

    margin-bottom: 6px;

    color: #6e6e73;

    font-size: 11px;
    font-weight: 500;

    letter-spacing: 0.2px;
}

.field-group select {
    width: 100%;

    min-width: 0;

    height: 42px;

    padding: 10px 34px 10px 12px;

    border: 1px solid #d2d2d7;
    border-radius: 9px;

    outline: none;

    background-color: #ffffff;
    color: #1d1d1f;

    font-family: inherit;
    font-size: 13px;

    cursor: pointer;

    appearance: none;

    background-image:
        linear-gradient(45deg, transparent 50%, #8e8e93 50%),
        linear-gradient(135deg, #8e8e93 50%, transparent 50%);

    background-position:
        calc(100% - 15px) 50%,
        calc(100% - 10px) 50%;

    background-size:
        5px 5px,
        5px 5px;

    background-repeat: no-repeat;

    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.field-group select:hover {
    border-color: #b8b8bd;
}

.field-group select:focus {
    border-color: #0071e3;

    box-shadow:
        0 0 0 3px rgba(0, 113, 227, 0.12);
}

.field-group select option {
    background: #ffffff;
    color: #1d1d1f;
}


/* =========================================================
   DATE INPUT
   ========================================================= */

.task-date-field {
    width: 100%;

    margin-bottom: 12px;
}

.task-date-field input,
.field-group input,
.management-add input {
    width: 100%;

    min-width: 0;

    height: 42px;

    padding: 10px 12px;

    border: 1px solid #d2d2d7;
    border-radius: 9px;

    outline: none;

    background: #ffffff;
    color: #1d1d1f;

    font-family: inherit;
    font-size: 13px;

    color-scheme: light;

    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.task-date-field input:hover,
.field-group input:hover,
.management-add input:hover {
    border-color: #b8b8bd;
}

.task-date-field input:focus,
.field-group input:focus,
.management-add input:focus {
    border-color: #0071e3;

    box-shadow:
        0 0 0 3px rgba(0, 113, 227, 0.12);
}

.task-date-field input::placeholder,
.field-group input::placeholder,
.management-add input::placeholder {
    color: #8e8e93;
}

.new-type-field {
    margin-top: 8px;
}

.type-row {
    display: flex;

    align-items: center;

    gap: 8px;

    width: 100%;
}

.type-row select {
    flex: 1;

    min-width: 0;
}

.type-add-button {
    flex-shrink: 0;

    display: inline-flex;

    width: 42px;
    height: 42px;

    align-items: center;
    justify-content: center;

    border: 1px solid #d2d2d7;
    border-radius: 9px;

    background: #ffffff;
    color: #1d1d1f;

    font-family: inherit;
    font-size: 20px;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;

    transition:
        border-color 0.15s,
        background 0.15s;
}

.type-add-button:hover {
    border-color: #b8b8bd;

    background: #f5f5f7;
}

.type-add-button:focus {
    border-color: #0071e3;

    box-shadow:
        0 0 0 3px rgba(0, 113, 227, 0.12);

    outline: none;
}

.new-type-field input {
    width: 100%;

    min-width: 0;

    height: 42px;

    padding: 10px 12px;

    border: 1px solid #d2d2d7;
    border-radius: 9px;

    outline: none;

    background: #ffffff;
    color: #1d1d1f;

    font-family: inherit;
    font-size: 13px;

    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.new-type-field input:focus {
    border-color: #0071e3;

    box-shadow:
        0 0 0 3px rgba(0, 113, 227, 0.12);
}

.task-date-field input[type="date"] {
    color: #1d1d1f;
    cursor: pointer;
}

.task-date-field input[type="date"]::-webkit-calendar-picker-indicator {
    width: 17px;
    height: 17px;

    margin-left: 6px;

    opacity: 0.5;

    cursor: pointer;

    transition: opacity 0.15s;
}

.task-date-field input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 0.85;
}

.task-date-field input[type="date"]::-webkit-datetime-edit {
    color: #1d1d1f;
}

.task-date-field input[type="date"]::-webkit-datetime-edit-text {
    color: #8e8e93;
}

.task-date-field input[type="date"]::-webkit-datetime-edit-month-field,
.task-date-field input[type="date"]::-webkit-datetime-edit-day-field,
.task-date-field input[type="date"]::-webkit-datetime-edit-year-field {
    color: #1d1d1f;
}

.task-date-field input[type="date"]::-webkit-datetime-edit-month-field:focus,
.task-date-field input[type="date"]::-webkit-datetime-edit-day-field:focus,
.task-date-field input[type="date"]::-webkit-datetime-edit-year-field:focus {
    background: rgba(0, 113, 227, 0.10);

    color: #0071e3;

    border-radius: 3px;
}


/* =========================================================
   ADD TASK INPUT
   ========================================================= */

.add-task {
    display: flex;

    gap: 10px;
}

.add-task input[type="text"] {
    flex: 1;

    min-width: 0;

    height: 44px;

    padding: 11px 13px;

    border: 1px solid #d2d2d7;
    border-radius: 9px;

    outline: none;

    background: #ffffff;

    color: #1d1d1f;

    font-family: inherit;
    font-size: 14px;

    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.add-task input[type="text"]::placeholder {
    color: #8e8e93;
}

.add-task input[type="text"]:hover {
    border-color: #b8b8bd;
}

.add-task input[type="text"]:focus {
    border-color: #0071e3;

    box-shadow:
        0 0 0 3px rgba(0, 113, 227, 0.12);
}


/* =========================================================
   TASK HEADER
   ========================================================= */

.task-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 11px;

    color: #6e6e73;

    font-size: 13px;
    font-weight: 600;
}

.data-actions {
    display: flex;
    align-items: center;

    gap: 7px;
}

.export-button {
    display: flex;
    align-items: center;

    gap: 6px;

    padding: 7px 10px;

    border: 1px solid #d2d2d7;
    border-radius: 8px;

    background: #ffffff;
    color: #6e6e73;

    font-size: 12px;
}

.export-button:hover {
    background: #f8f8f8;
    color: #1d1d1f;
}

.settings-data-actions {
    flex-wrap: wrap;
}


/* =========================================================
   TASK CARD
   ========================================================= */

.card {
    position: relative;

    display: flex;
    flex-direction: row;

    max-width: 900px;

    margin-bottom: 10px;

    border-radius: 14px;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.08);

    transition:
        box-shadow 0.15s,
        transform 0.15s;
}

.card:hover {
    transform: translateY(-1px);

    box-shadow:
        0 5px 18px rgba(0, 0, 0, 0.09);
}

.card[draggable="true"] {
    cursor: grab;
}

.card[draggable="true"]:active {
    cursor: grabbing;
}

.card.dragging {
    opacity: 0.45;

    transform: scale(0.99);
}

.card.drag-over {
    box-shadow:
        0 -3px 0 rgba(184, 134, 9, 0.85),
        0 5px 18px rgba(0, 0, 0, 0.055);
}

.card.active {
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.08);
}


/* =========================================================
   START PANEL
   ========================================================= */

.start-panel {
    flex: 0 0 220px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px 0 0 14px;

    background: #B88609;

    color: #ffffff;

    font-size: 26px;
    font-weight: 700;

    cursor: pointer;
    user-select: none;

    transition: background 0.15s;
}

.start-panel:hover {
    background: #9e7308;
}

.start-panel:active {
    background: #856006;
}

.start-panel.stop {
    background: #ff3b30;
}

.start-panel.stop:hover {
    background: #e5362c;
}


/* =========================================================
   CARD CONTENT
   ========================================================= */

.content {
    flex: 1;

    min-width: 0;

    display: flex;
    flex-direction: column;

    border-radius: 0 14px 14px 0;

    background: #e9e5df;
}

.header-row {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding: 16px 24px 8px;
}

.title {
    margin: 0;

    font-family: "Source Sans 3", sans-serif;

    font-size: 20px;
    font-weight: 700;

    color: #1c1c1c;

    line-height: 1.35;

    overflow-wrap: anywhere;
    word-break: break-word;
}

.menu-dots {
    flex-shrink: 0;

    padding: 2px 6px;

    border-radius: 6px;

    color: #6b6b6b;

    font-size: 18px;
    letter-spacing: 2px;

    cursor: pointer;
}

.menu-dots:hover {
    color: #1c1c1c;

    background: rgba(0, 0, 0, 0.06);
}


/* =========================================================
   CARD DROPDOWN MENU
   ========================================================= */

.card-menu {
    position: absolute;

    top: calc(100% + 2px);
    right: 16px;

    z-index: 30;

    display: none;

    min-width: 140px;

    flex-direction: column;

    border: 1px solid #e5e5ea;
    border-radius: 10px;

    background: #ffffff;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.12);

    overflow: hidden;
}

.card-menu.open {
    display: flex;
}

.card-menu button {
    display: block;

    width: 100%;

    padding: 11px 16px;

    border: none;

    background: none;

    text-align: left;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    color: #1c1c1c;

    cursor: pointer;
}

.card-menu button:hover {
    background: #f5f5f7;
}

.card-menu button[data-menu-action="delete"] {
    color: #ff3b30;
}

.card-menu button[data-menu-action="delete"]:hover {
    background: #fff1f0;
}


/* =========================================================
   INFO ROW
   ========================================================= */

.info-row {
    display: flex;
    align-items: center;

    flex-wrap: wrap;

    gap: 14px 22px;

    padding: 8px 24px 16px;
}

.timer {
    font-family:
        "SF Mono",
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 26px;
    font-weight: 400;

    color: #1c1c1c;

    letter-spacing: 1px;
}

.time-range {
    color: #4d4d4d;

    font-size: 14px;

    white-space: nowrap;
}

.spacer {
    flex: 1;
}

/* =========================================================
   EMOJI PILLS (feedback)
   ========================================================= */

.emoji-pills {
    display: flex;

    gap: 10px;
}

.emoji-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 32px;

    padding: 0;

    border: 2px solid transparent;
    border-radius: 999px;

    background: #ded8ce;

    font-size: 17px;
    line-height: 1;
    font-family: inherit;

    cursor: pointer;

    opacity: 0.55;

    transition: all 0.15s ease;
}

button.emoji-pill:hover {
    opacity: 0.9;

    transform: scale(1.08);
}

.emoji-pill.active {
    opacity: 1;

    border-color: #B88609;

    background: #ffffff;
}

.emoji-pill.static {
    cursor: default;
}


/* =========================================================
   FOOTER ROW
   ========================================================= */

.footer-row {
    display: flex;
    align-items: center;

    flex-wrap: wrap;

    gap: 8px 40px;

    padding: 12px 24px;

    border-top: 1px solid #ddd8cf;
    border-radius: 0 0 14px 0;

    background: #ffffff;

    color: #4d4d4d;

    font-size: 14px;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    display: none;

    padding: 55px 20px;

    text-align: center;

    border: 1px solid #e5e5ea;
    border-radius: 13px;

    color: #86868b;

    background: #ffffff;

    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.025);
}

.empty-icon {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 14px;

    border-radius: 50%;

    background: #f2f2f7;

    color: #6e6e73;

    font-size: 20px;
}

.empty-state h2 {
    margin: 0 0 6px;

    color: #3a3a3c;

    font-size: 15px;
    font-weight: 600;
}

.empty-state p {
    margin: 0;

    font-size: 12px;
}


/* =========================================================
   SETTINGS / HISTORY SCREEN
   ========================================================= */

.settings-screen {
    animation: screenFadeIn 0.16s ease;
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
        transform: translateY(3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;
}

.settings-header h2 {
    margin: 0;

    color: #1d1d1f;

    font-size: 24px;
    font-weight: 700;

    letter-spacing: -0.5px;
}

.settings-header p {
    margin: 4px 0 0;

    color: #86868b;

    font-size: 12px;
}


/* =========================================================
   SETTINGS CARDS
   ========================================================= */

.settings-card {
    padding: 20px;

    margin-bottom: 14px;

    border: 1px solid #e5e5ea;
    border-radius: 14px;

    background: #ffffff;

    box-shadow:
        0 3px 14px rgba(0, 0, 0, 0.035);
}

.settings-card-header {
    margin-bottom: 16px;
}

.settings-card-header h3 {
    margin: 0;

    color: #3a3a3c;

    font-size: 15px;
    font-weight: 600;
}

.settings-icon {
    margin-right: 4px;
}

.settings-card-header p {
    margin: 4px 0 0;

    color: #86868b;

    font-size: 11px;
}

.settings-card-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    cursor: pointer;

    -webkit-user-select: none;
    user-select: none;
}

.settings-card.collapsed {
    padding: 14px 16px;
}

.settings-card.collapsed .settings-card-toggle {
    margin-bottom: 0;
}

.settings-card.collapsed .settings-card-body {
    display: none;
}

.settings-card.collapsed .toggle-chevron {
    transform: rotate(-90deg);
}

.settings-card:not(.collapsed) .toggle-chevron {
    transform: rotate(180deg);
}


/* =========================================================
   SETTINGS LAYOUT (MENU + PANELS)
   ========================================================= */

.settings-layout {
    display: flex;

    align-items: flex-start;

    gap: 18px;
}

.settings-nav {
    display: flex;
    flex-direction: column;

    flex-shrink: 0;

    width: 210px;

    padding: 8px;

    border: 1px solid #e5e5ea;
    border-radius: 14px;

    background: #ffffff;

    box-shadow:
        0 3px 14px rgba(0, 0, 0, 0.035);
}

.settings-nav-footer {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: auto;

    padding: 12px 8px 6px;

    border-top: 1px solid #e5e5ea;
}

.settings-nav-footer-logo {
    width: 22px;
    height: 22px;
}

.settings-nav-footer-text {
    font-family: "Libre Baskerville", Georgia, serif;

    font-size: 11px;
    color: #6e6e73;
}

.settings-nav-item {
    display: flex;
    align-items: center;

    gap: 10px;

    width: 100%;
    padding: 12px 14px;

    border: none;
    border-radius: 10px;

    background: transparent;

    color: #3a3a3c;

    font-size: 14px;
    font-weight: 500;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.12s,
        color 0.12s;
}

.settings-nav-item:hover {
    background: #f2f2f7;
}

.settings-nav-item.active {
    background: #f0f0f5;

    color: #1d1d1f;

    font-weight: 600;
}

.settings-panels {
    flex: 1;

    min-width: 0;
}

.settings-pane .settings-card {
    margin-bottom: 0;
}


/* =========================================================
   TOGGLE SWITCH
   ========================================================= */

.toggle-switch {
    position: relative;

    display: inline-block;

    width: 44px;
    height: 26px;

    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    border-radius: 26px;

    background: #e5e5ea;

    cursor: pointer;

    transition: background 0.25s ease;
}

.toggle-slider::before {
    content: "";

    position: absolute;

    left: 2px;
    bottom: 2px;

    width: 22px;
    height: 22px;

    border-radius: 50%;

    background: #ffffff;

    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.15);

    transition: transform 0.25s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: #34c759;
}

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


.admin-link {
    display: block;

    padding: 10px 0 0;

    color: #007aff;
    text-decoration: none;

    font-size: 13px;
    font-weight: 500;
}

.admin-link:hover {
    text-decoration: underline;
}


/* =========================================================
   MANAGEMENT
   ========================================================= */

.management-add {
    display: flex;

    gap: 9px;

    margin-bottom: 14px;
}

.management-add input {
    flex: 1;
}

.management-add .management-button {
    flex-shrink: 0;

    width: 44px;
    height: 42px;

    padding: 0;

    font-size: 20px;
    line-height: 1;
}

.management-list {
    display: flex;
    flex-direction: column;

    gap: 6px;
}

.management-empty {
    padding: 16px;

    border: 1px dashed #d2d2d7;
    border-radius: 9px;

    color: #86868b;

    text-align: center;

    font-size: 12px;
}

.management-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    min-width: 0;

    padding: 9px 11px;

    border: 1px solid #e5e5ea;
    border-radius: 9px;

    background: #fafafa;

    cursor: grab;

    -webkit-user-select: none;
    user-select: none;

    -webkit-touch-callout: none;
}

.management-item-name {
    flex: 1;

    min-width: 0;

    overflow: hidden;

    color: #3a3a3c;

    font-size: 13px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.management-item.dragging {
    opacity: 0.5;
}

.management-item.drag-over {
    border-color: #0071e3;
}

.management-drag-handle {
    flex-shrink: 0;

    color: #b0b0b5;

    font-size: 13px;

    cursor: grab;

    touch-action: none;

    user-select: none;
    -webkit-user-select: none;
}

.management-item-actions {
    display: flex;
    flex-shrink: 0;

    gap: 4px;
}

.management-action {
    width: 30px;
    height: 30px;

    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #d2d2d7;

    background: #ffffff;
    color: #6e6e73;

    font-size: 12px;
}

.management-action:hover {
    background: #f5f5f7;
    color: #1d1d1f;
}

.management-action.delete:hover {
    background: #fff1f0;

    border-color: #ffd6d3;

    color: #ff3b30;
}


/* =========================================================
   HISTORY
   ========================================================= */

.history-list {
    display: flex;
    flex-direction: column;

    gap: 8px;
}

.history-date {
    border: 1px solid #e5e5ea;
    border-radius: 12px;

    background: #ffffff;

    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.03);
}

.history-date-header {
    width: 100%;

    padding: 15px 17px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: transparent;
    color: #3a3a3c;

    border-radius: 0;

    text-align: left;
}

.history-date-header:hover {
    background: #fafafa;
}

.history-date-left {
    display: flex;
    align-items: center;

    gap: 8px;
}

.history-chevron {
    display: inline-flex;

    width: 19px;
    height: 19px;

    align-items: center;
    justify-content: center;

    color: #8e8e93;

    font-size: 20px;

    transition: transform 0.18s ease;
}

.history-date.open .history-chevron {
    transform: rotate(90deg);
}

.history-date-title {
    font-size: 13px;
    font-weight: 600;
}

.history-date-total {
    color: #1d1d1f;

    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 13px;
    font-weight: 600;
}

.history-date-content {
    display: none;

    padding: 0 10px 10px;
}

.history-date.open .history-date-content {
    display: block;
}

.history-task {
    position: relative;

    display: flex;

    margin-bottom: 10px;

    border-radius: 14px;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.08);
}

.history-task .content {
    border-radius: 14px;
}


/* =========================================================
   ADD FROM HISTORY DROPDOWN
   ========================================================= */

.package-add-task-fields {
    padding: 0 4px 14px;
}

/* =========================================================
   ADD FROM HISTORY
   ========================================================= */

.history-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;

    background: rgba(0, 0, 0, 0.5);

    animation: backdropIn 0.18s ease;
}

@keyframes backdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.history-dropdown {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 100;

    width: 480px;
    max-width: calc(100vw - 40px);
    max-height: 70vh;

    overflow-y: auto;

    transform: translate(-50%, -50%);

    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;

    background: #ffffff;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.18),
        0 4px 16px rgba(0, 0, 0, 0.06);

    animation: popoverIn 0.18s ease;
}

.history-dropdown::before {
    display: none;
}

@keyframes popoverIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.history-dropdown-empty {
    padding: 20px;

    text-align: center;

    color: #8e8e93;
    font-size: 14px;
}

.history-dropdown-item {
    display: flex;
    flex-direction: column;
    gap: 4px;

    width: 100%;
    padding: 12px 16px;

    border: none;
    border-bottom: 1px solid #f2f2f7;

    background: transparent;

    text-align: left;
    cursor: pointer;

    transition: background 0.12s;
}

.history-dropdown-item:last-child {
    border-bottom: none;
}

.history-dropdown-item:hover {
    background: #f2f2f7;
}

.history-dropdown-meta {
    display: flex;
    gap: 6px;
}

.history-dropdown-name {
    font-size: 15px;
    font-weight: 500;

    color: #1c1c1e;
}

.history-dropdown-time {
    font-size: 13px;

    color: #8e8e93;
}


/* =========================================================
   MODAL
   ========================================================= */

.modal {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.24);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    width: 520px;
    max-width: 100%;

    overflow: hidden;

    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 15px;

    background: #ffffff;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.16);

    animation: modalFadeIn 0.16s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    padding: 20px;

    border-bottom: 1px solid #e5e5ea;
}

.modal-header h2 {
    margin: 0;

    color: #1d1d1f;

    font-size: 19px;
    font-weight: 600;
}

.modal-header p {
    margin: 4px 0 0;

    color: #86868b;

    font-size: 11px;
}

.modal-close {
    width: 30px;
    height: 30px;

    padding: 0;

    background: #f2f2f7;
    color: #6e6e73;

    font-size: 20px;
}

.modal-close:hover {
    background: #e5e5ea;
    color: #1d1d1f;
}

.modal-body {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 14px;

    padding: 20px;
}

.modal-body .field-group:nth-child(3),
.modal-body .field-group:nth-child(4) {
    grid-column: span 2;
}

.modal-note {
    grid-column: 1 / -1;

    margin: 0;

    color: #86868b;

    font-size: 11px;
}

.modal-note:not([hidden]) {
    display: block;
}

input:disabled,
select:disabled {
    opacity: 0.5;

    cursor: not-allowed;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;

    gap: 8px;

    padding: 16px 20px;

    border-top: 1px solid #e5e5ea;

    background: #fafafa;
}


/* =========================================================
   CHARTS
   ========================================================= */

.charts-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.summary-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #86868b;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.chart-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.chart-card h3 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
}

.chart-card-wide {
    margin-bottom: 16px;
}

.chart-container {
    position: relative;
    height: 220px;
}

.chart-container-wide {
    height: 200px;
}

.charts-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.charts-filter-bar .field-group {
    flex: 1;
    max-width: 200px;
}

.charts-filter-bar label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #86868b;
}

.charts-filter-bar select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #1d1d1f;
    appearance: auto;
}

.charts-filter-bar input[type="date"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #1d1d1f;
}

.charts-filter-bar .secondary-button {
    margin-bottom: 0;
    white-space: nowrap;
}

.filter-indicator {
    font-size: 10px;
    font-weight: 400;
    color: #ff9500;
    text-transform: lowercase;
    letter-spacing: 0;
}


/* =========================================================
   HIDDEN
   ========================================================= */

[hidden] {
    display: none !important;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 700px) {

    .login-screen {
        background-position-x: 200px;
    }

    .settings-layout {
        flex-direction: column;
    }

    .settings-nav {
        flex-direction: row;
        flex-wrap: wrap;

        width: 100%;
    }

    .settings-nav-item {
        flex: 1 1 calc(50% - 10px);

        min-width: 140px;
    }

    .settings-panels {
        width: 100%;
    }

    .app {
        max-width: calc(100% - 24px);

        padding-top: 25px;
    }

    .app-header {
        align-items: flex-start;

        gap: 15px;
    }

    .header-actions {
        align-items: flex-start;
    }

    .today-card {
        display: none;
    }

    .task-selectors {
        grid-template-columns: 1fr;
    }

    .add-task {
        flex-direction: column;
    }

    .primary-button {
        justify-content: center;
    }

    .card {
        flex-direction: column;
    }

    .start-panel {
        flex-basis: auto;

        min-height: 48px;

        border-radius: 14px 14px 0 0;

        font-size: 20px;
    }

    .content {
        border-radius: 0 0 14px 14px;
    }

    .header-row {
        flex-wrap: wrap;
    }

    .info-row {
        gap: 10px 14px;
    }

    .info-row .spacer {
        display: none;
    }

    .timer {
        flex-basis: 100%;
    }

    .emoji-pills {
        margin-left: auto;
    }

    .time-range {
        white-space: normal;
    }

    .footer-row {
        gap: 6px 20px;
    }

    .settings-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .management-add {
        flex-direction: column;
    }

    .management-add .primary-button {
        width: 100%;
    }

    .task-date-field input,
    .field-group input,
    .management-add input,
    .field-group select,
    #taskInput {
        font-size: 16px;
    }

    .task-date-field input[type="date"],
    .field-group input[type="date"],
    .field-group input[type="time"] {
        min-width: 0;

        max-width: 100%;

        -webkit-appearance: none;
        appearance: none;
    }

    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-body .field-group:nth-child(3),
    .modal-body .field-group:nth-child(4) {
        grid-column: span 1;
    }

}


@media (max-width: 520px) {

    .app {
        max-width: calc(100% - 20px);

        padding-top: 18px;
    }

    .app-header {
        margin-bottom: 22px;
    }

    .brand {
        gap: 9px;
    }

    .brand-icon {
        width: 42px;
        height: 42px;

        flex-basis: 42px;

        border-radius: 11px;

        font-size: 19px;
    }

    h1 {
        font-size: 21px;
    }

    .brand p {
        font-size: 11px;
    }

    .icon-button {
        width: 36px;
        height: 36px;
    }

    .header-actions {
        gap: 5px;
    }

    .header-actions .secondary-button {
        padding: 8px 10px;
        font-size: 12px;
    }

    .add-task-card,
    .settings-card {
        padding: 16px;
    }

    .task-header {
        align-items: flex-start;

        flex-direction: column;

        gap: 8px;
    }

    .data-actions {
        width: 100%;
    }

    .data-actions button {
        flex: 1;

        justify-content: center;
    }

    .history-date-header {
        padding: 14px;
    }

    .charts-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .charts-filter-bar {
        flex-wrap: wrap;
    }

    .charts-filter-bar .field-group {
        min-width: 140px;
    }
}


@media (max-width: 380px) {

    .brand p {
        display: none;
    }

    .data-actions {
        flex-direction: column;
    }

    .data-actions button {
        width: 100%;
    }

    .summary-value {
        font-size: 16px;
    }
}

h1 {
  /* Create a wide gradient that repeats or loops smoothly */
  background: linear-gradient(to right, #000000, #e5b11c, #000000);
  /* Make the background 200% wider so there is room to slide it */
  background-size: 200% auto;
  
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  
  /* Link the animation: 5 seconds, linear speed, infinite loop */
  animation: flowGradient 15s linear infinite;
}

@keyframes flowGradient {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: -200% center;
  }
}


