body,
html {
    height: 100%;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.24);
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.36);
}

/* POPUP */

.container {
    width: 200px;
    height: 200px;
    position: relative;
    overflow: hidden;
    margin: 20px;
    display: inline-block;
}

.container img {
    width: 100%;
    height: auto;
    transition: filter 0.3s ease;
}

.container:hover img {
    filter: hue-rotate(180deg);
}

.popup {
    width: 150px;
    height: fit-content;
    color: #fff;
    position: absolute;
    top: 0;
    left: 0;
    transform: translateX(-150px);
    z-index: 10;
    padding: 10px;
    transition: transform 0.5s ease;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease;
}

.container:hover .popup {
    transform: translateX(0);
}

#ram-list ul {
    height: auto;
}

.bg-image {
    height: 100vh;
    background-image: url("../image/nature.jpeg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    isolation: isolate;
}

.bg-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    z-index: 0;
}

.card-scroll-wrapper {
    height: 100vh;
    overflow-y: scroll;
    scrollbar-gutter: stable;

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

    padding-top: 8vh;
    padding-bottom: 8vh;

    position: relative;
    z-index: 1;
}

.dashboard-layout {
    width: min(1280px, calc(100% - 40px));
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 18px;
}

.weather-card {
    order: 1;
}

.card-container {
    order: 2;
}

.quick-notes-card {
    order: 3;
}

.dashboard-layout.widgets-swapped .quick-notes-card {
    order: 1;
}

.dashboard-layout.widgets-swapped .card-container {
    order: 2;
}

.dashboard-layout.widgets-swapped .weather-card {
    order: 3;
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: min(520px, 100%);
    flex: 0 0 520px;
    max-height: calc(100vh - 16vh);
    overflow-y: auto;
    padding-right: 4px;
    padding-bottom: 36px;
    min-width: 0;
}

.card {
    width: 170px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(20, 20, 20, 0.42);
    border-radius: 12px;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card-body {
    padding: 10px 10px 4px;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-body h5 {
    min-height: 38px;
    margin: 0 0 4px;
    font-size: 15px;
    line-height: 1.25;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-wrap: anywhere;
}

.card a {
    text-decoration: none;
    color: inherit;
}

/* For smartphones and tablets */
@media (max-width: 1350px) {
    .bg-image {
        height: auto;
        min-height: 100vh;
    }

    .dashboard-layout {
        width: calc(100% - 30px);
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .card-container {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        flex-direction: column;
        gap: 15px;
        width: 100%;
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }

    .card {
        width: 100%;
        margin: 0 auto;
        padding-bottom: 10px;
    }
}


@media (max-width: 1350px) {
    .card-scroll-wrapper {
        padding-top: 20px;
    }
}

/* Bild-Link */
.link-image-link {
    width: 86px;
    height: 66px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 4px auto 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.link-card-image {
    max-width: 72px;
    max-height: 54px;
    width: auto;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s, filter 0.3s;
}

.link-image-link:hover .link-card-image {
    filter: hue-rotate(180deg);
    transform: scale(1.04);
}

/* BUTTONS */

.btn-circle {
    width: 40px;
    height: 40px;
    padding: 10px 0px;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    line-height: 1.42857;
}

.fixed-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

#new-button {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    color: #fff;
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    background: rgba(20, 20, 20, 0.46);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

#new-button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.46);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
}

#new-button:active {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.55);
}


@keyframes pulse {
    0% {
        transform: scale(0.9);
    }

    50% {
        transform: scale(1);
    }

    100% {
        transform: scale(0.9);
    }
}

.pulse-button {
    animation: pulse 1.5s infinite;
}


/* CUSTOM */


.custom-btn {
    font-size: 12px;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 10px;
    border: none;
    color: #fff;
    cursor: pointer;
    text-align: center;
    display: inline-block;
    margin: 0;
}


.custom-btn-success {
    background-color: #333;
    border: 1px solid #444;
}

.custom-btn-danger {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.custom-btn-danger:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.38);
}

.link-search-panel {
    width: 100%;
    padding: 14px;
    color: #fff;
    background: rgba(20, 20, 20, 0.42);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.link-search-panel input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    color: #fff;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 10px 12px;
    outline: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.link-search-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.link-search-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0;
    text-transform: uppercase;
    opacity: 0.75;
}

.link-search-head strong {
    color: #fff;
    font-size: 15px;
}

.link-search-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.link-search-body {
    margin-top: 10px;
}

.link-search-panel input::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.link-search-panel input:hover,
.link-search-panel input:focus {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.42);
}

