: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;
    --glow-color: #B8878C;
    --glow-spread: 0 0 10px rgba(184, 135, 140, 0.5), 0 0 20px rgba(184, 135, 140, 0.3);
    --scale: 1;
    --clock-size: 1;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --clock-font: 'Segment7', monospace;
    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;
        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;
    color-scheme: dark;
}

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

html {
    background: transparent !important;
}

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

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

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

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

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

@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') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

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

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

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

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

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

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

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

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

@font-face {
    font-family: '3D Isometric';
    src: url('/assets/fonts/3DIsometric-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

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

@font-face {
    font-family: 'Alpha Prota';
    src: url('/assets/fonts/AlphaProta-Italic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
}

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

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

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

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

@font-face {
    font-family: 'Ringus';
    src: url('/assets/fonts/RingusItalic-9Mm1B.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'Monsieur La Doulaise';
    src: url('/assets/fonts/MonsieurLaDoulaiseRegular-O5YP.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

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

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


@font-face {
    font-family: 'Gossip Med Cross Stitch';
    src: url('/assets/fonts/Gossip-MedCrossStitch.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Gossip High Cross Stitch';
    src: url('/assets/fonts/Gossip-HighCrossStitch.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}


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

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: 100%;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    max-width: 320px;
    height: 180px;
    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;
}

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

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

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

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

.clock-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: var(--white);
    background-image: linear-gradient(rgba(222, 184, 184, 0.08) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(222, 184, 184, 0.08) 1px, transparent 1px);
    background-size: 8px 8px;
    position: relative;
}

.clock-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.clock-time {
    font-size: 74px;
    font-weight: normal;
    font-family: var(--clock-font);
    letter-spacing: 4px;
    margin-right: -4px;  
    line-height: 1;  
    display: inline-block;
    white-space: nowrap;  
    color: var(--text);
    text-shadow: var(--glow-spread);
    transition: text-shadow 0.3s, color 0.3s;
    font-variant-numeric: tabular-nums;  
}

.clock-time.font-segment-7 {
    transform: translate(0, 0);
}

.clock-time.font-minecraft {
    letter-spacing: 0;
    margin-right: 0;
    transform: translate(0.02em, -0.06em);
}

.clock-time.font-undertale {
    letter-spacing: 0;
    margin-right: 0;
    transform: translate(0.06em, -0.03em);
}

.clock-time.font-pf-pixelscript {
    letter-spacing: 0;
    margin-right: 0;
    transform: translate(0em, -0.12em);
}

.clock-time.font-afternoon {
    transform: translate(0, 0.05em);
}

.clock-period {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.glow-none .clock-time {
    text-shadow: none;
}

.glow-light .clock-time {
    text-shadow: 0 0 8px rgba(184, 135, 140, 0.4);
}

.glow-medium .clock-time {
    text-shadow: 0 0 12px rgba(184, 135, 140, 0.5), 0 0 24px rgba(184, 135, 140, 0.3);
}

.glow-strong .clock-time {
    text-shadow: 0 0 15px rgba(184, 135, 140, 0.6), 0 0 30px rgba(184, 135, 140, 0.4), 0 0 45px rgba(184, 135, 140, 0.2);
}

.format-24 .clock-period {
    display: none;
}

.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;
    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-content {
    padding: 12px;
    max-height: calc(80vh - 4px);
    overflow-y: auto;
    overflow-x: hidden;
}

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

.settings-header h3 {
    font-size: 9px;
    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;
}

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

.clock-container.hide-grid {
    background-image: none !important;
}

.y2k-window.compact {
    width: fit-content;
    max-width: 100%;
    height: auto;
}

.y2k-window.compact.hide-border {
    overflow: visible;
}

.y2k-window.compact .y2k-title-bar {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 4px 7px 4px 4px;
    border-bottom: none;
    background: transparent;
    z-index: 2;
}

html[data-shape="square"] .y2k-window.compact .y2k-title-bar {
    padding: 4px;
}

.y2k-window.compact .y2k-title-bar #settings-btn {
    width: 14px;
    height: 14px;
}

.y2k-window.compact .y2k-title-bar #settings-btn svg {
    width: 10px;
    height: 10px;
}

.y2k-window.compact .clock-container {
    padding: 16px;
}

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

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

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

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

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

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

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

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

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

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

#period-color {
    width: 28px;
    height: 28px;
    border: 1px solid var(--primary-lighter);
    border-radius: 50%;
    cursor: pointer;
    -webkit-appearance: none;
    padding: 0;
}

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

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

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

.format-options,
.intensity-options {
    display: flex;
    gap: 2px;
    background: var(--primary-lighter);
    border-radius: 10px;
    padding: 2px;
}

.format-btn,
.toggle-btn,
.intensity-btn {
    flex: 1;
    padding: 5px 8px;
    font-size: 9px;
    font-family: var(--font-family);
    font-weight: 500;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.format-btn:hover,
.toggle-btn:hover,
.intensity-btn:hover {
    color: var(--text);
}

.format-btn.active,
.toggle-btn.active,
.intensity-btn.active {
    background: var(--white);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.font-select {
    width: 100%;
    padding: 6px 26px 6px 10px;
    font-size: 10px;
    font-family: var(--font-family);
    background: var(--primary-lighter);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    color: var(--text);
    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 8px center;
}

.font-select:focus {
    outline: none;
}

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

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

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

.y2k-footer-left,
.y2k-footer-right {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    color: var(--text-muted);
}

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

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

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

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

.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: 'Inter', sans-serif;
    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: 8px;
    width: 100%;
}

.sync-buttons-row .sync-btn {
    flex: 1;
}

.credits-section {
    border-top: 1px solid rgba(0,0,0,0.08);
    padding-top: 10px;
    margin-top: 4px;
}

.credits-line {
    font-size: 9px;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0 0 3px 0;
}

.credits-line:last-child {
    margin-bottom: 0;
}

.credits-box {
    max-height: 64px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 10px;
    background: var(--primary-lighter);
    border-radius: 10px;
}

.credits-box::-webkit-scrollbar {
    width: 4px;
}

.credits-box::-webkit-scrollbar-track {
    background: transparent;
}

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

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

.credits-line a {
    color: var(--text-muted);
    text-decoration: underline;
}

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


.window-style-toggle .window-style-btn.active {
    color: var(--on-accent, var(--white));
}


/* 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 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;
}

/* 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);
    }
}
