html,
body {
    height: 100%;
    overflow: hidden;
}
body {
    margin: 0;
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    color: var(--text);
    position: relative;
    background:
        radial-gradient(circle at 20% 16%, rgb(var(--ink) / 0.04), transparent 20%),
        radial-gradient(circle at 80% 18%, rgb(var(--ink) / 0.03), transparent 18%),
        linear-gradient(150deg, var(--bg-1) 0%, var(--bg-2) 24%, var(--bg-3) 58%, var(--bg-4) 100%);
}
body.board-editing {
    user-select: none;
    -webkit-user-select: none;
}
.board-page {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: calc(100vw - 2 * var(--edge));
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    padding: calc(clamp(1rem, 2vw, 2rem) + env(safe-area-inset-top)) 0 calc(0.4rem + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
}
.board-head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: var(--corner-size);
    margin-bottom: 0.7rem;
    flex-wrap: wrap;
    flex: 0 0 auto;
}
.board-head h1 {
    margin: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.45em;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    line-height: 1;
}
@media (max-width: 599px) {
    .board-head {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "back title"
            "actions actions";
        align-items: center;
        gap: 0.7rem;
    }
    .board-head .board-back {
        grid-area: back;
    }
    .board-head h1 {
        grid-area: title;
        font-size: 1.4rem;
        min-width: 0;
    }
    .board-head .board-actions {
        grid-area: actions;
        justify-content: flex-start;
    }
}
.board-back {
    color: inherit;
    text-decoration: none;
    box-sizing: border-box;
    width: var(--corner-size);
    height: var(--corner-size);
    display: inline-grid;
    place-items: center;
    border-radius: var(--corner-radius);
    border: 1px solid rgb(var(--ink) / 0.16);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    background: rgb(var(--ink) / 0.06);
}
.board-back:hover {
    background: rgb(var(--ink) / 0.16);
}
.board-back svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.board-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.board-button {
    appearance: none;
    font: inherit;
    font-size: 0.85rem;
    height: 44px;
    padding: 0 1rem;
    border-radius: var(--corner-radius);
    border: 1px solid rgb(var(--ink) / 0.22);
    background: rgb(var(--ink) / 0.08);
    color: inherit;
    cursor: pointer;
}
.board-button:hover {
    background: rgb(var(--ink) / 0.16);
}
.board-button--primary {
    background: rgb(var(--ink) / 0.14);
}
.board-button--primary[aria-pressed="true"],
button.board-button--primary[type="submit"] {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg-2);
}
.board-button[hidden] {
    display: none;
}
.board-page :focus-visible,
.board-dialog :focus-visible {
    outline: 2px solid #8cc8ff;
    outline-offset: 2px;
}
.board-hint {
    position: fixed;
    left: 50%;
    bottom: calc(3rem + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 30;
    box-sizing: border-box;
    width: min(560px, calc(100% - 2rem));
    margin: 0;
    padding: 0.55rem 0.9rem;
    border-radius: 14px;
    background: rgb(var(--panel) / 0.82);
    border: 1px solid rgb(var(--ink) / 0.16);
    font-size: 0.78rem;
    text-align: center;
    color: rgb(var(--text-rgb) / 0.85);
    pointer-events: none;
}
.board-hint[hidden] {
    display: none;
}
.board-empty {
    grid-column: 1 / -1;
    grid-row: 1 / span 2;
    margin: 0;
    display: grid;
    place-items: center;
    text-align: center;
    border: 2px dashed rgb(var(--ink) / 0.22);
    border-radius: 24px;
    color: rgb(var(--text-rgb) / 0.7);
    padding: 1rem;
}

/* ------------------------------------------------- Seiten (kein Scrollen) */
.board-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
}
.board-pager {
    --cols: 4;
    --cell: 78px;
    --gap: 10px;
    position: absolute;
    inset: 0;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.board-pager::-webkit-scrollbar {
    display: none;
}
.board-pageview {
    flex: 0 0 100%;
    box-sizing: border-box;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: grid;
    grid-template-columns: repeat(var(--cols), var(--cell));
    grid-auto-rows: var(--cell);
    gap: var(--gap);
    justify-content: center;
    align-content: start;
    position: relative;
}
.board-pageview.is-new-page {
    border-radius: 24px;
    outline: 2px dashed rgb(var(--ink) / 0.2);
    outline-offset: -6px;
}
.board-pageview.is-new-page::after {
    content: "Neue Seite";
    grid-column: 1 / -1;
    grid-row: 1 / span 2;
    display: grid;
    place-items: center;
    color: rgb(var(--text-rgb) / 0.45);
    font-size: 0.9rem;
}
.board-dots {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    min-height: 34px;
}
.board-dots[hidden] {
    display: none;
}
.board-dot {
    appearance: none;
    box-sizing: content-box;
    width: 9px;
    height: 9px;
    padding: 8px;
    margin: 0 -2px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    background-clip: content-box;
    cursor: pointer;
    position: relative;
}
.board-dot::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: rgb(var(--ink) / 0.3);
    transition: background 160ms ease, transform 160ms ease;
}
.board-dot.is-active::before {
    background: var(--text);
    transform: scale(1.25);
}
.board-dot--new {
    font: inherit;
    font-size: 0.8rem;
    line-height: 1;
    color: rgb(var(--text-rgb) / 0.7);
}
.board-dot--new::before {
    background: transparent;
    border: 1px dashed rgb(var(--ink) / 0.5);
}
.board-dot--new.is-active::before {
    border-color: var(--text);
    transform: none;
}

/* ---------------------------------------------------------------- Widgets */
.widget {
    position: relative;
    container-type: size;
    border-radius: 24px;
    border: 1px solid rgb(var(--ink) / 0.16);
    background: linear-gradient(135deg, rgb(var(--ink) / 0.11), rgb(var(--ink) / 0.05));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}
.widget-body {
    position: absolute;
    inset: 0;
    padding: clamp(8px, 6cqmin, 18px);
    overflow: hidden;
}
.widget-tools {
    position: absolute;
    inset: 0;
    display: none;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: 4px;
    padding: 4px;
    background: rgb(var(--panel) / 0.64);
}
.board-editing .widget {
    cursor: grab;
    animation: widgetJiggle 0.32s ease-in-out infinite alternate;
}
.board-editing .widget:nth-child(2n) {
    animation-delay: -0.12s;
    animation-direction: alternate-reverse;
}
.board-editing .widget:nth-child(3n) {
    animation-delay: -0.2s;
}
.board-editing .widget-tools {
    display: flex;
}
.board-editing .widget-body {
    pointer-events: none;
}
.widget.is-dragging {
    z-index: 20;
    cursor: grabbing;
    animation: none;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    opacity: 0.92;
}
@keyframes widgetJiggle {
    from {
        rotate: -0.7deg;
    }
    to {
        rotate: 0.7deg;
    }
}
.widget-handle {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 34px;
    height: 34px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgb(var(--ink) / 0.14);
    color: var(--text);
    cursor: grab;
    touch-action: none;
}
.widget-handle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
.board-editing .widget-handle {
    display: inline-flex;
}
.widget[data-size="S"] .widget-handle {
    width: 26px;
    height: 26px;
    top: 2px;
    left: 2px;
}
.widget[data-size="S"] .widget-handle svg {
    width: 16px;
    height: 16px;
}
.widget-tool {
    appearance: none;
    font: inherit;
    font-size: 0.78rem;
    line-height: 1;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-radius: 999px;
    border: 1px solid rgb(var(--ink) / 0.3);
    background: rgb(var(--ink) / 0.92);
    color: #1c1f23;
    cursor: pointer;
    font-weight: 700;
}
.widget-tool--remove {
    background: #ffb4a8;
}
.widget-tool:hover {
    background: #ffffff;
}
.widget[data-size="S"] .widget-tool {
    min-width: 24px;
    height: 24px;
    padding: 0 3px;
    font-size: 0.7rem;
}
.widget[data-size="S"] .widget-tools {
    gap: 3px;
    padding: 2px;
}

