@font-face {
    font-family: 'Mesgentia';
    src: url('/assets/fonts/Mesgentia.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    ascent-override: 100%;
    descent-override: 20%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'Mineko';
    src: url('/assets/fonts/Mineko.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    ascent-override: 97.5%;
    descent-override: 22.5%;
    line-gap-override: 0%;
}


@font-face {
    font-family: 'Minecraft';
    src: url('/assets/fonts/MinecraftRegular-Bmg3.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Minecraft';
    src: url('/assets/fonts/MinecraftBold-nMK1.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Minecraft';
    src: url('/assets/fonts/MinecraftItalic-R8Mo.otf') format('opentype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'Minecraft';
    src: url('/assets/fonts/MinecraftBoldItalic-1y1e.otf') format('opentype');
    font-weight: bold;
    font-style: italic;
}

@font-face {
    font-family: 'Imprima';
    src: url('/assets/fonts/Imprima-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Lora';
    src: url('/assets/fonts/Lora-Regular.ttf?v=2') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Lora';
    src: url('/assets/fonts/Lora-Bold.ttf?v=2') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Lora';
    src: url('/assets/fonts/Lora-Italic.ttf?v=2') format('truetype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'Lora';
    src: url('/assets/fonts/Lora-BoldItalic.ttf?v=2') format('truetype');
    font-weight: bold;
    font-style: italic;
}

:root {
    --primary: #B8878C;
    --primary-light: #c9a8a8;
    --primary-lighter: #e8d4d4;
    --primary-hover: #dcc3c6;
    --sync-fill: #f1f1ef;
    --background: #FDF8F4;
    --cream: #f8f0f0;
    --text: #555;
    --text-muted: #6B6B6B;
    --border: #deb8b8;
    --white: #fff;
    --completed: #9CAF88;
    --grid-bg: linear-gradient(rgba(222, 184, 184, 0.1) 1px, transparent 1px),
                linear-gradient(90deg, rgba(222, 184, 184, 0.1) 1px, transparent 1px);
    --scale: 1;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --background: #121212;
        --sync-fill: #2a2a2a;
        --white: #1e1e1e;
        --cream: #252525;
        --text: #e3e3e2;
        --text-muted: #9b9a97;
        --completed: #9caf88;
        --primary-light: #37352f;
        --primary-lighter: #2f2f2f;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --background: #121212;
    --sync-fill: #2a2a2a;
    --white: #1e1e1e;
    --cream: #252525;
    --text: #e3e3e2;
    --text-muted: #9b9a97;
    --completed: #9caf88;
    --primary-light: #37352f;
    --primary-lighter: #2f2f2f;
    color-scheme: dark;
}

:root[data-theme="light"] {
    --background: #FDF8F4;
    --sync-fill: #f1f1ef;
    --white: #fff;
    --cream: #f8f0f0;
    --text: #555;
    --text-muted: #6B6B6B;
    --border: #deb8b8;
    --completed: #9CAF88;
    color-scheme: light;
}

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

button, input, select, textarea {
    font-family: inherit;
}

html {
    background: transparent !important;
}

body {
    --frame-pad: 20px;
    font-family: var(--font-family);
    background: transparent !important;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--frame-pad);
}


.y2k-window {
    width: 100%;
    max-width: 300px;
    height: calc((100vh - (var(--frame-pad) * 2)) / var(--scale, 1));
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    zoom: var(--scale);
}


.y2k-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
}

.y2k-title-bar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--border);
    letter-spacing: -0.3px;
}

.y2k-title-bar-left svg {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.y2k-title-bar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}



.y2k-date-btn {
    display: flex;
    align-items: center;
    gap: 3px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 100px;
    transition: background-color 0.15s;
}

.y2k-date-btn:hover {
    background: transparent;
}

.y2k-date-btn:hover .y2k-date,
.y2k-date-btn:hover svg {
    color: var(--primary);
    opacity: 1;
}

/* on a colored title bar the date still answers the hover, by softening its own bar text.
   the accent can't be used there: a bar the same color as the accent would swallow it
   (nari, 10/02: the hover shouldn't depend on anyone's title bar color) */
[data-titlebar="custom"] .y2k-title-bar .y2k-date-btn:hover .y2k-date,
[data-titlebar="custom"] .y2k-title-bar .y2k-date-btn:hover svg {
    color: var(--kou-titlebar-text);
    opacity: 0.5;
}

.y2k-date {
    font-size: 12px;
    color: var(--text-muted);
}

.y2k-date-btn svg {
    color: var(--text-muted);
    opacity: 0.5;
}


.y2k-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    opacity: 0.6;
    transition: opacity 0.15s, background-color 0.15s;
}

.y2k-settings-btn:hover {
    opacity: 1;
    background: var(--primary-hover);
    color: var(--primary);
}

.y2k-settings-btn svg {
    transition: transform 0.3s ease;
}

.y2k-settings-btn:hover svg {
    transform: rotate(45deg);
}


.y2k-input-area {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.y2k-task-input {
    flex: 1;
    padding: 6px 12px;
    font-size: 12px;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--primary-lighter);
    border-radius: 16px;
    outline: none;
    transition: border-color 0.15s;
}

.y2k-task-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.y2k-task-input:focus {
    border-color: var(--primary);
}


.y2k-add-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--on-accent, #fff);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s, background-color 0.15s;
}

.y2k-add-btn:hover {
    background: var(--primary-hover);
}

.y2k-add-btn:active {
    transform: scale(0.9);
}

.y2k-add-btn svg {
    width: 14px;
    height: 14px;
}


.y2k-popup-body {
    flex: 1;
    min-height: 60px;
    padding: 12px;
    overflow-y: auto;
    background-color: var(--white);
    background-image: var(--grid-bg);
    background-size: 8px 8px;
}


.y2k-popup-body::-webkit-scrollbar {
    width: 9px;
}

.y2k-popup-body::-webkit-scrollbar-track {
    background: transparent;
}

.y2k-popup-body::-webkit-scrollbar-thumb {
    background-color: #c4c0ba;
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.y2k-popup-body::-webkit-scrollbar-button {
    display: none;
}

[data-titlebar="custom"] .y2k-popup-body::-webkit-scrollbar-thumb {
    background-color: var(--kou-titlebar-bg);
}


.y2k-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: var(--text-muted);
    text-align: center;
}

.y2k-empty-state .y2k-empty-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
    color: var(--primary);
}