.category-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.category-chip,
.widget-toggle-btn,
.widget-swap-btn {
    min-height: 42px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.widget-arrow-btn {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}

.widget-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
}

.widget-swap-btn {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    font-size: 16px;
    line-height: 1;
}

.category-chip:hover,
.widget-toggle-btn:hover,
.widget-swap-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.42);
    transform: translateY(-1px);
}

.category-chip:active,
.widget-toggle-btn:active,
.widget-swap-btn:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.26);
}

.category-chip-active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.48);
}

.link-category-group {
    width: 100%;
}

.link-category-group h3 {
    margin: 4px 0 10px;
    color: #fff;
    font-size: 16px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.link-category-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.link-category-cards .card {
    width: 100%;
    min-height: 145px;
}

.link-category-badge {
    display: inline-block;
    margin: 0;
    padding: 2px 7px;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    font-size: 11px;
}

.link-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 9px 9px;
}

.link-more-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
}

.link-more-panel span {
    display: block;
    text-align: center;
}

.link-more-panel button {
    min-height: 42px;
    padding: 8px 14px;
    color: #fff;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.link-more-panel button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.42);
    transform: translateY(-1px);
}

.link-more-panel button:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.26);
}

.link-empty-state {
    width: 100%;
    padding: 18px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    background: rgba(20, 20, 20, 0.36);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.link-empty-state p {
    margin: 0 0 4px;
    font-weight: bold;
}

.link-empty-state span {
    font-size: 12px;
}

.widget-open {
    max-height: 720px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.28s ease, opacity 0.2s ease, margin 0.2s ease;
}

.widget-closed {
    max-height: 0 !important;
    opacity: 0;
    margin: 0 !important;
    overflow: hidden !important;
    pointer-events: none;
    transition: max-height 0.28s ease, opacity 0.2s ease, margin 0.2s ease;
}

.widget-card-closed {
    min-height: 0;
    max-height: 110px;
}

.weather-card {
    width: 340px;
    flex: 0 0 340px;
    min-height: 360px;
    padding: 18px;
    color: #fff;
    background: rgba(20, 20, 20, 0.42);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.26);
    overflow: hidden;
    transition: transform 0.32s ease, min-height 0.28s ease, padding 0.28s ease, opacity 0.2s ease;
}

.weather-card.widget-card-closed {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 84px);
    left: 0;
    z-index: 1600;
    width: 340px;
    transform: translateX(calc(-100% + 58px));
    min-height: 0;
    max-height: 82px;
    padding: 12px 8px 12px 14px;
}

.weather-card.widget-card-closed:hover {
    transform: translateX(calc(-100% + 68px));
}

.dashboard-layout.widgets-swapped .weather-card.widget-card-closed {
    left: auto;
    right: 0;
    padding: 12px 14px 12px 8px;
    transform: translateX(calc(100% - 58px));
}

.dashboard-layout.widgets-swapped .weather-card.widget-card-closed:hover {
    transform: translateX(calc(100% - 68px));
}

.weather-card.widget-card-closed .weather-head {
    justify-content: flex-end;
    margin-bottom: 0;
}

.dashboard-layout.widgets-swapped .weather-card.widget-card-closed .weather-head {
    justify-content: flex-start;
}

.weather-card.widget-card-closed .weather-head > div:first-child,
.weather-card.widget-card-closed .widget-swap-btn,
.weather-card.widget-card-closed .weather-manage-btn {
    display: none;
}

.weather-card.widget-card-closed .widget-header-actions {
    width: 42px;
}

.weather-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

.weather-compact-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

.weather-compact-title strong,
.weather-compact-title span {
    color: #fff;
}

.weather-location-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.weather-manage-btn,
.weather-head button,
.weather-manage-panel select,
.weather-form input,
.weather-form select,
.weather-form button {
    color: #fff;
    min-height: 42px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 9px 11px;
    outline: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.weather-manage-panel select {
    max-width: 205px;
    min-width: 150px;
}

.weather-head button,
.weather-manage-panel button,
.weather-form button {
    cursor: pointer;
    font-weight: bold;
}

.weather-manage-panel select:hover,
.weather-head button:hover,
.weather-form input:hover,
.weather-form select:hover,
.weather-form button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.42);
}