/* Rueckseite und Bearbeiten-Knopf */
.widget-edit {
    appearance: none;
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgb(var(--ink) / 0.22);
    background: rgb(var(--panel) / 0.78);
    color: rgb(var(--text-rgb) / 0.9);
    cursor: pointer;
    opacity: 0;
    transition: opacity 160ms ease, background 160ms ease;
}
.widget-edit svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
}
.widget-edit:hover {
    background: rgb(var(--ink) / 0.24);
}
@media (hover: hover) and (pointer: fine) {
    .widget:hover .widget-edit {
        opacity: 1;
    }
}
.widget-edit:focus-visible {
    opacity: 1;
}
@media (hover: none) {
    .widget-edit {
        opacity: 0.75;
        width: 30px;
        height: 30px;
    }
    .widget[data-size="S"] .widget-edit {
        display: none;
    }
}
@media (pointer: coarse) {
    .widget-tool {
        min-width: 34px;
        height: 34px;
    }
    .widget[data-size="S"] .widget-tool {
        min-width: 28px;
        height: 28px;
    }
    .widget[data-size="S"] .widget-tool--earlier,
    .widget[data-size="S"] .widget-tool--later {
        display: none;
    }
    .widget-back-size,
    .widget-back-button {
        height: 34px;
    }
    .widget-back input[type="text"],
    .widget-back select {
        height: 36px;
        font-size: 16px;
    }
    .wd-note-area {
        font-size: 16px;
    }
}
.board-editing .widget-edit {
    display: none;
}
.widget-back {
    position: absolute;
    inset: 0;
    z-index: 3;
    box-sizing: border-box;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 12px;
    overflow-y: auto;
    background: linear-gradient(135deg, rgb(var(--panel) / 0.98), rgb(var(--panel) / 0.98));
    font-size: 0.78rem;
    scrollbar-width: thin;
}
.widget.is-flipped .widget-body,
.widget.is-flipped .widget-tools,
.widget.is-flipped .widget-edit {
    display: none;
}
.board-editing .widget.is-flipped {
    animation: none;
    cursor: default;
}
.widget-back-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgb(var(--text-rgb) / 0.6);
}
.widget-back-row {
    display: grid;
    gap: 4px;
}
.widget-back-row--check {
    grid-template-columns: auto 1fr;
    align-items: center;
}
.widget-back-label {
    font-weight: 600;
    color: rgb(var(--text-rgb) / 0.85);
}
.widget-back input[type="text"],
.widget-back select {
    font: inherit;
    height: 30px;
    padding: 0 8px;
    border-radius: 9px;
    border: 1px solid rgb(var(--ink) / 0.25);
    background: rgb(var(--ink) / 0.08);
    color: inherit;
}
.widget-back select option {
    color: #1c1f23;
}
.widget-back input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #ff7a59;
}
.widget-back-sizes {
    display: flex;
    gap: 4px;
}
.widget-back-size {
    appearance: none;
    font: inherit;
    flex: 1;
    height: 28px;
    padding: 0;
    border-radius: 9px;
    border: 1px solid rgb(var(--ink) / 0.25);
    background: rgb(var(--ink) / 0.06);
    color: inherit;
    cursor: pointer;
    font-weight: 600;
}
.widget-back-size[aria-pressed="true"] {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg-2);
}
.widget-back-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}
.widget-back-button {
    appearance: none;
    font: inherit;
    flex: 1 1 auto;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgb(var(--ink) / 0.25);
    background: rgb(var(--ink) / 0.08);
    color: inherit;
    cursor: pointer;
    white-space: nowrap;
}
.widget-back-button:hover {
    background: rgb(var(--ink) / 0.18);
}
.widget-back-button--primary {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg-2);
}
.widget-back-button--primary:hover {
    background: #ffffff;
}
.widget-back-button--danger {
    color: #ffb4a8;
    border-color: rgba(255, 180, 168, 0.45);
}
.widget-back :focus-visible {
    outline: 2px solid #8cc8ff;
    outline-offset: 1px;
}

.wd-message {
    display: grid;
    place-items: center;
    height: 100%;
    text-align: center;
    font-size: clamp(0.7rem, 7cqmin, 0.95rem);
    color: rgb(var(--text-rgb) / 0.7);
}