.y2k-empty-state p {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text);
}

.y2k-empty-state span {
    font-size: 11px;
    opacity: 0.7;
}


.y2k-task-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 100px;
    margin-bottom: 4px;
    transition: background-color 0.15s;
}

.y2k-task-item:hover {
    background: var(--primary-hover);
}

[data-shape="square"] .y2k-task-item {
    border-radius: 0;
}

.y2k-task-item.completed {
    opacity: 0.6;
}

.y2k-task-item.completed .y2k-task-text {
    text-decoration: line-through;
    color: var(--text-muted);
}


.y2k-checkbox {
    width: 16px;
    height: 16px;
    min-width: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--primary-light);
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
    transition: background-color 0.15s, border-color 0.15s;
}

.y2k-checkbox:hover {
    border-color: var(--primary);
    background: var(--primary-hover);
}

.y2k-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}


.y2k-checkbox svg {
    width: 10px;
    height: 10px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.15s;
}


.y2k-checkbox.heart svg,
.y2k-checkbox.star svg,
.y2k-checkbox.pixel-heart svg {
    opacity: 1;
}


.y2k-checkbox.square {
    border-radius: 4px;
}


.y2k-checkbox.diamond {
    border-radius: 4px;
    background: transparent;
    border: 1.5px solid var(--primary-light);
    transform: rotate(45deg);
}

.y2k-checkbox.diamond svg {
    transform: rotate(-45deg);
}

.y2k-checkbox.diamond.checked {
    background: var(--primary);
    border-color: var(--primary);
}


.y2k-checkbox.heart {
    background: transparent;
    border: none;
    width: 16px;
    height: 16px;
}

.y2k-checkbox.heart svg {
    width: 16px;
    height: 16px;
    stroke: var(--primary-light);
    stroke-width: 1.5px;
    fill: transparent;
    opacity: 1;
}

