@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;
    --mood-great: #4ade80;
    --mood-good: #a3e635;
    --mood-okay: #facc15;
    --mood-meh: #fb923c;
    --mood-bad: #f87171;
    --scale: 1;
    --widget-width: 360px;
    --widget-height: 340px;
    --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;
        --primary-light: #37352f;
        --primary-lighter: #2f2f2f;
        --border: #37352f;
        color-scheme: dark;
    }
}

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

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

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

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

html {
    background: transparent !important;
}

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

.y2k-window {
    width: var(--widget-width);
    height: var(--widget-height);
    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 10px;
    border-bottom: 1px solid var(--border);
    flex-wrap: nowrap;
    gap: 8px;
}

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

.y2k-window-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.y2k-title-text {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--primary);
}

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

.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 month 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;
    font-weight: 500;
    color: var(--text-muted);
}

.y2k-date-btn svg {
    color: var(--text-muted);
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.y2k-date-btn.active svg {
    transform: rotate(180deg);
}

.y2k-title-bar-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.y2k-settings-btn {
    width: 24px;
    height: 24px;
    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, color 0.15s;
    padding: 0;
}

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

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

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

.mood-container {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background-color: var(--white);
    background-image: var(--grid-bg);
    background-size: 8px 8px;
    border-radius: 0 0 20px 20px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.mood-container::-webkit-scrollbar {
    width: 4px;
}

.mood-container::-webkit-scrollbar-track {
    background: transparent;
}

.mood-container::-webkit-scrollbar-thumb {
    background: var(--primary-lighter);
    border-radius: 2px;
}

.view-toggle {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.view-btn {
    padding: 4px 12px;
    font-size: 8px;
    font-weight: 600;
    font-family: var(--font-family);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.15s;
}

.view-btn:hover {
    color: var(--text);
}

.view-btn.active {
    background: var(--white);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.mood-legend {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 5px;
    background: var(--primary-lighter);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 7px;
    color: var(--text-muted);
}

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

.legend-item.selected {
    background: var(--white);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    color: var(--text);
}

.legend-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot.great { background: var(--mood-great); }
.legend-dot.good { background: var(--mood-good); }
.legend-dot.okay { background: var(--mood-okay); }
.legend-dot.meh { background: var(--mood-meh); }
.legend-dot.bad { background: var(--mood-bad); }

.legend-label {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

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

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

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 8px;
}

.day-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 8px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--cream);
    transition: all 0.15s;
}

.day-cell:hover {
    transform: scale(1.08);
}

[data-shape="square"] .day-cell,
[data-shape="square"] .day-mini-dot,
[data-shape="square"] .month-mini,
[data-shape="square"] .legend-item,
[data-shape="square"] .legend-dot,
[data-shape="square"] .stat-item,
[data-shape="square"] .stat-dot {
    border-radius: 0;
}

.day-cell.empty {
    background: transparent;
    cursor: default;
    pointer-events: none;
}

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

.day-cell.filled-great { background: var(--mood-great); color: #155724; }
.day-cell.filled-good { background: var(--mood-good); color: #155724; }
.day-cell.filled-okay { background: var(--mood-okay); color: #713f12; }
.day-cell.filled-meh { background: var(--mood-meh); color: #7c2d12; }
.day-cell.filled-bad { background: var(--mood-bad); color: #7f1d1d; }

.year-view {
    display: none;
}

.year-view.active {
    display: block;
}

.year-view-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 4px;
}

.year-display {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    min-width: 40px;
    text-align: center;
}

.year-nav-btn {
    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);
    opacity: 0.6;
    transition: opacity 0.15s, background-color 0.15s, color 0.15s;
}

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

.year-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.month-mini {
    background: var(--cream);
    border-radius: 10px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.month-mini:hover {
    background: var(--primary-hover);
}

.month-mini-header {
    font-size: 8px;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
    text-align: center;
}

.month-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.day-mini-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
}

.day-mini-dot.filled-great { background: var(--mood-great); }
.day-mini-dot.filled-good { background: var(--mood-good); }
.day-mini-dot.filled-okay { background: var(--mood-okay); }
.day-mini-dot.filled-meh { background: var(--mood-meh); }
.day-mini-dot.filled-bad { background: var(--mood-bad); }

.day-number {
    position: absolute;
    font-size: 6px;
    opacity: 0.7;
}

.mood-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding-top: 6px;
    border-top: 1px solid var(--primary-lighter);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 6px;
    background: var(--cream);
    border-radius: 8px;
    font-size: 7px;
}

.stat-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stat-dot.great { background: var(--mood-great); }
.stat-dot.good { background: var(--mood-good); }
.stat-dot.okay { background: var(--mood-okay); }
.stat-dot.meh { background: var(--mood-meh); }
.stat-dot.bad { background: var(--mood-bad); }

.stat-label {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
}

.stat-value {
    color: var(--text);
    font-weight: 600;
    min-width: 24px;
    text-align: right;
}

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

.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-panel.active {
    display: block;
}

.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    display: none;
    z-index: 999;
}

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

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

.font-select {
    width: 100%;
    padding: 6px 12px;
    font-size: 10px;
    font-family: inherit;
    border: none;
    border-radius: 999px;
    background: var(--primary-lighter);
    color: var(--text);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    transition: all 0.15s ease;
    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;
    padding-right: 28px;
}

.font-select:hover {
    background-color: var(--primary-hover);
}

.font-select:focus {
    border-color: var(--primary);
}

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

.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: 5px;
    display: block;
}

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

#great-color, #good-color, #okay-color, #meh-color, #bad-color, #accent-color {
    width: 18px;
    height: 18px;
    border: 1px solid var(--primary-lighter);
    border-radius: 50%;
    cursor: pointer;
    -webkit-appearance: none;
    padding: 0;
    background: transparent;
}

#great-color::-webkit-color-swatch-wrapper,
#good-color::-webkit-color-swatch-wrapper,
#okay-color::-webkit-color-swatch-wrapper,
#meh-color::-webkit-color-swatch-wrapper,
#bad-color::-webkit-color-swatch-wrapper,
#accent-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

#great-color::-webkit-color-swatch,
#good-color::-webkit-color-swatch,
#okay-color::-webkit-color-swatch,
#meh-color::-webkit-color-swatch,
#bad-color::-webkit-color-swatch,
#accent-color::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

/* title bar swatch comes from kou-theme.css at 28px; koumood 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);
}

.color-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mood-color-row {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
}

.mood-color-row .color-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
}

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

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

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

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

.clear-btn {
    width: 100%;
    padding: 6px 12px;
    font-size: 9px;
    font-weight: 600;
    font-family: var(--font-family);
    background: var(--primary-lighter);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: var(--mood-bad);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.15s;
}

.clear-btn:hover {
    background: var(--mood-bad);
    color: var(--white);
}

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

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

.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-check {
    font-size: 12px;
}

.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;
    gap: 6px;
    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: 10px;
    padding-top: 10px;
    margin-bottom: 10px;
    border-top: 1px solid var(--primary-lighter);
}

/* the line above Cloud Sync lives on the sync section (12 above, 12 below), like koubrain's,
   so the embed box under it doesn't draw a second one */
.sync-section > .share-link-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

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

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

.share-link-input {
    flex: 1;
    min-width: 0;
    padding: 4px 0;
    border: none;
    background: transparent;
    font-size: 9px;
    font-family: 'Inter', sans-serif;
    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.05);
}

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

.share-copy-btn svg {
    flex-shrink: 0;
}

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

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

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

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

.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: 'Inter', sans-serif;
    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: 6px 0 0 0;
    text-align: center;
}

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

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

.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);
}

.mood-container.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 .mood-container {
    background-color: transparent !important;
}

[data-shape="square"] .mood-container {
    border-radius: 0;
}

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

.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;
}