.weather-head button:hover,
.weather-form button:hover {
    transform: translateY(-1px);
}

.weather-head button:active,
.weather-form button:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.26);
}

.weather-manage-panel select:focus,
.weather-form input:focus,
.weather-form select:focus {
    border-color: rgba(255, 255, 255, 0.58);
    background: rgba(255, 255, 255, 0.18);
}

.weather-manage-panel option,
.weather-form option {
    color: #111;
}

.weather-manage-btn {
    width: auto;
    min-width: 74px;
    height: 42px;
    padding: 0 12px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    border-radius: 10px;
}

.weather-manage-active {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.45);
}

.weather-manage-panel {
    margin-top: 12px;
    margin-bottom: 8px;
}

.weather-manage-row {
    display: flex;
    justify-content: flex-end;
    margin: 10px 0 0;
}

.weather-delete-btn {
    background: rgba(130, 22, 22, 0.48) !important;
    border-color: rgba(255, 130, 130, 0.38) !important;
}

.weather-delete-btn:hover {
    background: rgba(165, 32, 32, 0.62) !important;
    border-color: rgba(255, 160, 160, 0.52) !important;
}

.weather-delete-btn:active {
    background: rgba(190, 42, 42, 0.68) !important;
}

.weather-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0;
    text-transform: uppercase;
    opacity: 0.75;
    margin-bottom: 3px;
}

.weather-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.weather-main > div:first-child {
    flex: 1;
    min-width: 0;
}

.weather-main h2 {
    margin: 0;
    font-size: 26px;
    word-break: break-word;
}

.weather-main p {
    margin: 5px 0 0;
    opacity: 0.9;
}

.weather-icon-chart {
    display: flex;
    gap: 7px;
    width: 100%;
    max-width: 100%;
    margin: -6px 0 14px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}

.weather-icon-chart::-webkit-scrollbar {
    display: none;
}

.weather-icon-point {
    min-width: 42px;
    padding: 6px 5px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
}

.weather-icon-point span,
.weather-icon-point small {
    display: block;
}

.weather-icon-point span {
    font-size: 18px;
    line-height: 1;
}

.weather-icon-point small {
    margin-top: 4px;
    font-size: 10px;
    opacity: 0.72;
}

.weather-temp {
    font-size: 48px;
    line-height: 1;
    font-weight: bold;
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.weather-grid div,
.weather-hour {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 9px;
    min-width: 0;
}

.weather-grid span,
.weather-hour span,
.weather-hour small {
    display: block;
    font-size: 12px;
    opacity: 0.78;
}

.weather-grid strong {
    display: block;
    margin-top: 2px;
    font-size: 15px;
    overflow-wrap: anywhere;
}

.weather-hours {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.weather-hour strong {
    display: block;
    margin: 3px 0;
    font-size: 18px;
}

.weather-form {
    display: grid;
    grid-template-columns: minmax(72px, 0.8fr) minmax(126px, 1fr) minmax(72px, auto);
    align-items: stretch;
    gap: 8px;
}

.weather-form input,
.weather-form select,
.weather-form button {
    width: 100%;
    min-width: 0;
}

.weather-form button {
    white-space: nowrap;
}

.weather-form input::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.weather-error {
    margin: 14px 0;
    padding: 10px;
    background: rgba(120, 20, 20, 0.45);
    border: 1px solid rgba(255, 120, 120, 0.35);
    border-radius: 10px;
    color: #fff;
}

.quick-notes-card {
    width: 320px;
    flex: 0 0 320px;
    max-height: 560px;
    padding: 16px;
    color: #fff;
    background: rgba(20, 20, 20, 0.42);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.26);
    overflow: hidden;
    transition: max-height 0.28s ease, padding 0.28s ease;
}

.quick-notes-card.widget-card-closed {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 84px);
    right: 0;
    z-index: 1600;

    width: 320px;
    min-height: 0;
    max-height: 82px;

    padding: 12px 14px 12px 8px;

    transform: translateX(calc(100% - 58px));
    transition: transform 0.32s ease,
                min-height 0.28s ease,
                padding 0.28s ease,
                opacity 0.2s ease;
}

.quick-notes-card.widget-card-closed:hover {
    transform: translateX(calc(100% - 68px));
}