.y2k-checkbox.heart.checked svg {
    stroke: var(--primary);
    fill: var(--primary);
}

.y2k-checkbox.pixel-heart {
    background: transparent;
    border: none;
    width: 16px;
    height: 16px;
}

.y2k-checkbox.pixel-heart svg {
    width: 16px;
    height: 16px;
    stroke: none !important;
    stroke-width: 0 !important;
    fill: none;
    opacity: 1;
}

.y2k-checkbox.pixel-heart svg .outline-path {
    fill: var(--primary-light);
    display: block;
}

.y2k-checkbox.pixel-heart svg .filled-path {
    display: none;
}

.y2k-checkbox.pixel-heart:hover svg .outline-path {
    fill: var(--primary);
}

.y2k-checkbox.pixel-heart.checked svg .outline-path {
    display: none;
}

.y2k-checkbox.pixel-heart.checked svg .filled-path {
    display: block;
    fill: var(--primary);
}


.y2k-checkbox.star {
    background: transparent;
    border: none;
    width: 16px;
    height: 16px;
}

.y2k-checkbox.star svg {
    width: 16px;
    height: 16px;
    stroke: var(--primary-light);
    stroke-width: 1.5px;
    fill: transparent;
    opacity: 1;
}

.y2k-checkbox.star.checked svg {
    stroke: var(--primary);
    fill: var(--primary);
}


.y2k-checkbox.crescent {
    background: transparent;
    border: none;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.y2k-checkbox.crescent svg {
    width: 16px;
    height: 16px;
    stroke: var(--primary-light);
    stroke-width: 1.5px;
    fill: transparent;
    opacity: 1;
}

.y2k-checkbox.crescent:hover svg {
    stroke: var(--primary);
}

.y2k-checkbox.crescent.checked svg {
    stroke: var(--primary);
    fill: var(--primary);
}

.y2k-task-text {
    flex: 1;
    font-size: 12px;
    color: var(--text);
    line-height: 1.3;
    word-break: break-word;
    cursor: pointer;
}

.y2k-task-text:hover {
    color: var(--primary);
}

.y2k-task-edit-input {
    flex: 1;
    font-size: 12px;
    font-family: inherit;
    color: var(--text);
    background: transparent;
    border: none;
    border-bottom: 1.5px dotted var(--primary);
    padding: 0;
    margin: 0;
    line-height: 1.3;
    outline: none;
    width: 100%;
}

.y2k-task-item.editing .y2k-delete-btn {
    opacity: 0 !important;
    pointer-events: none;
}


.y2k-delete-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background-color 0.15s;
}

.y2k-task-item:hover .y2k-delete-btn {
    opacity: 0.4;
}

.y2k-delete-btn:hover {
    opacity: 1 !important;
    background: var(--primary-hover);
}

.y2k-delete-btn svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}


.y2k-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    border-top: 1px solid var(--border);
    background: var(--white);
}

.y2k-footer-left {
    font-size: 11px;
    color: var(--text-muted);
}

.y2k-task-count {
    font-weight: 500;
}

.y2k-footer-right {
    display: flex;
    gap: 8px;
}

.y2k-clear-btn {
    font-size: 11px;
    font-family: inherit;
    color: var(--text-muted);
    background: transparent;
    border: 1px dotted var(--border);
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.y2k-clear-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-hover);
}


.settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    max-height: 70vh;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: none;
    z-index: 1000;
    overflow: hidden;
    box-sizing: border-box;
}

.settings-panel.active {
    display: block;
}

.settings-content {
    padding: 12px;
    max-height: calc(70vh - 4px);
    overflow-y: auto;
    overflow-x: hidden;
}

.settings-content::-webkit-scrollbar {
    width: 4px;
}

.settings-content::-webkit-scrollbar-track {
    background: transparent;
}

.settings-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--primary-lighter);
}

