* {
    box-sizing: border-box;
}

:root {
    --accent: #8ad7ff;
    --accent-hover: #0369a1;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --bg: #f8fafc;
    --text: #ffffff;
    --shadow: rgba(0, 0, 0, 0.05);
}

html,
body {
    min-height: 100vh;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
    overflow-x: hidden;
    /* prevent horizontal scroll from background */
    font-family: Inter, Roboto, system-ui, Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(120deg, #f8fafc, #e0e7ff, #fce7f3);
    background-size: 200% 200%;
    animation: rgbfade 7s ease-in-out infinite alternate;
    background: #0f172a;
}

.rain-bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    /* keep it interactive if needed; JS can manage events on canvas */
}

.rain-bg .moon {
    position: absolute;
    top: 10%;
    right: 15%;
    width: 100px;
    height: 100px;
    background: #f4f4f4;
    border-radius: 50%;
    box-shadow: 0 0 60px rgba(255, 255, 255, 0.8), 0 0 100px rgba(255, 255, 255, 0.5);
    animation: rotateMoon 20s linear infinite;
}

.rain-bg .moon::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 20px;
    height: 20px;
    background: #d4d4d4;
    border-radius: 50%;
    box-shadow: 35px 10px 0 5px #d4d4d4, 10px 35px 0 3px #d4d4d4;
}

@keyframes rotateMoon {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.clouds-bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    /* fit viewport to avoid scroll */
    height: 100vh;
    /* fit viewport to avoid scroll */
    overflow: hidden;
    background: linear-gradient(to bottom, #87CEEB, #B2FFFF);
    z-index: 0;
    pointer-events: none;
    display: none;
    /* hidden by default; toggled via JS */
}

.clouds-bg .sun {
    position: absolute;
    top: 18%;
    left: 12%;
    width: 80px;
    height: 80px;
    background: transparent;
}

.clouds-bg .sun::before,
.clouds-bg .sun::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    transform-origin: center;
}

.clouds-bg .sun::before {
    inset: -40px;
    background: repeating-conic-gradient(rgba(255, 251, 0, 0.185) 10deg 10deg, transparent 30deg 10deg);
    animation: rotateRays 20s linear infinite;
}

.clouds-bg .sun::after {
    inset: 0;
    background: #FFD700;
    box-shadow: 0 0 600px #FFD700, 0 0 100px #FFD700, 0 0 150px #FFA500;
    pointer-events: none;
}

.clouds-bg .cloud {
    position: absolute;
    background: #ffffffe1;
    border-radius: 100px;
    animation: moveClouds linear infinite, float ease-in-out infinite;
}

.clouds-bg .cloud::before,
.clouds-bg .cloud::after {
    content: '';
    position: absolute;
    border-radius: 100px;
}

.clouds-bg .cloud::before {
    background: #ffffffde;
    width: 100px;
    height: 60px;
    top: -20px;
    left: 40px;
}

.clouds-bg .cloud::after {
    width: 120px;
    height: 90px;
    background: #ffffffa2;
    top: -40px;
    right: 30px;
}

.clouds-bg .cloud:nth-child(2) {
    top: 10%;
    width: 160px;
    height: 50px;
    animation-duration: 50s, 6s;
    animation-delay: -5s, -2s;
}

.clouds-bg .cloud:nth-child(3) {
    top: 20%;
    width: 200px;
    height: 90px;
    animation-duration: 60s, 7s;
    animation-delay: -10s, -3s;
}

.clouds-bg .cloud:nth-child(4) {
    top: 30%;
    width: 240px;
    height: 80px;
    animation-duration: 40s, 7s;
    animation-delay: -3s, -1s;
}

.clouds-bg .cloud:nth-child(5) {
    top: 40%;
    width: 300px;
    height: 80px;
    animation-duration: 30s, 5s;
    animation-delay: -8s, -4s;
}

.clouds-bg .cloud:nth-child(6) {
    top: 45%;
    width: 200px;
    height: 50px;
    animation-duration: 35s, 9s;
    animation-delay: -12s, -5s;
}