/* ------------------------------------------------------------------ Uhr */
.wd-clock {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6cqmin;
}
.wd-clock-digital {
    display: grid;
    gap: 1cqmin;
    justify-items: center;
    text-align: center;
}
.wd-clock-time {
    display: flex;
    align-items: baseline;
    gap: 2cqmin;
    font-variant-numeric: tabular-nums;
    font-weight: 300;
    letter-spacing: -0.02em;
}
.wd-clock--S .wd-clock-time {
    font-size: 30cqmin;
}
.wd-clock--M .wd-clock-time {
    font-size: 38cqmin;
}
.wd-clock--XL2 .wd-clock-time {
    font-size: 26cqmin;
}
.wd-clock--XL1 .wd-clock-time {
    font-size: 24cqw;
}
.wd-clock-colon {
    animation: clockBlink 1s steps(1, end) infinite;
}
@keyframes clockBlink {
    50% {
        opacity: 0.25;
    }
}
.wd-clock-seconds {
    font-size: 0.42em;
    color: rgb(var(--text-rgb) / 0.6);
}
.wd-clock-date {
    font-size: clamp(0.7rem, 9cqmin, 1.1rem);
    color: rgb(var(--text-rgb) / 0.75);
}
.wd-clock--L,
.wd-clock--XL1 {
    flex-direction: column;
    gap: 3cqmin;
}
.wd-clock-week {
    font-size: clamp(0.65rem, 6cqw, 0.9rem);
    color: rgb(var(--text-rgb) / 0.55);
}
.wd-clock--L .wd-analog {
    width: 78cqmin;
    height: 78cqmin;
}
.wd-clock--XL2 .wd-analog {
    height: 84cqh;
    width: 84cqh;
}
.wd-clock--XL1 .wd-analog {
    width: 80cqw;
    height: 80cqw;
}
.wd-clock--XL1 .wd-clock-date {
    font-size: clamp(0.75rem, 7cqw, 1.1rem);
}
.wd-face {
    fill: rgb(var(--ink) / 0.06);
    stroke: rgb(var(--ink) / 0.35);
    stroke-width: 1;
}
.wd-tick {
    stroke: rgb(var(--ink) / 0.4);
    stroke-width: 0.8;
}
.wd-tick--major {
    stroke: rgb(var(--ink) / 0.9);
    stroke-width: 1.6;
}
.wd-hand {
    stroke-linecap: round;
    transform-origin: 50px 50px;
}
.wd-hand--hour {
    stroke: var(--text);
    stroke-width: 4;
}
.wd-hand--minute {
    stroke: var(--text);
    stroke-width: 2.6;
}
.wd-hand--second {
    stroke: #ff7a59;
    stroke-width: 1.2;
    transition: transform 0.35s cubic-bezier(0.4, 2.2, 0.6, 1);
}
.wd-pin {
    fill: #ff7a59;
}
.wd-datewin {
    fill: rgb(var(--panel) / 0.55);
    stroke: rgb(var(--ink) / 0.4);
    stroke-width: 0.5;
}
.wd-datenum {
    fill: var(--text);
    font-size: 7.6px;
    font-weight: 600;
    text-anchor: middle;
    font-variant-numeric: tabular-nums;
}
.wd-citytext {
    fill: rgb(var(--text-rgb) / 0.6);
    font-size: 5px;
    letter-spacing: 0.7px;
    text-anchor: middle;
}
.wd-clock--S .wd-citytext,
.wd-clock--M .wd-citytext {
    display: none;
}
.wd-clock--S .wd-datenum {
    font-size: 9px;
}
.wd-clock--S .wd-analog {
    width: 92cqmin;
    height: 92cqmin;
}
.wd-clock--M .wd-analog {
    height: 88cqh;
    width: 88cqh;
}
.wd-clock-side {
    display: grid;
    gap: 1.5cqmin;
}
.wd-clock-city {
    font-size: clamp(0.6rem, 6cqmin, 0.8rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgb(var(--text-rgb) / 0.5);
}
.wd-clock--L.wd-clock--digital .wd-clock-time {
    font-size: 19cqw;
}
.board-title-icon {
    width: 0.95em;
    height: 0.95em;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ------------------------------------------------------------- Kalender */
.wd-cal {
    height: 100%;
}
.wd-cal--S {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0;
    text-align: center;
}
.wd-cal-weekday {
    font-size: 16cqmin;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ff7a59;
}
.wd-cal-daynum {
    font-size: 46cqmin;
    font-weight: 300;
    line-height: 1;
}
.wd-cal-month {
    font-size: 14cqmin;
    color: rgb(var(--text-rgb) / 0.7);
}
.wd-cal--M {
    display: grid;
    align-content: center;
    gap: 5cqmin;
}
.wd-cal-title {
    font-size: clamp(0.7rem, 15cqh, 1rem);
    font-weight: 600;
    color: rgb(var(--text-rgb) / 0.8);
}
.wd-cal-strip {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2cqw;
}
.wd-cal-stripday {
    display: grid;
    justify-items: center;
    gap: 2cqh;
    padding: 3cqh 0;
    border-radius: 12px;
}
.wd-cal-stripname {
    font-size: clamp(0.55rem, 11cqh, 0.8rem);
    color: rgb(var(--text-rgb) / 0.65);
}
.wd-cal-stripnum {
    font-size: clamp(0.8rem, 20cqh, 1.2rem);
    font-weight: 600;
}
.wd-cal-stripday.is-today {
    background: #ff7a59;
    color: #1c1f23;
}
.wd-cal-stripday.is-today .wd-cal-stripname {
    color: #1c1f23;
}
.wd-cal--L,
.wd-cal--XL1,
.wd-cal--XL2 {
    display: flex;
    flex-direction: column;
    gap: 2cqh;
}
.wd-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.wd-cal-navbtn {
    appearance: none;
    font: inherit;
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgb(var(--ink) / 0.2);
    background: rgb(var(--ink) / 0.08);
    color: inherit;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
}
.wd-cal-navbtn:hover {
    background: rgb(var(--ink) / 0.18);
}
.wd-cal-months {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 4cqw;
}
.wd-cal--XL1 .wd-cal-months {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-auto-rows: 1fr;
    gap: 3cqh;
}
.wd-cal--XL1 .wd-cal-grid {
    font-size: clamp(0.5rem, 2.9cqh, 0.8rem);
}
.wd-cal--XL1 .wd-cal-monthname {
    margin-bottom: 0;
    font-size: clamp(0.6rem, 3.4cqh, 0.85rem);
}
.wd-cal-monthbox {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.wd-cal-monthname {
    margin-bottom: 1cqh;
    font-size: clamp(0.7rem, 5.5cqh, 0.95rem);
    font-weight: 600;
}
.wd-cal-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(0, 1fr);
    text-align: center;
    align-items: center;
    line-height: 1.1;
    font-size: clamp(0.55rem, 4.3cqh, 0.85rem);
}
.wd-cal-gridhead {
    color: rgb(var(--text-rgb) / 0.55);
}
.wd-cal-griddays.is-today {
    background: #ff7a59;
    color: #1c1f23;
    border-radius: 50%;
    font-weight: 700;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    justify-self: center;
    height: min(1.9em, 100%);
    width: auto;
}

/* ---------------------------------------------------------------- Wetter */
.wd-weather {
    height: 100%;
    display: flex;
    gap: 4cqmin;
}
.wd-weather-now {
    display: flex;
    align-items: center;
    gap: 4cqmin;
    min-width: 0;
}
.wd-wicon {
    flex: 0 0 auto;
    width: 40cqmin;
    height: 40cqmin;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.wd-weather--S {
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}
.wd-weather--S .wd-weather-now {
    flex-direction: column;
    gap: 0;
}
.wd-weather--S .wd-wicon {
    width: 52cqmin;
    height: 52cqmin;
}
.wd-weather--S .wd-weather-temp {
    font-size: 26cqmin;
}
.wd-weather--M {
    align-items: center;
    justify-content: space-between;
}
.wd-weather--M .wd-wicon {
    width: 70cqh;
    height: 70cqh;
}
.wd-weather--M .wd-weather-temp {
    font-size: 40cqh;
}
.wd-weather--L {
    flex-direction: column;
    justify-content: space-between;
}
.wd-weather--L .wd-wicon {
    width: 38cqmin;
    height: 38cqmin;
}
.wd-weather--L .wd-weather-temp {
    font-size: 24cqmin;
}
.wd-weather--XL1 {
    flex-direction: column;
    justify-content: space-between;
}
.wd-weather--XL1 .wd-wicon {
    width: 36cqw;
    height: 36cqw;
}
.wd-weather--XL1 .wd-weather-temp {
    font-size: 24cqw;
}
.wd-weather--XL1 .wd-weather-city {
    font-size: clamp(0.85rem, 8cqw, 1.2rem);
}
.wd-weather--XL1 .wd-forecast {
    gap: 2.5cqh;
}
.wd-weather--XL1 .wd-forecast-day {
    font-size: clamp(0.7rem, 6cqw, 1rem);
}
.wd-weather--XL2 {
    justify-content: space-between;
    align-items: center;
}
.wd-weather--XL2 .wd-wicon {
    width: 62cqh;
    height: 62cqh;
}
.wd-weather--XL2 .wd-weather-temp {
    font-size: 40cqh;
}
.wd-weather-temp {
    font-weight: 300;
    line-height: 1;
}
.wd-weather-city {
    font-size: clamp(0.75rem, 10cqmin, 1.1rem);
    font-weight: 600;
    margin-top: 1cqmin;
}
.wd-weather-desc {
    font-size: clamp(0.65rem, 8cqmin, 0.95rem);
    color: rgb(var(--text-rgb) / 0.7);
}
.wd-weather-range {
    align-self: center;
    font-size: clamp(0.7rem, 12cqh, 1rem);
    color: rgb(var(--text-rgb) / 0.8);
    white-space: pre;
}
.wd-forecast {
    display: grid;
    gap: 1.5cqmin;
}
.wd-weather--XL2 .wd-forecast {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 2cqw;
    flex: 1;
}
.wd-forecast-day {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 2cqmin;
    font-size: clamp(0.65rem, 6.5cqmin, 0.9rem);
}
.wd-weather--XL2 .wd-forecast-day {
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: center;
    gap: 1cqh;
    border-radius: 14px;
    background: rgb(var(--ink) / 0.07);
    font-size: clamp(0.65rem, 8cqh, 0.95rem);
}
.wd-forecast-day .wd-wicon {
    width: 1.8em;
    height: 1.8em;
}
.wd-weather--XL2 .wd-forecast-day .wd-wicon {
    width: 2.6em;
    height: 2.6em;
}
.wd-forecast-name {
    color: rgb(var(--text-rgb) / 0.75);
}
.wd-forecast-min {
    color: rgb(var(--text-rgb) / 0.55);
}
/* Schmales XL2 (z. B. Handy): kompakter, nur 4 Vorhersagetage */
@container (max-width: 480px) {
    .wd-weather--XL2 .wd-wicon {
        width: 40cqh;
        height: 40cqh;
    }
    .wd-weather--XL2 .wd-weather-temp {
        font-size: 30cqh;
    }
    .wd-weather--XL2 .wd-weather-desc {
        display: none;
    }
    .wd-weather--XL2 .wd-weather-city {
        font-size: 0.75rem;
    }
    .wd-weather--XL2 .wd-weather-now {
        flex-direction: column;
        gap: 0;
        align-items: flex-start;
        justify-content: center;
    }
    .wd-weather--XL2 .wd-forecast-day:nth-child(n+5) {
        display: none;
    }
    .wd-weather--XL2 .wd-forecast-day .wd-wicon {
        width: 1.8em;
        height: 1.8em;
    }
}
/* Wetter-Details (gefuehlt, Wind, Regen, ...): nur wenn genug Platz ist */
.wd-weather-stats,
.wd-hourly {
    display: none;
}
.wd-weather-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2cqmin 1.6cqmin;
    font-size: clamp(0.58rem, 4.2cqmin, 0.8rem);
    line-height: 1.15;
}
.wd-stat {
    display: grid;
    gap: 0.15em;
    padding: 0.35em 0.55em;
    border-radius: 10px;
    background: rgb(var(--ink) / 0.07);
    min-width: 0;
}
.wd-stat-label {
    font-size: 0.82em;
    color: rgb(var(--text-rgb) / 0.55);
}
.wd-stat-value {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wd-hourly {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 1cqw;
    text-align: center;
    font-size: clamp(0.6rem, 4.4cqw, 0.85rem);
}
.wd-hour {
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 0.25em;
    padding: 0.4em 0.1em;
    border-radius: 12px;
    background: rgb(var(--ink) / 0.06);
}
.wd-hour .wd-wicon {
    width: 1.9em;
    height: 1.9em;
}
.wd-hour-time,
.wd-hour-rain {
    font-size: 0.82em;
    color: rgb(var(--text-rgb) / 0.6);
}
.wd-hour-rain {
    color: #8cc8ff;
}
@container (min-height: 300px) {
    .wd-weather--L .wd-weather-stats {
        display: grid;
    }
    /* L: nur die drei wichtigsten Werte in einer Zeile */
    .wd-weather--L .wd-stat:nth-child(n+4) {
        display: none;
    }
}
@container (min-height: 400px) {
    .wd-weather--XL1 .wd-weather-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}
@container (min-height: 540px) {
    .wd-weather--XL1 .wd-hourly {
        display: grid;
    }
}
@container (min-width: 660px) and (min-height: 190px) {
    .wd-weather--XL2 .wd-weather-stats {
        display: grid;
        grid-template-columns: repeat(2, auto);
        align-content: center;
    }
    .wd-weather--XL2 .wd-wicon {
        width: 36cqh;
        height: 36cqh;
    }
    .wd-weather--XL2 .wd-weather-temp {
        font-size: 26cqh;
    }
}
.wd-weather--XL2 .wd-weather-now {
    flex: 0 0 auto;
}
.wd-weather--XL2 .wd-forecast {
    min-width: 0;
}
/* Wetter-Icons: Farben und Animationen */
.wi-sun {
    fill: #ffcf4a;
    stroke: #ffb81f;
    stroke-width: 1;
}
.wi-rays {
    stroke: #ffcf4a;
    stroke-width: 1.6;
    transform-box: fill-box;
    transform-origin: center;
    animation: wiSpin 14s linear infinite;
}
.wi-moon {
    fill: #f3e9c4;
    stroke: #d9c98a;
    stroke-width: 0.8;
    animation: wiFloat 5s ease-in-out infinite;
}
.wi-cloud {
    fill: #e4eaf1;
    stroke: #b8c3d1;
    stroke-width: 0.9;
    animation: wiDrift 6s ease-in-out infinite alternate;
}
.wd-wicon--cloud .wi-cloud {
    fill: #c9d2dd;
}
.wi-drop {
    stroke: #6fb7ff;
    stroke-width: 1.6;
    animation: wiFall 1.1s linear infinite;
}
.wi-drop--2 {
    animation-delay: -0.35s;
}
.wi-drop--3 {
    animation-delay: -0.7s;
}
.wi-flake {
    fill: #ffffff;
    animation: wiFall 2.2s linear infinite;
}
.wi-flake--2 {
    animation-delay: -0.7s;
}
.wi-flake--3 {
    animation-delay: -1.4s;
}
.wi-bolt {
    fill: #ffd84a;
    stroke: #ffb81f;
    stroke-width: 0.6;
    animation: wiFlash 2.4s steps(1, end) infinite;
}
.wi-fog {
    stroke: #c5ced9;
    stroke-width: 1.6;
    animation: wiFloat 3.5s ease-in-out infinite;
}
@keyframes wiSpin {
    to {
        transform: rotate(360deg);
    }
}
@keyframes wiFloat {
    50% {
        transform: translateY(-0.6px);
        opacity: 0.85;
    }
}
@keyframes wiDrift {
    from {
        transform: translateX(-0.5px);
    }
    to {
        transform: translateX(0.8px);
    }
}
@keyframes wiFall {
    0% {
        transform: translateY(-1.4px);
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
    100% {
        transform: translateY(2px);
        opacity: 0;
    }
}
@keyframes wiFlash {
    0%, 70%, 78%, 100% {
        opacity: 1;
    }
    74%, 82% {
        opacity: 0.2;
    }
}

/* ------------------------------------------------------------ Nachrichten */
.wd-news {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 3cqmin;
}
.wd-news-title {
    font-size: clamp(0.6rem, 4cqmin, 0.75rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgb(var(--text-rgb) / 0.6);
}
.wd-news a {
    color: inherit;
    text-decoration: none;
}
.wd-news a:hover {
    text-decoration: underline;
}
.wd-news-stage {
    flex: 1;
    min-height: 0;
    display: grid;
    align-items: center;
    overflow: hidden;
}
.wd-news-slide {
    display: grid;
    gap: 2cqh;
    animation: newsIn 0.6s ease both;
}
.wd-news-headline {
    font-size: clamp(0.8rem, 20cqh, 1.15rem);
    font-weight: 600;
    line-height: 1.25;
}
@keyframes newsIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}
.wd-news-time {
    font-size: clamp(0.6rem, 3.8cqmin, 0.75rem);
    color: rgb(var(--text-rgb) / 0.55);
    white-space: nowrap;
}
.wd-news-dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    margin: 0 0.5em 0.15em;
    border-radius: 50%;
    background: currentColor;
    vertical-align: middle;
    opacity: 0.8;
}
.wd-news-time {
    white-space: normal;
}
.wd-news-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-height: 0;
    display: grid;
    align-content: space-between;
    gap: 1.5cqmin;
    overflow: hidden;
}
.wd-news--XL2 .wd-news-list {
    grid-template-columns: 1fr 1fr;
    column-gap: 4cqw;
    grid-auto-flow: row;
}
.wd-news-item {
    display: grid;
    gap: 0.5cqmin;
    font-size: clamp(0.7rem, 5cqmin, 0.95rem);
    line-height: 1.25;
}
.wd-news--XL2 .wd-news-item {
    font-size: clamp(0.7rem, 7cqh, 0.95rem);
}
.wd-news--XL1 .wd-news-item {
    font-size: clamp(0.75rem, 6.2cqw, 1rem);
}
.wd-news-link {
    overflow-wrap: anywhere;
}
.wd-news-item[hidden] {
    display: none;
}

/* ----------------------------------------------------------------- Notiz */
.wd-note {
    height: 100%;
}
.wd-note-area {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    resize: none;
    border: 0;
    border-radius: 12px;
    padding: 4px 2px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: clamp(0.8rem, 8cqh, 1rem);
    line-height: 1.4;
}
.wd-note-area::placeholder {
    color: rgb(var(--text-rgb) / 0.45);
}
.wd-note-area:focus {
    outline: none;
}

/* ---------------------------------------------------------------- Dialog */
.board-dialog {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(8, 9, 11, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.board-dialog[hidden] {
    display: none;
}
.board-dialog-panel {
    width: min(420px, 100%);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    display: grid;
    gap: 0.9rem;
    padding: 1.2rem;
    border-radius: 24px;
    border: 1px solid rgb(var(--ink) / 0.2);
    background: linear-gradient(135deg, var(--bg-3), var(--bg-4));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.board-dialog-panel h2 {
    margin: 0;
    font-size: 1.1rem;
}
.board-picker-list {
    display: grid;
    gap: 0.5rem;
}
.board-picker-item {
    appearance: none;
    font: inherit;
    display: grid;
    gap: 0.2rem;
    text-align: left;
    padding: 0.7rem 0.9rem;
    border-radius: 16px;
    border: 1px solid rgb(var(--ink) / 0.16);
    background: rgb(var(--ink) / 0.06);
    color: inherit;
    cursor: pointer;
}
.board-picker-item:hover {
    background: rgb(var(--ink) / 0.14);
}
.board-picker-item span {
    font-size: 0.8rem;
    color: rgb(var(--text-rgb) / 0.65);
}
.board-form {
    display: grid;
    gap: 0.8rem;
}
.board-field {
    display: grid;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
}
.board-field input {
    font: inherit;
    font-size: 0.95rem;
    font-weight: 400;
    height: 40px;
    padding: 0 0.8rem;
    border-radius: 12px;
    border: 1px solid rgb(var(--ink) / 0.25);
    background: rgb(var(--ink) / 0.08);
    color: inherit;
}

@view-transition {
    navigation: auto;
    types: to-board;
}

.widget-ghost {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 200;
    pointer-events: none;
    animation: none !important;
    opacity: 0.92;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.widget-ghost .widget-tools,
.widget-ghost .widget-edit {
    display: none;
}
.widget.is-drag-source {
    opacity: 0.25;
    animation: none;
}

/* ------------------------------------------------------------------ Kurs */
.wd-quote {
    --q: #c5ced9;
    height: 100%;
    min-width: 0;
}
.wd-quote[data-direction="up"] {
    --q: #4cd98a;
}
.wd-quote[data-direction="down"] {
    --q: #ff7b7b;
}
.wd-quote-name {
    font-weight: 600;
    color: rgb(var(--text-rgb) / 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.wd-quote-price {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.wd-quote-change {
    color: var(--q);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: pre;
}
.wd-quote--S {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 2cqh;
    text-align: center;
}
.wd-quote--S .wd-quote-name {
    font-size: clamp(0.5rem, 12cqw, 0.7rem);
}
.wd-quote--S .wd-quote-price {
    font-size: clamp(0.8rem, 21cqw, 1.5rem);
}
.wd-quote--S .wd-quote-change {
    font-size: clamp(0.6rem, 14cqw, 0.85rem);
}
.wd-quote--M {
    display: flex;
    align-items: center;
    gap: 5cqw;
}
.wd-quote-left {
    flex: 0 0 auto;
    min-width: 0;
    display: grid;
    gap: 1cqh;
}
.wd-quote--M .wd-quote-name {
    max-width: 9em;
    font-size: clamp(0.55rem, 14cqh, 0.8rem);
}
.wd-quote--M .wd-quote-price {
    font-size: clamp(0.85rem, 24cqh, 1.4rem);
}
.wd-quote--M .wd-quote-change {
    font-size: clamp(0.6rem, 15cqh, 0.85rem);
}
.wd-quote--L,
.wd-quote--XL1 {
    display: flex;
    flex-direction: column;
    gap: 2cqh;
}
.wd-quote--XL2 {
    display: flex;
    gap: 3cqw;
}
.wd-quote-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.wd-quote-titles {
    min-width: 0;
}
.wd-quote-isin {
    font-size: 0.65rem;
    color: rgb(var(--text-rgb) / 0.5);
}
.wd-quote-figures {
    text-align: right;
}
.wd-quote--L .wd-quote-name,
.wd-quote--XL1 .wd-quote-name,
.wd-quote--XL2 .wd-quote-name {
    font-size: clamp(0.75rem, 4.2cqmin, 1rem);
}
.wd-quote--L .wd-quote-price,
.wd-quote--XL1 .wd-quote-price,
.wd-quote--XL2 .wd-quote-price {
    font-size: clamp(1.1rem, 7cqmin, 2rem);
}
.wd-quote--L .wd-quote-change,
.wd-quote--XL1 .wd-quote-change,
.wd-quote--XL2 .wd-quote-change {
    font-size: clamp(0.62rem, 3.4cqmin, 0.85rem);
}
.wd-quote--XL2 .wd-quote-side {
    flex: 0 0 38%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
}
.wd-quote--XL2 .wd-quote-head {
    flex-direction: column;
    gap: 4px;
}
.wd-quote--XL2 .wd-quote-figures {
    text-align: left;
}
.wd-quote-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wd-quote-tabs {
    display: flex;
    gap: 4px;
    flex: 0 0 auto;
}
.wd-quote-tab {
    appearance: none;
    font: inherit;
    font-size: 0.7rem;
    flex: 1 1 0;
    min-width: 0;
    height: 26px;
    padding: 0 2px;
    border-radius: 999px;
    border: 1px solid rgb(var(--ink) / 0.22);
    background: rgb(var(--ink) / 0.06);
    color: inherit;
    cursor: pointer;
}
.wd-quote-tab:hover {
    background: rgb(var(--ink) / 0.16);
}
.wd-quote-tab[aria-pressed="true"] {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg-2);
    font-weight: 600;
}
.wd-quote-foot {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    font-size: 0.7rem;
}
.wd-quote-stat {
    display: grid;
}
.wd-quote-stat-label,
.wd-quote-source {
    color: rgb(var(--text-rgb) / 0.5);
    font-size: 0.62rem;
}
.wd-quote-stat-value {
    font-variant-numeric: tabular-nums;
}
.wd-quote-source {
    grid-column: 1 / -1;
}
.wd-quote--L .wd-quote-foot {
    grid-template-columns: 1fr;
}
/* L ist klein (2x2): kompakter Kopf, ohne ISIN-Zeile */
.wd-quote--L .wd-quote-head {
    flex-direction: column;
    gap: 2px;
}
.wd-quote--L .wd-quote-figures {
    text-align: left;
}
.wd-quote--L .wd-quote-isin {
    display: none;
}
.wd-quote--L .wd-quote-tab {
    height: 22px;
    font-size: 0.62rem;
}
.wd-quote--L .wd-quote-source {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Diagramm */
.wd-chart {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    touch-action: none;
    cursor: crosshair;
}
.wd-chart svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}
.wd-chart-area {
    fill: var(--q);
    opacity: 0.16;
}
.wd-chart-line-path {
    fill: none;
    stroke: var(--q);
    stroke-width: 1.8;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}
.wd-chart-cursor {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgb(var(--ink) / 0.45);
    pointer-events: none;
}
.wd-chart-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: var(--q);
    border: 2px solid #1c1f23;
    box-sizing: border-box;
    pointer-events: none;
}
.wd-chart-tip {
    position: absolute;
    top: 2px;
    transform: translateX(10px);
    display: grid;
    gap: 1px;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgb(var(--panel) / 0.92);
    border: 1px solid rgb(var(--ink) / 0.18);
    font-size: 0.72rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
}
.wd-chart-tip.is-right {
    transform: translateX(calc(-100% - 10px));
}
.wd-chart-tip-time {
    color: rgb(var(--text-rgb) / 0.6);
    font-size: 0.65rem;
}
.wd-chart-cursor[hidden],
.wd-chart-dot[hidden],
.wd-chart-tip[hidden] {
    display: none;
}
.wd-chart--spark {
    align-self: stretch;
    margin: 12% 0;
}
.wd-chart--spark .wd-chart-tip {
    font-size: 0.62rem;
    padding: 2px 6px;
}

/* Groesse aendern an den Ecken (nur Maus) */
.widget-resize {
    display: none;
}
@media (hover: hover) and (pointer: fine) {
    .widget-resize {
        display: block;
        position: absolute;
        z-index: 1;
        width: 18px;
        height: 18px;
        opacity: 0;
        transition: opacity 160ms ease;
    }
    .widget-resize::after {
        content: "";
        position: absolute;
        width: 9px;
        height: 9px;
        border: 0 solid rgb(var(--ink) / 0.75);
    }
    .widget-resize--nw { left: 0; top: 0; cursor: nwse-resize; }
    .widget-resize--ne { right: 0; top: 0; cursor: nesw-resize; }
    .widget-resize--sw { left: 0; bottom: 0; cursor: nesw-resize; }
    .widget-resize--se { right: 0; bottom: 0; cursor: nwse-resize; }
    .widget-resize--nw::after { left: 4px; top: 4px; border-left-width: 2px; border-top-width: 2px; border-top-left-radius: 4px; }
    .widget-resize--ne::after { right: 4px; top: 4px; border-right-width: 2px; border-top-width: 2px; border-top-right-radius: 4px; }
    .widget-resize--sw::after { left: 4px; bottom: 4px; border-left-width: 2px; border-bottom-width: 2px; border-bottom-left-radius: 4px; }
    .widget-resize--se::after { right: 4px; bottom: 4px; border-right-width: 2px; border-bottom-width: 2px; border-bottom-right-radius: 4px; }
    .widget:hover .widget-resize,
    .widget.is-resizing .widget-resize {
        opacity: 1;
    }
    .widget.is-flipped .widget-resize,
    .widget-ghost .widget-resize {
        display: none;
    }
    .widget:not(.is-flipped):not(.widget--note) {
        cursor: grab;
    }
    body.board-resizing,
    body.board-resizing * {
        user-select: none;
    }
}
.widget.is-resizing {
    z-index: 5;
    box-shadow: 0 0 0 2px rgb(var(--ink) / 0.55);
}

/* ---------------------------------------------------------------- Timer */
.wd-timer {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3cqmin;
}
.wd-timer-time {
    font-variant-numeric: tabular-nums;
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1;
}
.wd-timer--S .wd-timer-time {
    font-size: 24cqmin;
}
.wd-timer--M {
    flex-direction: row;
    gap: 6cqmin;
}
.wd-timer--M .wd-timer-time {
    font-size: 36cqh;
}
.wd-timer-dial {
    position: relative;
    display: grid;
    place-items: center;
}
.wd-timer-dial svg {
    width: 100%;
    height: 100%;
}
.wd-timer-dial .wd-timer-time {
    position: absolute;
    font-size: 17cqmin;
}
.wd-timer--L .wd-timer-dial {
    width: 62cqmin;
    height: 62cqmin;
}
.wd-timer--L .wd-timer-dial .wd-timer-time {
    font-size: 13cqmin;
}
.wd-timer--XL1 .wd-timer-dial {
    width: 78cqw;
    height: 78cqw;
}
.wd-timer--XL1 .wd-timer-dial .wd-timer-time {
    font-size: 16cqw;
}
.wd-timer--XL2 {
    flex-direction: row;
    gap: 6cqmin;
}
.wd-timer--XL2 .wd-timer-dial {
    width: 80cqh;
    height: 80cqh;
}
.wd-timer--XL2 .wd-timer-dial .wd-timer-time {
    font-size: 17cqh;
}
.wd-timer-side {
    display: grid;
    gap: 4cqmin;
    justify-items: center;
}
.wd-timer-track {
    fill: none;
    stroke: rgb(var(--ink) / 0.14);
    stroke-width: 5;
}
.wd-timer-progress {
    fill: none;
    stroke: #ff7a59;
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.25s linear;
}
.wd-timer-controls {
    display: flex;
    gap: 2.5cqmin;
    align-items: center;
}
.wd-timer-button {
    appearance: none;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgb(var(--ink) / 0.22);
    background: rgb(var(--ink) / 0.1);
    color: inherit;
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}
.wd-timer-button:hover {
    background: rgb(var(--ink) / 0.22);
}
.wd-timer-button--main {
    background: #ff7a59;
    border-color: #ff7a59;
    color: #1b1d20;
    min-width: 38px;
    height: 34px;
}
.wd-timer-button--main:hover {
    background: #ff9174;
}
.wd-timer--S .wd-timer-button {
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
}
.wd-timer-presets {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 100%;
}
.wd-timer-chip {
    appearance: none;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgb(var(--ink) / 0.2);
    background: transparent;
    color: rgb(var(--text-rgb) / 0.8);
    font: inherit;
    font-size: 0.75rem;
    cursor: pointer;
}
.wd-timer-chip:hover,
.wd-timer-chip.is-active {
    background: rgb(var(--ink) / 0.18);
    color: var(--text);
}
.wd-timer[data-mode="running"] .wd-timer-progress {
    stroke: #4cd98a;
}
.wd-timer[data-mode="paused"] .wd-timer-time {
    opacity: 0.6;
}
.wd-timer[data-mode="done"] .wd-timer-time {
    color: #ff5d5d;
    animation: timerFlash 0.8s steps(1, end) infinite;
}
.wd-timer[data-mode="done"] .wd-timer-progress {
    stroke: #ff5d5d;
}
@keyframes timerFlash {
    50% {
        opacity: 0.25;
    }
}
@media (prefers-reduced-motion: reduce) {
    .wd-timer[data-mode="done"] .wd-timer-time {
        animation: none;
    }
}

/* Bearbeiten als Icon-Knopf (Regler); beim Bearbeiten ein Haken */
.board-button--icon {
    width: var(--corner-size);
    height: var(--corner-size);
    box-sizing: border-box;
    padding: 0;
    display: inline-grid;
    place-items: center;
}
.board-button--icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.board-button--icon .icon-check,
.board-button--icon[aria-pressed="true"] .icon-sliders {
    display: none;
}
.board-button--icon[aria-pressed="true"] .icon-check {
    display: block;
}
.widget-tool svg {
    width: 15px;
    height: 15px;
    display: block;
    margin: 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* Bearbeiten sitzt fest oben rechts, genau dort, wo auf der Startseite der Menue-Knopf ist;
   der Umblaetter-Knopf liegt direkt links daneben (gleiche Stelle wie auf der Startseite).
   Zuruecksetzen und + Widget bleiben in der Kopfzeile und halten dafuer Platz frei. */
#board-edit {
    position: fixed;
    top: clamp(1rem, 2vw, 2rem);
    right: var(--edge);
    z-index: 50;
}
.board-head .board-actions {
    margin-right: calc(2 * var(--corner-size) + 2 * var(--corner-gap));
}
@media (max-width: 599px) {
    .board-head .board-actions {
        margin-right: 0;
    }
}

/* Sehr schmale Handys (320-360 px): Titel kuerzer, damit er nicht unter den Knoepfen liegt */
@media (max-width: 400px) {
    .board-head h1 {
        font-size: 1.25rem;
    }
    .board-head .board-title-icon {
        display: none;
    }
}

/* Darstellungs-Knopf im Dashboard: klein in die Punktezeile, damit er keine Widgets ueberdeckt */
.look-toggle {
    width: 34px;
    height: 34px;
    bottom: calc(4px + env(safe-area-inset-bottom));
}
.look-toggle svg {
    width: 17px;
    height: 17px;
}
.look-panel {
    bottom: calc(46px + env(safe-area-inset-bottom));
}

/* ------------------------------------------------------------ Weltuhr */
.wd-world {
    display: grid;
    gap: 0.15em;
    margin-top: 0.4em;
    font-size: clamp(0.6rem, 4.6cqmin, 0.85rem);
    color: rgb(var(--text-rgb) / 0.75);
    justify-items: center;
}
.wd-world-row {
    display: flex;
    align-items: baseline;
    gap: 0.6em;
    white-space: nowrap;
}
.wd-world-city {
    color: rgb(var(--text-rgb) / 0.55);
}
.wd-world-time {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.wd-world-day {
    font-size: 0.8em;
    color: rgb(var(--text-rgb) / 0.5);
}
.wd-clock-side .wd-world {
    justify-items: start;
}

/* ------------------------------------------------------- Aufgabenliste */
.wd-todo {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}
.wd-todo--S {
    align-items: center;
    justify-content: center;
    text-align: center;
}
.wd-todo-count {
    font-size: 36cqmin;
    font-weight: 300;
    line-height: 1;
}
.wd-todo-sub {
    font-size: clamp(0.6rem, 12cqmin, 0.85rem);
    color: rgb(var(--text-rgb) / 0.6);
}
.wd-todo-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: clamp(0.6rem, 4.2cqmin, 0.78rem);
}
.wd-todo-title {
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgb(var(--text-rgb) / 0.6);
}
.wd-todo-open {
    color: rgb(var(--text-rgb) / 0.55);
}
.wd-todo-clear {
    appearance: none;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
    color: rgb(var(--text-rgb) / 0.6);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}
.wd-todo-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    display: grid;
    align-content: start;
    gap: 2px;
}
.wd-todo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 2px;
    font-size: clamp(0.72rem, 5.4cqmin, 0.95rem);
    line-height: 1.25;
}
.wd-todo-item input {
    flex: 0 0 auto;
    width: 1.05em;
    height: 1.05em;
    accent-color: #ff7a59;
    cursor: pointer;
}
.wd-todo-text {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}
.wd-todo-item.is-done .wd-todo-text {
    text-decoration: line-through;
    color: rgb(var(--text-rgb) / 0.45);
}
.wd-todo-remove {
    appearance: none;
    border: 0;
    background: none;
    color: rgb(var(--text-rgb) / 0.5);
    font: inherit;
    font-size: 1.1em;
    cursor: pointer;
    padding: 0 2px;
    opacity: 0;
}
.wd-todo-item:hover .wd-todo-remove,
.wd-todo-remove:focus-visible {
    opacity: 1;
}
@media (hover: none) {
    .wd-todo-remove {
        opacity: 0.6;
    }
}
.wd-todo-form input {
    box-sizing: border-box;
    width: 100%;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgb(var(--ink) / 0.2);
    background: rgb(var(--ink) / 0.07);
    color: inherit;
    font: inherit;
    font-size: clamp(0.7rem, 5cqmin, 0.9rem);
}
.wd-todo-form input::placeholder {
    color: rgb(var(--text-rgb) / 0.45);
}
.wd-todo-form input:focus-visible {
    outline: 2px solid #8cc8ff;
    outline-offset: 1px;
}

/* ------------------------------------- Kalender: Feiertage und Notizen */
.wd-cal-griddays {
    appearance: none;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    padding: 0;
    cursor: pointer;
    position: relative;
}
.wd-cal-griddays:hover {
    background: rgb(var(--ink) / 0.12);
    border-radius: 6px;
}
.wd-cal-griddays.is-holiday {
    color: #ff9f7a;
    font-weight: 600;
}
.wd-cal-griddays.is-today.is-holiday {
    color: #1c1f23;
}
.wd-cal-griddays.has-note::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 1px;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: #8cc8ff;
}
.wd-cal-stripday.is-holiday .wd-cal-stripnum {
    color: #ff9f7a;
}
.wd-cal-stripday.is-today.is-holiday .wd-cal-stripnum {
    color: #1c1f23;
}
.wd-cal-daynum.is-holiday {
    color: #ff9f7a;
}
.wd-cal-editor {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    font-size: clamp(0.6rem, 3.6cqmin, 0.8rem);
}
.wd-cal-editor-label {
    flex: 0 0 auto;
    max-width: 45%;
    color: rgb(var(--text-rgb) / 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wd-cal-editor input {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgb(var(--ink) / 0.22);
    background: rgb(var(--ink) / 0.08);
    color: inherit;
    font: inherit;
}

/* ------------------------------------------------ Timer: Name im Ring */
.wd-timer-name {
    position: absolute;
    top: 24%;
    max-width: 70%;
    font-size: clamp(0.6rem, 4.4cqmin, 0.8rem);
    color: rgb(var(--text-rgb) / 0.6);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------------------------------- Nachrichten: Filter und Blaettern */
.wd-news-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.wd-news-pager {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: clamp(0.58rem, 3.6cqmin, 0.72rem);
    color: rgb(var(--text-rgb) / 0.55);
}
.wd-news-pager[hidden] {
    display: none;
}
.wd-news-page {
    appearance: none;
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgb(var(--ink) / 0.2);
    background: rgb(var(--ink) / 0.08);
    color: inherit;
    font: inherit;
    line-height: 1;
    cursor: pointer;
}
.wd-news-page:hover {
    background: rgb(var(--ink) / 0.2);
}
.wd-news-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.wd-news-chip {
    appearance: none;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid rgb(var(--ink) / 0.2);
    background: transparent;
    color: rgb(var(--text-rgb) / 0.75);
    font: inherit;
    font-size: clamp(0.58rem, 3.6cqmin, 0.74rem);
    cursor: pointer;
}
.wd-news-chip[aria-pressed="true"] {
    background: rgb(var(--ink) / 0.2);
    color: var(--text);
    border-color: rgb(var(--ink) / 0.5);
}

/* Kalender M: grosse Zahl links, Kalenderblatt rechts; Wochennummern in allen Monatsgittern */
.wd-cal--M {
    /* genau in der Mitte geteilt: links die Zahl, rechts das Kalenderblatt */
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-content: stretch;
    align-items: stretch;
    gap: 0;
    position: relative;
}
.wd-cal--M::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 8%;
    bottom: 8%;
    width: 1px;
    background: rgb(var(--ink) / 0.14);
}
.wd-cal-bigdate {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2cqh;
    min-width: 0;
    padding: 0 3cqw;
    box-sizing: border-box;
    text-align: center;
}
.wd-cal-bignum {
    font-size: clamp(2.4rem, 68cqh, 5.6rem);
    font-weight: 600;
    line-height: 0.95;
    font-variant-numeric: tabular-nums;
}
.wd-cal-bignum.is-holiday {
    color: #ff9f7a;
}
.wd-cal-bigweekday {
    font-size: clamp(0.6rem, 10cqh, 0.9rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ff7a59;
    font-weight: 700;
}
.wd-cal-bigholiday {
    font-size: clamp(0.5rem, 8cqh, 0.75rem);
    color: #ff9f7a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.wd-cal--M .wd-cal-monthbox {
    min-width: 0;
    min-height: 0;
    padding: 1cqh 2cqw 1cqh 2.5cqw;
    box-sizing: border-box;
    justify-content: stretch;
}
.wd-cal--M .wd-cal-gridhead {
    font-size: 0.85em;
}
.wd-cal-monthbox--compact .wd-cal-monthname {
    margin-bottom: 0.5cqh;
    font-size: clamp(0.55rem, 11cqh, 0.9rem);
    color: rgb(var(--text-rgb) / 0.8);
    flex: 0 0 auto;
}
.wd-cal-monthbox--compact .wd-cal-grid {
    flex: 1;
    min-height: 0;
    font-size: clamp(0.44rem, 10.2cqh, 0.8rem);
    line-height: 1;
}
.wd-cal-monthbox--compact .wd-cal-griddays.is-today {
    width: auto;
    height: min(1.7em, 100%);
}
.wd-cal-grid--kw {
    grid-template-columns: 1.5em repeat(7, 1fr);
}
.wd-cal-kw,
.wd-cal-kwhead {
    color: rgb(var(--text-rgb) / 0.4);
    font-size: 0.82em;
    font-variant-numeric: tabular-nums;
}
.wd-cal-kw {
    border-right: 1px solid rgb(var(--ink) / 0.12);
    margin-right: 0.25em;
    align-self: stretch;
    display: grid;
    align-items: center;
}
/* Touch: der Einstellungs-Knopf sitzt beim Kalenderblatt oben rechts (neben dem Monatsnamen),
   damit er keine Tage verdeckt */
@media (hover: none) {
    .widget:has(.wd-cal--M) .widget-edit {
        bottom: auto;
        top: 3px;
        right: 5px;
        width: 20px;
        height: 20px;
    }
    .widget:has(.wd-cal--M) .widget-edit svg {
        width: 12px;
        height: 12px;
    }
}

/* Kalender M in schmalen Kacheln (Handy): ohne Wochennummern, kurzer Monatsname */
.wd-cal-name-short {
    display: none;
}
@container (max-width: 230px) {
    .wd-cal--M .wd-cal-kw,
    .wd-cal--M .wd-cal-kwhead {
        display: none;
    }
    .wd-cal--M .wd-cal-grid--kw {
        grid-template-columns: repeat(7, 1fr);
    }
    .wd-cal--M .wd-cal-name-full {
        display: none;
    }
    .wd-cal--M .wd-cal-name-short {
        display: inline;
    }
    .wd-cal--M .wd-cal-monthbox {
        padding: 0 1cqw 0 1.5cqw;
    }
    .wd-cal--M .wd-cal-monthbox--compact .wd-cal-grid {
        font-size: clamp(0.4rem, 9.2cqh, 0.66rem);
    }
}

/* Leistung: Auf Touch-Geraeten und kleinen Bildschirmen kein Hintergrund-Weichzeichner hinter den Widgets
   (teuer, weil der animierte Hintergrund jedes Bild neu verwischt werden muesste). */
@media (pointer: coarse), (max-width: 700px) {
    .widget {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: linear-gradient(135deg, rgb(var(--ink) / 0.14), rgb(var(--ink) / 0.08));
    }
}