.settings-header h3 {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-close {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    opacity: 0.5;
    transition: opacity 0.15s, background-color 0.15s;
}

.settings-close:hover {
    opacity: 1;
    background: var(--primary-hover);
}

.settings-section {
    margin-bottom: 12px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    display: block;
}

.color-picker-section {
    margin-bottom: 0;
}

.color-picker-section label {
    display: none;
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

#accent-color {
    width: 18px;
    height: 18px;
    border: 1px solid var(--primary-lighter);
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    background: none;
}

#accent-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

#accent-color::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

/* title bar swatch comes from kou-theme.css at 28px; koudo keeps every swatch even with its hex box */
.settings-panel #titlebar-color,
.settings-panel .titlebar-clear {
    width: 18px;
    height: 18px;
}

/* the clear x is just the x: no pad shape, full strength so it reads in light and dark */
.settings-panel .titlebar-clear {
    background: none;
    opacity: 1;
    margin-left: -6px;
}

/* a 10px x; its ink sits 8px from the hex box, the same gap as the swatch (nari, 10/02) */
.settings-panel .titlebar-clear svg {
    width: 10px;
    height: 10px;
}

.settings-panel .titlebar-clear:hover {
    color: var(--text);
}

.color-hex {
    width: 62px;
    height: 18px;
    font-size: 10px;
    font-family: inherit;
    color: var(--text);
    font-weight: 400;
    background: var(--primary-lighter);
    border: none;
    border-radius: 999px;
    padding: 3px 6px;
    text-align: center;
    outline: none;
    transition: background-color 0.15s ease;
}

.color-hex:focus {
    background: var(--primary-light);
}


.shape-toggle {
    display: flex;
    gap: 4px;
}

.shape-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.shape-btn:hover {
    background: var(--primary-hover);
}

.shape-btn.active {
    background: var(--primary-lighter);
    border-color: transparent;
}

.shape-btn svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.shape-btn.active svg {
    color: var(--primary);
}

.preset-colors {
    display: none;
}


.date-picker-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: none;
    z-index: 1000;
    box-sizing: border-box;
}

.date-picker-overlay.active {
    display: block;
}

.date-picker-popup {
    padding: 10px;
}

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

.date-picker-nav {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    transition: background-color 0.15s;
}

.date-picker-nav:hover {
    background: var(--primary-hover);
}

.date-picker-month {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
}

.date-picker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--primary-lighter);
}

.date-picker-weekdays span {
    font-size: 8px;
    color: var(--text-muted);
    font-weight: 500;
}

.date-picker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.date-picker-day {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.15s;
}

.date-picker-day:hover {
    background: var(--primary-hover);
}

.date-picker-day.other-month {
    opacity: 0.3;
}

.date-picker-day.today {
    background: var(--primary-lighter);
    font-weight: 600;
}

.date-picker-day.selected {
    background: var(--primary);
    color: var(--on-accent, var(--white));
}

.date-picker-today {
    width: 100%;
    margin-top: 8px;
    padding: 5px;
    font-size: 9px;
    font-family: inherit;
    color: var(--primary);
    background: transparent;
    border: 1px dotted var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.date-picker-today:hover {
    background: var(--primary-hover);
}

[data-shape="square"] .date-picker-overlay,
[data-shape="square"] .date-picker-nav,
[data-shape="square"] .date-picker-day,
[data-shape="square"] .date-picker-today {
    border-radius: 0;
}


@media (max-width: 400px) {
    body {
        --frame-pad: 10px;
    }
    
    .y2k-window {
        max-width: 100%;
    }
    
    .settings-panel {
        max-width: calc(100% - 24px);
    }
    
    .settings-content,
    .date-picker-popup {
        max-width: 100%;
    }
}


.sync-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--primary-lighter);
}

