/* =====================================================================
   Startseite – Vollbild-Layout ohne Scrollen, Glas-Optik über Hintergrund
   ===================================================================== */

/* ---------------------------------------------------------------- Hintergrund */
#bg { position: fixed; inset: 0; z-index: 0; display: none; overflow: hidden; background: #070b14; pointer-events: none; }
body.on-home #bg { display: block; }
body.on-home { background: #070b14; }
.layout { position: relative; z-index: 1; }
.bg-grad, .bg-photo, .bg-dim { position: absolute; inset: 0; }

.bg-grad { background: var(--g0, #070b14); transition: opacity 1.2s ease; }
.bg-grad i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; animation: bg-drift 30s ease-in-out infinite alternate; }
.bg-grad i:nth-child(1) { width: 65vmax; height: 65vmax; top: -25vmax; left: -15vmax; background: var(--g1, #1f6feb); }
.bg-grad i:nth-child(2) { width: 60vmax; height: 60vmax; bottom: -28vmax; right: -18vmax; background: var(--g2, #7c3aed); animation-duration: 36s; animation-direction: alternate-reverse; }
.bg-grad i:nth-child(3) { width: 40vmax; height: 40vmax; top: 35%; left: 38%; background: var(--g3, #10b981); opacity: 0.35; animation-duration: 44s; }
@keyframes bg-drift { to { transform: translate(9vmax, 6vmax) scale(1.15) rotate(20deg); } }

#bg[data-mode="aurora"], #bg[data-mode="daily"], #bg[data-mode="custom"] { --g0: #070b14; --g1: #1f6feb; --g2: #7c3aed; --g3: #10b981; }
#bg[data-mode="sunset"]   { --g0: #1a0a14; --g1: #f97316; --g2: #be185d; --g3: #facc15; }
#bg[data-mode="ocean"]    { --g0: #03111d; --g1: #0284c7; --g2: #1e3a8a; --g3: #14b8a6; }
#bg[data-mode="forest"]   { --g0: #06120c; --g1: #15803d; --g2: #064e3b; --g3: #a3e635; }
#bg[data-mode="midnight"] { --g0: #04050a; --g1: #312e81; --g2: #1e1b4b; --g3: #7e22ce; }
#bg[data-mode="rose"]     { --g0: #14080f; --g1: #e11d48; --g2: #7c3aed; --g3: #fb7185; }

.bg-photo { background: center / cover no-repeat; opacity: 0; transform: scale(1.06); transition: opacity 1.4s ease, transform 12s ease-out; }
.bg-photo.loaded { opacity: 1; transform: scale(1); }
#bg.has-photo .bg-grad { opacity: 0; }
.bg-dim {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(4, 7, 13, calc(var(--dim, 0.35) * 0.4)) 0%, transparent 60%),
    linear-gradient(180deg, rgba(4, 7, 13, calc(var(--dim, 0.35) * 0.7)) 0%, rgba(4, 7, 13, var(--dim, 0.35)) 45%, rgba(4, 7, 13, calc(var(--dim, 0.35) + 0.25)) 100%);
}
#bg:not(.has-photo) .bg-dim { background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.35) 100%); }

@media (prefers-reduced-motion: reduce) {
  .bg-grad i { animation: none; }
  .bg-photo { transition: opacity 0.4s; transform: none; }
}

/* ---------------------------------------------------------------- Rahmen & Farben auf der Startseite */
body.on-home .sidebar { background: rgba(6, 9, 15, 0.35); border-right-color: rgba(255, 255, 255, 0.07); }
body.on-home .sidebar .nav-item { color: rgba(240, 244, 250, 0.6); }
body.on-home .sidebar .nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
body.on-home .sidebar .nav-item.active { background: rgba(255, 255, 255, 0.14); color: #fff; }
body.on-home .bottom-nav { background: rgba(6, 9, 15, 0.55); border-top-color: rgba(255, 255, 255, 0.08); }
body.on-home .bottom-nav .nav-item { color: rgba(240, 244, 250, 0.6); }
body.on-home .bottom-nav .nav-item.active { color: #fff; background: rgba(255, 255, 255, 0.12); }

main.view-home {
  --text: #f4f6fb;
  --muted: rgba(232, 238, 248, 0.62);
  --border: rgba(255, 255, 255, 0.1);
  --card-hover: rgba(255, 255, 255, 0.08);
  --input: rgba(255, 255, 255, 0.06);
  color: var(--text);
  max-width: none;
  height: 100vh;
  height: 100dvh;
  padding: 28px 34px 26px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
}
main.view-home a { color: inherit; }

.glass {
  background: rgba(14, 18, 28, 0.42);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.dim { opacity: 0.6; }
.tiny { font-size: 0.72rem; }

/* ---------------------------------------------------------------- Kopfzeile */
.home-header { display: grid; grid-template-columns: 1fr minmax(340px, 640px) 1fr; align-items: end; gap: 28px; flex: none; }
.clock { text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35); }
.clock-greet { font-size: 0.8rem; font-weight: 650; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); margin-bottom: 4px; }
.clock-time { font-size: clamp(3.6rem, 6.4vw, 6.2rem); font-weight: 200; line-height: 0.92; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.clock-date { font-size: 1.08rem; color: rgba(255, 255, 255, 0.82); margin-top: 8px; font-weight: 450; }

.search-wrap { position: relative; margin-bottom: 4px; }
.search {
  display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 20px;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.7);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.search:focus-within { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.35); box-shadow: 0 16px 50px rgba(0, 0, 0, 0.3), 0 0 0 4px rgba(255, 255, 255, 0.06); }
.search input { flex: 1; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; height: 100%; font-size: 1.08rem; color: #fff; }
.search input::placeholder { color: rgba(255, 255, 255, 0.55); }
.search input::-webkit-search-cancel-button { filter: invert(1); }
.search-engine { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.4); }
.search-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; background: rgba(20, 24, 34, 0.92); backdrop-filter: blur(24px); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; overflow: hidden; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4); }
.search-suggest:empty { display: none; }
.suggest-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; color: #fff !important; text-decoration: none !important; }
.suggest-item:hover, .suggest-item:focus { background: rgba(255, 255, 255, 0.08); outline: none; }
.suggest-item img { width: 18px; height: 18px; border-radius: 4px; }
.suggest-item .muted { margin-left: auto; color: rgba(255, 255, 255, 0.5); }

.weather { justify-self: end; text-align: right; text-decoration: none !important; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35); }
.w-now { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.w-emoji { font-size: 2.6rem; line-height: 1; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3)); }
.w-temp { font-size: 2.7rem; font-weight: 250; line-height: 1; letter-spacing: -0.03em; }
.w-label { font-size: 0.85rem; color: rgba(255, 255, 255, 0.78); }
.w-city { font-size: 0.78rem; color: rgba(255, 255, 255, 0.62); margin: 6px 0 10px; }
.w-days { display: flex; justify-content: flex-end; gap: 6px; }
.w-day {
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 54px; padding: 6px 8px;
  font-size: 0.74rem; border-radius: 12px; background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); text-shadow: none;
}
.w-day-ico { font-size: 1.05rem; }

/* ---------------------------------------------------------------- Raster */
.home-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 22px; }
.home-col { display: flex; flex-direction: column; gap: 22px; min-height: 0; min-width: 0; }
.home-col:empty { display: none; }

.widget { position: relative; display: flex; flex-direction: column; min-height: 0; flex: 1 1 0; overflow: hidden; }
.w-spotify { flex: 0 0 auto; }
.w-notes { flex: 0.75 1 0; }
.w-bookmarks { flex: 1.25 1 0; }
.widget .card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 6px 20px; min-height: 48px; flex: none; }
.widget .card-head h3 { display: flex; align-items: center; gap: 9px; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(240, 244, 250, 0.7); }
.widget .card-actions { display: flex; align-items: center; gap: 4px; }
.widget .icon-btn { color: rgba(240, 244, 250, 0.55); }
.widget .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.widget .card-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 18px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.widget .card-body::-webkit-scrollbar { width: 6px; }
.widget .card-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 6px; }
.w-count { min-width: 24px; height: 22px; padding: 0 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); font-size: 0.74rem; font-weight: 700; display: inline-grid; place-items: center; }
.w-count:empty { display: none; }
.w-empty { color: var(--muted); font-size: 0.9rem; padding: 10px 0; }
.w-empty p { margin: 0 0 10px; }
.glass-btn { background: rgba(255, 255, 255, 0.12) !important; border-color: rgba(255, 255, 255, 0.16) !important; color: #fff !important; }

/* ---------------------------------------------------------------- Favoriten */
.bm-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.bm-tab { border: 0; cursor: pointer; padding: 6px 14px; border-radius: 99px; font-size: 0.8rem; font-weight: 650; background: rgba(255, 255, 255, 0.07); color: rgba(240, 244, 250, 0.7); transition: background 0.15s, color 0.15s; }
.bm-tab:hover { background: rgba(255, 255, 255, 0.13); color: #fff; }
.bm-tab.on { background: rgba(255, 255, 255, 0.92); color: #10141c; }
.bm-tab.add { background: transparent; border: 1px dashed rgba(255, 255, 255, 0.25); }
.bm-tab-tools { display: inline-flex; gap: 1px; margin-right: 4px; }
.icon-btn.xs { width: 24px; height: 24px; border-radius: 6px; }
.bm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; }
.bm-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px 10px;
  border-radius: 16px; border: 1px solid transparent; background: transparent; cursor: pointer;
  color: var(--text) !important; text-decoration: none !important; transition: background 0.15s, transform 0.15s;
}
.bm-tile:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-2px); }
.bm-tile:hover .bm-icon { box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35); }
.bm-tile.editing { border: 1px dashed rgba(255, 255, 255, 0.22); cursor: grab; }
.bm-tile.dragging { opacity: 0.35; }
.bm-tile.add { color: var(--muted) !important; }
.bm-icon {
  width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; overflow: hidden;
  background: rgba(255, 255, 255, 0.92); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); transition: box-shadow 0.15s;
}
.bm-tile.add .bm-icon { background: rgba(255, 255, 255, 0.08); box-shadow: none; border: 1px dashed rgba(255, 255, 255, 0.25); color: #fff; }
.bm-icon img { width: 28px; height: 28px; }
.bm-letter { font-weight: 750; font-size: 1.25rem; color: #2a3140; }
.bm-title { font-size: 0.78rem; font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }

/* ---------------------------------------------------------------- Termine */
.events { display: flex; flex-direction: column; }
.event-day { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; font-size: 0.74rem; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.event-day:first-child { margin-top: 2px; }
.ed-num { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, 0.09); color: var(--text); font-size: 0.9rem; letter-spacing: 0; }
.event-day.today { color: #fff; }
.event-day.today .ed-num { background: var(--accent); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 50%, transparent); }
.event { display: flex; gap: 12px; padding: 8px 10px; margin-left: 30px; border-radius: 12px; text-decoration: none !important; transition: background 0.15s; }
.event:hover { background: rgba(255, 255, 255, 0.07); }
.event.running { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.event .event-bar { width: 3px; min-height: 32px; }
.event-main { display: flex; flex-direction: column; min-width: 0; }
.event-title { font-weight: 550; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event .event-time { font-size: 0.76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- Aufgaben */
.quick-form-mini {
  display: flex; align-items: center; gap: 8px; padding: 0 12px; margin-bottom: 8px; border-radius: 13px;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.07); color: var(--muted);
  position: sticky; top: 0; z-index: 2;
}
.quick-form-mini:focus-within { border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.1); }
.quick-form-mini input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 10px 0 !important; margin: 0; color: #fff; }
.quick-form-mini input::placeholder { color: rgba(255, 255, 255, 0.45); }
.w-todo .todo-mini { display: flex; flex-direction: column; }
.w-todo .todo-row { gap: 12px; padding: 9px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); transition: opacity 0.3s; }
.w-todo .todo-row:last-child { border-bottom: 0; }
.check {
  width: 20px; height: 20px; padding: 0; flex: none; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.35); background: transparent; color: transparent;
  display: grid; place-items: center; transition: all 0.15s;
}
.check:hover { border-color: var(--success); color: var(--success); }
.todo-row.done { opacity: 0.45; }
.todo-row.done .check { background: var(--success); border-color: var(--success); color: #fff; }
.todo-row.done .ts-text { text-decoration: line-through; }
.w-todo .todo-subject { flex: 1; min-width: 0; display: flex; flex-direction: column; white-space: normal; }
.ts-text { font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-project { display: flex; align-items: center; gap: 5px; font-size: 0.72rem; color: var(--muted); }
.todo-project .dot { width: 7px; height: 7px; }
main.view-home .due.today { color: #fbbf24; }
main.view-home .due.overdue { color: #ff7a80; }

/* ---------------------------------------------------------------- Gmail */
.mail-hero { display: flex; align-items: center; gap: 14px; padding: 2px 0 14px; margin-bottom: 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); text-decoration: none !important; }
.mail-num { font-size: 2.9rem; font-weight: 200; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.mail-label { display: flex; flex-direction: column; font-size: 0.88rem; color: rgba(240, 244, 250, 0.8); }
.mail-label .dim { font-size: 0.72rem; }
.mail-list { display: flex; flex-direction: column; }
.mail-row { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: 12px; text-decoration: none !important; transition: background 0.15s; }
.mail-row:hover { background: rgba(255, 255, 255, 0.07); }
.mail-avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; color: #fff; background: linear-gradient(135deg, var(--accent), #8b5cf6); }
.mail-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mail-top { display: flex; justify-content: space-between; gap: 10px; }
.mail-from { font-weight: 620; font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-date { flex: none; font-size: 0.7rem; color: var(--muted); }
.mail-subject { font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- Spotify */
.w-spotify .sp-bg { position: absolute; inset: -40px; z-index: 0; background: center / cover no-repeat; filter: blur(42px) saturate(170%); opacity: 0.5; transition: opacity 0.6s; }
.w-spotify > .card-head, .w-spotify > .card-body { position: relative; z-index: 1; }
.w-spotify .card-body { overflow: visible; }
.sp-main { display: flex; align-items: center; gap: 14px; }
.sp-cover { width: 64px; height: 64px; flex: none; border-radius: 12px; object-fit: cover; display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4); }
.sp-info { flex: 1; min-width: 0; }
.sp-title { display: block; font-weight: 650; font-size: 0.98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none !important; }
.sp-title:hover { text-decoration: underline !important; }
.sp-artist { font-size: 0.85rem; color: rgba(240, 244, 250, 0.75); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-device { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 0.7rem; color: var(--muted); }
.sp-controls { display: flex; align-items: center; gap: 2px; flex: none; }
.w-spotify .icon-btn { color: rgba(255, 255, 255, 0.8); }
.icon-btn.play { width: 40px; height: 40px; border-radius: 50%; background: #fff !important; color: #10141c !important; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); transition: transform 0.1s; }
.icon-btn.play:hover { transform: scale(1.06); }
.sp-progress { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.sp-progress .progress { flex: 1; height: 4px; margin: 0; background: rgba(255, 255, 255, 0.18); border-radius: 4px; overflow: hidden; }
.sp-progress .progress-fill { height: 100%; background: #1ed760; transition: width 1s linear; }
.sp-time { font-size: 0.7rem; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.eq i { transform-origin: bottom; width: 2px; height: 100%; background: #1ed760; border-radius: 1px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: 0.2s; }
.eq i:nth-child(3) { animation-delay: 0.4s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }

/* ---------------------------------------------------------------- Notizen */
.w-notes .card-body { display: flex; padding-bottom: 16px; }
main.view-home textarea.notes {
  flex: 1; min-height: 0; resize: none; border: 0 !important; border-radius: 14px; padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05) !important; color: var(--text); line-height: 1.55; box-shadow: none !important;
}
main.view-home textarea.notes::placeholder { color: rgba(255, 255, 255, 0.35); }

/* ---------------------------------------------------------------- Bildnachweis */
.bg-credit {
  position: fixed; right: 18px; bottom: 8px; z-index: 2; max-width: 38vw;
  font-size: 0.68rem; color: rgba(255, 255, 255, 0.5) !important; text-decoration: none !important;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.bg-credit:hover { color: rgba(255, 255, 255, 0.85) !important; }

/* ---------------------------------------------------------------- Responsiv */
@media (max-width: 1320px) {
  .home-header { grid-template-columns: 1fr auto; row-gap: 20px; }
  .search-wrap { grid-column: 1 / -1; grid-row: 2; justify-self: center; width: min(720px, 100%); margin: 0; }
  .home-grid { grid-template-columns: 1fr 1.15fr 1fr; gap: 18px; }
  .home-col { gap: 18px; }
}

/* Niedrige Bildschirme: lieber scrollen als quetschen */
@media (min-width: 761px) and (max-height: 760px), (min-width: 761px) and (max-width: 1080px) {
  main.view-home { height: auto; min-height: 100vh; overflow: visible; }
  .home-grid { flex: none; }
  .widget { flex: none !important; height: 340px; }
  .w-spotify, a.w-gmail { height: auto; }
  .w-notes, .w-countdown { height: 260px; }
  .w-calendar { height: 470px; }
}
@media (min-width: 761px) and (max-width: 1080px) {
  .home-grid { grid-template-columns: 1fr 1fr; }
  .col-center { grid-column: 1 / -1; grid-row: 1; }
}

/* Smartphone */
@media (max-width: 760px) {
  main.view-home { height: auto; min-height: 100vh; overflow: visible; padding: 22px 14px calc(96px + env(safe-area-inset-bottom)); gap: 18px; }
  .home-header { grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
  .clock-time { font-size: 3.4rem; }
  .clock-date { font-size: 0.95rem; }
  .weather .w-city, .weather .w-days { display: none; }
  .w-emoji { font-size: 2rem; }
  .w-temp { font-size: 2rem; }
  .search-wrap { grid-column: 1 / -1; grid-row: 2; }
  .search { height: 52px; border-radius: 16px; }
  .search input { font-size: 16px !important; }
  .search-engine { display: none; }
  .home-grid { display: flex; flex-direction: column; gap: 14px; flex: none; }
  .home-col { display: contents; }
  .widget { flex: none !important; }
  .w-bookmarks { order: 1; }
  .w-calendar { order: 2; max-height: 380px; }
  .w-todo { order: 3; max-height: 420px; }
  .w-gmail { order: 4; max-height: 380px; }
  .w-spotify { order: 5; }
  .w-notes { order: 6; height: 220px; }
  .glass { border-radius: 20px; }
  .bm-tiles { grid-template-columns: repeat(4, 1fr); gap: 2px; }
  .bm-tile { padding: 8px 0; }
  .bm-icon { width: 48px; height: 48px; }
  .bg-credit { display: none; }
  .event { margin-left: 0; }
}

/* ---------------------------------------------------------------- Animationen */
.bg-fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.bg-photo.loaded { animation: kenburns 70s ease-in-out infinite alternate; }
@keyframes kenburns {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.08) translate(-1.2%, -0.8%); }
  100% { transform: scale(1.14) translate(1%, -1.5%); }
}
.clock-sec { font-size: 0.32em; font-weight: 300; letter-spacing: 0; margin-left: 0.15em; opacity: 0.55; vertical-align: 0.15em; display: inline-block; min-width: 1.3em; }
.home-header > *, .home-col > * { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.home-header > *:nth-child(2) { animation-delay: 0.06s; }
.home-header > *:nth-child(3) { animation-delay: 0.12s; }
.col-left > * { animation-delay: 0.15s; }
.col-center > * { animation-delay: 0.22s; }
.col-right > * { animation-delay: 0.29s; }
.home-col > *:nth-child(2) { animation-delay: 0.36s; }
.home-col > *:nth-child(3) { animation-delay: 0.43s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
/* sanfter Lichtschimmer, der über die Kacheln wandert */
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.06) 45%, transparent 60%);
  background-size: 250% 100%; animation: sheen 14s ease-in-out infinite;
}
.col-center .glass::after { animation-delay: 2s; }
.col-right .glass::after { animation-delay: 4s; }
@keyframes sheen { 0%, 70% { background-position: 150% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) {
  .bg-photo.loaded, .glass::after, .home-header > *, .home-col > * { animation: none; }
}

/* ---------------------------------------------------------------- Monatskalender */
.w-calendar { flex: 1.5 1 0; }
.w-calendar .card-body { display: flex; flex-direction: column; }
.mc-month { font-size: 1.15rem; font-weight: 650; text-transform: capitalize; margin: -2px 0 10px; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; flex: none; }
.mc-dow { text-align: center; font-size: 0.66rem; font-weight: 750; letter-spacing: 0.08em; color: var(--muted); padding-bottom: 4px; text-transform: uppercase; }
.mc-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: clamp(30px, 4.2vh, 40px); border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; font-size: 0.84rem;
  transition: background 0.12s;
}
.mc-cell:hover { background: rgba(255, 255, 255, 0.08); }
.mc-cell.we .mc-num { opacity: 0.75; }
.mc-cell.other { opacity: 0.3; }
.mc-cell.sel { background: rgba(255, 255, 255, 0.14); }
.mc-cell.today .mc-num { background: var(--accent); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 55%, transparent); }
.mc-num { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-weight: 550; font-variant-numeric: tabular-nums; }
.mc-dots { display: flex; gap: 2px; height: 4px; }
.mc-dots i { width: 4px; height: 4px; border-radius: 50%; }
.mc-day { flex: 1; min-height: 0; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.mc-day-head { font-size: 0.78rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.mc-day .event { margin-left: 0; }

/* ---------------------------------------------------------------- Countdown */
.w-countdown { flex: 0.9 1 0; }
.cd-list { display: flex; flex-direction: column; gap: 8px; }
.cd-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 14px; cursor: pointer; text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.07); color: var(--text);
  background: linear-gradient(100deg, color-mix(in srgb, var(--c) 22%, transparent), rgba(255, 255, 255, 0.03));
  transition: transform 0.15s, background 0.15s;
}
.cd-item:hover { transform: translateX(2px); background: linear-gradient(100deg, color-mix(in srgb, var(--c) 32%, transparent), rgba(255, 255, 255, 0.05)); }
.cd-item.past { opacity: 0.45; }
.cd-item.now { animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 45%, transparent), 0 0 30px color-mix(in srgb, var(--c) 35%, transparent); } }
.cd-emoji { font-size: 1.6rem; line-height: 1; flex: none; }
.cd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cd-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-date { font-size: 0.74rem; color: var(--muted); }
.cd-bar { display: block; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; margin-top: 4px; }
.cd-bar i { display: block; height: 100%; background: var(--c); border-radius: 3px; }
.cd-days { display: flex; flex-direction: column; align-items: center; flex: none; min-width: 52px; line-height: 1; }
.cd-days b { font-size: 1.7rem; font-weight: 300; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.cd-days small { font-size: 0.66rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 3px; }
.cd-days.small-label { font-weight: 700; font-size: 0.85rem; color: var(--c); }

/* ---------------------------------------------------------------- Fällige Aufgaben */
.todo-sec { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; margin: 10px 0 2px; }
.todo-sec:first-child { margin-top: 2px; }
.sec-over { color: #ff7a80; }
.sec-today { color: #fbbf24; }
.sec-soon { color: var(--muted); }
.w-count.alert { background: #e5484d; color: #fff; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(229, 72, 77, 0.25); } }

/* ---------------------------------------------------------------- Gmail-Kachel (kompakt) */
a.w-gmail { flex: 0 0 auto; display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 16px 18px; text-decoration: none !important; transition: transform 0.15s, background 0.15s; }
a.w-gmail:hover { transform: translateY(-2px); background: rgba(20, 26, 38, 0.55); }
.gm-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #ea4335, #c5221f); box-shadow: 0 6px 18px rgba(234, 67, 53, 0.35); }
.gm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gm-label { font-weight: 650; font-size: 0.95rem; }
.gm-acct { font-size: 0.74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-num { font-size: 2.3rem; font-weight: 250; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.gm-num.zero { font-size: 1.5rem; color: var(--success); font-weight: 600; }
.gm-num.bump { animation: bump 0.6s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes bump { 40% { transform: scale(1.25); color: #fbbf24; } }
.gm-go { color: var(--muted); }
a.w-gmail.has-unread .gm-icon { animation: mailbob 3.5s ease-in-out infinite; }
@keyframes mailbob { 0%, 80%, 100% { transform: translateY(0) rotate(0); } 85% { transform: translateY(-3px) rotate(-6deg); } 90% { transform: translateY(0) rotate(5deg); } 95% { transform: rotate(-2deg); } }

/* ---------------------------------------------------------------- Notizen-Kachel */
.nw-list { display: flex; flex-direction: column; }
.nw-item { display: flex; gap: 12px; align-items: center; padding: 8px; margin: 0 -8px; border-radius: 12px; text-decoration: none !important; transition: background 0.15s; }
.nw-item:hover { background: rgba(255, 255, 255, 0.07); }
.nw-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; font-size: 0.95rem; color: var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); }
.nw-text { min-width: 0; display: flex; flex-direction: column; }
.nw-title { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nw-prev { font-size: 0.76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
  .w-calendar { order: 2; max-height: none !important; }
  .w-countdown { order: 3; }
  a.w-gmail { order: 0; }
  .mc-cell { height: 38px; }
}

/* =====================================================================
   Käpt'n Klabautz (Maskottchen)
   ===================================================================== */
.home-header { grid-template-columns: auto minmax(300px, 1fr) minmax(300px, 1fr) auto; grid-template-areas: "clock search mascot weather"; }
.home-header .search-wrap { max-width: 620px; width: 100%; justify-self: center; }
.home-header .clock { grid-area: clock; }
.home-header .search-wrap { grid-area: search; grid-column: auto; grid-row: auto; }
.home-header .mascot, .home-header .mascot-empty { grid-area: mascot; }
.home-header .weather, .home-header .weather-empty { grid-area: weather; }

.mascot { display: flex; align-items: flex-end; gap: 4px; min-width: 0; justify-self: center; position: relative; }
.m-stage { position: relative; flex: none; }
.m-figure { display: block; width: 104px; height: 119px; padding: 0; border: 0; background: none; cursor: pointer; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35)); }
.m-svg { width: 100%; height: 100%; overflow: visible; }
.m-svg * { transform-box: fill-box; }
.m-shadow { fill: rgba(0, 0, 0, 0.35); transform-origin: center; animation: m-shadow 4s ease-in-out infinite; }
.m-ship { transform-box: view-box !important; transform-origin: 70px 152px; animation: m-sway 4s ease-in-out infinite; }
.m-eye { transform-origin: center; animation: m-blink 5.5s infinite; }
.m-feather { transform-origin: 0% 100%; animation: m-feather 2.6s ease-in-out infinite; }
.m-phead { transform-origin: 70% 90%; animation: m-parrot 3.2s ease-in-out infinite; }
.m-arm { transform-box: view-box !important; transform-origin: 40px 113px; }
.mascot.talking .m-arm, .m-figure:hover .m-arm { animation: m-wave 0.9s ease-in-out infinite; }
.mascot.talking .m-mouth { transform-origin: center; animation: m-talk 0.25s ease-in-out infinite alternate; }
.mascot.mood-alarm .m-brow { transform-origin: center; transform: rotate(14deg) translateY(1px); }
.mascot.mood-alarm .m-ship { animation-duration: 1.6s; }
.mascot.mood-happy .m-pupil { transform: translateY(-0.6px); }
.mascot.jump .m-ship { animation: m-jump 0.9s cubic-bezier(0.3, 1.5, 0.5, 1), m-sway 4s ease-in-out 0.9s infinite; }
.mascot.cheer .m-ship { animation: m-cheer 1.2s ease-in-out, m-sway 4s ease-in-out 1.2s infinite; }
.mascot.cheer .m-arm { animation: m-wave 0.3s ease-in-out 4; }
.mascot.cheer .m-phead { animation: m-squawk 0.25s ease-in-out 4; }

@keyframes m-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-3px); } }
@keyframes m-shadow { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0.88); opacity: 0.8; } }
@keyframes m-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes m-feather { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(8deg); } }
@keyframes m-parrot { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-14deg); } 80% { transform: rotate(6deg); } 90% { transform: rotate(-6deg); } }
@keyframes m-wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-28deg); } }
@keyframes m-talk { to { transform: scaleY(1.6); } }
@keyframes m-jump { 0% { transform: translateY(0); } 35% { transform: translateY(-26px) rotate(-6deg); } 65% { transform: translateY(0) scaleY(0.92); } 100% { transform: translateY(0); } }
@keyframes m-cheer { 0%, 100% { transform: translateY(0); } 20% { transform: translateY(-22px) rotate(-8deg); } 40% { transform: translateY(0) scaleY(0.94); } 60% { transform: translateY(-16px) rotate(8deg); } 80% { transform: translateY(0); } }
@keyframes m-squawk { 50% { transform: rotate(-22deg) translateY(-2px); } }

.m-bubble {
  position: relative; align-self: center; margin-bottom: 30px; max-width: 300px; min-width: 150px;
  padding: 10px 14px 11px; border-radius: 16px 16px 16px 4px;
  background: rgba(255, 255, 255, 0.92); color: #1b2230; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  font-size: 0.86rem; line-height: 1.4; transform-origin: 0% 100%;
}
.m-bubble::before { content: ""; position: absolute; left: -8px; bottom: 10px; border: 8px solid transparent; border-right-color: rgba(255, 255, 255, 0.92); border-left: 0; }
.m-bubble.pop { animation: m-pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes m-pop { from { transform: scale(0.7); opacity: 0; } }
.mb-name { display: block; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #a51f31; margin-bottom: 2px; }
.mb-text { display: block; min-height: 1.4em; }
.mascot.mood-alarm .m-bubble { background: #fff1f1; }
.mascot.mood-alarm .m-bubble::before { border-right-color: #fff1f1; }
.mascot.mood-alarm .mb-name { color: #d92d3a; }
.mascot.mood-happy .mb-name { color: #12935a; }

.m-coins { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.coin { position: absolute; top: 10%; font-size: 1.2rem; animation: coin 1.6s cubic-bezier(0.2, 0.6, 0.4, 1) forwards; }
@keyframes coin {
  0% { transform: translate(0, 0) scale(0.4) rotate(0); opacity: 0; }
  15% { opacity: 1; transform: translate(calc(var(--dx) * 0.3), -60px) scale(1.1) rotate(calc(var(--rot) * 0.3)); }
  100% { transform: translate(var(--dx), 90px) scale(0.9) rotate(var(--rot)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .m-ship, .m-eye, .m-feather, .m-phead, .m-shadow, .m-arm, .coin { animation: none !important; }
}

/* Kopfzeile responsiv mit Maskottchen */
@media (max-width: 1600px) {
  .home-header { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "clock mascot weather" "search search search"; }
  .home-header .search-wrap { grid-column: auto; grid-row: auto; justify-self: center; width: min(720px, 100%); }
}
@media (max-width: 760px) {
  .home-header { grid-template-columns: 1fr auto; grid-template-areas: "clock weather" "mascot mascot" "search search"; }
  .mascot { justify-self: stretch; }
  .m-figure { width: 78px; height: 89px; }
  .m-bubble { flex: 1; max-width: none; margin-bottom: 18px; font-size: 0.82rem; }
}
