:root{
  --bg:#0b0d12;
  --panel:#151923;
  --panel-hover:#222a3b;
  --text:#f4f7fb;
  --muted:#98a3b6;
  --border:rgba(255,255,255,.08);
  --accent:#4da3ff;
  --good:#64d487;
  --danger:#ff6b6b;
}

*{box-sizing:border-box}

html,body{
  margin:0;
  min-height:100%;
}

body{
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:
    radial-gradient(circle at top left,rgba(77,163,255,.20),transparent 34rem),
    radial-gradient(circle at bottom right,rgba(100,212,135,.12),transparent 30rem),
    var(--bg);
  color:var(--text);
}

.dashboard{
  width:min(1280px,100%);
  min-height:100vh;
  margin:0 auto;
  padding:34px;
  display:flex;
  flex-direction:column;
  gap:22px;
}

.hero{
  display:grid;
  grid-template-columns:1.25fr .75fr;
  gap:20px;
  align-items:stretch;
}

.hero>div,
.weather,
.dialog,
.settings-card{
  border:1px solid var(--border);
  border-radius:28px;
  background:rgba(21,25,35,.90);
  backdrop-filter:blur(8px);
}

.hero>div,
.weather,
.settings-card{
  padding:28px;
}

.clock{
  font-size:clamp(4rem,13vw,9rem);
  line-height:.95;
  font-weight:800;
  letter-spacing:-.06em;
}

.date{
  margin-top:12px;
  color:var(--muted);
  font-size:clamp(1.2rem,2vw,1.7rem);
}

.weather{
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.weather-main{
  display:flex;
  align-items:center;
  gap:18px;
}

.weather-icon{
  font-size:4rem;
}

.temperature{
  font-size:clamp(3rem,7vw,5.6rem);
  font-weight:800;
  letter-spacing:-.05em;
}

.weather-text{
  margin-top:8px;
  font-size:1.25rem;
}

.weather-location{
  margin-top:16px;
  color:var(--muted);
  font-size:1rem;
}

.weather-meta{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:18px;
  color:var(--muted);
}

.weather-meta span,
.statusbar span{
  padding:8px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
}

.section-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.section-head h2{
  margin:0;
  font-size:1.2rem;
  color:var(--muted);
  font-weight:650;
}

.head-actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.subtle-search-form{
  width:260px;
}

.subtle-search-form input{
  width:100%;
  padding:10px 14px;
  border:1px solid var(--border);
  border-radius:999px;
  background:rgba(255,255,255,.045);
  color:var(--muted);
  font-size:.95rem;
  outline:none;
}

.subtle-search-form input:focus{
  color:var(--text);
  border-color:rgba(77,163,255,.45);
  background:rgba(255,255,255,.075);
}

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:18px;
}

.tile{
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-height:150px;
  padding:26px;
  border:1px solid var(--border);
  border-radius:24px;
  background:var(--panel);
  color:var(--text);
  text-decoration:none;
  transition:transform .12s ease,background .12s ease,border-color .12s ease;
}

a.tile:hover,
a.tile:focus,
.tile.clickable:hover,
.tile.clickable:focus{
  transform:translateY(-2px);
  background:var(--panel-hover);
  border-color:rgba(255,255,255,.18);
  outline:none;
}

.clean-icon{
  width:42px;
  height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-bottom:18px;
  color:var(--accent);
}