.sync-section label {
    display: block;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.sync-status-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.sync-status-text.synced {
    color: var(--primary);
}

.sync-controls {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}


.sync-buttons-row {
    display: flex;
    flex-direction: row;
    gap: 6px;
    width: 100%;
}

.sync-buttons-row .sync-btn {
    flex: 1;
    min-width: 0;
    font-size: 10px;
}

.sync-btn {
    flex: 1;
    min-width: 60px;
    padding: 6px 10px;
    border: none;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--primary);
    color: var(--on-accent, white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sync-btn:hover {
    opacity: 0.85;
    transform: scale(1.02);
}

.sync-btn:active {
    transform: scale(0.98);
}

.sync-btn.secondary {
    background: var(--sync-fill);
    color: var(--text);
}

.sync-btn.danger {
    background: rgba(231, 76, 60, 0.15);
    color: #c0392b;
}

.sync-btn.danger:hover {
    background: rgba(231, 76, 60, 0.25);
}

#sync-code-input {
    flex: 1;
    min-width: 60px;
    padding: 6px 10px;
    border: none;
    border-radius: 999px;
    font-size: 9px;
    font-family: inherit;
    background: var(--primary-lighter);
    transition: background-color 0.15s ease;
}

#sync-code-input:focus {
    outline: none;
    background: var(--primary-light);
}

.sync-hint {
    font-size: 9px;
    color: var(--text-muted);
    margin: 12px 0 0 0;
    text-align: center;
}


.sync-status-panel {
    background: var(--primary-lighter);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--primary-lighter);
}

.sync-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    min-height: 24px;
}

.sync-status-row:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sync-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.3;
}

.sync-value {
    font-size: 10px;
    color: var(--text);
    font-weight: 500;
    line-height: 1.3;
    display: flex;
    align-items: center;
}

.sync-time-value {
    color: var(--text-muted);
    font-size: 10px;
}

.sync-code-row {
    flex-wrap: nowrap;
    gap: 6px;
}

.sync-code-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    background: var(--white);
    border-radius: 999px;
    border: 1px solid var(--primary-lighter);
    min-width: 0;
    flex-shrink: 1;
    max-width: 100%;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sync-code-pill:hover {
    background: var(--primary-hover);
}

.sync-code-pill:active {
    transform: scale(0.97);
}

.sync-code-value {
    font-family: 'Courier Prime', monospace;
    font-size: 10px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.3px;
    margin-top: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.share-link-section {
    margin-top: 12px;
    padding-top: 12px;
    margin-bottom: 12px;
    border-top: 1px solid var(--primary-lighter);
}

.share-link-section label {
    display: block;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.share-link-container {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-lighter);
    border-radius: 999px;
    padding: 6px 6px 6px 12px;
}

.share-link-input {
    flex: 1;
    min-width: 0;
    padding: 6px 0;
    border: none;
    background: transparent;
    font-size: 11px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.share-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    background: var(--primary);
    color: var(--on-accent, white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.share-copy-btn:hover {
    opacity: 0.85;
    transform: scale(1.02);
}

.share-copy-btn:active {
    transform: scale(0.98);
}

.share-copy-btn svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}


.sync-error-panel {
    background: rgba(231, 76, 60, 0.1);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(231, 76, 60, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-error-icon {
    font-size: 16px;
    color: #c0392b;
}

.sync-error-message {
    font-size: 11px;
    color: #c0392b;
    flex: 1;
}


.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);

    color: var(--primary);
    font-size: 11px;
    font-weight: 600;

    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.size-slider {
    flex: 1;
    min-width: 0; /* webkit won't shrink a range below 129px, guards a narrow embed */
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--primary-lighter);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.size-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

.slider-value {
    font-size: 10px;
    color: var(--text-muted);
    min-width: 45px;
    text-align: right;
}

.y2k-select {
    width: 100%;
    font-size: 10px;
    font-family: inherit;
    color: var(--text);
    background: var(--primary-lighter);
    border: none;
    border-radius: 999px;
    padding: 6px 28px 6px 12px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 1 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: background-color 0.15s ease;
}

.y2k-select:focus {
    background-color: var(--primary-light); /* color only, so the chevron stays (kousched's rule) */
}

.y2k-select option {
    background: var(--white);
    color: var(--text);
}

.setting-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.setting-toggle-row .settings-label {
    margin-bottom: 0;
}

.cute-toggle {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--primary-lighter);
    transition: .2s ease;
    border-radius: 999px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: var(--white);
    transition: .2s ease;
    border-radius: 50%;
}

.cute-toggle input:checked + .toggle-slider {
    background-color: var(--primary);
}

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

.y2k-popup-body.hide-grid {
    background-image: none !important;
}

.y2k-window.hide-border {
    border-color: transparent !important;
    background: transparent !important;
}

.y2k-window.hide-border .y2k-title-bar {
    background-color: transparent !important;
    border-bottom-color: transparent !important;
}

.y2k-window.hide-border .y2k-input-area,
.y2k-window.hide-border .y2k-popup-body,
.y2k-window.hide-border .y2k-footer {
    background-color: transparent !important;
    border-top-color: transparent !important;
    border-bottom-color: transparent !important;
}

.y2k-window.hide-border .y2k-popup-body::-webkit-scrollbar {
    border-left: none !important;
}
.y2k-window.hide-border .y2k-popup-body::-webkit-scrollbar-thumb {
    border: 2px solid transparent !important;
}
.y2k-window.hide-border .y2k-popup-body::-webkit-scrollbar-button {
    border-bottom: none !important;
    border-top: none !important;
}




/* the confirm popup: no dim (the overlay stays only so a tap outside closes it), as wide as its words
   and never wider than the panel's rows, flat. same as kouid (nari, 10/07) */
.confirm-popup-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    display: none;
    z-index: 1050;
}

.confirm-popup-overlay.active {
    display: block;
}

.confirm-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: max-content;
    padding: 14px 16px;
    display: none;
    flex-direction: column;
    gap: 14px;
    z-index: 1060;
    box-sizing: border-box;
    max-width: 196px;
}