.dashboard-layout.widgets-swapped .quick-notes-card.widget-card-closed {
    right: auto;
    left: 0;
    padding: 12px 8px 12px 14px;
    transform: translateX(calc(-100% + 58px));
}

.dashboard-layout.widgets-swapped .quick-notes-card.widget-card-closed:hover {
    transform: translateX(calc(-100% + 68px));
}

.quick-notes-card.widget-card-closed .quick-notes-head > div:first-child,
.quick-notes-card.widget-card-closed #quick-note-add,
.quick-notes-card.widget-card-closed .widget-swap-btn {
    display: none;
}

.quick-notes-card.widget-card-closed .quick-notes-head {
    justify-content: flex-start;
    margin-bottom: 0;
}

.dashboard-layout.widgets-swapped .quick-notes-card.widget-card-closed .quick-notes-head {
    justify-content: flex-end;
}

.quick-notes-card.widget-card-closed .quick-notes-actions {
    width: 42px;
}

.quick-notes-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.quick-notes-head h2 {
    margin: 0;
    font-size: 22px;
}

.quick-notes-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0;
    text-transform: uppercase;
    opacity: 0.75;
    margin-bottom: 3px;
}

.quick-notes-head button,
.quick-notes-actions button,
.quick-note-tools button {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
}

.quick-notes-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.quick-notes-head h2 span {
    font-size: 13px;
    opacity: 0.7;
}

.quick-notes-list {
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
}

.quick-note {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
}

.quick-note-pinned {
    border-color: rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.16);
}

.quick-note-tools {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 8px;
}

.quick-note-title,
.quick-note-text {
    width: 100%;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px;
    outline: none;
    box-sizing: border-box;
}

.quick-note-title {
    margin-bottom: 8px;
    font-weight: bold;
}

.quick-note-text {
    min-height: 78px;
    max-height: 160px;
    resize: vertical;
}

.quick-note-title::placeholder,
.quick-note-text::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.quick-note-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    font-size: 11px;
    opacity: 0.68;
}

.quick-notes-empty {
    padding: 16px 10px;
    text-align: center;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
}

.quick-notes-empty p {
    margin: 0 0 4px;
    font-weight: bold;
}

.quick-notes-empty span {
    font-size: 12px;
}

.background-settings {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 1000;
}

.background-settings-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    background: rgba(30, 30, 30, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.background-settings-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.42);
    transform: translateY(-1px);
}

.background-settings-btn:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.24);
}

.background-panel {
    position: absolute;
    left: 0;
    bottom: 52px;
    width: 260px;
    padding: 14px;
    color: #fff;
    background: rgba(20, 20, 20, 0.6);
    border-radius: 14px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.26);
}

.background-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.background-panel h3 {
    margin: 0;
    font-size: 18px;
}

.background-panel button,
.background-upload {
    width: 100%;
    display: block;
    margin-top: 8px;
    min-height: 42px;
    padding: 9px 11px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.background-panel button:hover,
.background-upload:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.42);
    transform: translateY(-1px);
}

.background-panel button:active,
.background-upload:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.26);
}

.background-panel-head button {
    width: 42px;
    margin-top: 0;
}

.background-upload input {
    display: none;
}

.background-preset-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.background-preset-list .background-preset {
    margin-top: 0;
    font-size: 12px;
}