.clean-icon svg,
.icon-button svg{
  width:100%;
  height:100%;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.radio-tile{
  min-height:unset;
  width:100%;
}

.radio-top{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:18px;
  align-items:center;
}

.radio-top .clean-icon{
  margin:0;
  width:44px;
  height:44px;
}

.radio-top .title,
.radio-top .desc{
  display:block;
}

.radio-controls{
  display:grid;
  grid-template-columns:minmax(150px,220px) 1fr minmax(150px,220px);
  gap:16px;
  align-items:center;
  margin-top:22px;
}

.volume{
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  align-items:center;
  color:var(--muted);
  font-size:.95rem;
}

.volume input{
  width:100%;
}

.delete-fav{
  position:absolute;
  top:12px;
  right:12px;
  width:34px;
  height:34px;
  border:0;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  color:var(--text);
  font-size:1.2rem;
  cursor:pointer;
}

.delete-fav:hover{
  background:rgba(255,107,107,.30);
}

.title{
  font-size:1.45rem;
  font-weight:750;
}

.desc{
  margin-top:5px;
  color:var(--muted);
  font-size:1rem;
  overflow-wrap:anywhere;
}

.button{
  border:0;
  border-radius:999px;
  padding:12px 18px;
  background:var(--accent);
  color:#06111f;
  font-weight:800;
  cursor:pointer;
  text-decoration:none;
  display:inline-block;
}

.button.play{
  height:46px;
}

.button.ghost{
  background:rgba(255,255,255,.08);
  color:var(--text);
}

.dialog{
  width:min(460px,calc(100% - 30px));
  color:var(--text);
  padding:0;
}

.dialog.wide{
  width:min(720px,calc(100% - 30px));
}

.dialog::backdrop{
  background:rgba(0,0,0,.65);
}

.dialog form{
  padding:24px;
}

.dialog h2{
  margin:0 0 18px;
}

.dialog label,
.settings-card label{
  display:grid;
  gap:7px;
  margin:14px 0;
  color:var(--muted);
}

.dialog input,
.settings-card input{
  width:100%;
  padding:13px 14px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#0d1017;
  color:var(--text);
  font-size:1rem;
}

.settings-card input[readonly]{
  opacity:.75;
}

.icon-picker{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(52px,1fr));
  gap:10px;
  margin-top:8px;
}

.icon-button{
  height:52px;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.06);
  color:var(--muted);
  padding:12px;
  cursor:pointer;
}

.icon-button:hover,
.icon-button.selected{
  background:rgba(77,163,255,.18);
  color:var(--accent);
  border-color:rgba(77,163,255,.45);
}

.dialog-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:20px;
}

.dialog-actions.left{
  justify-content:flex-start;
}

.radio-results{
  display:grid;
  gap:10px;
  margin-top:18px;
  max-height:420px;
  overflow:auto;
}

.radio-result{
  display:grid;
  grid-template-columns:1fr auto;
  gap:12px;
  align-items:center;
  padding:14px;
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(255,255,255,.045);
}

.radio-result strong{
  display:block;
}

.radio-result span{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:.9rem;
}

.muted{
  color:var(--muted);
}

.search-overlay{
  position:fixed;
  inset:0;
  z-index:99;
  background:rgba(0,0,0,.62);
  display:grid;
  place-items:center;
  padding:24px;
}

.search-overlay[hidden]{
  display:none;
}

.search-panel{
  width:min(720px,100%);
  border:1px solid var(--border);
  border-radius:28px;
  background:rgba(21,25,35,.96);
  backdrop-filter:blur(12px);
  padding:24px;
}

.search-panel-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:16px;
}

.search-panel-head h2{
  margin:0;
}

.search-results{
  display:grid;
  gap:12px;
}

.search-result{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:14px;
  align-items:center;
  padding:16px;
  border:1px solid var(--border);
  border-radius:18px;
  background:rgba(255,255,255,.05);
  color:var(--text);
  text-decoration:none;
}

.search-result:hover{
  background:rgba(255,255,255,.10);
}

.result-icon{
  margin:0;
  width:34px;
  height:34px;
}

.search-result strong{
  display:block;
}

.search-result span{
  display:block;
  color:var(--muted);
  margin-top:4px;
}

.statusbar{
  margin-top:auto;
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:.95rem;
}

#onlineStatus.online{
  color:var(--good);
}

#onlineStatus.offline{
  color:var(--danger);
}

.settings-page{
  width:min(900px,100%);
}

.settings-card h3{
  margin:18px 0 6px;
}

.settings-card h3:first-child{
  margin-top:0;
}

.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

.settings-actions,
.location-actions{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
  margin-top:16px;
  flex-wrap:wrap;
}

.location-actions{
  justify-content:flex-start;
}

.settings-saved{
  color:var(--good);
  font-weight:800;
  text-align:right;
}

code{
  background:rgba(255,255,255,.08);
  padding:2px 6px;
  border-radius:6px;
}

@media(max-width:820px){
  .dashboard{
    padding:20px;
  }

  .hero,
  .form-grid{
    grid-template-columns:1fr;
  }

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

  .tile{
    min-height:118px;
  }

  .radio-controls{
    grid-template-columns:1fr;
  }

  .head-actions{
    justify-content:stretch;
    width:100%;
  }

  .subtle-search-form{
    width:100%;
  }
}