.confirm-popup.active {
    display: flex;
}

.confirm-popup-message {
    font-size: 11px;
    line-height: 1.5;
    color: var(--text);
    text-align: center;
}

.confirm-popup-actions {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.confirm-popup-btn {
    font-size: 10px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 50px;
    cursor: pointer;
    background: var(--white);
    color: var(--text);
    font-family: inherit;
    transition: background-color 0.15s, border-color 0.15s;
}

.confirm-popup-btn:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.confirm-popup-btn.danger {
    color: #e53e3e;
    border-color: #feb2b2;
}

.confirm-popup-btn.danger:hover {
    background: #fff5f5;
}

[data-shape="square"] .confirm-popup,
[data-shape="square"] .confirm-popup-btn {
    border-radius: 0;
}

[data-shape="square"] #sync-code-input {
    border-radius: 0;
}


/* the embed block is the first thing inside the sync section, so its own top
   margin, padding and border doubled the section's own. one divider, not two.
   nari spotted the gap in koucard 2026-10-01. */
.sync-section > .share-link-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* the picked pill's words take the readable-on-accent color, like the rest of the fleet,
   so a pale accent doesn't leave white words on a pale pill */
.window-style-toggle .window-style-btn.active {
    color: var(--on-accent, var(--white));
}

/* the pill words (Curve / Square, Outline / Filled): the line is trimmed to the letters, then
   lifted so the middle point between the capital tops and the lowercase tops sits at the middle
   of the pill. it reads each font's own cap and x-heights, so it fits every widget font; same 25px
   pill. browsers without text-box or the cap unit keep a centered line. nari, 10/02 */
.settings-panel .window-style-btn {
    text-box: trim-both cap alphabetic;
    height: 25px;
    padding-top: 0;
    padding-bottom: 0;
    padding-bottom: calc((1cap - 1ex) / 2);
}

/* Imprima sits a hair high with the rule above, so it comes down a quarter pixel (nari's pick) */
@container style(--font-family: 'Imprima', sans-serif) {
    .settings-panel .window-style-btn {
        padding-bottom: calc((1cap - 1ex) / 2 - 0.5px);
    }
}

/* the title stays put while the settings scroll, like kourie's. it sits outside
   the scroller now, in the same spot as before, and the scroller keeps its 4px
   gutter so the line under the title ends where the rows do. nari 2026-10-02. */
.settings-panel.active {
    display: flex;
    flex-direction: column;
}

.settings-panel > .settings-header {
    flex-shrink: 0;
    margin: 12px 16px 0 12px;
}

.settings-panel > .settings-content {
    min-height: 0;
    scrollbar-gutter: stable;
}