.clouds-bg .bird {
    position: absolute;
    width: 40px;
    height: 50px;
    background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/174479/bird-cells-new.svg');
    background-size: 415px;
    animation: fly-cycle 1s steps(4) infinite, fly-right linear infinite;
    z-index: 1;
}

.clouds-bg .bird:nth-child(7) {
    top: 15%;
    animation-duration: 1s, 15s;
    animation-delay: -2s, -2s;
    transform: scale(0.8);
}

.clouds-bg .bird:nth-child(8) {
    top: 35%;
    animation-duration: 1s, 20s;
    animation-delay: 0s, -3s;
    transform: scale(1);
}

.clouds-bg .bird:nth-child(9) {
    top: 70%;
    animation-duration: 1s, 18s;
    animation-delay: -1s, -12s;
    transform: scale(0.9);
}

@keyframes rotateRays {
    to {
        transform: rotate(360deg);
    }
}

@keyframes moveClouds {
    from {
        transform: translateX(-200%);
    }
    to {
        transform: translateX(120vw);
    }
}

@keyframes float {
    50% {
        margin-top: 20px;
    }
}

@keyframes fly-cycle {
    to {
        background-position: -500px 0;
    }
}

@keyframes fly-right {
    0% {
        left: -10%;
        transform: translateY(0);
    }
    50% {
        transform: translateY(50%);
    }
    100% {
        left: 110%;
        transform: translateY(0);
    }
}

.bg-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3;
    background: #0284c7;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s ease;
}

.bg-toggle:hover {
    background: #0369a1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bg-toggle select {
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    background: rgba(4, 151, 250, 0.95);
    font-family: Inter, Roboto, system-ui, Arial, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0c4a6e;
    cursor: pointer;
    transition: background 0.2s;
    min-width: 180px;
    min-height: 56px;
}

.bg-toggle select:hover {
    background: #ffffff;
}

.bg-toggle select:focus {
    outline: none;
    background: #ffffff;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

header.topbar,
main.container,
footer {
    position: relative;
    z-index: 1;
}

@keyframes rgbfade {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 18px;
}

main.container {
    flex: 1 0 auto;
}

.content-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

.topbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 350px;
    /* Space for fixed toggles */
}

@media (max-width: 1400px) {
    .topbar .container {
        padding-right: 280px;
        /* Reduced space for smaller toggles */
    }
}

@media (max-width: 1200px) {
    .topbar .container {
        padding-right: 0;
        /* No padding when toggles are relative */
    }
}

.brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
}

nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

nav a {
    text-decoration: none;
    color: var(--accent);
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--accent-hover);
}

.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
}

.search-form input[type="search"] {
    padding: 6px 12px;
    border: 2px solid var(--accent);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-size: 0.9rem;
    min-width: 200px;
    transition: all 0.2s;
}

.search-form input[type="search"]:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-hover);
}

.search-form input[type="search"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-form button {
    padding: 6px 12px;
    background: var(--accent);
    color: #0f172a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.search-form button:hover {
    background: var(--accent-hover);
    color: white;
}

body.bg-rgb .brand,
body.bg-clouds .brand {
    color: #0c4a6e;
}

body.bg-rgb nav a,
body.bg-clouds nav a {
    color: #0369a1;
}

body.bg-rgb nav a:hover,
body.bg-clouds nav a:hover {
    color: #075985;
}

body.bg-rgb .search-form input[type="search"] {
    border-color: #0369a1;
    background: rgba(255, 255, 255, 0.7);
    color: #0f172a;
}

body.bg-rgb .search-form input[type="search"]::placeholder,
body.bg-clouds .search-form input[type="search"]::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

body.bg-clouds .search-form input[type="search"] {
    border-color: #0369a1;
    background: rgba(255, 255, 255, 0.7);
    color: #0f172a;
}

body.bg-rgb .search-form button,
body.bg-clouds .search-form button {
    background: #0369a1;
    color: white;
}

body.bg-rgb .search-form button:hover,
body.bg-clouds .search-form button:hover {
    background: #075985;
}

body.bg-rgb .header-meta,
body.bg-clouds .header-meta {
    color: #334155;
}

body.bg-rgb .page-header h2,
body.bg-clouds .page-header h2 {
    color: #1e293b;
}

.note-list {
    width: 100%;
    max-width: 900px;
    min-width: 600px;
    margin: 0 auto 24px auto;
    list-style: none;
    padding: 0;
}

.note-item {
    background: #fff;
    max-width: 860px;
    margin: 0 auto 14px auto;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.note-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--shadow);
}