.button.danger{
  background: rgba(255,107,107,.2);
  color:#ff8f8f;
  border:1px solid rgba(255,107,107,.3);
}
.button.danger:hover{
  background: rgba(255,107,107,.3);
}


.draggable-tile{
  cursor:grab;
}

.draggable-tile:active{
  cursor:grabbing;
}

.draggable-tile.dragging{
  opacity:.45;
  transform:scale(.98);
}

.draggable-tile.drag-over{
  border-color:rgba(77,163,255,.65);
  background:rgba(77,163,255,.12);
}

.drag-handle{
  position:absolute;
  top:14px;
  left:14px;
  color:var(--muted);
  opacity:.55;
  font-size:1rem;
  line-height:1;
  letter-spacing:-.2em;
  user-select:none;
  pointer-events:auto;
}

.draggable-tile:hover .drag-handle{
  opacity:.95;
}


/* Theme controls */
.settings-card select{
  width:100%;
  padding:13px 14px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#0d1017;
  color:var(--text);
  font-size:1rem;
}

.settings-card input[type="color"]{
  height:48px;
  padding:6px;
  cursor:pointer;
}

/* Custom Theme: neutrale, nicht bläuliche Grau-/Schwarzwerte */
body[data-theme="custom"]{
  --bg:#101010;
  --panel:#1b1b1b;
  --panel-hover:#252525;
  --text:#f5f5f5;
  --muted:#9a9a9a;
  --border:rgba(255,255,255,.10);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 16%, transparent), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(255,255,255,.05), transparent 30rem),
    var(--bg);
}

body[data-theme="custom"] .hero>div,
body[data-theme="custom"] .weather,
body[data-theme="custom"] .dialog,
body[data-theme="custom"] .settings-card{
  background:rgba(27,27,27,.92);
}

body[data-theme="custom"] .tile{
  background:var(--panel);
}

body[data-theme="custom"] .tile:hover,
body[data-theme="custom"] .tile:focus,
body[data-theme="custom"] .tile.clickable:hover,
body[data-theme="custom"] .tile.clickable:focus{
  background:var(--panel-hover);
}

body[data-theme="custom"] .weather-meta span,
body[data-theme="custom"] .statusbar span{
  background:rgba(255,255,255,.055);
}

body[data-theme="custom"] .subtle-search-form input,
body[data-theme="custom"] .dialog input,
body[data-theme="custom"] .settings-card input,
body[data-theme="custom"] .settings-card select{
  background:#151515;
}

body[data-theme="custom"] .button{
  background:var(--accent);
}

body[data-theme="custom"] .button.ghost{
  background:rgba(255,255,255,.075);
  color:var(--text);
}

body[data-theme="custom"] .clean-icon{
  color:var(--accent);
}

body[data-theme="custom"] .icon-button:hover,
body[data-theme="custom"] .icon-button.selected{
  background:color-mix(in srgb, var(--accent) 18%, transparent);
  color:var(--accent);
  border-color:color-mix(in srgb, var(--accent) 50%, transparent);
}


/* Theme-aware range slider */
input[type="range"]{
  accent-color:var(--accent);
}

/* Chromium/WebKit range styling */
input[type="range"]::-webkit-slider-runnable-track{
  height:6px;
  border-radius:999px;
  background:linear-gradient(90deg, var(--accent), var(--accent));
}

input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:18px;
  height:18px;
  margin-top:-6px;
  border-radius:999px;
  background:var(--accent);
  border:2px solid var(--text);
}

input[type="range"]{
  -webkit-appearance:none;
  appearance:none;
  height:22px;
  background:transparent;
}

/* Light Mode: blaues Akzentdesign auf hellen Flächen */
body[data-theme="light"]{
  --bg:#f4f6f8;
  --panel:#ffffff;
  --panel-hover:#f0f3f7;
  --text:#121417;
  --muted:#657080;
  --border:rgba(18,20,23,.10);
  --good:#187a3b;
  --danger:#c43131;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 14%, transparent), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(18,20,23,.045), transparent 30rem),
    var(--bg);
}

