/* Version 20261031_114115 */

        /*
Copyright 2010-2024 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries.

This Font Software is licensed under the SIL Open Font License, Version 1.1.

This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded, 
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
        */
        @font-face {
            font-family: 'ONStart Source Sans 3';
            font-style: normal;
            font-weight: 200 900;
            font-display: swap;
            src: url('./source-sans-3-normal_261030-2303.woff2') format('woff2');
        }
        @font-face {
            font-family: 'ONStart Source Sans 3';
            font-style: italic;
            font-weight: 200 900;
            font-display: swap;
            src: url('./source-sans-3-italic_261030-2303.woff2') format('woff2');
        }
        /* --- MÖRKT TEMA (Standard) --- */
        :root, [data-theme="dark"] {
            --bg-color: #27282c;
            --rail-bg: #303136;
            --page-gradient:
                radial-gradient(ellipse at 15% 18%, rgba(108, 76, 48, 0.24), transparent 58%),
                radial-gradient(ellipse at 86% 25%, rgba(145, 113, 52, 0.16), transparent 56%),
                radial-gradient(ellipse at 58% 92%, rgba(82, 65, 46, 0.22), transparent 60%);
            --card-bg: #1d2027;
            --search-bg: #303237;
            --group-bg: #1d2027;
            --group-glass-bg: rgba(29, 32, 39, 0.78);
            --group-border: #4b4e55;
            --dock-bg: #1d2027;
            --dock-glass-bg: rgba(29, 32, 39, 0.78);
            --dock-border: #595c64;
            --text-color: #eef0f4;
            --text-muted: #a1a8b5;
            --copyright-color: #fbfcff;
            --chrome-tint: rgba(28, 30, 34, 0.62);
            --chrome-blur: 16px;
            --band-tint: rgba(28, 30, 34, 0.40);
            --band-text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
            --information-bg: rgba(38, 40, 44, 0.94);
            --information-text: #ffffff;
            --primary-color: #2563eb;
            --primary-hover: #1d4ed8;
            --danger-color: #c93632;
            --danger-hover: #ae2926;
            --danger-text-color: #ff8e89;
            --border-color: #343944;
            --radius: 16px;
            --shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
            --icon-shadow: none;
            --input-bg: #171a20;
            --modal-bg: #1d2027;
            --overlay-bg: rgba(0, 0, 0, 0.65);
            --btn-secondary-bg: #272b34;
            --btn-secondary-hover: #323743;
            --app-bg-default: #272b34;
        }

        /* --- LJUST TEMA --- */
        [data-theme="light"] {
            --bg-color: #f3f5f6;
            --rail-bg: #e9ecf1;
            --page-gradient:
                radial-gradient(ellipse at 12% 14%, rgba(185, 214, 241, 0.48), transparent 58%),
                radial-gradient(ellipse at 88% 24%, rgba(205, 228, 212, 0.42), transparent 56%),
                radial-gradient(ellipse at 52% 94%, rgba(219, 224, 232, 0.40), transparent 60%);
            --card-bg: #ffffff;
            --search-bg: #ffffff;
            --group-bg: #eef0f2;
            --group-glass-bg: rgba(238, 240, 242, 0.78);
            --group-border: #dfe3e7;
            --dock-bg: #f5f0e6;
            --dock-glass-bg: rgba(245, 240, 230, 0.78);
            --dock-border: #ded6c8;
            --text-color: #202631;
            --text-muted: #626c7b;
            --copyright-color: #0e1a28;
            --chrome-tint: rgba(246, 248, 250, 0.53);
            --chrome-blur: 16px;
            --band-tint: rgba(246, 248, 250, 0.30);
            --band-text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
            --information-bg: rgba(248, 249, 246, 0.94);
            --information-text: #09131f;
            --primary-color: #2563eb;
            --primary-hover: #1d4ed8;
            --danger-color: #c93632;
            --danger-hover: #ae2926;
            --danger-text-color: #b52725;
            --border-color: #e1e5eb;
            --shadow: 0 2px 8px rgba(20, 30, 45, 0.04);
            --icon-shadow: none;
            --input-bg: #f8f9fb;
            --modal-bg: #ffffff;
            --overlay-bg: rgba(20, 25, 35, 0.4);
            --btn-secondary-bg: #f1f3f6;
            --btn-secondary-hover: #e7ebf0;
            --app-bg-default: #f1f3f6;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: "ONStart Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        }

        html {
            min-height: 100%;
            background-color: var(--bg-color);
            /* Samma tillgängliga sidbredd i både korta och långa vyer.
               scroll reserverar även plats i webbläsare utan scrollbar-gutter.
               Överlagrade rullningslister på mobil tar fortfarande ingen extra bredd. */
            overflow-y: scroll;
            scrollbar-gutter: stable;
        }

        body::before {
            content: "";
            position: fixed;
            inset: -40px;
            background-color: var(--bg-color);
            background-image: var(--appearance-image, var(--page-gradient));
            background-size: cover;
            background-position: center;
            filter: blur(var(--appearance-blur, 0px));
            pointer-events: none;
            z-index: -1;
        }

        body {
            isolation: isolate;
            background-color: var(--bg-color);
            color: var(--text-color);
            padding: 30px 20px 80px 88px;
            max-width: 1268px;
            margin: 0 auto;
            position: relative;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            transition: background-color 0.3s ease, color 0.3s ease;
            font-weight: 400;
            font-optical-sizing: auto;
        }


        header {
            display: flex;
            justify-content: center;
            align-items: flex-start;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid var(--border-color);
            position: relative;
            min-height: 80px;
        }

        .clock-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }

        .clock-date {
            font-size: 0.9rem;
            font-weight: 400;
            color: var(--text-muted);
            letter-spacing: -0.2px;
        }

        .clock-time {
            font-size: 2rem;
            font-weight: 400;
            color: var(--text-color);
            line-height: 1.1;
            margin: 2px 0;
            letter-spacing: -0.6px;
            font-variant-numeric: tabular-nums;
        }

        .clock-namnsdag {
            font-size: 0.78rem;
            font-weight: 400;
            color: var(--text-muted);
        }

        button {
            cursor: pointer;
            padding: 7px 14px;
            border: none;
            border-radius: 10px;
            font-weight: 400;
            font-size: 0.85rem;
            transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;

        }

        button:active {
            transform: none;
        }

        .btn-primary {
            background-color: var(--primary-color);
            color: white;
        }

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

        .btn-secondary {
            background-color: var(--btn-secondary-bg);
            color: var(--text-color);
            border: 1px solid var(--border-color);
        }

        .btn-secondary:hover {
            background-color: var(--btn-secondary-hover);
        }

        .btn-danger {
            background-color: var(--danger-color);
            color: white;
        }

        .btn-danger:hover {
            background-color: var(--danger-hover);
        }

        .btn-danger-outline {
            background-color: transparent;
            color: var(--danger-text-color);
        }

        .btn-danger-outline:hover {
            background-color: rgba(255, 59, 48, 0.15);
        }

        .btn-small {
            padding: 4px 10px;
            font-size: 0.75rem;
            border-radius: 12px;
        }

        /* --- CENTRERAT SÖKFÄLT OVANFÖR FAVORITER --- */
        .main-search-wrapper {
            display: flex;
            justify-content: center;
            margin-bottom: 22px;
            width: 100%;
        }

        /* Genomskinligt sökfält med temaanpassad text och fokusmarkering. */
        :root, [data-theme="dark"] {
            --search-glass-rest: rgba(25, 29, 35, .12);
            --search-glass-active: #ffffff;
            --search-glass-text: #f3f5f8;
            --search-glass-muted: #cbd1da;
            --search-glass-border: rgba(224, 232, 244, .22);
            --search-glass-focus: #9cc8ff;
            --search-glass-ring: rgba(156, 200, 255, .22);
            --search-control-bg: rgba(220, 230, 245, .12);
            --search-control-border: rgba(220, 230, 245, .28);
            --search-scheme: dark;
        }
        [data-theme="light"] {
            --search-glass-rest: rgba(255, 255, 255, .10);
            --search-glass-active: #ffffff;
            --search-glass-text: #202631;
            --search-glass-muted: #46515f;
            --search-glass-border: rgba(42, 54, 70, .22);
            --search-glass-focus: #38689a;
            --search-glass-ring: rgba(56, 104, 154, .16);
            --search-control-bg: rgba(42, 54, 70, .09);
            --search-control-border: rgba(42, 54, 70, .22);
            --search-scheme: light;
        }

        .main-search-bar {
            display: flex;
            align-items: center;
            background: var(--search-glass-rest);
            color: var(--search-glass-text);
            color-scheme: var(--search-scheme);
            -webkit-backdrop-filter: blur(16px) saturate(110%);
            backdrop-filter: blur(16px) saturate(110%);
            border: 1px solid var(--search-glass-border);
            border-radius: 14px;
            padding: 6px 8px 6px 12px;
            box-shadow: none;
            width: 100%;
            max-width: 680px;
            gap: 8px;
            transition: background-color 0.15s ease, border-color 0.2s, box-shadow 0.2s;
        }

        .main-search-bar:has(#mainSearchInput:focus) {
            --search-glass-text: #202631;
            --search-glass-muted: #46515f;
            --search-control-bg: rgba(42, 54, 70, .09);
            background: var(--search-glass-active);
            color-scheme: light;
            border-color: var(--search-glass-focus);
            box-shadow: 0 0 0 2px var(--search-glass-ring);
        }

        .search-engine-select {
            background: var(--btn-secondary-bg);
            color: var(--text-color);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 8px 12px;
            font-size: 0.85rem;
            font-weight: 400;
            outline: none;
            cursor: pointer;
            transition: background-color 0.2s;
        }

        .search-engine-select option {
            background-color: var(--bg-color);
            color: var(--text-color);
        }

        .main-search-input-wrapper {
            position: relative;
            flex: 1 1 0%;
            min-width: 0;
            display: flex;
            align-items: center;
        }

        .main-search-input-wrapper input {
            width: 100%;
            background: transparent;
            border: none;
            outline: none;
            color: var(--search-glass-text);
            caret-color: var(--search-glass-text);
            font-size: 0.95rem;
            padding: 8px 28px 8px 8px;
        }

        .main-search-input-wrapper input::placeholder {
            color: var(--search-glass-muted);
            opacity: 1;
        }

        .main-search-clear {
            position: absolute;
            right: 6px;
            background: var(--search-control-bg);
            border: none;
            font-size: 0.75rem;
            color: var(--search-glass-text);
            cursor: pointer;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }

        /* --- STIL FÖR UTLOGGAD VY MELLAN SÖK OCH FOOTER --- */
        .logged-out-container {
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 40px 20px;
            width: 100%;
            grid-column: 1 / -1;
        }

        .logged-out-box {
            background: var(--card-bg);


            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 40px 30px;
            box-shadow: none;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            gap: 18px;
            max-width: 420px;
            width: 100%;
        }

        .logged-out-icon-wrapper {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: var(--btn-secondary-bg);
            border: 1px solid var(--border-color);
            display: flex;
            justify-content: center;
            align-items: center;
            color: var(--primary-color);
            box-shadow: var(--icon-shadow);
        }

        .logged-out-icon-wrapper svg {
            width: 38px;
            height: 38px;
        }

        .logged-out-title {
            font-size: 1.35rem;
            font-weight: 500;
            color: var(--text-color);
            letter-spacing: -0.3px;
        }

        .logged-out-desc {
            font-size: 0.9rem;
            color: var(--text-muted);
            line-height: 1.4;
            margin-top: -6px;
        }

        .logged-out-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 12px 28px;
            font-size: 0.98rem;
            font-weight: 500;
            border-radius: 10px;
            cursor: pointer;
            width: 100%;
            box-shadow: none;
            transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s;
        }

        .logged-out-btn:hover {
            transform: none;
        }

        .logged-out-btn:active {
            transform: none;
        }

        /* --- SUBTIL DRAG & DROP-RAM I GRUPPER VID AKTIV EXTERNA DRAG --- */
        .drop-target-zone-group {
            display: none;
            border: 1px dashed var(--primary-color);
            background: var(--input-bg);
            border-radius: 12px;
            padding: 12px;
            text-align: center;
            font-size: 0.82rem;
            font-weight: 400;
            color: var(--text-color);
            margin-top: 10px;
            margin-bottom: 10px;
            transition: border-color 0.15s ease, background-color 0.15s ease;
        }

        body.edit-mode.external-drag-active .drop-target-zone-group {
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .drop-target-zone-group.drag-over {
            border-color: var(--primary-color);
            background: var(--btn-secondary-hover);
            color: var(--text-color);
            transform: none;
            border-style: solid;
        }

        .inline-group-control[hidden], .inline-group-control [hidden] {
            display: none !important;
        }

        .inline-group-control { flex: 0 1 auto; max-width: 100%; }
        .inline-group-add { width: 64px; }
        .inline-group-add:focus-visible, .inline-group-form input:focus-visible {
            outline: 2px solid var(--primary-color);
            outline-offset: 3px;
        }
        .inline-group-form {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
            padding: 12px;
            border-radius: 14px;
            background: var(--dock-bg);
            border: 1px solid var(--border-color);
            box-shadow: none;
        }
        .inline-group-form input {
            flex: 1 1 140px;
            width: 180px;
            min-width: 0;
            padding: 10px 12px;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            background: var(--input-bg);
            color: var(--text-color);
            font: inherit;
        }

        .favorites-dock-wrapper {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 16px;
            justify-content: center;
            margin-bottom: 30px;
            width: 100%;
        }

        .drag-trash-target {
            display: flex;
            flex: 0 0 64px;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 5px;
            min-height: 76px;
            padding: 8px 4px;
            border: 1px dashed var(--dock-border);
            border-radius: 14px;
            background: var(--dock-bg);
            color: var(--text-color);
            font: inherit;
            font-size: .65rem;
            cursor: pointer;
        }
        .drag-trash-target[hidden] { display: none !important; }
        .drag-trash-target.drag-over {
            color: var(--danger-text-color);
            border-color: var(--danger-color);
            outline: 2px solid var(--danger-color);
            outline-offset: 2px;
        }
        .inline-group-add.drag-over {
            color: var(--primary-color);
            border-color: var(--primary-color);
            outline-color: var(--primary-color);
        }
        @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
            .drag-trash-target {
                background: var(--dock-glass-bg);
                -webkit-backdrop-filter: blur(12px);
                backdrop-filter: blur(12px);
            }
        }

        .favorites-dock {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            align-items: center;
            gap: 18px;
            padding: 4px 12px;
            background: transparent;


            border-radius: 0;
            border: none;
            box-shadow: none;
            max-width: 100%;
        }

        .favorites-dock.drag-over { border-radius: 14px; outline: 2px solid var(--primary-color); outline-offset: 2px; }
        .favorites-dock.link-drag-target:empty {
            min-height:68px; padding:16px; border:1px dashed var(--text-muted);
            border-radius:14px; align-items:center; background:transparent;
        }
        .favorites-dock.link-drag-target:empty::before {
            content: 'Dra hit för att lägga till en favorit';
            color: var(--text-color);
            font-size: .85rem;
        }

        .app-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 72px;
            text-decoration: none;
            position: relative;
            user-select: none;
            cursor: pointer;
        }

        .app-icon-wrapper {
            position: relative;
            width: 60px;
            height: 60px;
            border-radius: 12px;
            background: var(--app-bg-default);
            box-shadow: var(--icon-shadow);
            display: flex;
            justify-content: center;
            align-items: center;
            transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
            overflow: visible;
            border: 1px solid var(--border-color);
        }

        .app-item:hover .app-icon-wrapper {
            transform: translateY(-1px);
            box-shadow: none;
            border-color: var(--text-muted);
        }

        .app-item:active .app-icon-wrapper {
            transform: none;
        }

        .app-icon-img {
            width: 36px;
            height: 36px;
            object-fit: contain;
            border-radius: 6px;
        }

        .app-initial {
            font-size: 1.35rem;
            font-weight: 500;
            color: var(--text-muted);
            text-shadow: none;
        }

        .app-label {
            margin-top: 6px;
            font-size: 0.72rem;
            font-weight: 400;
            color: var(--text-color);
            text-align: center;
            width: 100%;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            letter-spacing: -0.1px;
        }

        body.edit-mode .app-item {
            cursor: grab;
        }

        body.edit-mode .app-item:active {
            cursor: grabbing;
        }

        .app-badge-edit {
            position: absolute;
            top: -6px;
            right: -6px;
            width: 22px;
            height: 22px;
            background-color: var(--btn-secondary-bg);
            color: var(--text-color);
            border-radius: 50%;
            display: none;
            justify-content: center;
            align-items: center;
            font-size: 10px;
            box-shadow: none;
            border: 1px solid var(--border-color);
            z-index: 10;
        }

        body.edit-mode .app-badge-edit {
            display: flex;
        }

        .app-item.dragging-app {
            opacity: 0.18;
            transform: scale(0.85);
        }

        main {
            flex: 1;
        }

        .groups-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 18px;
            align-items: start;
        }

        /* En till fem grupper centreras med samma bredd som i det vanliga rutnätet. */
        .groups-grid.centered-groups {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            align-items: flex-start;
        }
        .groups-grid.centered-groups > .group-card {
            flex: 0 0 calc((100% - 54px) / 4);
        }
        @media (max-width: 1179px) {
            .groups-grid.centered-groups > .group-card {
                flex-basis: calc((100% - 36px) / 3);
            }
        }
        @media (max-width: 899px) {
            .groups-grid.centered-groups > .group-card {
                flex-basis: calc((100% - 18px) / 2);
            }
        }

        .group-card {
            background-color: var(--group-bg);


            border-radius: var(--radius);
            box-shadow: none;
            border: 1px solid var(--group-border);
            min-width: 0;
            padding: 14px;
            transition: border-color 0.15s ease, background-color 0.15s ease;
        }

        /* Lätt genomskinliga ytor; texten behåller sin fulla kontrast och opacitet. */
        @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
            .group-card {
                -webkit-backdrop-filter: blur(12px);
                backdrop-filter: blur(12px);
            }
            .group-card { background-color: var(--group-glass-bg); }

        }

        /* Öppna grupper är kvadratiska när innehållet ryms och växer vid behov. */
        .group-card.is-expanded { aspect-ratio: 1 / 1; }
        .group-card .app-item { width: 64px; max-width: 100%; }
        .group-card .app-icon-wrapper { width: 52px; height: 52px; }
        .group-card .app-icon-img { width: 32px; height: 32px; }
        .group-card .group-title {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .group-card .toggle-icon, .group-card .link-count { flex-shrink: 0; }
        @media (max-width: 1179px) {
            .groups-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        }
        @media (max-width: 899px) {
            .groups-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        }

        .group-card.drag-over {
            border-color: var(--primary-color);
            outline: 1px solid var(--primary-color);
            outline-offset: 1px;
        }

        body.edit-mode .group-card {
            cursor: grab;
        }

        .group-card.dragging-group {
            opacity: 0.18;
            border: 2px dashed var(--primary-color);
        }

        .group-header {
            display: grid;
            grid-template-columns: 0 minmax(0, 1fr) 0;
            align-items: center;
            cursor: pointer;
            padding: 4px 0;
        }

        body.edit-mode .group-header {
            grid-template-columns: 0 minmax(0, 1fr) 0;
            row-gap: 6px;
        }

        .group-title-container {
            display: flex;
            grid-column: 2;
            grid-row: 1;
            justify-content: center;
            align-items: center;
            min-width: 0;
            text-align: center;
            gap: 8px;
        }

        .toggle-icon {
            font-size: 0.75rem;
            color: var(--text-muted);
            transition: transform 0.2s ease;
        }

        .group-title {
            font-size: 1rem;
            font-weight: 500;
            color: var(--text-color);
            letter-spacing: -0.2px;
        }

        .link-count {
            font-size: 0.78rem;
            color: var(--text-muted);
            font-weight: 400;
        }

        .group-actions {
            display: none;
            grid-column: 3;
            grid-row: 1;
            justify-self: end;
            gap: 4px;
        }

        body.edit-mode .group-actions {
            display: flex;
            grid-column: 2;
            grid-row: 2;
            justify-self: end;
        }

        .apps-grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 16px 8px;
            justify-items: center;
            align-items: start;
            padding-top: 14px;
            min-height: 80px;
            transition: all 0.2s ease;
        }

        .apps-grid.collapsed {
            display: none;
        }

        .empty-state {
            color: var(--text-muted);
            font-size: 0.82rem;
            font-style: italic;
            text-align: center;
            grid-column: 1 / -1;
            padding: 20px 0;
        }

        .app-item[data-tooltip]::after,
        .daily-priority-button[data-tooltip]::before,
        .reminder-summary[data-tooltip]::before {
            content: attr(data-tooltip);
            position: absolute;
            bottom: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%);
            background-color: var(--modal-bg);
            color: var(--text-color);
            border: 1px solid var(--border-color);
            padding: 6px 10px;
            border-radius: 8px;
            font-size: 0.75rem;
            white-space: pre-line;
            word-break: break-all;
            pointer-events: none;
            opacity: 0;
            visibility: hidden;
            z-index: 1000;
            box-shadow: var(--shadow);
            width: max-content;
            max-width: 240px;
            text-align: center;
            transition: opacity 0.15s, visibility 0.15s;
        }

        body:not(.edit-mode) .app-item[data-tooltip]:hover::after,
        .daily-priority-button[data-tooltip]:hover::before,
        .daily-priority-button[data-tooltip]:focus-visible::before,
        .reminder-summary[data-tooltip]:hover::before,
        .reminder-summary[data-tooltip]:focus-visible::before {
            opacity: 1;
            visibility: visible;
        }

        .modal-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: var(--overlay-bg);

            display: flex;
            justify-content: center;
            align-items: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s;
            z-index: 1000;
        }

        .modal-overlay.active {
            opacity: 1;
            pointer-events: auto;
        }

        .modal {
            background: var(--modal-bg);

            padding: 22px;
            border-radius: 16px;
            width: 100%;
            max-width: 380px;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
            border: 1px solid var(--border-color);
            color: var(--text-color);
        }

        .modal h2 {
            margin-bottom: 14px;
            font-size: 1.15rem;
            letter-spacing: -0.3px;
        }

        .form-group {
            margin-bottom: 12px;
        }

        .form-group label {
            display: block;
            margin-bottom: 4px;
            font-size: 0.82rem;
            font-weight: 400;
            color: var(--text-color);
        }

        .form-group input[type="text"], 
        .form-group input[type="password"],
        .form-group input[type="email"], 
        .form-group input[type="url"], 
        .form-group textarea,
        .form-group select {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            font-size: 0.88rem;
            background-color: var(--input-bg);
            color: var(--text-color);
            outline: none;
        }

        .form-group textarea { resize: vertical; font-family: inherit; min-height: 90px; }

        .password-requirements { --password-ok-text: #61d884; margin: 8px 0 16px; font-size: 0.78rem; }
        [data-theme="light"] .password-requirements { --password-ok-text: #147a3a; }
        .password-meter-track { height: 7px; background: var(--border-color); border-radius: 8px; overflow: hidden; }
        .password-meter-fill { height: 100%; width: 0; background: #ff453a; transition: width 0.2s, background-color 0.2s; }
        .password-meter-text { margin: 6px 0; color: var(--text-color); }
        .password-rule-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
        .password-rule-list li:last-child { grid-column: 1 / -1; }

        /* --- LÖSENORDSFÄLT MED ÖGONKNAPP --- */
        .password-wrapper {
            position: relative;
            display: flex;
            align-items: center;
            width: 100%;
        }

        .password-wrapper input {
            width: 100%;
            padding-right: 48px !important;
        }

        .toggle-password-btn {
            position: absolute;
            right: 6px;
            width: 36px;
            height: 36px;
            background: transparent;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: color 0.2s, background-color 0.2s;

        }

        .toggle-password-btn:hover {
            color: var(--text-color);
            background-color: rgba(255, 255, 255, 0.1);
        }

        .toggle-password-btn:focus-visible {
            outline: 2px solid var(--primary-color);
            outline-offset: 2px;
        }

        .toggle-password-btn:active {
            transform: scale(0.9);
        }

        .form-group select option {
            background-color: var(--bg-color);
            color: var(--text-color);
        }

        .modal-footer {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            gap: 8px;
            margin-top: 18px;
        }

        .modal-switch-link {
            font-size: 0.8rem;
            color: var(--primary-color);
            cursor: pointer;
            margin-top: 12px;
            text-align: center;
            display: block;
            text-decoration: underline;
        }

        .export-options {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 12px;
        }

        .export-options button {
            text-align: left;
            padding: 12px 14px;
            border-radius: 14px;
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        .export-options button span.btn-desc {
            font-size: 0.75rem;
            font-weight: normal;
            opacity: 0.75;
        }

        .floating-trash-badge {
            position: absolute;
            top: -2px;
            right: -2px;
            background-color: var(--danger-color);
            color: white;
            font-size: 0.72rem;
            font-weight: 500;
            min-width: 20px;
            height: 20px;
            border-radius: 10px;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 0 4px;
            border: 2px solid var(--modal-bg);
        }

        footer {
            margin-top: 40px;
            padding-top: 18px;
            text-align: center;
            font-size: 0.78rem;
            color: var(--text-muted);
            border-top: 1px solid var(--border-color);
        }

        .footer-copyright {
            margin-top: 10px;
            font-size: 0.7rem;
            line-height: 1.4;
            text-align: center;
            color: var(--copyright-color);
        }

        .footer-quote {
            font-style: italic;
        }

        @media (max-width: 768px) {
            header {
                flex-direction: column;
                justify-content: center;
                align-items: center;
                position: relative;
            }
            .clock-container {
                align-items: center;
                text-align: center;
            }
            .main-search-bar {
                flex-direction: row;
                padding: 6px;
                gap: 6px;
            }
            .search-engine-select {
                padding: 8px 10px;
                font-size: 0.8rem;
            }
            .main-search-input-wrapper input {
                font-size: 0.88rem;
                padding: 8px 25px 8px 6px;
            }
        }

        /* Responsiv sökning, favoriter och grupper, även i liggande mobilvy. */
        @media (max-width: 768px), (max-width: 1024px) and (max-height: 500px) and (pointer: coarse) {
            html { width: 100%; }
            body { width: 100%; min-width: 0; padding: 16px 10px 60px 64px; }
            header, main, .main-search-wrapper, .favorites-dock-wrapper {
                width: 100%;
                min-width: 0;
                max-width: 100%;
            }
            .main-search-wrapper { margin-bottom: 16px; }
            .main-search-bar { width: 100%; min-width: 0; max-width: 680px; gap: 4px; }
            .main-search-input-wrapper { flex: 1 1 0%; min-width: 0; }
            .main-search-input-wrapper input {
                min-width: 0;
                max-width: 100%;
                font-size: 16px;
                padding: 8px 25px 8px 6px;
            }
            .search-engine-select {
                flex: 0 1 auto;
                min-width: 0;
                max-width: 45%;
                font-size: 16px;
                padding: 8px 6px;
            }
            .favorites-dock-wrapper { gap: 10px; margin-bottom: 18px; }
            .favorites-dock {
                min-width: 0;
                max-width: 100%;
                flex: 0 1 auto;
                gap: 10px;
                padding: 4px;
                border-radius: 0;
            }
            .favorites-dock .app-item { width: 56px; }
            .favorites-dock .app-icon-wrapper { width: 48px; height: 48px; border-radius: 12px; }
            .favorites-dock .app-icon-img { width: 30px; height: 30px; }
            .favorites-dock .app-initial { font-size: 1.25rem; }
            .favorites-dock .app-label { font-size: 0.7rem; }
            .inline-group-control { min-width: 0; max-width: 100%; }
            .inline-group-form { min-width: 0; max-width: 100%; }
            .inline-group-form input, .form-group input, .form-group textarea,
        .form-group select {
                font-size: 16px;
            }
            .groups-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
            .groups-grid.centered-groups > .group-card { flex-basis: 100%; }
            .group-card {
                width: 100%;
                min-width: 0;
                padding: 10px;
                display: flex;
                flex-direction: column;
                max-height: calc(100vh - 24px);
                max-height: calc(100dvh - 24px);
            }
            .group-header { flex: 0 0 auto; gap: 8px; min-width: 0; }
            .group-title-container { flex: 1; min-width: 0; gap: 5px; }
            .group-title {
                min-width: 0;
                font-size: 0.95rem;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }
            .toggle-icon, .link-count, .group-actions { flex-shrink: 0; }
            .group-actions .btn-small { min-width: 32px; min-height: 32px; }
            .drop-target-zone-group { flex: 0 0 auto; padding: 8px; overflow-wrap: anywhere; }
            .group-card.is-expanded { aspect-ratio: auto; }
            .group-card .apps-grid {
                grid-template-columns: repeat(3, minmax(0, 1fr));
                gap: 10px 6px;
                padding-top: 10px;
                padding-bottom: 6px;
                min-height: 0;
                overflow-y: auto;
                overflow-x: hidden;
                -webkit-overflow-scrolling: touch;
            }
            .group-card .app-item { width: 56px; }
            .group-card .app-icon-wrapper { width: 48px; height: 48px; border-radius: 12px; }
            .group-card .app-icon-img { width: 30px; height: 30px; }
            .group-card .app-initial { font-size: 1.25rem; }
            .group-card .app-label { font-size: 0.7rem; }
        }

        #aboutModal[hidden] { display: none; }
        .about-modal {
            width: calc(100% - 24px);
            max-width: 560px;
            max-height: 90vh;
            max-height: 90dvh;
            line-height: 1.5;
        }
        .about-modal p { margin-bottom: 14px; }
        .about-modal ul { padding-left: 20px; }
        .about-modal li { margin-bottom: 10px; }
        .about-modal h3 { margin: 24px 0 8px; font-size: 1rem; font-weight: 600; }
        .about-modal kbd { font: inherit; font-size: .85em; padding: 1px 5px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--input-bg); white-space: nowrap; }
        .about-modal .help-note { color: var(--text-muted); font-size: .85rem; }

        .remember-login { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-size: 0.88rem; cursor: pointer; }
        .remember-login input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--primary-color); }
        #backupReminderModal[hidden] { display: none; }
        #backupReminderModal .modal { width: calc(100% - 24px); }
        #backupReminderModal p { line-height: 1.5; margin-bottom: 14px; }
        #backupReminderModal .modal-footer { flex-wrap: wrap; }
        #deleteAccountModal[hidden], #deleteAccountModal [hidden] { display: none !important; }
        #deleteAccountModal .modal, #accountModal .modal { width: calc(100% - 24px); }
        #deleteAccountModal p { line-height: 1.5; margin-bottom: 14px; }
        #deleteAccountModal .modal-footer { flex-wrap: wrap; }
        #accountModal .account-action-row { flex-wrap: nowrap; align-items: stretch; }
        #accountModal .account-action-row button { min-width: 0; }
        #accountModal .account-action-row .btn-primary { margin-right: auto; }
        @media (max-width: 480px) {
            #accountModal .account-action-row { gap: 6px; }
            #accountModal .account-action-row button { padding: 8px 6px; font-size: 0.78rem; }
            #accountModal .account-action-row .btn-primary { flex: 2 1 0; }
            #accountModal .account-action-row .btn-secondary { flex: 1 1 0; }
        }
        .account-danger-zone { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-color); }
        .account-danger-zone .btn-danger { width: 100%; }
        /* Diskret redigeringsstatus och tydlig tangentbordsfokus. */
        .edit-toolbar { display: none; align-items: center; justify-content: center; gap: 12px; margin: -8px 0 18px; color: var(--text-muted); font-size: .8rem; }
        body.edit-mode:not(.logged-out) .edit-toolbar { display: flex; }
        .edit-done { padding: 5px 14px; min-height: 34px; border: 1px solid var(--border-color); border-radius: 999px; background: var(--btn-secondary-bg); color: var(--text-color); font: inherit; font-size: .8rem; cursor: pointer; }
        .edit-done:hover { border-color: var(--text-muted); }
        button:focus-visible, select:focus-visible {
            outline: 2px solid var(--primary-color);
            outline-offset: 3px;
        }
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation: none !important;
                transition: none !important;
                scroll-behavior: auto !important;
            }
        }
        h1, h2, h3, .btn-primary, .btn-danger { font-weight: 500; }
        strong, b { font-weight: 600; }
        /* Fast kantlist med funktioner överst och konto/papperskorg nederst. */
        .side-rail {
            position: fixed;
            left: 0;
            top: 0;
            bottom: 0;
            width: 60px;
            padding: 16px 10px;
            padding-top: calc(16px + env(safe-area-inset-top, 0px));
            padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
            background: var(--rail-bg);
            border: none;
            border-radius: 0;
            box-shadow: none;
            z-index: 950;
        }
        .rail-button {
            position: relative;
            width: 40px;
            height: 40px;
            flex: 0 0 auto;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            background: transparent;
            border: 1px solid transparent;
            border-radius: 9px;
        }
        .rail-button:hover, .rail-button:focus-visible {
            color: var(--text-color);
            background: var(--btn-secondary-bg);
        }
        .rail-button[aria-pressed="true"] {
            color: var(--text-color);
            background: var(--btn-secondary-bg);
            border-color: var(--primary-color);
        }
        .rail-button::after {
            content: attr(data-tooltip);
            position: absolute;
            left: calc(100% + 14px);
            top: 50%;
            transform: translateY(-50%);
            padding: 7px 10px;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            background: var(--modal-bg);
            color: var(--text-color);
            font-size: 0.8rem;
            font-weight: 400;
            line-height: 1.4;
            white-space: normal;
            width: max-content;
            max-width: min(280px, calc(100vw - 76px));
            pointer-events: none;
            opacity: 0;
            visibility: hidden;
            box-shadow: var(--shadow);
            transition: opacity 0.15s ease, visibility 0.15s ease;
        }
        .rail-button:hover::after, .rail-button:focus-visible::after {
            opacity: 1;
            visibility: visible;
        }
        .rail-spacer { flex: 1 1 auto; min-height: 12px; width: 100%; }
        .rail-button.drag-over {
            color: var(--danger-text-color);
            border-color: var(--danger-color);
            outline: 2px solid var(--danger-color);
            outline-offset: 1px;
        }
        .rail-button .floating-trash-badge {
            top: -3px;
            right: -3px;
            min-width: 16px;
            height: 16px;
            font-size: 0.65rem;
            border-width: 1px;
        }
        .account-danger-zone { display: flex; flex-direction: column; gap: 10px; }
        .account-danger-zone .btn-danger-outline { border: 1px solid var(--border-color); width: 100%; }
        @media (max-width: 768px), (max-width: 1024px) and (max-height: 500px) and (pointer: coarse) {
            .side-rail {
                width: 48px;
                padding: 12px 4px;
                padding-top: calc(12px + env(safe-area-inset-top, 0px));
                padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
                gap: 4px;
            }
            .rail-button { width: 38px; height: 40px; }
        }
        @media (max-height: 420px) {
            .side-rail { gap: 2px; padding-top:calc(8px + env(safe-area-inset-top, 0px)); padding-bottom:calc(8px + env(safe-area-inset-bottom, 0px)); }
            .rail-button { height: 32px; }
        }
        @media (max-height: 280px) {
            .side-rail { overflow-y: auto; }
        }
        /* Utloggad vy: ingen sidomeny eller kalender-/citatinformation. */
        body.logged-out .side-rail,
        body.logged-out #clock,
        body.logged-out #dailyQuoteContainer { display: none !important; }
        body.logged-out { padding: 30px 20px 80px; }
        body.logged-out > header {
            min-height: 0;
            margin: 0;
            padding: 0;
            border: 0;
        }
        @media (max-width: 768px), (max-width: 1024px) and (max-height: 500px) and (pointer: coarse) {
            body.logged-out { padding: 16px 10px 60px; }
        }
        body::after {
            content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
            background: var(--appearance-dim-color, transparent); opacity: var(--appearance-dim, 0);
        }
        .appearance-overlay { background: rgba(20,25,35,.12); }
        .appearance-panel { width: 440px; max-width: 100%; max-height: 90vh; max-height: 90dvh; overflow-y: auto; }
        .appearance-intro { color: var(--text-muted); font-size: .85rem; margin: 8px 0 20px; }
        .appearance-panel .appearance-range { width: 100%; accent-color: var(--primary-color); padding: 0; }
        .appearance-range-label { display: flex; justify-content: space-between; align-items: center; }
        .appearance-range-label output { color: var(--text-muted); font-size: .8rem; }
        .appearance-panel .modal-footer { flex-wrap: wrap; }
        .appearance-panel .appearance-reset { margin-right: auto; }
        .appearance-panel [hidden] { display: none !important; }
        .appearance-previews { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 10px 0 16px; }
        .appearance-preview { background: var(--input-bg); color: var(--text-color); border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; padding: 0; font: inherit; font-size: .8rem; cursor: pointer; }
        .appearance-preview[aria-pressed="true"] { outline: 2px solid var(--primary-color); outline-offset: 2px; }
        .appearance-preview span { display: block; padding: 5px; }
        .appearance-preview .appearance-thumbnail { height: 58px; background-position: center; background-size: cover; padding: 0; }
        .appearance-preview .appearance-theme-kind { color: var(--text-muted); font-size: .7rem; padding: 0 5px 6px; }
        @media (max-width: 480px) { .appearance-panel .modal-footer { gap: 8px; } .appearance-panel .appearance-reset { flex-basis: 100%; } }
        /* Sidhuvud och sidfot följer sidans skrollning; vänstermenyn är fast. */
        :root { --rail-width: 60px; --page-header-height: 110px; }
        html { scroll-padding-top: 16px; scroll-padding-bottom: 16px; }
        body:not(.logged-out) > header,
        body:not(.logged-out) > footer {
            position: relative;
            left: auto;
            right: auto;
            top: auto;
            bottom: auto;
            width: var(--page-band-width, calc(100vw - var(--rail-width)));
            max-width: none;
            border: 0;
            border-radius: 0;
            box-shadow: none;
            background: var(--rail-bg);
            z-index: auto;
        }
        body:not(.logged-out) > header {
            min-height: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 10px 20px;
            margin: 0 0 20px;
        }
        body:not(.logged-out) > footer {
            padding: 10px 20px;
            margin: 40px 0 0;
            max-height: none;
            overflow: visible;
        }
        body:not(.logged-out) > header,
        body:not(.logged-out) > footer { margin-left: var(--page-band-shift, 0px); }
        .clock-container.information-surface { max-width: 100%; padding: 0; background: none; }
        .clock-container .clock-date,
        .clock-container .clock-time,
        .clock-container .clock-namnsdag { color: var(--information-text); }
        .footer-information { max-width: 960px; margin: 0 auto; line-height: 1.5; overflow-wrap: anywhere; padding: 0; background: none; }
        .footer-information .footer-quote { color: var(--information-text); }
        .footer-information .footer-copyright { color: var(--copyright-color); margin-top: 5px; }
        .group-card { scroll-margin-top: 16px; }
        @media (max-width: 768px), (max-width: 1024px) and (max-height: 500px) and (pointer: coarse) {
            :root { --rail-width: 48px; }
            body:not(.logged-out) > header,
            body:not(.logged-out) > footer { padding-left: 12px; padding-right: 12px; }
        }
        @media (max-height: 500px) {
            body:not(.logged-out) .clock-container { flex-direction: row; flex-wrap: wrap; justify-content: center; column-gap: 14px; row-gap: 2px; }
            body:not(.logged-out) .clock-time { font-size: 1.3rem; margin: 0; }
            body:not(.logged-out) .clock-date { font-size: .8rem; }
            body:not(.logged-out) .clock-namnsdag { font-size: .72rem; }
            body:not(.logged-out) > footer { font-size: .72rem; }
            body:not(.logged-out) .footer-copyright { font-size: .65rem; margin-top: 2px; }
        }
        /* Appikonerna börjar överst i den fasta listen, oberoende av sidhuvudet. */
        /* Frostade band: samma behandling för meny, sidhuvud och sidfot. */
        body:not(.logged-out) .side-rail .rail-button { color: var(--information-text); }
        body:not(.logged-out) .side-rail .rail-button:hover,
        body:not(.logged-out) .side-rail .rail-button:focus-visible { color: var(--text-color); }
        @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
            body:not(.logged-out) .side-rail,
            body:not(.logged-out) > header,
            body:not(.logged-out) > footer {
                background: var(--chrome-tint);
                -webkit-backdrop-filter: blur(var(--chrome-blur)) saturate(110%);
                backdrop-filter: blur(var(--chrome-blur)) saturate(110%);
            }
        }
        /* Bandens bakgrunder når sidans övre och nedre kant. */
        body:not(.logged-out) { padding-top: 0; padding-bottom: 0; }
        body:not(.logged-out) > header {
            flex-shrink: 0;
            padding-top: calc(10px + env(safe-area-inset-top, 0px));
        }
        body:not(.logged-out) #groupsContainer {
            flex: 1 0 auto;
            align-content: start;
        }
        body:not(.logged-out) > footer {
            flex-shrink: 0;
            padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        }
        /* Mjukare band; vänstermenyn behåller sin befintliga toning. */
        body:not(.logged-out) > header .clock-container,
        body:not(.logged-out) > footer .footer-information { text-shadow: var(--band-text-shadow); }
        @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
            body:not(.logged-out) > header,
            body:not(.logged-out) > footer {
                background: var(--band-tint);
                -webkit-backdrop-filter: blur(8px) saturate(100%);
                backdrop-filter: blur(8px) saturate(100%);
            }
        }
        /* Tona ut endast bandens bakgrund, med texten kvar i full styrka. */
        @supports ((mask-image: linear-gradient(#000, transparent)) or (-webkit-mask-image: linear-gradient(#000, transparent))) {
            body:not(.logged-out) > header,
            body:not(.logged-out) > footer {
                isolation: isolate;
                overflow: visible;
                background: transparent !important;
                -webkit-backdrop-filter: none !important;
                backdrop-filter: none !important;
            }
            body:not(.logged-out) > header::before,
            body:not(.logged-out) > footer::before {
                content: '';
                position: absolute;
                left: 0;
                right: 0;
                pointer-events: none;
                z-index: -1;
                background: var(--band-tint);
            }
            body:not(.logged-out) > header::before {
                top: 0;
                bottom: -22px;
                -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 28px), transparent 100%);
                mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 28px), transparent 100%);
            }
            body:not(.logged-out) > footer::before {
                top: -24px;
                bottom: 0;
                -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 28px, #000 100%);
                mask-image: linear-gradient(to bottom, transparent 0%, #000 28px, #000 100%);
            }
            @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
                body:not(.logged-out) > header::before,
                body:not(.logged-out) > footer::before {
                    -webkit-backdrop-filter: blur(8px) saturate(100%);
                    backdrop-filter: blur(8px) saturate(100%);
                }
            }
        }

        /* Mappförhandsvisningar och lugnare ikoner utan att flytta klickytorna. */
        .group-card { border-radius: 22px; }
        .group-card:not(.is-expanded) {
            background: transparent;
            border-color: transparent;
            box-shadow: none;
            -webkit-backdrop-filter: none;
            backdrop-filter: none;
        }
        .group-card:not(.is-expanded) .group-header { display: none; }
        body.edit-mode .group-card:not(.is-expanded) .group-header { display: grid; margin-bottom: 8px; }
        .group-card:not(.is-expanded) .group-title-container { display: none; }
        .folder-preview {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            gap: 12px;
            width: 100%;
            max-width: 176px;
            aspect-ratio: 1 / 1;
            margin: 0 auto;
            padding: 16px;
            border: 1px solid var(--group-border);
            border-radius: 22px;
            background: var(--group-bg);
            color: var(--text-color);
            font: inherit;
            cursor: pointer;
            transition: border-color .18s ease, transform .18s ease;
        }
        .folder-heading { display: block; width: 100%; min-width: 0; }
        .folder-name {
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            overflow: hidden;
            overflow-wrap: anywhere;
            line-height: 1.25;
            font-size: .95rem;
            font-weight: 500;
            text-align: center;
        }
        .folder-name { min-height: 2.5em; }
        .folder-count { display: block; margin-top: 4px; font-size: .7rem; color: var(--text-muted); }
        .folder-links {
            position: absolute;
            left: 16px;
            right: 16px;
            top: 58%;
            transform: translateY(-50%);
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 8px;
        }
        .folder-mini-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            min-width: 0;
            min-height: 0;
            aspect-ratio: 1 / 1;
            border-radius: 9px;
            background: var(--app-bg-default);
        }
        .folder-mini-icon img { width: 22px; height: 22px; max-width: 75%; max-height: 75%; object-fit: contain; border-radius: 4px; }
        .folder-mini-initial { font-size: .85rem; color: var(--text-muted); }
        .folder-mini-placeholder { background: var(--app-bg-default); opacity: .18; }
        .folder-empty { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-items: center; color: var(--text-muted); }
        .folder-preview:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 4px; }
        .group-card.drag-over .folder-preview { border-color: var(--primary-color); outline: 2px solid var(--primary-color); outline-offset: 2px; }
        .group-card.drag-over:not(.is-expanded) { outline: none; }
        body.edit-mode .folder-preview { cursor: grab; }
        @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
            .folder-preview {
                background: var(--group-glass-bg);
                -webkit-backdrop-filter: blur(12px);
                backdrop-filter: blur(12px);
            }
        }
        .app-icon-wrapper { transform: scale(.85); transform-origin: center; transition: transform .2s ease, border-color .15s ease, background-color .15s ease; }
        .app-item:hover .app-icon-wrapper, .app-item:active .app-icon-wrapper { transform: scale(.85); }
        .app-label {
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            white-space: normal;
            overflow-wrap: anywhere;
            line-height: 1.25;
            min-height: 2.5em;
            max-height: 2.5em;
            margin-top: 2px;
        }
        @media (hover: hover) and (pointer: fine) {
            .app-icon-wrapper, .app-item:active .app-icon-wrapper { transform: scale(.82); }
            .app-item:hover:not(.dragging-app) .app-icon-wrapper { transform: translateY(-1px) scale(1); }
            .app-item:hover { z-index: 2; }
            .folder-preview:hover { border-color: var(--text-muted); }
        }
        @media (hover: none), (pointer: coarse) {
            .app-item, .group-card .app-item, .favorites-dock .app-item { min-height: 64px; min-width: 44px; }
        }
        @media (prefers-reduced-motion: reduce) {
            .app-icon-wrapper, .folder-preview { transition: none; }
        }

        /* Jämnstora mappceller ger samma mellanrum i båda riktningarna. */
        body:not(.logged-out) { max-width: 1440px; }
        body:not(.logged-out) .groups-grid {
            width: 100%;
            max-width: 1264px; /* Sex celler à 204 px och fem mellanrum à 8 px. */
            margin-left: auto;
            margin-right: auto;
            grid-template-columns: repeat(auto-fill, 204px);
            gap: 8px;
        }
        body:not(.logged-out) .groups-grid.centered-groups > .group-card {
            flex: 0 0 204px;
            max-width: 100%;
        }
        @media (max-width: 768px), (max-width: 1024px) and (max-height: 500px) and (pointer: coarse) {
            body:not(.logged-out) .groups-grid {
                grid-template-columns: minmax(0, 1fr);
                gap: 8px;
            }
            body:not(.logged-out) .groups-grid.centered-groups > .group-card {
                flex-basis: 100%;
            }
        }

        /* Utan sökträffar används hela bredden, inte mappgridens fasta kolumner. */
        body:not(.logged-out) .groups-grid.no-search-matches { display: block; }
        .favorites-dock .app-item { width: 64px; }
        .favorites-dock .app-icon-wrapper { width: 52px; height: 52px; }
        @media (max-width: 768px) { .favorites-dock .app-item { width: 56px; } .favorites-dock .app-icon-wrapper { width: 48px; height: 48px; } }
        .search-empty-state { width: 100%; box-sizing: border-box; margin: 0 auto; font-style: normal; text-align: center; padding: 24px 12px; }
        .search-empty-state > p { margin: 0; text-align: center; }
        .search-forward-links { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: 16px; margin-top: 12px; }
        .search-forward-links .search-provider { width: 92px; padding: 6px 2px; color: var(--text-color); text-decoration: none; }
        .search-provider .app-icon-wrapper { width: 48px; height: 48px; }
        .search-provider .app-icon-img { width: 30px; height: 30px; }
        .search-provider .app-label { font-size: .75rem; }
        .search-forward-links a:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; border-radius: 8px; }

        #calendarModal[hidden], #reminderOverviewModal[hidden], .upcoming-reminders[hidden], .reminder-summary-secondary[hidden] { display: none !important; }
        /* Samma kalenderikon intill den centrerade klockan på alla skärmar. */
        .header-information-row { display: grid; grid-template-columns: minmax(44px, 1fr) fit-content(calc(100% - 104px)) minmax(44px, 1fr); align-items: center; column-gap: 8px; width: 100%; min-width: 0; }
        .header-information-row > .clock-container { grid-column: 2; grid-row: 1; min-width: 0; overflow-wrap: anywhere; }
        .upcoming-reminders { grid-column: 3; grid-row: 1; justify-self: start; width: 44px; max-width: 44px; min-width: 0; margin: 0; box-sizing: border-box; }
        .reminder-summary { position: relative; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; border: none; border-radius: 50%; background: transparent; color: var(--text-color); font: inherit; cursor: pointer; }
        .reminder-summary[data-tooltip]::before { top: calc(100% + 8px); bottom: auto; left: auto; right: 0; transform: none; max-width: min(240px, calc(50vw + 12px)); font-weight: 400; line-height: 1.4; }
        .reminder-summary svg { width: 24px; height: 24px; flex-shrink: 0; color: currentColor; }
        .reminder-summary:hover { background: var(--btn-secondary-bg); }
        .reminder-summary:focus-visible { outline: 2px solid #4f94d7; outline-offset: 3px; }
        .reminder-summary-primary,
        .reminder-summary-secondary { display: none; }
        .reminder-summary.has-today::after { content: ''; position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: #4f94d7; }
        .reminder-overview { max-width: 500px; }
        .reminder-overview-day { padding: 12px 0; border-bottom: 1px solid var(--border-color); }
        .reminder-overview-day h3 { font-size: .85rem; margin: 0 0 8px; color: #4f94d7; }
        .reminder-overview-day ul { margin: 0; padding-left: 18px; font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
        .reminder-overview-day li + li { margin-top: 6px; }
        @media (max-width: 900px) {
            body:not(.logged-out) .header-information-row > .clock-container { flex-direction: column; }
        }
        #priorityHistoryModal[hidden], #priorityReflectionGroup[hidden], #priorityHistorySave[hidden] { display: none !important; }
        .summary-email-choice { display: flex; align-items: flex-start; gap: 8px; font-size: .85rem; line-height: 1.5; margin-bottom: 8px; }
        .summary-email-choice input { flex: 0 0 auto; margin-top: 4px; }
        .priority-history-task { display: flex; gap: 12px; align-items: baseline; font-size: .85rem; line-height: 1.5; margin: 10px 0; overflow-wrap: anywhere; }
        .priority-history-status { flex: 0 0 72px; font-size: .75rem; color: var(--text-muted); }
        .priority-history-task.is-done > span:last-child { opacity: .65; text-decoration: line-through; }
        #priorityWorkSection[hidden], #dailyPriorityModal[hidden], #dailyPriorityButton[hidden], #priorityReload[hidden] { display: none !important; }
        .daily-priority-button { grid-column: 1; grid-row: 1; justify-self: end; position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 10px; background: transparent; color: var(--text-color); border: 0; border-radius: 50%; cursor: pointer; }
        .daily-priority-button:hover { background: var(--btn-secondary-bg); }
        .daily-priority-button:focus-visible { outline: 2px solid #4f94d7; outline-offset: 3px; }
        .daily-priority-button[data-tooltip]::before { top: calc(100% + 8px); bottom: auto; left: 0; transform: none; max-width: min(240px, calc(50vw + 12px)); font-weight: 400; line-height: 1.4; }
        .daily-priority-panel { width: 480px; max-width: 100%; }
        .priority-section-heading { font-size: .9rem; font-weight: 600; margin: 16px 0 8px; }
        .priority-bonus-heading { border-top: 1px solid var(--border-color); padding-top: 20px; margin-top: 24px; }
        .priority-row.priority-bonus-row { margin: 10px 0; }
        .priority-intro, .priority-tip { font-size: .82rem; color: var(--text-muted); line-height: 1.5; }
        .priority-row { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 10px; align-items: center; margin: 16px 0; }
        .priority-row label { display: block; font-size: .75rem; color: var(--text-muted); margin-bottom: 4px; }
        .priority-row input[type="text"] { width: 100%; box-sizing: border-box; font: inherit; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--input-bg); color: var(--text-color); }
        .priority-row input[type="text"]:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
        .priority-row input[type="checkbox"] { width: 20px; height: 20px; margin: 16px 0 0; accent-color: var(--text-color); cursor: pointer; }
        .priority-row.is-done input[type="text"] { text-decoration: line-through; opacity: .6; }
        .priority-char-count { display: block; font-size: .65rem; text-align: right; color: var(--text-muted); margin-top: 3px; }
        #priorityMessage { font-size: .82rem; line-height: 1.5; }
        .calendar-panel { width: 580px; max-width: 100%; max-height: 90dvh; overflow-y: auto; }
        .calendar-intro, .reminder-empty { color: var(--text-muted); font-size: .85rem; }
        .reminder-list { margin: 14px 0 20px; }
        #reminderList[hidden], #reminderImportFile[hidden] { display: none !important; }
        .reminder-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
        .reminder-tools button { flex: 1 1 auto; }
        .reminder-tools button:disabled { opacity: .5; cursor: default; }
        .reminder-row { display: flex; align-items: center; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
        .reminder-row-text { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .85rem; }
        .reminder-row-text div { margin-top: 3px; font-size: .72rem; color: var(--text-muted); }
        .reminder-icon-button { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-color); background: var(--btn-secondary-bg); cursor: pointer; }
        .reminder-delete { color: var(--danger-text-color); }
        .reminder-checkbox { display: flex; align-items: center; gap: 9px; margin: 12px 0; font-size: .85rem; }
        .calendar-panel .reminder-checkbox input { width: 18px; height: 18px; flex-shrink: 0; }
        .reminder-actions { display: flex; justify-content: flex-end; gap: 8px; }
        #reminderSubmit, #reminderCancel { min-height: 40px; }


        .calendar-panel .reminder-tabs { margin:18px 0 22px; display:flex; overflow-x:auto; }
        .reminder-tabs button { flex:1 0 auto; }
        .calendar-panel [role="tabpanel"][hidden] { display:none !important; }
        .reminder-tabs button:focus-visible { outline:2px solid var(--primary-color); outline-offset:2px; }
        .reminder-entry { border-bottom:1px solid var(--border-color); }
        .reminder-entry:last-child { border-bottom:0; }
        .reminder-entry .reminder-row { border-bottom:0; }
        .reminder-entry.is-editing { padding:0 12px 14px; border:1px solid var(--border-color); border-radius:12px; background:var(--btn-secondary-bg); margin:8px 0; }
        .reminder-date { color:var(--text-muted); font-size:.76rem; flex:0 0 88px; line-height:1.4; }
        .reminder-inline-host form { margin:12px 0 0; }
        .reminder-footer { margin-top:16px; padding-top:14px; border-top:1px solid var(--border-color); }
        #reminderManagerMessage { font-size:.85rem; color:var(--text-color); overflow-wrap:anywhere; }
        @media(max-width:480px) {
            .reminder-row { gap:5px; flex-wrap:wrap; }
            .reminder-date { flex-basis:100%; }
            .reminder-row-text { flex-basis:calc(100% - 86px); }
            .reminder-tabs button { font-size:.76rem; padding:9px 8px; }
        }

        #headerNotes[hidden], .header-note-button[hidden], body.logged-out #headerNotes { display:none !important; }
        .header-notes { grid-column:1; grid-row:1; justify-self:end; display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:2px; width:max-content; max-width:100%; min-width:0; }
        .header-note-button { display:grid; place-items:center; flex:0 0 34px; width:34px; height:40px; padding:5px; border:0; border-radius:9px; background:transparent; cursor:pointer; }
        .header-note-button svg { width:24px; height:24px; overflow:visible; }
        .header-note-button .note-paper { fill:var(--note-paper); stroke:#645c52; stroke-width:1.15; stroke-linejoin:round; }
        .header-note-button .note-lines { fill:none; stroke:#645c52; stroke-width:1.3; stroke-linecap:round; }
        .header-note-button:hover { background:var(--btn-secondary-bg); }
        .header-note-button:focus-visible { outline:2px solid #4f94d7; outline-offset:2px; }
        .header-note-button:disabled { opacity:.5; cursor:default; }
        @media(pointer:coarse) { .header-note-button { flex-basis:44px; width:44px; height:44px; } }

        .notes-indicator { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: #438fe0; pointer-events: none; }
        .notes-indicator[hidden] { display: none !important; }
        [data-theme="dark"] .notes-indicator { background: #72b3f2; }
        #notesModal[hidden] { display: none !important; }
        .notes-panel { width: 780px; max-width: 100%; max-height: 90dvh; overflow-y: auto; }
        .notes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0 24px; }
        .note-card { position: relative; min-height: 150px; padding: 32px 18px 20px; background: var(--note-paper,#f5e8ac); color: #343022; border-radius: 3px 3px 16px 3px; box-shadow: 0 3px 9px rgba(0,0,0,.12); }
        .note-tone-0 { --note-paper:#f5e8ac; }
        .note-tone-1 { --note-paper:#e1edcf; }
        .note-tone-2 { --note-paper:#f1d5d3; }
        [data-theme="dark"] .note-tone-0 { --note-paper:#d2c48b; }
        [data-theme="dark"] .note-tone-1 { --note-paper:#bdcda9; }
        [data-theme="dark"] .note-tone-2 { --note-paper:#d1aaa6; }
        .note-open { display: block; width: 100%; min-height: 150px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: .95rem; text-align: left; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; }
        .note-open:focus-visible { outline: 2px solid #74662f; outline-offset: 4px; }
        .note-empty { box-shadow: none; opacity: .8; }
        .note-empty .note-open { text-align: center; cursor: pointer; }
        .note-edit-actions { display: flex; gap: 10px; }
        .note-action { font: inherit; font-size: .8rem; border: 1px solid rgba(52,48,34,.3); border-radius: 5px; padding: 5px 8px; background: rgba(255,255,255,.2); color: #343022; cursor: pointer; }
        @media (max-width: 600px) { .notes-grid { grid-template-columns: minmax(0, 1fr); } .note-card { min-height: 100px; } .note-open { min-height: 100px; } }
        .note-delete { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border: none; background: transparent; color: #a32121; font-size: 25px; line-height: 1; cursor: pointer; border-radius: 5px; }
        .note-delete:hover, .note-delete:focus-visible { background: rgba(163,33,33,.12); }
        .note-delete:disabled { opacity: .5; cursor: wait; }
        .note-edit-text { display: block; width: 100%; min-height: 150px; resize: vertical; padding: 0; border: 0; outline-offset: 4px; background: transparent; color: #343022; font: inherit; font-size: .95rem; line-height: 1.45; box-sizing: border-box; }
        .note-counter { text-align: right; color: #59523a; font-size: .75rem; margin: 6px 0 10px; }
        .notes-actions { display: flex; justify-content: flex-end; gap: 8px; }
        #saveFeedback[hidden], #saveFeedbackUndo[hidden] { display: none !important; }
        .save-feedback { position: fixed; z-index: 2100; left: calc(50% + var(--rail-width, 56px) / 2); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(460px, calc(100vw - var(--rail-width, 56px) - 28px)); padding: 11px 14px; box-sizing: border-box; border: 1px solid var(--border-color); border-radius: 12px; background: var(--modal-bg); color: var(--text-color); box-shadow: 0 5px 20px rgba(0,0,0,.12); font-size: .85rem; }
        #saveFeedbackMessage { flex: 1; min-width: 0; overflow-wrap: anywhere; }
        .feedback-action, .feedback-close { background: transparent; border: 0; color: var(--text-color); font: inherit; cursor: pointer; padding: 4px; min-height: 32px; }
        .feedback-action { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
        .feedback-close { width: 32px; flex-shrink: 0; opacity: .65; font-size: 1.2rem; }
        .feedback-action:disabled { opacity: .5; cursor: wait; }
        #bulkTools[hidden], #auxSearchResults[hidden], #preferencesForm[hidden], #openGroupLinksBtn[hidden], #duplicateModal[hidden] { display:none !important; }
        .feature-front-overlay { z-index: 1200; }
        .edit-toolbar { flex-wrap: wrap; width:100%; max-width:680px; box-sizing:border-box; margin-left:auto; margin-right:auto; gap:8px; }
        .bulk-tools { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; margin:-6px 0 20px; font-size:.8rem; }
        .bulk-tools select { max-width:220px; padding:7px; background:var(--input-bg); color:var(--text-color); border:1px solid var(--border-color); border-radius:8px; }
        .bulk-checkbox { position:absolute; top:0; left:0; width:18px; height:18px; accent-color:var(--primary-color); cursor:pointer; }
        .app-item.bulk-selectable .app-badge-edit { display:none; }
        .app-item.bulk-selected { outline:2px solid var(--primary-color); outline-offset:3px; border-radius:8px; }
        .search-group-label { font-size:.65rem; color:var(--text-muted); text-align:center; width:100%; overflow-wrap:anywhere; }
        .preferences-heading { font-size:1rem; margin:18px 0 10px; }
        #preferencesForm { padding-bottom:18px; margin-bottom:18px; border-bottom:1px solid var(--border-color); }
        .aux-search-results { width:100%; max-width:680px; margin:20px auto; }
        .aux-search-results h3 { font-size:.9rem; font-weight:500; color:var(--text-muted); margin:18px 0 8px; }
        .aux-search-hit { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; width:100%; margin:6px 0; padding:10px 12px; border:1px solid var(--border-color); border-radius:9px; background:var(--card-bg); color:var(--text-color); font:inherit; font-size:.85rem; text-align:left; white-space:pre-wrap; overflow-wrap:anywhere; cursor:pointer; }
        #bulkDropModal[hidden], #bulkDropNameField[hidden] { display:none !important; }
        .app-item[data-drag-count]::before { content:attr(data-drag-count); position:absolute; right:0; top:-4px; min-width:20px; height:20px; padding:0 4px; box-sizing:border-box; display:grid; place-items:center; border-radius:999px; background:var(--primary-color); color:white; font-size:.7rem; font-weight:600; z-index:5; }
        /* Sökträffar följer direkt efter varandra utan huvudytans utfyllnad. */
        body:not(.logged-out) #groupsContainer.search-results-active { flex: 0 0 auto; }
        .aux-search-results { flex: 0 0 auto; margin-top: 8px; }
        body:not(.logged-out) #groupsContainer.library-view, #groupsContainer.library-view { display:block; width:100%; max-width:1264px; min-width:0; margin-left:auto; margin-right:auto; }
        .library-breadcrumbs { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:7px; padding:4px 0 18px; color:var(--text-muted); font-size:.85rem; }
        .library-breadcrumbs button { border:0; border-radius:6px; padding:5px 7px; background:none; color:var(--text-muted); font:inherit; cursor:pointer; max-width:100%; overflow-wrap:anywhere; }
        .library-breadcrumbs button[aria-current="page"] { color:var(--text-color); font-weight:500; }
        .library-breadcrumbs button:hover { background:var(--btn-secondary-bg); }
        .library-breadcrumbs button.drag-over { outline:2px solid var(--primary-color); }
        .library-folder-grid { display:grid; grid-template-columns:repeat(auto-fit,88px); justify-content:center; align-items:start; justify-items:center; gap:18px 12px; margin:0 0 24px; padding:8px 4px 18px; }
        .library-folder-card { position:relative; width:80px; min-width:0; border:0; border-radius:8px; background:transparent; }
        .library-folder-card.drag-over { outline:2px solid var(--primary-color); outline-offset:3px; }
        .library-folder-card.dragging-group { opacity:.18; }
        .library-folder-open { display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:2px; width:100%; min-height:88px; padding:0; border:0; border-radius:8px; background:transparent; color:var(--text-color); font:inherit; cursor:pointer; }
        .library-folder-icon { display:grid; place-items:center; flex:0 0 52px; width:52px; height:52px; box-sizing:border-box; border:1.5px solid #252a32; border-radius:12px; background:var(--app-bg-default); color:#252a32; transform:scale(.85); transform-origin:center; transition:transform .2s ease,border-color .15s ease; }
        .library-folder-icon svg { display:block; }
        .library-folder-name { display:block; width:100%; min-width:0; color:#151719; font-size:.75rem; font-weight:700; line-height:1.25; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
        .library-folder-info { display:block; width:100%; color:var(--text-muted); font-size:.65rem; font-weight:400; line-height:1.3; text-align:center; white-space:nowrap; }
        [data-theme="dark"] .library-folder-icon { border-color:#c1c7d0; color:#e5e8ed; }
        [data-theme="dark"] .library-folder-name { color:#eef0f4; }
        .library-folder-edit { position:absolute; right:-3px; top:-3px; width:24px; height:24px; border:1px solid var(--border-color); border-radius:50%; background:var(--btn-secondary-bg); color:var(--text-color); cursor:pointer; font:inherit; font-size:.8rem; }
        .library-folder-edit:hover { border-color:var(--text-muted); }
        @media(hover:hover) and (pointer:fine) { .library-folder-icon { transform:scale(.82); } .library-folder-open:hover .library-folder-icon { transform:translateY(-1px) scale(1); } }
        .library-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin:0 0 20px; }
        .library-section-title { text-align:center; margin:18px 0 14px; font-size:.85rem; font-weight:500; color:var(--text-muted); }
        .library-links-grid { display:grid; grid-template-columns:repeat(auto-fit,88px); justify-content:center; align-items:start; justify-items:center; gap:18px 12px; min-height:76px; padding:8px 4px 18px; border-radius:10px; }
        .library-links-grid .app-item { width:80px; max-width:100%; }
        .library-links-grid .app-icon-wrapper { width:52px; height:52px; }
        .library-links-grid .app-icon-img { width:30px; height:30px; }
        .library-links-grid.drag-over { outline:2px solid var(--primary-color); outline-offset:2px; }
        .library-empty { grid-column:1/-1; width:100%; color:var(--text-muted); font-size:.85rem; text-align:center; padding:16px 8px; box-sizing:border-box; }
        @media(max-width:600px) { .library-folder-grid,.library-links-grid { grid-template-columns:repeat(auto-fit,72px); gap:16px 8px; } .library-folder-card,.library-links-grid .app-item { width:68px; } }
        @media(prefers-reduced-motion:reduce) { .library-folder-icon { transition:none; } }
        /* Behåll den ursprungliga dragkällan i DOM medan en separat målvy öppnas. */
        #groupsContainer.library-drag-navigation { position: relative; }
        #groupsContainer > .library-drag-preserved { position: absolute !important; left: -100000px !important; top: 0; width: 100%; opacity: 0; pointer-events: none; }
        .library-drag-view { width: 100%; min-width: 0; }
        .library-folder-card.drag-over { outline: 2px solid var(--primary-color); outline-offset: 5px; background: var(--btn-secondary-bg); }
        .library-folder-card.drag-over .library-folder-icon { transform: scale(1.08); }
        .library-folder-card.drag-over .library-folder-info { font-size: 0; }
        .library-folder-card.drag-over .library-folder-info::after { content: 'Släpp här'; font-size: .65rem; line-height: 1.3; color: var(--text-color); }
        body.external-drag-active .library-folder-card::before { content: ''; position: absolute; inset: -8px -6px; }
        .library-folder-open { position: relative; }
        .library-folder-edit { z-index: 1; }
        .library-breadcrumbs button { position: relative; }
        .library-breadcrumbs button.drag-over { background: var(--btn-secondary-bg); }
        .library-breadcrumbs button.drag-open-pending::after { content: 'Håll kvar för att öppna'; position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 180px; padding: 5px 8px; border: 1px solid var(--border-color); border-radius: 7px; background: var(--modal-bg); color: var(--text-color); font-size: .72rem; box-shadow: var(--shadow); pointer-events: none; z-index: 10; }
        @media (prefers-reduced-motion: reduce) { .library-folder-card.drag-over .library-folder-icon { transform: none; } }
        /* En gemensam bredd för sökning, grupper och favoriter. */
        :root { --library-cell: 88px; }
        .main-search-bar { box-sizing: border-box; }
        body:not(.logged-out) #groupsContainer.library-view, #groupsContainer.library-view { max-width: 680px; box-sizing: border-box; }
        .library-folder-grid, .library-links-grid { grid-template-columns: repeat(auto-fit, var(--library-cell)); }
        .favorites-dock-wrapper { max-width: 680px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
        #favoritesContainer { flex: 1 1 0%; min-width: min(160px, 100%); max-width: 100%; padding: 4px; box-sizing: border-box; column-gap: 12px; row-gap: 18px; align-items: flex-start; }
        [data-large-group-icons="true"] { --library-cell: 112px; }
        [data-large-group-icons="true"] .library-folder-card { width: 104px; }
        [data-large-group-icons="true"] .library-folder-open { min-height: 116px; }
        [data-large-group-icons="true"] .library-folder-icon { width: 76px; height: 76px; flex-basis: 76px; border-radius: 17px; }
        [data-large-group-icons="true"] .library-folder-icon svg { width: 44px; height: 44px; }
        .group-icon-options { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px; }
        .group-icon-option { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 8px 2px; border: 1px solid transparent; border-radius: 9px; color: var(--text-color); background: transparent; font: inherit; cursor: pointer; }
        .group-icon-option svg { width: 24px; height: 24px; }
        .group-icon-option span { font-size: .65rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
        .group-icon-option:hover, .group-icon-option[aria-pressed="true"] { border-color: var(--primary-color); background: var(--btn-secondary-bg); }
        .group-icon-option:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 1px; }
        @media(max-width:600px) { :root { --library-cell: 72px; } [data-large-group-icons="true"] { --library-cell: 96px; } [data-large-group-icons="true"] .library-folder-card { width: 88px; } [data-large-group-icons="true"] .library-folder-open { min-height: 104px; } [data-large-group-icons="true"] .library-folder-icon { width: 64px; height: 64px; flex-basis: 64px; } [data-large-group-icons="true"] .library-folder-icon svg { width: 36px; height: 36px; } }
        #createChoiceModal[hidden] { display:none !important; }
        .create-choice-dialog { width:calc(100% - 32px); box-sizing:border-box; }
        .create-choice-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:20px 0; }
        .create-choice-option { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; padding:20px 8px; min-height:100px; font:inherit; }
        .create-choice-dialog .modal-actions { display:flex; justify-content:flex-end; }
        .create-choice-option:focus-visible { outline:2px solid var(--primary-color); outline-offset:3px; }
        #countdownModal[hidden], #countdownDays[hidden] { display:none !important; }
        .countdown-menu-button { flex-direction:column; gap:0; }
        .countdown-menu-button.has-countdown svg { width:18px; height:18px; flex-shrink:0; }
        .countdown-days { display:block; font-size:9px; font-weight:600; line-height:11px; white-space:nowrap; max-width:100%; overflow:hidden; text-overflow:ellipsis; font-variant-numeric:tabular-nums; }
        .countdown-dialog { width:calc(100% - 32px); box-sizing:border-box; }
        .countdown-dialog input { width:100%; min-width:0; box-sizing:border-box; }
        .countdown-preview { font-size:.9rem; line-height:1.5; overflow-wrap:anywhere; }
        .countdown-message { font-size:.8rem; color:var(--text-muted); overflow-wrap:anywhere; }
        .countdown-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }

        .countdown-dialog { width:580px; max-width:calc(100% - 24px); max-height:90dvh; overflow-y:auto; }
        .countdown-dialog .countdown-tabs { margin:18px 0; display:flex; overflow-x:auto; }
        .countdown-tabs button { flex:1 0 auto; }
        .countdown-dialog [role="tabpanel"][hidden], #countdownEditHome[hidden] { display:none !important; }
        .countdown-tabs button:focus-visible { outline:2px solid var(--primary-color); outline-offset:2px; }
        .countdown-goal { min-height:40px; }
        .countdown-goal > div { white-space:normal; overflow:visible; overflow-wrap:anywhere; }
        .countdown-edit { display:grid; place-items:center; flex:0 0 28px; width:28px; height:28px; border:0; border-radius:8px; background:transparent; color:var(--text-color); cursor:pointer; }
        .countdown-edit:hover { background:var(--btn-secondary-bg); }
        .countdown-edit:focus-visible { outline:2px solid var(--primary-color); }
        .countdown-edit:disabled { opacity:.5; cursor:default; }
        .countdown-entry.is-editing { margin:8px 0; padding:8px 12px 14px; border:1px solid var(--border-color); border-radius:12px; background:var(--btn-secondary-bg); }
        .countdown-edit-form { margin-top:14px; }
        .countdown-footer { justify-content:flex-end; border-top:1px solid var(--border-color); padding-top:14px; }
        @media(pointer:coarse) { .countdown-edit { flex-basis:40px; width:40px; height:40px; } }

        .countdown-menu-button::after { display:none; }
        .countdown-tooltip { position:absolute; left:calc(100% + 14px); top:50%; transform:translateY(-50%); padding:7px 10px; border-radius:8px; border:1px solid var(--border-color); background:var(--modal-bg); color:var(--text-color); font-size:.8rem; font-weight:400; line-height:1.4; white-space:pre-wrap; text-align:left; overflow-wrap:anywhere; width:max-content; max-width:min(280px,calc(100vw - 76px)); pointer-events:none; opacity:0; visibility:hidden; box-shadow:var(--shadow); transition:opacity .15s ease,visibility .15s ease; }
        .countdown-tooltip strong { display:block; font-weight:700; }
        .countdown-tooltip > span { display:block; }
        .countdown-tooltip > span:empty { display:none; }
        .countdown-menu-button:hover .countdown-tooltip, .countdown-menu-button:focus-visible .countdown-tooltip { opacity:1; visibility:visible; }
        .countdown-list { margin-top:16px; }
        .countdown-goal { display:flex; align-items:center; gap:8px; padding:0; }
        .countdown-goal > div { flex:1; min-width:0; font-size:.85rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
        .countdown-goal strong { display:inline; font-size:inherit; font-weight:600; }
        .countdown-goal span { display:inline; font-size:inherit; color:var(--text-muted); }
        .countdown-remove { display:grid; place-items:center; flex:0 0 28px; width:28px; height:28px; border:0; border-radius:8px; background:transparent; color:var(--danger-text-color); cursor:pointer; }
        .countdown-remove:hover { background:var(--btn-secondary-bg); }
        .countdown-remove:focus-visible { outline:2px solid var(--primary-color); }
        .countdown-remove:disabled { opacity:.5; cursor:default; }
        .countdown-add-heading { font-size:.95rem; margin:22px 0 14px; }
        .countdown-empty { font-size:.85rem; color:var(--text-muted); }

        @media (pointer:coarse) { .countdown-remove { flex-basis:40px; width:40px; height:40px; } }
        /* Samma tooltips och dialogrytm över hela sidan. */
        .rail-group-gap { flex:0 0 7px; width:100%; }
        .rail-button::after, .app-item[data-tooltip]::after, .daily-priority-button[data-tooltip]::before, .reminder-summary[data-tooltip]::before, .countdown-tooltip { display:none !important; }
        .unified-tooltip { position:fixed; z-index:3000; pointer-events:none; padding:8px 11px; background:var(--modal-bg); color:var(--text-color); border:1px solid var(--border-color); border-radius:8px; box-shadow:var(--shadow); font-size:.8rem; font-weight:400; line-height:1.4; text-align:left; white-space:pre-line; overflow-wrap:anywhere; width:max-content; max-width:min(280px,calc(100vw - 24px)); box-sizing:border-box; }
        .unified-tooltip strong { display:block; font-weight:700; }
        /* Samma färg och dämpning som Open-Meteo under klockan. */
        .unified-tooltip strong.tooltip-weather-action { display:inline; color:var(--information-text); opacity:.75; }
        [data-theme="dark"] .unified-tooltip strong.tooltip-weather-action { color:var(--text-link-color,#93c5fd); }
        .unified-tooltip span { display:block; }
        .unified-tooltip span:empty { display:none; }
        #unifiedTooltip[hidden], #itemQuickMenu[hidden], #moveItemModal[hidden], #moveGroupFromEditor[hidden] { display:none !important; }
        .modal { box-sizing:border-box; padding:22px; }
        .modal h2 { font-size:1.15rem; font-weight:600; line-height:1.3; margin:0 0 18px; overflow-wrap:anywhere; }
        .modal .form-group { margin-bottom:14px; }
        .modal .form-group label { margin-bottom:6px; }
        .modal .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), .modal .form-group select, .modal .form-group textarea { box-sizing:border-box; max-width:100%; font-family:inherit; }
        .modal .form-group input[type="date"] { width:100%; padding:8px 12px; border:1px solid var(--border-color); border-radius:12px; background:var(--input-bg); color:var(--text-color); font-size:.88rem; }
        .modal-footer, .modal-actions, .countdown-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:18px; }
        .modal-footer > button, .modal-actions > button, .countdown-actions > button { margin:0; }
        .app-item, .library-folder-open { -webkit-touch-callout:none; -webkit-user-select:none; user-select:none; touch-action:manipulation; }
        .dialog-hint { color:var(--text-muted); font-size:.82rem; line-height:1.4; overflow-wrap:anywhere; }
        #moveGroupFromEditor { margin-bottom:12px; }
        .item-quick-menu { position:fixed; z-index:2200; width:220px; max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); overflow-y:auto; padding:6px; box-sizing:border-box; border:1px solid var(--border-color); border-radius:12px; background:var(--modal-bg); color:var(--text-color); box-shadow:var(--shadow); text-align:left; }
        .quick-menu-title { padding:7px 10px; color:var(--text-muted); font-size:.78rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
        .item-quick-menu button { display:block; width:100%; border:0; background:transparent; color:var(--text-color); text-align:left; padding:10px; border-radius:7px; font:inherit; font-size:.85rem; cursor:pointer; }
        .item-quick-menu button:hover, .item-quick-menu button:focus-visible { background:var(--btn-secondary-bg); outline:none; }
        .item-quick-menu .quick-menu-danger { color:var(--danger-text-color); }
        @media(max-height:600px) { .rail-group-gap { flex-basis:2px; } }
        .library-folder-card[data-group-drop-mode="before"] { border-left:3px solid var(--primary-color); box-sizing:border-box; }
        .library-folder-card[data-group-drop-mode="after"] { border-right:3px solid var(--primary-color); box-sizing:border-box; }
        .library-folder-card[data-group-drop-mode] .library-folder-info { font-size:0; }
        .library-folder-card[data-group-drop-mode] .library-folder-info::after { content:none; }
        .library-folder-card[data-group-drop-mode]::after { content:attr(data-group-drop-label); position:absolute; left:50%; bottom:-18px; transform:translateX(-50%); white-space:nowrap; font-size:.65rem; color:var(--text-color); pointer-events:none; }
        .group-drop-invalid { outline:2px dashed var(--danger-color); outline-offset:3px; }
        .library-folder-card.group-drop-invalid .library-folder-icon { opacity:.5; }
        .group-drag-active .library-breadcrumbs button { border:1px dashed var(--border-color); }
        #trashGroupModalBtn[hidden] { display:none !important; }
        #trashGroupModalBtn { margin-bottom:10px; }
        .trash-item { display:flex; align-items:center; justify-content:space-between; padding:10px 0; gap:10px; }
        .trash-item-text { min-width:0; flex:1; }
        .trash-item-text strong { display:block; font-size:.88rem; overflow-wrap:anywhere; }
        .trash-item-text span { display:block; font-size:.75rem; color:var(--text-muted); margin-top:3px; }
        .trash-item-actions { display:flex; flex-wrap:wrap; gap:6px; flex-shrink:0; }
        @media(max-width:420px) { .trash-item { align-items:flex-start; flex-wrap:wrap; } .trash-item-actions { width:100%; } }
        /* Sorteringspilar ändrar bara ikonens innehåll, aldrig rutnätets mått. */
        .library-folder-card[data-group-drop-mode="before"], .library-folder-card[data-group-drop-mode="after"] { border-left:0; border-right:0; }
        .library-folder-card.drag-over:is([data-group-drop-mode="before"],[data-group-drop-mode="after"]) .library-folder-icon { position:relative; transform:none; }
        .library-folder-card.drag-over:is([data-group-drop-mode="before"],[data-group-drop-mode="after"]) .library-folder-icon > svg { transform:translate(-13px,-13px) scale(.38); transform-origin:center; transition:transform .15s ease; }
        .library-folder-card.drag-over:is([data-group-drop-mode="before"],[data-group-drop-mode="after"]) .library-folder-icon::after { position:absolute; inset:0; display:grid; place-items:center; font-size:32px; font-weight:600; line-height:1; color:var(--text-color); pointer-events:none; }
        .library-folder-card.drag-over[data-group-drop-mode="before"] .library-folder-icon::after { content:'←'; }
        .library-folder-card.drag-over[data-group-drop-mode="after"] .library-folder-icon::after { content:'→'; }
        [data-large-group-icons="true"] .library-folder-card.drag-over:is([data-group-drop-mode="before"],[data-group-drop-mode="after"]) .library-folder-icon > svg { transform:translate(-21px,-21px) scale(.35); }
        [data-large-group-icons="true"] .library-folder-card.drag-over:is([data-group-drop-mode="before"],[data-group-drop-mode="after"]) .library-folder-icon::after { font-size:44px; }
        @media(max-width:600px) { [data-large-group-icons="true"] .library-folder-card.drag-over:is([data-group-drop-mode="before"],[data-group-drop-mode="after"]) .library-folder-icon > svg { transform:translate(-17px,-17px) scale(.35); } [data-large-group-icons="true"] .library-folder-card.drag-over:is([data-group-drop-mode="before"],[data-group-drop-mode="after"]) .library-folder-icon::after { font-size:38px; } }
        @media(prefers-reduced-motion:reduce) { .library-folder-card.drag-over:is([data-group-drop-mode="before"],[data-group-drop-mode="after"]) .library-folder-icon > svg { transition:none; } }
        /* Samma sorteringssignal för länkar som för grupper. */
        .app-item.link-sort-target .app-icon-wrapper { position:relative; transform:none; outline:2px solid var(--primary-color); outline-offset:3px; }
        .app-item.link-sort-target .app-icon-wrapper > .app-icon-img, .app-item.link-sort-target .app-icon-wrapper > .app-initial { transform:translate(-13px,-13px) scale(.38); transform-origin:center; transition:transform .15s ease; }
        .app-item.link-sort-target .app-icon-wrapper::after { position:absolute; inset:0; display:grid; place-items:center; font-size:32px; font-weight:600; line-height:1; color:var(--text-color); pointer-events:none; }
        .app-item.link-sort-target[data-link-drop-mode="before"] .app-icon-wrapper::after { content:'←'; }
        .app-item.link-sort-target[data-link-drop-mode="after"] .app-icon-wrapper::after { content:'→'; }
        @media(prefers-reduced-motion:reduce) { .app-item.link-sort-target .app-icon-wrapper > .app-icon-img, .app-item.link-sort-target .app-icon-wrapper > .app-initial { transition:none; } }
        /* Behåll sökträffarna samlade och låt innehållsytan fylla sidan ovanför sidfoten. */
        .library-content { display:flex; flex-direction:column; flex:1 0 auto; width:100%; min-width:0; }
        /* Flytta målobjektets innehåll, men behåll släppytan stilla så markeringen inte fladdrar. */
        .library-folder-open, .library-folder-edit { transform:translateX(var(--sort-target-shift,0px)); transition:transform .14s ease; }
        .library-folder-card.drag-over[data-group-drop-mode="before"], .app-item.link-sort-target[data-link-drop-mode="before"] { --sort-target-shift:14px; }
        .library-folder-card.drag-over[data-group-drop-mode="after"], .app-item.link-sort-target[data-link-drop-mode="after"] { --sort-target-shift:-14px; }
        .library-folder-card.drag-over:is([data-group-drop-mode="before"],[data-group-drop-mode="after"]) { outline:none; background:transparent; }
        .library-folder-card.drag-over:is([data-group-drop-mode="before"],[data-group-drop-mode="after"]) .library-folder-open { outline:2px solid var(--primary-color); outline-offset:5px; background:var(--btn-secondary-bg); }
        .library-folder-card.drag-over:is([data-group-drop-mode="before"],[data-group-drop-mode="after"]) > * { pointer-events:none; }
        .library-folder-card.drag-over:is([data-group-drop-mode="before"],[data-group-drop-mode="after"])::after { transform:translateX(calc(-50% + var(--sort-target-shift))); }
        .app-item > .app-icon-wrapper { translate:var(--sort-target-shift,0px) 0; transition:transform .2s ease,translate .14s ease,border-color .15s ease,background-color .15s ease; }
        .app-item > .app-label, .app-item > .search-group-label, .app-item > .app-badge-edit, .app-item > .bulk-checkbox { translate:var(--sort-target-shift,0px) 0; transition:translate .14s ease; }
        .app-item.link-sort-target > * { pointer-events:none; }
        @media(prefers-reduced-motion:reduce) { .library-folder-open, .library-folder-edit, .app-item > .app-icon-wrapper, .app-item > .app-label, .app-item > .search-group-label, .app-item > .app-badge-edit, .app-item > .bulk-checkbox { transition:none; } }
        /* Blå, något kraftigare ikonramar markerar redigeringsläget. */
        body.edit-mode { --edit-frame-color:#4675a9; }
        [data-theme="dark"] body.edit-mode { --edit-frame-color:#86b0dc; }
        body.edit-mode .app-item .app-icon-wrapper,
        body.edit-mode .library-folder-card .library-folder-icon { border-color:var(--edit-frame-color); border-width:2px; }
        /* Samlat redigeringsband som är tydligt mot samtliga bakgrundsbilder. */
        .edit-toolbar {
            --edit-band-bg:#e5eef8;
            --edit-band-text:#243e5a;
            --edit-band-border:#b3c8df;
            --edit-band-button:#f6f9fd;
            --edit-band-accent:#416b99;
            --edit-band-accent-text:#ffffff;
            padding:12px 14px;
            border:1px solid var(--edit-band-border);
            border-radius:14px;
            background:var(--edit-band-bg);
            color:var(--edit-band-text);
        }
        [data-theme="dark"] .edit-toolbar {
            --edit-band-bg:#263749;
            --edit-band-text:#e0ecf8;
            --edit-band-border:#506c89;
            --edit-band-button:#31465c;
            --edit-band-accent:#8fb9e5;
            --edit-band-accent-text:#152a40;
        }
        .edit-toolbar > [role="status"] { font-weight:600; white-space:nowrap; margin-right:4px; }
        .edit-toolbar .edit-done { border-color:var(--edit-band-border); background:var(--edit-band-button); color:var(--edit-band-text); }
        .edit-toolbar .edit-done:hover { border-color:var(--edit-band-accent); }
        .edit-toolbar .edit-done:last-child { background:var(--edit-band-accent); border-color:var(--edit-band-accent); color:var(--edit-band-accent-text); }
        .edit-toolbar .edit-done[aria-pressed="true"] { border-color:var(--edit-band-accent); box-shadow:inset 0 0 0 1px var(--edit-band-accent); }
        @media(max-width:540px) {
            .edit-toolbar { padding:10px; gap:8px 6px; }
            .edit-toolbar > [role="status"] { flex-basis:100%; text-align:center; margin:0 0 2px; }
            .edit-toolbar .edit-done { padding-left:10px; padding-right:10px; }
        }

        /* Mitt konto: lugn yta, tydliga flikar och en fast plats för dialogens åtgärder. */
        #accountModal [hidden] { display:none !important; }
        #accountModal .account-panel { width:min(640px,calc(100% - 24px)); max-width:640px; height:min(620px,90vh); height:min(620px,90dvh); max-height:90vh; max-height:90dvh; padding:0; display:flex; flex-direction:column; overflow:hidden; }
        .account-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:24px 24px 18px; }
        .account-header h2 { margin:0 0 4px; }
        .account-description { display:block; color:var(--text-muted); font-size:.82rem; line-height:1.5; font-weight:400; margin:5px 0 0; }
        .account-header .account-description { margin:0; }
        .account-close-icon { display:grid; place-items:center; flex:0 0 32px; width:32px; height:32px; border:0; border-radius:8px; background:transparent; color:var(--text-muted); font:inherit; font-size:1.5rem; cursor:pointer; }
        .account-close-icon:hover { background:var(--btn-secondary-bg); color:var(--text-color); }
        .account-tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; margin:0 24px; padding:4px; border-radius:11px; background:var(--btn-secondary-bg); flex-shrink:0; }
        .account-tabs button { min-width:0; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--text-muted); padding:9px 5px; font:inherit; font-size:.82rem; line-height:1.3; cursor:pointer; }
        .account-tabs button[aria-selected="true"] { background:var(--modal-bg); color:var(--text-color); border-color:var(--border-color); font-weight:600; }
        .account-tabs button:disabled { opacity:.45; cursor:default; }
        .account-content { flex:1 1 auto; padding:24px; overflow-y:auto; min-height:0; overscroll-behavior:contain; }
        .account-section-title { font-size:1rem; font-weight:600; margin:0 0 10px; }
        .account-section-divider { border-top:1px solid var(--border-color); padding-top:24px; margin-top:24px; }
        .account-email-line { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; }
        .account-email-line strong { font-size:.95rem; font-weight:500; min-width:0; overflow-wrap:anywhere; }
        .account-verification { font-size:.8rem; color:var(--text-muted); margin:8px 0 16px; }
        .account-verification.is-verified { color:var(--text-muted); }
        .account-setting-row { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding:20px 0; cursor:pointer; }
        .account-setting-row > span:first-child { min-width:0; }
        .account-setting-row strong,.account-carry-options strong,.account-management-row strong { font-size:.88rem; font-weight:500; }
        .account-switch { display:block; position:relative; flex:0 0 42px; width:42px; height:24px; margin-top:2px; }
        .account-switch input { position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0; cursor:pointer; }
        .account-switch-track { display:block; width:42px; height:24px; border:1px solid var(--border-color); border-radius:99px; background:var(--text-muted); pointer-events:none; }
        .account-switch-track::after { content:''; display:block; width:18px; height:18px; margin:2px; border-radius:50%; background:#fff; transition:transform .15s ease; }
        .account-switch input:checked + .account-switch-track { background:#497aac; border-color:#497aac; }
        .account-switch input:checked + .account-switch-track::after { transform:translateX(18px); }
        .account-switch input:focus-visible + .account-switch-track { outline:2px solid var(--primary-color); outline-offset:3px; }
        [data-theme="dark"] .account-switch input:checked + .account-switch-track { background:#6894c0; border-color:#6894c0; }
        .account-carry-options { min-width:0; margin:0; padding:20px 0; border:0; border-top:1px solid var(--border-color); border-bottom:1px solid var(--border-color); }
        .account-carry-options legend { float:left; width:100%; margin-bottom:12px; font-size:.88rem; font-weight:500; }
        .account-carry-options label { clear:both; display:flex; gap:10px; align-items:flex-start; padding:7px 0; cursor:pointer; }
        .account-carry-options input[type="radio"] { width:16px; height:16px; margin-top:3px; flex-shrink:0; accent-color:#497aac; }
        .account-management-row { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:20px 0; border-bottom:1px solid var(--border-color); }
        .account-management-row:last-child { border-bottom:0; padding-bottom:0; }
        .account-management-row button { flex-shrink:0; font-size:.8rem; }
        .account-inline-actions { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
        #accountModal #accountEmailForm { padding-top:12px; }
        #accountModal #changePasswordForm > .account-description { margin-bottom:20px; }
        .account-message { color:var(--text-muted); font-size:.82rem; line-height:1.5; overflow-wrap:anywhere; }
        .account-message:empty { display:none; }
        .account-footer { flex-shrink:0; padding:14px 24px 20px; border-top:1px solid var(--border-color); }
        .account-footer > .account-message:not(:empty) { margin-bottom:10px; }
        .account-footer-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; }
        .account-footer-actions form { display:contents; }
        .account-footer-actions button { min-height:36px; }
        @media(max-width:480px) { .account-header { padding:20px 18px 16px; } .account-tabs { margin:0 18px; grid-template-columns:repeat(2,minmax(0,1fr)); } .account-content { padding:22px 18px; } .account-footer { padding:14px 18px 18px; } .account-management-row { flex-direction:column; align-items:flex-start; gap:12px; } }
        @media(max-height:520px) { .account-header { padding:12px 18px 10px; } .account-header .account-description { display:none; } .account-content { padding:14px 18px; } .account-tabs button { padding-top:6px; padding-bottom:6px; } .account-footer { padding:10px 18px; } }
        @media(prefers-reduced-motion:reduce) { .account-switch-track::after { transition:none; } }

        /* Utseende ingår i kontots flikar; en enda rad på mobil. */
        .account-tabs { grid-template-columns:repeat(5,minmax(0,1fr)); }
        #accountPanelAppearance .appearance-range { width:100%; accent-color:var(--primary-color); padding:0; }
        #accountPanelAppearance .appearance-reset { margin-top:4px; }
        @media(max-width:480px) {
            .account-tabs { display:flex; overflow-x:auto; scrollbar-width:thin; overscroll-behavior-x:contain; }
            .account-tabs button { flex:0 0 auto; white-space:nowrap; padding-left:12px; padding-right:12px; }
        }

        /* Sex kontoflikar hålls på en skrollbar rad även i smalare datorfönster. */
        .account-tabs { display:flex; overflow-x:auto; scrollbar-width:thin; overscroll-behavior-x:contain; }
        .account-tabs button { flex:0 0 auto; white-space:nowrap; padding-left:12px; padding-right:12px; }
        .account-backup-options { display:flex; flex-direction:column; gap:12px; margin-top:20px; }
        .account-backup-row { display:grid; grid-template-columns:24px minmax(0,1fr) auto; align-items:center; gap:12px; padding:8px 0; }
        .account-backup-icon { width:23px; height:23px; color:var(--text-muted); }
        .account-backup-copy { min-width:0; }
        .account-backup-copy strong { display:block; color:var(--text-color); font-size:.9rem; font-weight:600; }
        .account-backup-copy p { margin:4px 0 0; color:var(--text-muted); font-size:.8rem; line-height:1.45; overflow-wrap:anywhere; }
        .account-backup-row button { width:auto; min-height:40px; padding:8px 14px; border-radius:9px; font-size:.82rem; white-space:nowrap; }
        .account-backup-restore { margin-top:16px; }
        @media (max-width:520px) {
            .account-backup-row { grid-template-columns:24px minmax(0,1fr); align-items:start; gap:10px 12px; }
            .account-backup-icon { margin-top:1px; }
            .account-backup-row button { grid-column:2; justify-self:start; }
        }

        /* Pennan ligger bredvid sökfältet utan att skapa en extra rad. */
        .main-search-wrapper { container-type:inline-size; }
        .search-and-edit { position:relative; width:100%; max-width:680px; min-width:0; }
        .library-edit-action { position:absolute; left:calc(100% + 8px); top:50%; transform:translateY(-50%); display:flex; }
        .library-edit-toggle { display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; padding:8px; border:1px solid transparent; border-radius:10px; background:transparent; color:var(--text-color); cursor:pointer; }
        .library-edit-toggle svg { width:22px; height:22px; pointer-events:none; }
        .library-edit-toggle:hover { background:var(--btn-secondary-bg); border-color:var(--border-color); }
        .library-edit-toggle:focus-visible { outline:2px solid var(--primary-color); outline-offset:3px; }
        body.edit-mode .library-edit-toggle { color:var(--edit-frame-color); background:var(--btn-secondary-bg); border-color:var(--edit-frame-color); }
        body.logged-out .library-edit-action { display:none; }
        @container (max-width:775px) {
            .main-search-bar { padding-right:56px; }
            .library-edit-action { left:auto; right:6px; }
            .library-edit-toggle { color:var(--search-glass-text); }
            .library-edit-toggle:hover { background:var(--search-control-bg); border-color:var(--search-control-border); }
            body.edit-mode .library-edit-toggle { color:var(--search-glass-focus); background:var(--search-control-bg); border-color:var(--search-control-border); }
        }

        .standalone-choices { display:flex; flex-direction:column; gap:14px; margin:20px 0; }
        .standalone-choices label { display:flex; align-items:flex-start; gap:10px; font-size:.88rem; cursor:pointer; }
        .standalone-choices input { flex-shrink:0; width:16px; height:16px; margin-top:3px; accent-color:var(--primary-color); }
        .standalone-choices .standalone-all { border-top:1px solid var(--border-color); padding-top:16px; }
        .standalone-actions { margin-top:18px; }
        #standaloneExportOptions { margin-top:20px; }

        #appearanceSolids[hidden], #appearanceAdjustments[hidden] { display:none !important; }
        .appearance-solid-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px 10px; margin:16px 0; }
        .appearance-solid { display:flex; flex-direction:column; gap:6px; padding:5px; min-width:0; background:transparent; color:var(--text-color); border:1px solid transparent; border-radius:10px; font:inherit; font-size:.78rem; cursor:pointer; }
        .appearance-swatch { display:grid; place-items:center; height:48px; width:100%; border-radius:8px; border:1px solid rgba(128,128,128,.35); }
        .appearance-swatch-check { visibility:hidden; font-size:1.2rem; font-weight:700; }
        .appearance-solid[aria-pressed="true"] { border-color:var(--primary-color); }
        .appearance-solid[aria-pressed="true"] .appearance-swatch-check { visibility:visible; }
        .appearance-solid:hover, .appearance-solid:focus-visible { outline:2px solid var(--primary-color); outline-offset:2px; }
        @media(max-width:480px) { .appearance-solid-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }

        .appearance-source-buttons { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
        .appearance-source-buttons button { min-height:38px; padding:7px 14px; border-radius:9px; font-size:.82rem; }
        .appearance-source-buttons button[aria-pressed="true"] { border-color:var(--primary-color); box-shadow:inset 0 0 0 1px var(--primary-color); }
        #appearanceBuiltins[hidden], #unsplashPicker[hidden], #unsplashPagination[hidden], #unsplashSelected[hidden], #backgroundPhotoCredit[hidden] { display:none !important; }
        .unsplash-search-row { display:flex; align-items:center; gap:8px; margin:14px 0 10px; }
        .unsplash-search-row input { flex:1 1 0; min-width:0; width:100%; padding:10px 12px; border:1px solid var(--border-color); border-radius:9px; background:var(--input-bg); color:var(--text-color); font:inherit; font-size:16px; }
        .unsplash-search-row button { min-height:42px; padding:8px 16px; }
        .unsplash-results { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px 10px; }
        .unsplash-card { min-width:0; }
        .unsplash-photo { display:block; width:100%; padding:0; overflow:hidden; border:2px solid transparent; border-radius:9px; background:var(--input-bg); cursor:pointer; }
        .unsplash-photo img { display:block; width:100%; height:auto; aspect-ratio:8/5; object-fit:cover; }
        .unsplash-photo[aria-pressed="true"], .unsplash-photo:hover { border-color:var(--primary-color); }
        .unsplash-photo:focus-visible { outline:2px solid var(--primary-color); outline-offset:3px; }
        .unsplash-card-credit { margin:4px 0 0; font-size:.67rem; line-height:1.4; color:var(--text-muted); overflow-wrap:anywhere; }
        .unsplash-card-credit a, .unsplash-selected a, .background-photo-credit a { color:inherit; text-decoration:underline; text-underline-offset:2px; }
        .unsplash-pagination { display:flex; justify-content:space-between; align-items:center; gap:8px; margin:12px 0; font-size:.8rem; color:var(--text-muted); }
        .unsplash-selected { display:flex; align-items:center; gap:12px; margin:16px 0; font-size:.82rem; }
        .unsplash-selected img { width:96px; height:60px; object-fit:cover; border-radius:8px; }
        .unsplash-selected p { margin:4px 0; font-size:.75rem; }
        .background-photo-credit { font-size:.68rem; color:var(--text-muted); margin:8px 0 3px; }
        body.logged-out .background-photo-credit { display:none; }
        @media(max-width:480px) { .unsplash-results { grid-template-columns:repeat(2,minmax(0,1fr)); } }
        .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }

        #dailyPriorityModal [hidden] { display:none !important; }
        #dailyPriorityModal .priority-tabs-panel { width:min(640px,calc(100% - 24px)); max-width:640px; height:min(620px,90vh); height:min(620px,90dvh); max-height:90vh; max-height:90dvh; padding:0; display:flex; flex-direction:column; overflow:hidden; }
        .priority-tabs button { flex:1 1 0; }
        .priority-tabs-content form { margin:0; }
        .priority-tabs-content .priority-intro:first-child { margin-top:0; }
        .priority-tabs-content .priority-row { margin:18px 0; }
        #dailyPriorityModal[data-priority-tab="history"] #priorityReload { display:none; }
        #priorityHistoryMessage { margin:0 0 10px; }
        #priorityHistoryReload { margin-top:12px; }
        .priority-tabs button:focus-visible { outline:2px solid var(--primary-color); outline-offset:2px; }

        #reminderOverviewUndo[hidden] { display:none !important; }
        .reminder-overview-day li { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:3px 0; }
        .reminder-overview-day li > span { min-width:0; overflow-wrap:anywhere; }
        .reminder-complete-button { flex:0 0 32px; display:grid; place-items:center; width:32px; height:32px; padding:6px; border:1px solid var(--border-color); border-radius:8px; background:transparent; color:var(--text-muted); cursor:pointer; }
        .reminder-complete-button:hover { background:var(--btn-secondary-bg); border-color:var(--primary-color); color:var(--text-color); }
        .reminder-complete-button:focus-visible { outline:2px solid var(--primary-color); outline-offset:2px; }
        .reminder-complete-button:disabled { opacity:.45; cursor:wait; }
        #reminderOverviewMessage { color:var(--text-muted); font-size:.82rem; line-height:1.5; margin-top:12px; }
        #reminderOverviewMessage:empty { display:none; }
    
/* Hjälp, instruktioner och kontakt använder samma flikstruktur som Mitt konto. */
#aboutModal[hidden],#aboutModal [hidden]{display:none!important}
#aboutModal .help-tabs-panel{width:min(640px,94vw);max-width:640px;height:min(680px,90vh);height:min(680px,90dvh);padding:0;display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box}
#aboutModal .help-tabs{display:flex;flex-shrink:0}
#aboutModal .help-tabs button{flex:1 1 0}
#aboutModal .help-content{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:6px 24px 20px}
#aboutModal .help-content h3{margin-top:18px}
#aboutModal .account-footer{flex-shrink:0}
#feedbackForm{display:flex;flex-direction:column;margin-top:18px;gap:7px}
#feedbackForm label{font-size:.88rem;font-weight:600;margin-top:7px}
#feedbackForm input,#feedbackForm select,#feedbackForm textarea{box-sizing:border-box;width:100%;font:inherit;color:var(--text-color);background:var(--input-bg);border:1px solid var(--border-color);border-radius:9px;padding:10px 12px;margin:0}
#feedbackForm textarea{resize:vertical;min-height:110px;max-height:300px;line-height:1.5}
#feedbackForm :focus-visible{outline:2px solid #5d95cf;outline-offset:2px}
#feedbackForm .feedback-count{text-align:right;margin:0}
#feedbackMessage{font-size:.88rem;line-height:1.5;overflow-wrap:anywhere}
@media(max-width:480px){#aboutModal .account-header{padding:18px 18px 14px}#aboutModal .help-tabs{margin-left:18px;margin-right:18px}#aboutModal .help-content{padding-left:18px;padding-right:18px}}
/* Konversationer använder sidans befintliga färger. */
#aboutMenuBtn{position:relative}.support-help-dot{position:absolute;top:5px;right:5px;width:8px;height:8px;background:#4b97e3;border-radius:50%;box-shadow:0 0 0 2px var(--sidebar-bg,#f0f2f5)}
.support-contact-tabs{display:flex;gap:4px;background:var(--btn-secondary-bg,#eef1f5);padding:4px;border-radius:9px;margin:18px 0}.support-contact-tabs button{flex:1;background:transparent;border:0;border-radius:6px;font:inherit;font-size:14px;padding:9px;color:var(--text-muted,#637080);cursor:pointer}.support-contact-tabs button[aria-selected=true]{background:var(--modal-bg,#fff);color:var(--text-color,#202630);box-shadow:0 1px 4px #0000000c}.support-unread-count{padding:1px 6px;border-radius:20px;background:#dcecfb;color:#235a8e;font-size:12px}.support-unread{color:#4b97e3;font-size:11px;margin-right:7px}.support-ticket{display:flex;flex-direction:column;gap:7px;width:100%;text-align:left;border:1px solid var(--border-color,#dce2e9);background:var(--btn-secondary-bg,#fafbfc);color:var(--text-color,#202630);border-radius:10px;padding:13px;margin:9px 0;cursor:pointer;font:inherit}.support-ticket-title{font-weight:600;overflow-wrap:anywhere}.support-ticket-meta{font-size:12px;color:var(--text-muted,#737d8a)}.support-list-tools{display:flex;gap:8px;align-items:center;justify-content:space-between;margin:14px 0;font-size:12px}
.support-message{padding:12px 14px;margin:12px 0;border-radius:10px;border:1px solid var(--border-color,#e1e7ee);overflow-wrap:anywhere;max-width:96%}.support-self{background:var(--btn-secondary-bg,#eef3f8);margin-left:auto}.support-other{background:var(--modal-bg,#fff);margin-right:auto}.support-message-meta{color:var(--text-muted,#637080);font-size:12px;margin:0 0 8px}.support-message-body{white-space:pre-wrap;line-height:1.6;font-size:14px;margin:0}
#supportReplyForm{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-top:22px}#supportReplyForm label{font-size:14px;font-weight:600}#supportReplyText{box-sizing:border-box;width:100%;min-height:110px;resize:vertical;border:1px solid var(--border-color,#dce2e9);background:var(--input-bg,#fff);color:var(--text-color,#202630);border-radius:8px;padding:12px;font:inherit;line-height:1.6}#supportReplyCount{align-self:flex-end}#supportReplyNotice,#supportThreadMessage,#supportListMessage{font-size:13px;line-height:1.6;overflow-wrap:anywhere}#supportThreadTitle{overflow-wrap:anywhere}.feedback-unread-marker{color:#367bb7;font-size:12px;font-weight:500}.feedback-unread>summary{color:#245e8f}.support-thread-messages{margin-top:12px}#supportMinePanel[hidden],#supportNewPanel[hidden],#supportReplyForm[hidden]{display:none!important}
        #newsMenuBtn[data-home-view="news"] { background:var(--btn-secondary-bg); color:var(--text-color); }
        #newsSettingsModal[hidden],#newsView[hidden],#libraryContent[hidden],.favorites-dock-wrapper[hidden],.library-edit-action[hidden],#newsErrors[hidden],#newsEmpty[hidden],#newsCustomEmpty[hidden] { display:none !important; }
        .news-view { width:100%; max-width:680px; margin:0 auto 30px; padding:0 4px; box-sizing:border-box; text-align:left; color:var(--text-color); }
        .news-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 14px; }
        .news-heading h2 { font-size:1.2rem; margin:0; font-weight:600; }
        .news-controls { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
        .news-filters { display:flex; flex:1 1 auto; gap:5px; flex-wrap:wrap; }
        .news-filter { color:var(--text-muted); background:transparent; border:1px solid transparent; border-radius:7px; padding:5px 9px; font:inherit; font-size:.85rem; cursor:pointer; }
        .news-filter[aria-pressed="true"] { background:var(--btn-secondary-bg); border-color:var(--border-color); color:var(--text-color); }
        .news-controls select { max-width:100%; min-width:120px; border:1px solid var(--border-color); border-radius:7px; color:var(--text-color); background:var(--input-bg); padding:6px 8px; font:inherit; font-size:.85rem; }
        .news-status-row { display:flex; justify-content:space-between; align-items:center; gap:10px; margin:18px 0 5px; color:var(--text-muted); font-size:.8rem; }
        .news-status-row button { border:0; padding:5px 0 5px 10px; background:none; color:var(--text-muted); font:inherit; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
        .news-row { padding:12px 0; border-bottom:1px solid var(--border-color); }
        .news-row h4 { font-size:.96rem; line-height:1.35; margin:0 0 5px; font-weight:600; }
        .news-row h4 a { color:var(--text-color); text-decoration:none; overflow-wrap:anywhere; }
        .news-row h4 a:hover { text-decoration:underline; text-underline-offset:3px; }
        .news-meta { margin:0; font-size:.8rem; line-height:1.4; color:var(--text-muted); }
        .news-empty { color:var(--text-muted); padding:25px 0; font-size:.95rem; }
        .news-footnote { color:var(--text-muted); font-size:.77rem; line-height:1.5; margin-top:22px; }
        .news-errors { margin:18px 0; color:var(--text-muted); font-size:.85rem; }
        .news-errors summary { cursor:pointer; }.news-errors p { overflow-wrap:anywhere; }
        .news-settings { max-width:600px; width:min(600px,calc(100vw - 32px)); box-sizing:border-box; }
        .news-settings h3 { margin:22px 0 8px; font-size:1rem; font-weight:600; }
        .news-source-row { display:flex; align-items:center; gap:10px; padding:9px 0; border-bottom:1px solid var(--border-color); }
        .news-source-row input[type="checkbox"] { flex:0 0 auto; width:17px; height:17px; margin:0; accent-color:var(--primary-color); }
        .news-source-row label { display:flex; align-items:center; gap:10px; flex:1; min-width:0; }.news-source-row span { flex:1; min-width:0; }.news-source-row strong { display:block; font-weight:500; font-size:.94rem; overflow-wrap:anywhere; }
        .news-source-row small { display:block; font-size:.77rem; color:var(--text-muted); margin-top:2px; }
        .news-remove { border:0; background:none; color:var(--text-muted); padding:6px; font:inherit; font-size:.8rem; cursor:pointer; text-decoration:underline; }
        .news-add-fields { margin:20px 0 0; padding:12px; border:1px solid var(--border-color); border-radius:9px; min-width:0; }
        .news-add-fields legend { color:var(--text-muted); font-size:.85rem; padding:0 5px; }
        .news-add-fields input,.news-add-fields select { width:100%; box-sizing:border-box; padding:10px 12px; border:1px solid var(--border-color); border-radius:8px; background:var(--input-bg); color:var(--text-color); font:inherit; }
        .news-add-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
        .news-view button:focus-visible,.news-row a:focus-visible { outline:2px solid var(--primary-color); outline-offset:3px; }
        @media(max-width:500px) { .news-view {padding:0 4px}.news-heading h2 {font-size:1.1rem}.news-row h4 {font-size:.96rem}.news-add-grid {grid-template-columns:1fr}.news-controls select {width:100%}.news-settings {width:100%} }


        .weather-row { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:3px 7px; margin-top:4px; max-width:100%; }
        #weatherIcon[hidden],#weatherCredit[hidden],#weatherRow[hidden],#accountWeatherSettings[hidden],#weatherSave[hidden] { display:none !important; }
        .weather-button { display:inline-flex; align-items:center; justify-content:center; gap:5px; max-width:100%; border:0; padding:0; border-radius:3px; background:none; font:inherit; color:inherit; line-height:1.4; text-align:center; }
        .weather-button:hover { color:var(--text-color); }.weather-button:focus-visible { outline:2px solid var(--primary-color); outline-offset:3px; }
        #weatherIcon { display:inline-flex; flex:0 0 auto; }#weatherIcon svg { width:15px; height:15px; }
        #weatherLabel { min-width:0; overflow-wrap:anywhere; }
        .weather-credit { color:inherit; font:inherit; font-size:.9em; opacity:.75; text-decoration:none; }.weather-credit:hover {text-decoration:underline;}
        .weather-enable { display:flex; gap:8px; align-items:center; font-size:.9rem; }.weather-enable input {width:16px;height:16px;margin:0;}
        .weather-search { display:flex; align-items:center; gap:8px; }.weather-search input {flex:1;min-width:0;width:100%;box-sizing:border-box;padding:10px 12px;border:1px solid var(--border-color);border-radius:8px;background:var(--input-bg);color:var(--text-color);font:inherit;}
        .weather-search button {flex:0 0 auto;}
        .weather-place-results {display:flex;flex-direction:column;gap:5px;}
        .weather-place-result {text-align:left;padding:9px 11px;border:1px solid var(--border-color);border-radius:7px;background:var(--btn-secondary-bg);color:var(--text-color);font:inherit;font-size:.85rem;overflow-wrap:anywhere;}
        .weather-settings-credit {margin-top:12px;color:var(--text-muted);font-size:.73rem;}.weather-settings-credit a {color:inherit;}


        .weather-chosen-place-row {display:flex;align-items:center;gap:6px;margin:10px 0;}
        .weather-chosen-place-row #weatherChosenPlace {margin:0;min-width:0;overflow-wrap:anywhere;}
        #weatherClearPlace {display:inline-flex;align-items:center;justify-content:center;flex:0 0 28px;width:28px;min-width:28px;height:28px;padding:0;border:0;background:transparent;color:var(--text-muted);border-radius:6px;}
        #weatherClearPlace svg {width:16px;height:16px;}
        #weatherClearPlace:hover {background:var(--btn-secondary-bg);color:var(--text-color);}
        #weatherClearPlace:focus-visible {outline:2px solid var(--primary-color);outline-offset:2px;}
        #weatherClearPlace[hidden] {display:none !important;}

        /* Textlänkar i mörkt tema. Ikonlänkar och länkar utformade som knappar behåller sin stil. */
        [data-theme="dark"] { --text-link-color:#93c5fd; --text-link-hover:#bfdbfe; }
        [data-theme="dark"] a[href]:not(.app-item):not(.btn-primary):not(.btn-secondary),
        [data-theme="dark"] a[href]:not(.app-item):not(.btn-primary):not(.btn-secondary):visited,
        [data-theme="dark"] .modal-switch-link { color:var(--text-link-color); }
        [data-theme="dark"] a[href]:not(.app-item):not(.btn-primary):not(.btn-secondary):hover,
        [data-theme="dark"] a[href]:not(.app-item):not(.btn-primary):not(.btn-secondary):focus-visible,
        [data-theme="dark"] .modal-switch-link:hover,
        [data-theme="dark"] .modal-switch-link:focus-visible {
            color:var(--text-link-hover); text-decoration:underline; text-underline-offset:3px;
        }
        .group-miniatures {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));width:100%;height:100%;min-width:0;min-height:0;padding:8px;gap:4px;pointer-events:none;opacity:.7;filter:saturate(.35);transition:transform .15s ease,opacity .18s ease,filter .18s ease;}
        .group-miniature {display:grid;place-items:center;position:relative;min-width:0;min-height:0;overflow:hidden;border-radius:3px;background:transparent;}
        .group-miniature img {width:100%;height:100%;object-fit:contain;padding:1px;display:block;}
        .group-miniature-initial {display:grid;place-items:center;font-size:10px;font-weight:600;line-height:1;color:var(--text-color);}
        .group-miniature-empty {background:transparent;}
        .library-folder-open:focus-visible .group-miniatures {opacity:1;filter:saturate(1);}
        @media(hover:hover) and (pointer:fine) {.library-folder-open:hover .group-miniatures {opacity:1;filter:saturate(1);}}
        .group-miniature img[hidden],.group-miniature-initial[hidden] {display:none !important;}
        [data-large-group-icons="true"] .group-miniatures {padding:11px;gap:6px;}
        [data-large-group-icons="true"] .group-miniature-initial {font-size:15px;}
        .library-folder-card.drag-over:is([data-group-drop-mode="before"],[data-group-drop-mode="after"]) .library-folder-icon > .group-miniatures {transform:translate(-13px,-13px) scale(.38);transform-origin:center;}
        [data-large-group-icons="true"] .library-folder-card.drag-over:is([data-group-drop-mode="before"],[data-group-drop-mode="after"]) .library-folder-icon > .group-miniatures {transform:translate(-21px,-21px) scale(.35);}
        @media(max-width:600px) {[data-large-group-icons="true"] .library-folder-card.drag-over:is([data-group-drop-mode="before"],[data-group-drop-mode="after"]) .library-folder-icon > .group-miniatures {transform:translate(-17px,-17px) scale(.35);}}
        @media(prefers-reduced-motion:reduce) {.group-miniatures {transition:none;}}

        /* Fria webbplatsikoner; grupper behåller en samlad yta. */
        :root {--link-icon-hover-bg:rgba(20,30,45,.045);}
        [data-theme="dark"] {--link-icon-hover-bg:rgba(255,255,255,.065);}
        .app-item .app-icon-wrapper {background:transparent;border-color:transparent;box-shadow:none;}
        .app-item:hover .app-icon-wrapper {border-color:transparent;}
        .app-item .app-icon-wrapper.is-fallback {background:var(--app-bg-default);border-color:var(--border-color);}
        .app-icon-wrapper.is-fallback .app-initial {color:var(--text-color);}
        @media(hover:hover) and (pointer:fine) {
            body:not(.edit-mode) .app-item:hover:not(.dragging-app) .app-icon-wrapper:not(.is-fallback) {background:var(--link-icon-hover-bg);}
        }
        body:not(.edit-mode) .app-item:focus-visible .app-icon-wrapper:not(.is-fallback) {background:var(--link-icon-hover-bg);}
        .library-folder-icon {border-color:#c7cdd4;}
        [data-theme="dark"] .library-folder-icon {border-color:#59616c;}


        /* Gemensam dialogram för ONStarts sex appar och inställningar. */
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .modal.app-dialog-panel {
            width:min(640px,calc(100% - 24px)); max-width:640px;
            height:min(640px,90vh); height:min(640px,90dvh);
            max-height:90vh; max-height:90dvh; min-height:0;
            padding:0; box-sizing:border-box; display:flex; flex-direction:column;
            overflow:hidden; border:1px solid var(--border-color); border-radius:18px;
            background:var(--modal-bg); color:var(--text-color);
        }
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel [hidden] { display:none !important; }
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel > .account-header {
            flex:0 0 auto; padding:24px 24px 18px; gap:16px;
        }
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel > .account-header > div { min-width:0; }
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel .account-header h2 {
            margin:0 0 5px; font-size:1.3rem; line-height:1.3; font-weight:600;
        }
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel .account-header .account-description {
            display:block; margin:0; font-size:.85rem; line-height:1.5; color:var(--text-muted);
        }
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel > .account-tabs {
            display:flex; flex:0 0 auto; gap:4px; margin:0 24px;
            padding:4px; overflow-x:auto; border-radius:11px;
            background:var(--btn-secondary-bg); scrollbar-width:thin;
        }
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel > .account-tabs > button {
            flex:1 0 auto; padding:9px 12px; font-size:.82rem; white-space:nowrap;
        }
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel > .account-content {
            flex:1 1 auto; min-height:0; padding:24px; overflow-y:auto;
            overscroll-behavior:contain; scrollbar-width:thin;
        }
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel > .account-content > :first-child { margin-top:0; }
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel > .account-footer {
            flex:0 0 auto; margin:0; padding:14px 24px 20px;
            border-top:1px solid var(--border-color);
        }
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel .account-footer-actions {
            display:flex; justify-content:flex-end; align-items:center; flex-wrap:wrap; gap:8px;
        }
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel .account-footer .account-message:empty { display:none; }
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel .account-footer .account-message { margin:0 0 10px; }
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel .btn-primary,
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel .btn-secondary {
            min-height:36px; border-radius:8px; font:inherit; font-size:.85rem;
        }
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel .calendar-intro,
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel .countdown-message { font-size:.85rem; line-height:1.5; }
        :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel .notes-grid { margin-bottom:0; gap:12px; }
        @media(max-width:480px) {
            :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel > .account-header { padding:20px 18px 16px; }
            :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel > .account-tabs { margin:0 18px; }
            :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel > .account-content { padding:22px 18px; }
            :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel > .account-footer { padding:14px 18px 18px; }
        }
        @media(max-height:520px) {
            :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel > .account-header { padding:12px 18px 10px; }
            :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel .account-header .account-description { display:none; }
            :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel > .account-tabs { margin:0 18px; }
            :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel > .account-tabs > button { padding-top:6px; padding-bottom:6px; }
            :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel > .account-content { padding:14px 18px; }
            :is(#accountModal,#dailyPriorityModal,#aboutModal,#calendarModal,#countdownModal,#notesModal) .app-dialog-panel > .account-footer { padding:10px 18px; }
        }

        /* Appvyer under sökrutan: samma sidflöde som Nyheter, utan överlägg. */
        #appPageHost { width:100%; max-width:680px; margin:0 auto 30px; padding:0 4px; box-sizing:border-box; text-align:left; }
        #appPageHost[hidden],#appPageHost .app-page-view[hidden] { display:none !important; }
        #appPageHost .app-page-view { display:block; position:static; inset:auto; width:100%; padding:0; background:transparent; backdrop-filter:none; }
        #appPageHost .app-page-view .app-dialog-panel {
            display:flex; flex-direction:column; position:static; width:100%; max-width:none;
            height:auto; max-height:none; min-height:0; padding:0; margin:0;
            border:0; border-radius:0; box-shadow:none; background:transparent;
            overflow:visible; transform:none; animation:none;
        }
        #appPageHost .app-page-view .app-dialog-panel [hidden] { display:none!important; }
        #appPageHost .app-dialog-panel > .account-header { padding:0; margin:0 0 18px; }
        #appPageHost .app-dialog-panel .account-header h2 { font-size:1.2rem; margin:0 0 5px; font-weight:600; }
        #appPageHost .app-dialog-panel > .account-tabs { display:flex; flex:0 0 auto; overflow-x:auto; margin:0 0 18px; padding:4px; }
        #appPageHost .app-dialog-panel > .account-tabs button { flex:1 0 auto; padding:9px 12px; white-space:nowrap; }
        #appPageHost .app-dialog-panel > .account-content { overflow:visible; flex:0 1 auto; min-height:0; padding:22px; border:1px solid var(--border-color); border-radius:12px; background:var(--modal-bg); }
        #appPageHost .app-dialog-panel > .account-footer { padding:16px 0 0; margin:0; border:0; }
        #appPageHost #notesModal .account-content { background:transparent; border:0; padding:0; }
        #appPageHost .notes-grid { margin-top:18px; }
        .side-rail { overflow-y:auto; overscroll-behavior:contain; scrollbar-width:none; }
        .side-rail .rail-button.is-current-view { background:var(--btn-secondary-bg); color:var(--text-color); box-shadow:inset 3px 0 0 var(--text-muted); }
        @media(max-width:480px) { #appPageHost .app-dialog-panel > .account-content { padding:18px; } }

        /* En gemensam läsyta runt sidfunktionerna; länksamling och dialoger är oförändrade. */
        :root {
            --function-surface-bg:rgba(255,255,255,.88);
            --function-surface-glass:rgba(255,255,255,.66);
            --function-surface-border:rgba(90,105,120,.12);
        }
        [data-theme="dark"] {
            --function-surface-bg:rgba(29,32,39,.90);
            --function-surface-glass:rgba(29,32,39,.68);
            --function-surface-border:rgba(205,215,225,.11);
        }
        /* Fyll ut korta sidvyer utan att sträcka själva bakgrundsrutan.
           Sidfoten ligger längst ned i fönstret eller efter längre innehåll. */
        #appPageHost { padding:0; flex:1 0 auto; }
        #appPageHost .app-page-view .app-dialog-panel,
        #newsView.news-view,
        #searchResultsSurface.search-surface {
            padding:24px; border:1px solid var(--function-surface-border);
            border-radius:18px; background:var(--function-surface-bg);
            color:var(--text-color); box-shadow:0 3px 16px rgba(0,0,0,.04);
            box-sizing:border-box;
        }
        #appPageHost .app-dialog-panel > .account-content {
            padding:0; border:0; border-radius:0; background:transparent;
        }
        #appPageHost .app-dialog-panel > .account-footer { padding-top:20px; }
        @supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
            #appPageHost .app-page-view .app-dialog-panel,
            #newsView.news-view,
        #searchResultsSurface.search-surface {
                background:var(--function-surface-glass);
                -webkit-backdrop-filter:blur(22px); backdrop-filter:blur(22px);
            }
        }
        @media(max-width:480px) {
            #appPageHost .app-page-view .app-dialog-panel,
            #newsView.news-view,
        #searchResultsSurface.search-surface { padding:18px 16px; border-radius:14px; }
            #appPageHost .app-dialog-panel > .account-content { padding:0; }
        }

        /* Gemensam bakgrundsyta för länksamlingen och alla sökresultat. */
        #collectionView { display:flex; flex-direction:column; flex:1 0 auto; width:100%; min-width:0; }
        #collectionView[hidden] { display:none !important; }
        #searchResultsSurface { display:flex; flex-direction:column; flex:1 0 auto; width:100%; min-width:0; }
        #searchResultsSurface.search-surface { flex:0 1 auto; max-width:680px; margin:0 auto 30px; text-align:left; }


        /* Tomma favoriter lämnar inget mellanrum; dragning behåller sin släppyta. */
        .favorites-dock-wrapper:has(> #favoritesContainer:empty:not(.link-drag-target)) {
            margin-bottom:0;
        }

        /* Icke-modal hjälp: sidans innehåll, flikar och utkast behålls. */
        .context-help-button { display:inline-flex; align-items:center; justify-content:center; flex:0 0 28px; width:28px; height:28px; margin-left:auto; border:1px solid var(--border-color); border-radius:50%; background:var(--btn-secondary-bg); color:var(--text-muted); font:inherit; font-size:.95rem; font-weight:600; cursor:pointer; }
        .context-help-button:hover,.context-help-button[aria-expanded="true"] { color:var(--text-color); background:var(--modal-bg); }
        .context-help-button:focus-visible,.context-help-panel button:focus-visible { outline:2px solid var(--primary-color); outline-offset:3px; }
        .context-help-button[hidden],#contextHelpPanel[hidden] { display:none!important; }
        #searchResultsSurface.search-surface { position:relative; padding-top:48px; }
        #searchResultsSurface > .context-help-button { position:absolute; top:12px; right:16px; }
        .news-heading h2 { margin-right:auto; }
        .context-help-panel { position:fixed; top:16px; right:16px; z-index:980; width:310px; max-width:calc(100vw - 32px); max-height:calc(100vh - 32px); max-height:calc(100dvh - 32px); overflow-y:auto; overscroll-behavior:contain; padding:20px; border:1px solid var(--border-color); border-radius:16px; background:var(--modal-bg); color:var(--text-color); box-shadow:0 8px 32px rgba(0,0,0,.16); font-size:.85rem; line-height:1.5; text-align:left; }
        .context-help-heading { position:sticky; top:0; z-index:1; background:var(--modal-bg); padding-bottom:10px; display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:12px; }
        .context-help-eyebrow { font-size:.72rem; color:var(--text-muted); margin:0 0 4px; }
        .context-help-heading h2 { font-size:1.1rem; font-weight:600; margin:0; line-height:1.3; }
        .context-help-close { flex:0 0 30px; width:30px; height:30px; border:0; border-radius:8px; background:transparent; color:var(--text-muted); font:inherit; font-size:1.4rem; cursor:pointer; }
        .context-help-close:hover { background:var(--btn-secondary-bg); }
        #contextHelpIntro { color:var(--text-muted); margin:0 0 16px; }
        .context-help-items { margin:0; padding:0; list-style:none; }
        .context-help-items li { padding:14px 0; border-top:1px solid var(--border-color); }
        .context-help-items h3 { margin:0 0 5px; font-size:.88rem; font-weight:600; }
        .context-help-items p { margin:0 0 8px; }
        .context-help-show { padding:4px 0; border:0; border-bottom:1px solid currentColor; background:transparent; color:var(--primary-color); font:inherit; font-size:.8rem; cursor:pointer; }
        [data-theme="dark"] .context-help-show { color:var(--text-link-color,#93c5fd); }
        .context-help-hint { padding:12px; border-radius:8px; background:var(--btn-secondary-bg); font-size:.8rem; margin:4px 0 18px; }
        .context-help-shortcut-title { font-size:.85rem; font-weight:600; margin:0 0 6px; }
        .context-help-keys { margin:0 0 16px; padding-left:17px; color:var(--text-muted); font-size:.8rem; }
        .context-help-footer { border-top:1px solid var(--border-color); padding-top:14px; }
        .context-help-footer button { font:inherit; font-size:.82rem; }
        .context-help-highlight { outline:3px solid var(--primary-color)!important; outline-offset:5px; border-radius:8px; scroll-margin-top:24px; }
        [data-theme="dark"] .context-help-highlight { outline-color:#93c5fd!important; }
        @media(max-width:1100px) {
            .context-help-panel { top:auto; bottom:12px; left:calc(var(--rail-width,60px) + 10px); right:10px; width:auto; max-width:none; max-height:45vh; max-height:45dvh; padding:18px; border-radius:16px; }
        }

/* Lokala fototeman: separata bildkompositioner för stående mobilskärm. */
:root { --local-photo-current: var(--local-photo-desktop); }
@media (max-width: 900px) and (orientation: portrait) {
    :root { --local-photo-current: var(--local-photo-mobile); }
}
.appearance-legacy-themes { margin-top: 1rem; }
.appearance-legacy-themes summary { cursor: pointer; color: var(--text-color); font-size: .85rem; padding: .4rem 0; }
.appearance-legacy-themes[open] summary { margin-bottom: .5rem; }

#appearanceIllustrations[hidden], #blendColorEditor[hidden] { display:none !important; }
.blend-color-buttons { display:flex; flex-wrap:wrap; align-items:center; gap:.65rem; margin:.8rem 0; }
.blend-color-choice { display:flex; align-items:center; gap:.65rem; text-align:left; }
.blend-swatch { display:block; width:2.2rem; height:2.2rem; border-radius:.6rem; border:1px solid var(--group-border); }
.blend-color-value { display:block; font-size:.7rem; opacity:.7; }
.blend-color-editor { max-width:360px; display:grid; gap:.65rem; padding:1rem; margin:1rem 0; border:1px solid var(--group-border); border-radius:12px; }
.blend-color-editor label { font-size:.82rem; }
.blend-color-editor input[type="color"] { width:100%; height:3rem; padding:.2rem; border:1px solid var(--group-border); border-radius:.5rem; background:transparent; cursor:pointer; }
.blend-rgb-row { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.65rem; }
.blend-rgb-row input { width:100%; box-sizing:border-box; }

/* Mappikon till vänster om sökfältet, pennan ligger kvar till höger. */
#searchResultsSurface[hidden], #libraryFolderControls[hidden] { display:none !important; }
.library-folder-controls { position:absolute;right:calc(100% + 8px);top:50%;transform:translateY(-50%);display:flex;margin:0;width:auto; }
.library-fold-toggle { display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:8px;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--text-color);cursor:pointer; }
.library-fold-toggle svg { width:22px;height:22px;pointer-events:none; }
.library-fold-toggle:hover:not(:disabled),.library-fold-toggle[aria-expanded="true"] { background:var(--btn-secondary-bg);border-color:var(--border-color); }
.library-fold-toggle:focus-visible { outline:2px solid var(--primary-color);outline-offset:3px; }
.library-fold-toggle:disabled { cursor:default;opacity:.65; }
@container (max-width:775px) {
    .main-search-bar { padding-left:56px; }
    .library-folder-controls { right:auto;left:6px; }
    .library-fold-toggle { color:var(--search-glass-text); }
    .library-fold-toggle:hover:not(:disabled) { background:var(--search-control-bg);border-color:var(--search-control-border); }
    .library-fold-toggle[aria-expanded="true"] { color:var(--search-glass-focus);background:var(--search-control-bg);border-color:var(--search-control-border); }
}
#searchResultsSurface.library-fold-reveal { animation:library-folder-reveal .16s ease-out; }
@keyframes library-folder-reveal { from { opacity:0;transform:translateY(-4px); } to { opacity:1;transform:translateY(0); } }
@media(prefers-reduced-motion:reduce) { #searchResultsSurface.library-fold-reveal { animation:none; } }


#dailyPriorityForm .priority-row { position:relative; grid-template-columns:24px minmax(0,1fr) 32px; transition:translate .14s ease; }
.priority-order-handle { align-self:center; display:inline-flex; align-items:center; justify-content:center; width:24px; min-height:44px; margin-top:10px; padding:0; border:0; border-radius:6px; background:transparent; color:var(--text-muted); cursor:grab; }
.priority-order-handle:active { cursor:grabbing; }
.priority-order-handle:disabled { opacity:.25; cursor:default; }
.priority-order-handle:hover:not(:disabled),.priority-order-handle:focus-visible { background:var(--btn-secondary-bg);color:var(--text-color); }
.priority-order-handle:focus-visible { outline:2px solid var(--primary-color);outline-offset:2px; }
.priority-row.priority-row-dragging { opacity:.4; }
.priority-row[data-priority-drop="before"] { translate:0 5px; }
.priority-row[data-priority-drop="after"] { translate:0 -5px; }
.priority-row[data-priority-drop]::before { content:'';position:absolute;left:30px;right:0;height:2px;border-radius:2px;background:var(--primary-color);pointer-events:none; }
.priority-row[data-priority-drop="before"]::before { top:-7px; }
.priority-row[data-priority-drop="after"]::before { bottom:-7px; }
.priority-row.priority-order-menu-open { z-index:10; }
.priority-order-menu { position:absolute;top:calc(100% - 4px);left:24px;z-index:20;display:flex;gap:4px;padding:5px;border:1px solid var(--border-color);border-radius:9px;background:var(--modal-bg);box-shadow:var(--shadow); }
.priority-order-menu[hidden] { display:none!important; }
.priority-order-menu button { padding:8px 10px;border:0;border-radius:6px;background:transparent;color:var(--text-color);font:inherit;font-size:.8rem;cursor:pointer; }
.priority-order-menu button:hover:not(:disabled),.priority-order-menu button:focus-visible { background:var(--btn-secondary-bg); }
.priority-order-menu button:disabled { opacity:.35;cursor:default; }
@media(max-width:480px) { #dailyPriorityForm .priority-row { column-gap:6px; } }
@media(prefers-reduced-motion:reduce) { #dailyPriorityForm .priority-row { transition:none; } }
/* Ikonerna ligger ovanför glasytan även när de ryms inuti sökraden. */
.library-folder-controls, .library-edit-action { z-index:1; }
@media(prefers-reduced-motion:reduce) { .main-search-bar { transition:none; } }

@container (max-width:775px) {
    .search-and-edit:has(#mainSearchInput:focus) {
        --search-glass-text: #202631;
        --search-glass-focus: #38689a;
        --search-control-bg: rgba(42, 54, 70, .09);
        --search-control-border: rgba(42, 54, 70, .22);
    }
}

/* Delarna döljs var för sig; anteckningar, påminnelser och copyright behålls. */
html[data-showdate="false"] #clockDate { display:none !important; }
html[data-showclock="false"] #clockTime { display:none !important; }
html[data-shownameday="false"] #clockNamnsdag { display:none !important; }
html[data-showweather="false"] #weatherRow { display:none !important; }
html[data-showquote="false"] #dailyQuoteContainer { display:none !important; }

/* Gemensam nyhetslista: rubrik, källa och publiceringstid. */
.news-list { width:100%;min-width:0; }
.news-list-table { width:100%;table-layout:fixed;border-collapse:collapse; }
.news-list-table[hidden] { display:none!important; }
.news-list-table .news-column-title { width:auto; }
.news-list-table .news-column-source { width:136px; }
.news-list-table .news-column-time { width:144px; }
.news-list-table th { padding:10px 12px;text-align:left;color:var(--text-muted);font-size:.75rem;font-weight:500;border-bottom:1px solid var(--border-color); }
.news-list-table td { padding:11px 12px;vertical-align:top;border-bottom:1px solid var(--border-color); }
.news-list-table th:first-child,.news-list-table td:first-child { padding-left:0; }
.news-list-table th:last-child,.news-list-table td:last-child { padding-right:0;text-align:right; }
.news-list-title a { display:block;max-width:100%;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text-color);font-size:.92rem;line-height:1.45;font-weight:600;text-decoration:none; }
.news-list-title a:hover { text-decoration:underline;text-underline-offset:3px; }
.news-list-title a:focus-visible { outline:2px solid var(--primary-color);outline-offset:3px;border-radius:2px; }
.news-list-source,.news-list-time { color:var(--text-muted);font-size:.8rem;line-height:1.65; }
.news-list-source { overflow-wrap:anywhere; }
.news-list-time { white-space:nowrap;font-variant-numeric:tabular-nums; }
@media(max-width:600px) {
    .news-list-table colgroup { display:none; }
    .news-list-table thead { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }
    .news-list-table,.news-list-table tbody { display:block;width:100%; }
    .news-list-table tbody tr { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;padding:11px 0;border-bottom:1px solid var(--border-color); }
    .news-list-table td { display:block;padding:0;border:0;min-width:0; }
    .news-list-table .news-list-title { grid-column:1 / -1; }
    .news-list-table .news-list-source { grid-column:1;text-align:left; }
    .news-list-table .news-list-time { grid-column:2;text-align:right; }
}
.push-device-row { flex-wrap:wrap; gap:12px; }
.push-device-row > span { min-width:0; overflow-wrap:anywhere; flex:1; }
.push-device-actions { display:flex; flex-wrap:wrap; gap:8px; }
.push-device-name-input { flex:1; min-width:160px; max-width:100%; }

/* Gemensam rytm, läsordning och fokus – samma ytor på alla funktionssidor. */
:root { --ux-gap:8px; --ux-space:24px; --ux-radius:12px; --ux-focus:#315f91; --ux-current-bg:rgba(70,100,135,.12); --ux-current-mark:#4e6f95; }
[data-theme="dark"] { --ux-focus:#a9cff5; --ux-current-bg:rgba(185,205,230,.13); --ux-current-mark:#b8cde4; }
#appPageHost .app-dialog-panel > .account-header,.news-heading { margin-bottom:20px; gap:16px; align-items:flex-start; }
#appPageHost .app-dialog-panel .account-header h2,.news-heading h2 { font-size:1.2rem; line-height:1.35; font-weight:600; letter-spacing:-.01em; }
#appPageHost .app-dialog-panel > .account-content { padding:0; background:transparent; border:0; border-radius:0; }
#appPageHost .app-dialog-panel > .account-tabs { gap:4px; margin-bottom:24px; padding:4px; border-radius:var(--ux-radius); }
#appPageHost .account-tabs button,.support-contact-tabs button { border-radius:8px; min-height:38px; line-height:1.3; }
#appPageHost .app-dialog-panel > .account-footer { padding-top:20px; margin-top:24px; border-top:1px solid var(--function-surface-border); }
#appPageHost .account-footer-actions { gap:8px; }
#appPageHost .account-footer-actions button,.news-heading button { min-height:38px; border-radius:9px; }
#appPageHost .account-description,#appPageHost .calendar-intro,#appPageHost .priority-intro { font-size:.84rem; line-height:1.55; }
#appPageHost .account-content > :first-child { margin-top:0; }
#appPageHost .form-group { margin-bottom:20px; }
#appPageHost .form-group label { margin-bottom:8px; }
#appPageHost :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea) { border-radius:9px; }
.side-rail .rail-button { position:relative; flex-shrink:0; }
.side-rail .rail-button.is-current-view { background:var(--ux-current-bg); color:var(--text-color); box-shadow:none; }
.side-rail .rail-button.is-current-view::before { content:''; position:absolute; left:0; top:calc(50% - 10px); width:3px; height:20px; border-radius:3px; background:var(--ux-current-mark); pointer-events:none; }
.side-rail .rail-button:active { transform:none; }
.news-list-table .news-list-title a { font-weight:550; }
.news-list-table .news-list-source,.news-list-table .news-list-time { font-size:.8rem; color:var(--text-muted); font-variant-numeric:tabular-nums; }
.reminder-row-text > div,.reminder-date,.countdown-entry .countdown-details,.priority-history-summary,.note-counter,.push-device-row .account-description { color:var(--text-muted); font-size:.8rem; line-height:1.5; }
#appPageHost .reminder-row-text strong,#appPageHost .countdown-entry strong { font-weight:600; }
.ux-empty-state { grid-column:1/-1; width:100%; box-sizing:border-box; padding:28px 12px; text-align:center; background:none; border:0; }
.ux-empty-state h3 { font-size:1rem; font-weight:600; margin:0 0 8px; color:var(--text-color); }
.ux-empty-state p { color:var(--text-muted); margin:0 auto; max-width:40ch; font-size:.86rem; line-height:1.55; }
.ux-empty-state button { margin-top:16px; min-height:38px; }
#newsEmpty:has(.ux-empty-state) { padding:0; }
dialog.onstart-action-dialog { position:fixed; inset:0; box-sizing:border-box; width:min(440px,calc(100vw - 32px)); height:fit-content; max-height:calc(100dvh - 40px); margin:auto; padding:24px; border:1px solid var(--border-color); border-radius:16px; background:var(--modal-bg); color:var(--text-color); box-shadow:0 20px 70px rgba(0,0,0,.25); backdrop-filter:none; overflow:auto; }
dialog.onstart-action-dialog:not([open]) { display:none!important; }
dialog.onstart-action-dialog[open] { display:block; z-index:2147483647; }
dialog.onstart-action-dialog::backdrop { background:rgba(10,15,22,.45); backdrop-filter:blur(3px); }
.onstart-action-dialog h2 { font-size:1.15rem; line-height:1.35; margin:0 0 12px; }
.onstart-action-dialog p { margin:0; font-size:.95rem; line-height:1.6; white-space:pre-line; overflow-wrap:anywhere; }
.onstart-dialog-actions { display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; margin-top:24px; }
.onstart-dialog-actions button { min-height:40px; min-width:88px; }
:where(button,a[href],input,select,textarea,[tabindex="0"]):focus-visible { outline:2px solid var(--ux-focus)!important; outline-offset:3px!important; }
.account-switch input:focus-visible + .account-switch-track { outline:2px solid var(--ux-focus); outline-offset:3px; }
:where(button,a[href],input,select,textarea) { scroll-margin-top:16px; scroll-margin-bottom:16px; }
@media(max-width:480px) { #appPageHost .app-dialog-panel > .account-content { padding:0; } #appPageHost .app-dialog-panel > .account-footer { margin-top:20px; padding-top:16px; } .ux-empty-state { padding:24px 4px; } }
@media(prefers-reduced-motion:reduce) {
 *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; transition-delay:0ms!important; }
 body:not(.edit-mode) .app-item .app-icon-wrapper,body:not(.edit-mode) .library-folder-icon { transform:scale(.85)!important; }
}

.account-tabs,.support-contact-tabs { scrollbar-width:thin; scrollbar-color:var(--text-muted) transparent; }
.account-tabs::-webkit-scrollbar,.support-contact-tabs::-webkit-scrollbar { height:4px; }
.account-tabs::-webkit-scrollbar-track,.support-contact-tabs::-webkit-scrollbar-track { background:transparent; }
.account-tabs::-webkit-scrollbar-thumb,.support-contact-tabs::-webkit-scrollbar-thumb { background:var(--text-muted); border-radius:4px; }

@media(prefers-reduced-motion:reduce) and (hover:hover) and (pointer:fine) { body:not(.edit-mode) .app-item .app-icon-wrapper,body:not(.edit-mode) .library-folder-icon { transform:scale(.82)!important; } }

/* Diskret fokus: musklick ger ingen extra ram. Tangentbordsfokus är neutralt. */
:root { --ux-focus:#707781; }
[data-theme="dark"] { --ux-focus:#a9adb4; }
html :where(button,a[href],input,select,textarea,[tabindex="0"]):focus-visible { outline:1px solid var(--ux-focus)!important; outline-offset:2px!important; }
html[data-focus-input="pointer"] :where(button,a[href],input,select,textarea,[tabindex]):focus:not(.context-help-highlight):not(.drag-over):not(.link-sort-target) { outline:none!important; }
html .account-switch input:focus-visible + .account-switch-track { outline:1px solid var(--ux-focus)!important; outline-offset:2px; }
html[data-focus-input="pointer"] .account-switch input:focus + .account-switch-track { outline:none!important; }
html #mainSearchInput:focus { outline:none!important; box-shadow:none!important; }
html .main-search-bar:has(#mainSearchInput:focus) { border-color:rgba(105,112,122,.45); box-shadow:none; }

/* Mina prompter använder samma läsyta och komponenter som övriga appar. */
.prompt-library-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin:0 0 20px; }
.prompt-library-toolbar .account-description { margin:0; }
.prompt-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:20px; }
.prompt-library-toolbar .prompt-actions { margin:0; }
.prompt-table { width:100%; table-layout:fixed; border-collapse:collapse; }
.prompt-table th { text-align:left; font-size:.78rem; color:var(--text-muted); font-weight:500; padding:8px; border-bottom:1px solid var(--border-color); }
.prompt-table th:not(:first-child),.prompt-action-cell { width:44px; }
.prompt-table td { padding:10px 8px; border-bottom:1px solid var(--border-color); }
.prompt-list-title { overflow:hidden; }
.prompt-title-button { display:block; width:100%; min-width:0; padding:8px 0; border:0; background:transparent; font:inherit; font-size:.95rem; font-weight:550; text-align:left; color:var(--text-color); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; }
.prompt-title-button:hover { text-decoration:underline; text-underline-offset:3px; }
.prompt-icon-button { display:grid; place-items:center; width:36px; height:36px; border:0; border-radius:8px; background:transparent; color:var(--text-muted); cursor:pointer; }
.prompt-icon-button:hover { color:var(--text-color); background:var(--btn-secondary-bg); }
.prompt-back-link { background:none; border:0; color:var(--text-muted); cursor:pointer; padding:4px 0; margin-bottom:16px; font:inherit; font-size:.85rem; }
.prompt-card-title { font-size:1.1rem; line-height:1.45; margin:0 0 20px; overflow-wrap:anywhere; }
#promptsPage h4 { font-size:.8rem; color:var(--text-muted); font-weight:500; margin:20px 0 8px; }
.prompt-purpose,.prompt-content { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.6; font-size:.93rem; }
.prompt-content { padding:16px; border:1px solid var(--border-color); border-radius:10px; background:var(--input-bg); max-height:55vh; overflow:auto; }
#promptsPage :is(input,textarea,select) { box-sizing:border-box; width:100%; padding:10px 12px; border:1px solid var(--border-color); background:var(--input-bg); color:var(--text-color); font:inherit; font-size:1rem; line-height:1.5; }
#promptsPage textarea { resize:vertical; min-height:80px; }
#promptText { min-height:220px; }
#promptUseForm { margin-top:24px; }
.prompt-preview { margin-top:20px; }
.prompt-preview summary { font-size:.83rem; color:var(--text-muted); cursor:pointer; padding:8px 0; }
.prompt-preview button { margin-top:8px; }
.prompt-tool-link { display:inline-block; margin-top:16px; font-size:.83rem; }
@media(max-width:480px) { .prompt-table td,.prompt-table th { padding:8px 4px; } .prompt-table th:not(:first-child),.prompt-action-cell { width:40px; } .prompt-icon-button { width:40px; height:44px; } .prompt-library-toolbar { align-items:flex-start; } .prompt-content { padding:12px; } }