.note-item h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: #000000;
}

.note-item.collapsed {
    padding: 12px 16px;
    cursor: pointer;
}

.note-item.collapsed h3 {
    margin: 0;
}

.note-item.collapsed .preview,
.note-item.collapsed .note-meta,
.note-item.collapsed .note-actions {
    display: none;
}

.note-item.collapsed:hover {
    background: #f8fafc;
}

.note-item.expanded {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preview {
    color: #475569;
    line-height: 1.4;
    margin-bottom: 10px;
}

.note-meta {
    color: #999ca1;
    font-size: 0.7rem;
    margin-bottom: 12px;
}

.weather-widget {
    background: white;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px var(--shadow);
    position: sticky;
    top: 24px;
}

.weather-attribution {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    color: #64748b;
    text-decoration: none;
    margin-top: 4px;
}

.weather-attribution:hover {
    color: var(--accent);
}

@media (max-width: 1200px) {
    .content-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .weather-widget {
        position: static;
        margin-bottom: 24px;
    }
    /* Stack the top toggles on tablets too */
    .toggles {
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
        max-width: 500px;
        margin: 8px auto 0 auto;
    }
    .toggles .bg-toggle {
        width: 100%;
        background: #0284c7;
        display: flex;
        justify-content: center;
    }
    .toggles .bg-toggle select {
        width: 100%;
        min-width: 0;
        min-height: 48px;
        font-size: 1.1rem;
        text-align: center;
    }
    .toggles .dark-mode-toggle {
        width: 100%;
        height: 48px;
        font-size: 1.1rem;
        box-shadow: none;
    }
}

.note-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.btn,
button.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    background: #0284c7;
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    text-align: center;
    transition: background 0.2s, transform 0.15s;
}

.btn:hover,
button.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-danger,
button.btn.btn-danger {
    background: var(--danger);
}

.btn-danger:hover,
button.btn.btn-danger:hover {
    background: var(--danger-hover);
}

form button.btn {
    margin: 0;
    font-size: 1rem;
}

.messages {
    margin-bottom: 14px;
}

.flash {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-weight: 500;
}

.flash.success {
    background: #dcfce7;
    color: #065f46;
}

.flash.error {
    background: #fee2e2;
    color: #7f1d1d;
}