body[data-theme="light"] .hero>div,
body[data-theme="light"] .weather,
body[data-theme="light"] .dialog,
body[data-theme="light"] .settings-card{
  background:rgba(255,255,255,.92);
}

body[data-theme="light"] .tile{
  background:var(--panel);
  box-shadow:0 10px 28px rgba(18,20,23,.06);
}

body[data-theme="light"] .tile:hover,
body[data-theme="light"] .tile:focus,
body[data-theme="light"] .tile.clickable:hover,
body[data-theme="light"] .tile.clickable:focus{
  background:var(--panel-hover);
}

body[data-theme="light"] .weather-meta span,
body[data-theme="light"] .statusbar span{
  background:rgba(18,20,23,.055);
}

body[data-theme="light"] .subtle-search-form input,
body[data-theme="light"] .dialog input,
body[data-theme="light"] .settings-card input,
body[data-theme="light"] .settings-card select{
  background:#ffffff;
  color:var(--text);
}

body[data-theme="light"] .button{
  background:var(--accent);
}

body[data-theme="light"] .button.ghost{
  background:rgba(18,20,23,.07);
  color:var(--text);
}

body[data-theme="light"] .search-panel{
  background:rgba(255,255,255,.96);
}

body[data-theme="light"] .search-result,
body[data-theme="light"] .radio-result{
  background:rgba(18,20,23,.04);
}

body[data-theme="light"] .search-result:hover{
  background:rgba(18,20,23,.07);
}

body[data-theme="light"] input[type="range"]::-webkit-slider-thumb{
  border-color:#ffffff;
}


body[data-theme="custom"] input[type="range"]::-webkit-slider-thumb{
  border-color:var(--text);
}


.news-tile{
  min-height:unset;
  width:100%;
}

.news-head{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:18px;
  align-items:center;
}

.news-head .clean-icon{
  margin:0;
  width:44px;
  height:44px;
}

.news-head .title,
.news-head .desc{
  display:block;
}

.news-list{
  display:grid;
  gap:10px;
  margin-top:18px;
}

.news-item{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:12px;
  align-items:center;
  padding:12px 14px;
  border-radius:16px;
  background:rgba(255,255,255,.045);
  color:var(--text);
  text-decoration:none;
}

.news-item:hover{
  background:rgba(255,255,255,.075);
}

.news-time{
  color:var(--muted);
  font-variant-numeric:tabular-nums;
  font-size:.92rem;
}

.news-item-title{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

body[data-theme="light"] .news-item{
  background:rgba(18,20,23,.04);
}

body[data-theme="light"] .news-item:hover{
  background:rgba(18,20,23,.07);
}


.password-overlay{
  position:fixed;
  inset:0;
  z-index:999;
  display:grid;
  place-items:center;
  padding:24px;
  background:
    radial-gradient(circle at top left,rgba(77,163,255,.18),transparent 28rem),
    rgba(0,0,0,.82);
  backdrop-filter:blur(12px);
  transition:opacity .18s ease, transform .18s ease;
}

.password-overlay.unlocked{
  opacity:0;
  pointer-events:none;
}

.password-card{
  width:min(420px,100%);
  padding:28px;
  border:1px solid var(--border);
  border-radius:28px;
  background:rgba(21,25,35,.96);
  color:var(--text);
  box-shadow:0 24px 80px rgba(0,0,0,.45);
}

.password-card h2{
  margin:0 0 8px;
}

.password-card input{
  width:100%;
  margin:18px 0 12px;
  padding:15px 16px;
  border:1px solid var(--border);
  border-radius:16px;
  background:#0d1017;
  color:var(--text);
  font-size:1.1rem;
}

.password-card .button{
  width:100%;
  text-align:center;
  margin-top:10px;
}

.password-error{
  color:var(--danger);
  font-weight:800;
  margin-bottom:8px;
}

body[data-theme="light"] .password-overlay{
  background:
    radial-gradient(circle at top left,rgba(77,163,255,.16),transparent 28rem),
    rgba(244,246,248,.86);
}

body[data-theme="light"] .password-card{
  background:rgba(255,255,255,.96);
}

body[data-theme="light"] .password-card input{
  background:#fff;
  color:var(--text);
}

body[data-theme="custom"] .password-card{
  background:rgba(27,27,27,.96);
}

body[data-theme="custom"] .password-card input{
  background:#151515;
}