@media (max-width: 1350px) {
    .weather-card {
        width: 100%;
        flex: none;
        min-height: 0;
    }

    .weather-card.widget-card-closed {
        top: calc(env(safe-area-inset-top, 0px) + 72px);
        width: min(340px, calc(100vw - 18px));
    }

    .quick-notes-card {
        width: 100%;
        flex: none;
        max-height: 520px;
    }

    .card-container {
        width: 100%;
        flex: none;
    }

    .weather-hours {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .background-panel {
        width: calc(100vw - 40px);
    }
}

@media (max-width: 480px) {
    .dashboard-layout {
        width: calc(100% - 20px);
        gap: 12px;
    }

    .card-scroll-wrapper {
        padding-top: 12px;
    }

    .weather-card {
        padding: 14px;
    }

    .weather-card.widget-card-closed {
        top: calc(env(safe-area-inset-top, 0px) + 62px);
        width: calc(100vw - 18px);
        transform: translateX(calc(-100% + 54px));
    }

    .weather-card.widget-card-closed:hover {
        transform: translateX(calc(-100% + 60px));
    }

    .dashboard-layout.widgets-swapped .weather-card.widget-card-closed {
        transform: translateX(calc(100% - 54px));
    }

    .dashboard-layout.widgets-swapped .weather-card.widget-card-closed:hover {
        transform: translateX(calc(100% - 60px));
    }

    .weather-head {
        display: flex;
        align-items: flex-start;
    }

    .weather-location-controls {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 3px;
    }

    .weather-manage-panel select {
        width: 100%;
        max-width: none;
    }

    .weather-manage-btn {
        min-width: 64px;
        padding: 0 9px;
    }

    .weather-main {
        flex-wrap: wrap;
    }

    .weather-icon-chart {
        max-width: 100%;
    }

    .weather-main h2 {
        font-size: 23px;
    }

    .weather-temp {
        font-size: 42px;
    }

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

    .weather-hours {
        grid-template-columns: 1fr;
    }

    .weather-form {
        grid-template-columns: minmax(0, 0.8fr) minmax(118px, 1.2fr);
    }

    .weather-form button {
        grid-column: 1 / -1;
    }

    .link-search-head {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .link-search-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .link-category-cards {
        grid-template-columns: 1fr;
    }

    .link-category-cards .card {
        min-height: 140px;
    }

    .background-settings {
        left: 10px;
        bottom: 10px;
    }

    .background-panel {
        width: calc(100vw - 20px);
    }
}



.link-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 18px;
    z-index: 2000;
}

/* Link-Modal Box */
.link-modal {
    width: min(390px, 100%);
    color: #fff;
    background: rgba(20, 20, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.link-modal h2 {
    margin: 0 0 14px;
    font-size: 22px;
    text-align: left;
}

.link-modal label {
    display: block;
    margin-top: 12px;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.82);
}

.link-modal input[type="text"],
.link-modal input[type="url"] {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 10px;
    outline: none;
    box-sizing: border-box;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.link-modal input[list] {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 10px;
    outline: none;
}

.link-modal input::placeholder {
    color: rgba(255, 255, 255, 0.58);
}

.link-modal input:hover,
.link-modal input:focus {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.42);
}

.link-modal button {
    margin-top: 12px;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.link-modal button:hover {
    background: rgba(255, 255, 255, 0.21);
    border-color: rgba(255, 255, 255, 0.42);
    transform: translateY(-1px);
}

.link-modal button:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.26);
}

#delete-btn {
    background: rgba(120, 20, 20, 0.45);
    border-color: rgba(255, 120, 120, 0.35);
}

#delete-btn:hover {
    background: rgba(145, 28, 28, 0.58);
    border-color: rgba(255, 150, 150, 0.45);
}

.close-modal-btn  {
    width: 38px;
    height: 38px;
    float: right;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
}

.close-modal-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}


@media (max-width: 1350px) {
    .quick-notes-card.widget-card-closed {
        top: calc(env(safe-area-inset-top, 0px) + 72px);
        width: min(320px, calc(100vw - 18px));
    }
}

@media (max-width: 480px) {
    .quick-notes-card.widget-card-closed {
        top: calc(env(safe-area-inset-top, 0px) + 62px);
        width: calc(100vw - 18px);
        transform: translateX(calc(100% - 54px));
    }

    .quick-notes-card.widget-card-closed:hover {
        transform: translateX(calc(100% - 60px));
    }

    .dashboard-layout.widgets-swapped .quick-notes-card.widget-card-closed {
        transform: translateX(calc(-100% + 54px));
    }

    .dashboard-layout.widgets-swapped .quick-notes-card.widget-card-closed:hover {
        transform: translateX(calc(-100% + 60px));
    }
}

@media (min-width: 1351px) {
    .dashboard-layout {
        width: 100%;
        max-width: 1280px;

        display: grid;
        grid-template-columns: 340px 520px 320px;

        justify-content: center;
        align-items: start;
        gap: 18px;
    }

    .weather-card {
        grid-column: 1;
    }

    .card-container {
        grid-column: 2;

        position: static;
        transform: none;

        width: 520px;
        flex: none;
    }

    .quick-notes-card {
        grid-column: 3;
    }

    .dashboard-layout.widgets-swapped .quick-notes-card {
        grid-column: 1;
    }

    .dashboard-layout.widgets-swapped .card-container {
        grid-column: 2;
    }

    .dashboard-layout.widgets-swapped .weather-card {
        grid-column: 3;
    }
}