.note-form {
    width: 100%;
    max-width: 900px;
    min-width: 600px;
    margin: 20px auto 30px auto;
    background: #fff;
    padding: 24px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.note-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.note-form input,
.note-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.note-form input:focus,
.note-form textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.note-form textarea {
    min-height: 160px;
    resize: vertical;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
}

.page-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.header-meta {
    color: #ffffff;
    font-size: 0.9rem;
    margin-left: 8px;
}

footer {
    padding: 18px;
    text-align: center;
    color: #ffffff;
}

@media (max-width: 1200px) {
    .topbar .container {
        flex-wrap: wrap;
        gap: 10px;
    }
    nav {
        flex-wrap: wrap;
        gap: 10px 12px;
        width: 100%;
    }
    .search-form {
        margin-left: 0;
    }
    .filters-section {
        padding: 1rem;
    }
    .note-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 700px) {
    .container {
        margin: 12px;
        padding: 0 10px;
    }
    .note-form,
    .note-list {
        min-width: unset;
        width: 100%;
    }
    .note-item {
        max-width: 100%;
        padding: 14px;
    }
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    nav a {
        margin-left: 0;
        margin-right: 12px;
    }
    .header-actions {
        flex-wrap: wrap;
        width: 100%;
    }
    .header-actions .btn {
        flex: 1 1 180px;
    }
    .search-form {
        width: 100%;
        gap: 6px;
    }
    .search-form input[type="search"] {
        min-width: 0;
        width: 100%;
    }
    .filters-section {
        padding: 0.8rem;
    }
    .sort-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .sort-controls select {
        width: 100%;
    }
    .tag-filters {
        gap: 6px;
    }
    .tag-pill {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    .note-actions {
        gap: 6px;
        flex-wrap: wrap;
    }
    .note-actions .btn,
    .note-actions form .btn {
        flex: 1 1 48%;
    }
    .bg-toggle {
        position: static;
        top: auto;
        right: auto;
        z-index: auto;
        margin: 8px 0;
        width: 100%;
        box-shadow: none;
        background: transparent;
    }
    .bg-toggle select {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        font-size: 1rem;
        padding: 10px 12px;
        background: #0284c7;
        color: #0c4a6e;
    }
    .dark-mode-toggle {
        position: static;
        top: auto;
        right: auto;
        width: 100%;
        height: 44px;
        border-radius: 10px;
        font-size: 1.1rem;
        margin: 6px 0 10px 0;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.9);
        justify-content: center;
        gap: 8px;
    }
    .clouds-bg .bird {
        display: none;
    }
}

@media (max-width: 480px) {
    .brand {
        font-size: 1.1rem;
    }
    .page-header h2 {
        font-size: 1.2rem;
    }
    .note-item h3 {
        font-size: 1rem;
    }
    .pin-indicator {
        top: 6px;
        right: 8px;
        font-size: 1.3rem;
    }
    .note-item {
        padding: 12px;
    }
    .tag-pill {
        font-size: 0.8rem;
        padding: 5px 9px;
    }
}

.header-flex {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inline-form {
    display: inline;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filters-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.sort-controls label {
    font-weight: 600;
    color: #334155;
}

.sort-controls select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #334155;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sort-controls select:hover {
    border-color: var(--accent);
}

.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-pill {
    padding: 6px 14px;
    background: #e2e8f0;
    color: #334155;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.tag-pill:hover {
    background: #cbd5e1;
    transform: translateY(-2px);
}

.tag-pill.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent-hover);
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.tag-badge {
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.note-item.pinned {
    border-left: 4px solid #fbbf24;
    background: linear-gradient(to right, #fef3c7, rgba(255, 255, 255, 0.95));
}

.pin-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    z-index: 10;
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.dark-mode-toggle {
    position: fixed;
    top: 90px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.dark-mode-toggle .sun-icon {
    display: block;
}

.dark-mode-toggle .moon-icon {
    display: none;
}

html.dark-mode {
    --bg: #1e293b;
    --text: #f1f5f9;
    --shadow: rgba(0, 0, 0, 0.3);
}

html.dark-mode body {
    background: linear-gradient(120deg, #0f172a, #1e1b4b, #1e293b);
}

html.dark-mode .dark-mode-toggle {
    background: rgba(30, 41, 59, 0.9);
}

html.dark-mode .dark-mode-toggle .sun-icon {
    display: none;
}

html.dark-mode .dark-mode-toggle .moon-icon {
    display: block;
}

html.dark-mode .topbar {
    background: rgba(30, 41, 59, 0.95);
}

html.dark-mode .container {
    background: transparent;
}

html.dark-mode .filters-section {
    background: rgba(30, 41, 59, 0.95);
    color: var(--text);
}

html.dark-mode .sort-controls label {
    color: var(--text);
}

html.dark-mode .sort-controls select {
    background: #0f172a;
    color: var(--text);
    border-color: #334155;
}

html.dark-mode .tag-pill {
    background: #334155;
    color: var(--text);
}

html.dark-mode .tag-pill:hover {
    background: #475569;
}

html.dark-mode .tag-pill.active {
    background: var(--accent);
    color: white;
}

html.dark-mode .note-item {
    background: rgba(30, 41, 59, 0.95);
    color: var(--text);
    border-color: #334155;
}

html.dark-mode .note-item.pinned {
    background: linear-gradient(to right, rgba(251, 191, 36, 0.2), rgba(30, 41, 59, 0.95));
}

html.dark-mode .note-item h3 {
    color: var(--text);
}

html.dark-mode .note-meta {
    color: #94a3b8;
}

html.dark-mode .note-form label {
    color: var(--text);
}

html.dark-mode .note-form input,
html.dark-mode .note-form textarea {
    background: #0f172a;
    color: var(--text);
    border-color: #334155;
}

html.dark-mode .page-header h2 {
    color: var(--text);
}

html.dark-mode footer {
    background: rgba(15, 23, 42, 0.95);
    color: #94a3b8;
}

html.dark-mode body.bg-rgb .brand,
html.dark-mode body.bg-clouds .brand {
    color: #e2f3ff;
}

html.dark-mode body.bg-rgb nav a,
html.dark-mode body.bg-clouds nav a {
    color: #8ad7ff;
}

html.dark-mode body.bg-rgb nav a:hover,
html.dark-mode body.bg-clouds nav a:hover {
    color: #bfe9ff;
}

html.dark-mode body.bg-rgb .header-meta,
html.dark-mode body.bg-clouds .header-meta {
    color: #cbd5e1;
}

html.dark-mode body.bg-rgb .search-form input[type="search"],
html.dark-mode body.bg-clouds .search-form input[type="search"] {
    background: rgba(255, 255, 255, 0.08);
    border-color: #8ad7ff;
    color: var(--text);
}

html.dark-mode body.bg-rgb .search-form input[type="search"]::placeholder,
html.dark-mode body.bg-clouds .search-form input[type="search"]::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

html.dark-mode body.bg-rgb .search-form button,
html.dark-mode body.bg-clouds .search-form button {
    background: #8ad7ff;
    color: #0f172a;
}

html.dark-mode body.bg-rgb .search-form button:hover,
html.dark-mode body.bg-clouds .search-form button:hover {
    background: #bfe9ff;
    color: #0f172a;
}

html.dark-mode body.bg-rgb .page-header h2 {
    color: #000000;
}

.toggles {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 1400px) {
    .toggles {
        position: fixed;
        top: 0px;
        right: 15px;
        z-index: 3;
        display: flex;
        align-items: center;
        gap: 8px;
        max-width: 300px;
    }
    .toggles .bg-toggle select {
        min-width: 120px;
        font-size: 1.2rem;
    }
}

.toggles .bg-toggle {
    position: static;
    top: auto;
    left: auto;
    margin: 0;
}

.toggles .dark-mode-toggle {
    position: static;
    top: auto;
    right: auto;
    width: auto;
    height: 56px;
    border-radius: 10px;
    border: none;
    background: #0284c7;
    color: #0c4a6e;
    padding: 0 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.toggles .dark-mode-toggle:hover {
    background: #0369a1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

html.dark-mode .toggles .dark-mode-toggle {
    background: #0369a1;
    color: #e0f2fe;
}

@media (max-width: 700px) {
    .toggles {
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        margin: 8px auto;
        width: 100%;
        max-width: 400px;
    }
    .toggles .bg-toggle {
        width: 100%;
        background: #0284c7;
        box-shadow: none;
        display: flex;
        justify-content: center;
    }
    .toggles .bg-toggle select {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        font-size: 1rem;
        padding: 10px 12px;
        background: rgba(4, 151, 250, 0.95);
        color: #0c4a6e;
        text-align: center;
    }
    .toggles .dark-mode-toggle {
        width: 100%;
        height: 44px;
        border-radius: 10px;
        font-size: 1.1rem;
        margin: 0;
        box-shadow: none;
        justify-content: center;
        gap: 8px;
        display: flex;
        align-items: center;
    }
}