:root {
    --gray: #6b7280;
    --text: #302F2B;
    --white: #fff;
    --bg: #ffffff8f;
    --muted: #94a3b8;
    --divider: #f1f5f9;
    --input-border: #e2e8f0;
    --page-bg: #f3f6fa;

    --main: #e2824a17;
    --main-soft: #e2824a0a;
    --main-hard: #e2824a54;
    --main-bg: linear-gradient(135deg, rgba(249, 115, 22, .08) 0%, rgba(249, 115, 22, .02) 100%);
    --border-main: 1px solid #e2824a54;
    --main-solid: #e2824a; /* massiv udgave af hovedfarven - til ting der ikke skal være gennemsigtige, fx Lumis avatar */

    --radius: 25px;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    --gab: 20px;
}

/* MØRKT TEMA - slås automatisk til om aftenen/natten af js/app.js (se updateTheme) */
html.dark {
    --gray: #9aa0ac;
    --text: #f1f0ec;
    --white: #24232b;
    --bg: #2c2b34cc;
    --muted: #9aa0ac;
    --divider: #383745;
    --input-border: #3f3e4d;
    --page-bg: #16151b;

    --main: #e2824a26;
    --main-soft: #e2824a14;
    --main-hard: #e2824a70;
    --main-bg: linear-gradient(135deg, rgba(226, 130, 74, .16) 0%, rgba(226, 130, 74, .04) 100%);
    --border-main: 1px solid #e2824a54;

    --shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
html.dark body{
  background: radial-gradient(circle at top left, rgb(226 130 74 / 12%), transparent 30%), radial-gradient(circle at bottom right, rgb(226 130 74 / 12%), transparent 30%), var(--page-bg);
}

*{
  box-sizing:border-box;
  margin:0;
  padding:0;
}
input[type="checkbox"]{
  accent-color: var(--main-solid);
}

html{
  height: 100%;
  overscroll-behavior: none; /* ingen "pull to refresh"/elastik-bounce på touch */
}
body{
  font-family:Inter,sans-serif;
  background: radial-gradient(circle at top left, rgb(226 130 74 / 25%), transparent 30%), radial-gradient(circle at bottom right, rgb(226 130 74 / 25%), transparent 30%), var(--page-bg);
  color: var(--text);
  padding: 20px;
  height: 100vh;
  overflow: hidden; /* siden selv scroller ikke - kun de enkelte kort gør, hvis nødvendigt */
  transition: background .3s ease, color .3s ease;
  overscroll-behavior: none;
  -webkit-touch-callout: none;  /* ingen "gem billede"/kopiér-menu ved langt tryk (iOS) */
  -webkit-user-select: none;    /* ingen tekstmarkering ved uheld på en fast skærm */
  user-select: none;
}
input,
textarea{
  -webkit-user-select: text; /* ...men man skal selvfølgelig kunne skrive/markere i selve formularfelter */
  user-select: text;
  -webkit-touch-callout: default;
}


.screen{
  max-width: 100%;
  height: 100%;
  margin: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

svg{
  width:40px;
  height:30px;
  vertical-align:-7px;
}
.hero svg{
  width:50px;
  height:50px;
  vertical-align:-15px;
  stroke-width: 1px;
}

.hero-main{
  display: flex;
  align-items: center;
  gap: 24px;
}
.analog-clock{
  width: 100px !important;
  height: 100px !important;
  flex-shrink: 0;
  color: var(--text);
}
.analog-clock circle,
.analog-clock line{
  vector-effect: non-scaling-stroke;
}

/* HERO */
.hero{
  background: var(--bg);
  border-radius: var(--radius);
  margin-top: 6px;
  padding: 20px 25px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--gab);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.hero h1{
  font-size: 38px;
}
.hero-status{
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 4px;
}
.hero-status-dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.hero-status-ok{
  color: #059669;
}
.hero-status-ok .hero-status-dot{
  background: #22c55e;
  animation: hero-status-pulse-green 2s ease-in-out infinite;
}
.hero-status-error{
  color: #b91c1c;
}
.hero-status-error .hero-status-dot{
  background: #dc2626;
  animation: hero-status-pulse-red 1.4s ease-in-out infinite;
}
@keyframes hero-status-pulse-green{
  0%, 100%{ box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); }
  50%{ box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}
@keyframes hero-status-pulse-red{
  0%, 100%{ box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); }
  50%{ box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}
.hero p{
  color: var(--gray);
  margin-top: 0;
}
.clock{
  font-weight: 600;
  font-variant-numeric:tabular-nums;
}
.overview{
  display: flex;
  gap: var(--gab);
  flex-wrap: wrap;
}
.stat{
  background: var(--main-soft);
  border: var(--border-main);
  padding: 20px 30px;
  border-radius: 18px;
  text-align: center;
}
.stat span{
  font-size: 13px;
  color: var(--text);
  display: block;
}
.stat strong{
  font-size: 30px;
}

/* TOP-ACTIONS - fuldskærm/log ud, fast i øverste højre hjørne, uden for alle kort */
.top-actions{
  position: fixed;
  top: 3px;
  right: 40px;
  display: flex;
  gap: 8px;
  z-index: 1000;
}
.icon-action-btn{
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  text-decoration: none;
  cursor: pointer;
}
.icon-action-btn svg{
  width: 18px;
  height: 18px;
}
.icon-action-btn:hover{
  color: var(--text);
  background: var(--main-soft);
}
.icon-action-btn.active{
  background: var(--main-hard);
  color: #fff;
}

/* ADMIN-SKUFFE */
.admin-overlay{
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 20, .35);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.admin-overlay.open{
  opacity: 1;
  pointer-events: auto;
}
.admin-drawer{
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 420px;
  max-width: 90vw;
  background: var(--white);
  box-shadow: -20px 0 50px rgba(0, 0, 0, .2);
  padding: 24px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.admin-overlay.open .admin-drawer{
  transform: translateX(0);
}
.admin-drawer-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.admin-drawer-header h2{
  margin-bottom: 0;
}
#admin-drawer-close{
  background: transparent;
  border: 0;
  font-size: 22px;
  color: var(--gray);
  cursor: pointer;
  padding: 4px 6px;
}
.admin-tabs{
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--divider);
}
.admin-tab{
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 10px 6px;
  font-size: 13px;
  color: var(--gray);
  border-bottom: 2px solid transparent;
  min-height: auto;
}
.admin-tab.active{
  color: var(--text);
  border-bottom-color: var(--main-solid);
  font-weight: 600;
}
.admin-tab-panel[hidden]{
  display: none;
}
.admin-hint{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}
.admin-list{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.admin-row{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--divider);
  border-radius: 12px;
  font-size: 13px;
}
.admin-row-drag{
  cursor: grab;
  color: var(--muted);
}
.admin-row-drag:active{
  cursor: grabbing;
}
.admin-row-name{
  flex: 1;
  font-weight: 600;
}
.admin-row select,
.admin-row input[type="number"]{
  width: 56px;
  padding: 6px 4px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  font-family: inherit;
  font-size: 13px;
}
.admin-form{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.admin-form label{
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--text);
}
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"]{
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  font-family: inherit;
  font-size: 13px;
}
.admin-form input[type="color"]{
  width: 60px;
  height: 34px;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
}
.admin-status{
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 10px;
}
.admin-status.success{
  background: #ecfdf5;
  color: #059669;
}
.admin-status.error{
  background: #fef2f2;
  color: #b91c1c;
}
.admin-account-delete,
.admin-row-delete{
  background: transparent;
  border: 0;
  color: var(--muted);
  min-width: 32px;
  min-height: 32px;
  padding: 4px;
}
.admin-photos-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.admin-photo-item{
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
}
.admin-photo-item img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.admin-photo-delete{
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.admin-photo-delete svg{
  width: 14px;
  height: 14px;
}
#admin-errors-clear{
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
}
#admin-errors-clear svg{
  width: 14px;
  height: 14px;
  vertical-align: 0;
}
.admin-account-delete:hover,
.admin-row-delete:hover{
  color: #dc2626;
}
.admin-account-delete svg,
.admin-row-delete svg{
  width: 16px;
  height: 16px;
}

.grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr; /* deler den resterende højde ligeligt mellem de rækker der rent faktisk findes */
  gap: var(--gab);
  flex: 1;
  min-height: 0; /* afgørende for at gridet kan fordele højden korrekt i stedet for at vokse ud af skærmen */
}
.card{
  background: var(--bg);
  padding: 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* gamle Edge/IE */
}
.card::-webkit-scrollbar{
  display: none; /* Chrome/Safari/nyere Edge */
}
.g1{ grid-column:span 1; }
.g2{ grid-column:span 2; }
.g3{ grid-column:span 3; }

h2{
  font-size: 25px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: capitalize;
  font-weight: 100;
}

button{
  border: 0;
  background: var(--main);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 15px;
  transition: background .15s ease;
  min-height: 40px;
  min-width: 40px;
  touch-action: manipulation; /* fjerner dobbelt-tryk-zoom og den lille tryk-forsinkelse på touch */
  border: 1px solid var(--main-hard);
}
button:hover{
  background: var(--main-hard);
  color:  var(--white);
  border: var(--border-main);
}

/* CALENDAR */
.calendar-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.calendar-header > div{
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.sync-now-btn svg{
  width: 18px;
  height: 18px;
  vertical-align: -3px;
}
.sync-now-btn:disabled{
  opacity: .6;
  cursor: not-allowed;
}
.spinning{
  animation: spin 1s linear infinite;
}
@keyframes spin{
  to{ transform:rotate(360deg); }
}
.week,
.days{
  display: grid;
  grid-template-columns:repeat(7,1fr);
  gap: 10px;
  text-align: center;
}
.week{
  color: var(--muted);
  margin-bottom: 15px;
  font-size: 20px;
}
.days span{
  min-height: 45px;
  padding-top: 12px;
  border-radius: 12px;
  position: relative;
  font-size: 20px;
}
.days span[data-date]{
  cursor: pointer;
  transition: background .15s ease;
}
.days span[data-date]:hover{
  background: var(--main-soft);
}
.today{
  background: var(--main);
  color: var(--text);
  font-weight: 600;
}
.selected{
  box-shadow: inset 0 0 0 2px var(--main-hard);
}
.today.selected{
  box-shadow: none; /* i dag + valgt = bare den fyldte blå baggrund, ingen dobbelt-ramme */
}
.dots{
  display: flex;
  justify-content: center;
  gap: 3px;
  margin-top: 2px;
}
.dot{
  width: 6px;
  height: 6px;
  background: #2563eb;
  border-radius: 50%;
  display: inline-block;
}

/* AGENDA */
.agenda-card h2{
  margin-bottom: 20px;
}
.agenda-empty{
  color: var(--muted);
  font-size: 14px;
}
.appointment{
  display: flex;
  gap: var(--gab);
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--divider);
}
.appointment section{
  flex: 1;
}
.appointment-actions{
  display: flex;
  gap: 4px;
}
.appointment-actions button{
  background: transparent;
  border: 0;
  padding: 8px;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
}
.appointment-actions button:hover{
  color: var(--text);
}
.appointment-actions svg{
  width: 15px;
  height: 15px;
  vertical-align: 0;
}
.appointment:last-child{
  border-bottom: 0;
  padding-bottom: 0;
}
.appointment > div{
  min-width: 52px;
  font-weight: 700;
  font-size: 14px;
  color: var(--main-soft);
}
.upcoming-time{
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.appointment section strong{
  display: block;
  font-size: 15px;
}
.appointment section p{
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

/* TODO */
.todo-section + .todo-section{
  margin-top: 22px;
}

.todo-item{
  display: flex;
  align-items: center;
  gap: var(--gab);
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
}
.todo-item:last-child{
  border-bottom: 0;
}
.todo-checkbox{
  width: 18px;
  height: 18px;
  accent-color: var(--main-solid);
  cursor: pointer;
  flex-shrink: 0;
}
.todo-item.todo-completing span{
  text-decoration: line-through;
  opacity: .5;
  transition: opacity .3s ease;
}
.todo-empty{
  color: var(--muted);
  font-size: 14px;
}
.todo-error{
  color: #dc2626;
  font-size: 14px;
}
.add-todo-form{
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.add-todo-form input{
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  font-size: 14px;
  font-family: inherit;
}
.add-todo-form button{
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.add-todo-form button svg{
  width: 18px;
  height: 18px;
}

/* WEATHER */
.weather-main{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--gab);
  margin: 6px 0 20px;
}
.weather-main .icon svg{
  width: 165px;
  height: 165px;
  color: var(--main-hard);
  stroke-width: 1px;
}
.weather-main h1{
  font-size: 100px;
  line-height: 1;
  font-weight: 100;
}
.weather-main p{
  color: var(--gray);
  margin-top: 4px;
}
.weather-info{
  display: grid;
  gap: 14px;
  margin-left: auto;
  margin-right: 18px;
}
.weather-info > div{
  text-align: center;
}
.weather-info span{
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.weather-info strong{
  font-size: 16px;
  font-weight: normal;
}
.weather-error{
  color: #dc2626;
  font-size: 14px;
}
.dmi-warnings{
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dmi-warning{
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
}
.dmi-warning svg{
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}
.dmi-warning-yellow{
  background: #fefce8;
  border: 1px solid #fde68a;
  color: #92660a;
}
.dmi-warning-orange{
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}
.dmi-warning-red{
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.electricity-main{
  display: flex;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 8px;
}
.electricity-chart{
  flex: 1;
  min-width: 0;
}
.electricity-status{
  flex-shrink: 0;
  width: 130px;
  padding: 12px;
  border-radius: 16px;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.electricity-status strong{
  display: block;
  font-size: 23px;
  margin-bottom: 10px;
  font-weight: 100;
}
.electricity-status p{
  font-size: 18px;
  font-weight: 700;
}
.electricity-cheap{
  background: #ecfdf517;
  color: #059618;
}
.electricity-medium{
  background: #fefce8;
  color: #92660a;
}
.electricity-expensive{
  background: #b91c1c63;
  color: var(--text);
}
.electricity-hint{
  font-size: 13px;
  color: var(--muted);
}
.electricity-range-btn{
  width: auto;
  min-width: auto;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 15px !important;
}
.electricity-range-btn.active{
  background: var(--main-hard);
  color: #fff;
}
.electricity-chart svg{
  width: 100%;
  height: auto;
  font-family: inherit;
}
.forecast-label{
  font-size: 10px;
  font-weight: normal;
  color: var(--muted);
  text-transform: capitalize;
  letter-spacing: .03em;
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
  margin-bottom: 6px;
}
.weather-forecast{
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.weather-forecast-day{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.weather-forecast-weekday{
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.weather-forecast-day svg{
  width: 40px;
  height: 40px;
  color: var(--main-hard);
}
.weather-forecast-temp{
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.weather-forecast-min{
  font-weight: 400;
  color: var(--muted);
}

.moon-forecast{
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.moon-forecast-day{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.moon-icon{
  position: relative;
  display: inline-block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--divider);
  border: none;
  color: var(--main-hard);
}
.moon-icon-lit{
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
}
.moon-icon-shadow{
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--bg);
  transform: translateX(calc(var(--dir) * var(--k) * -100%));
}
.aurora-hint{
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(34, 197, 94, .12), rgba(59, 130, 246, .12));
  font-size: 13px;
  color: var(--text);
}

/* HOUSEHOLD */
.household{
  display: flex;
  flex-direction: column;
  padding-bottom: 20px;
}
.household .card-title{
  margin-bottom: 20px;
}
.avatar{
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  z-index: 2;
}
.avatar svg{
  width: 26px;
  height: 26px;
  vertical-align: 0;
}
.avatar img,
.avatar video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none; /* forhindrer museover-kontroller (fx billede-i-billede-ikonet) i browseren */
}
.avatar video::-webkit-media-controls,
.avatar video::-webkit-media-controls-enclosure,
.avatar video::-webkit-media-controls-panel{
  display: none !important;
  opacity: 0 !important;
}
.avatar.nikolaj{ background: linear-gradient(135deg, #2563eb, #60a5fa); }
.avatar.maja{ background: linear-gradient(135deg, #ec4899, #f472b6); }
.avatar.lumi{ background: linear-gradient(135deg, var(--main-solid), #f4a875); }

.household-widgets{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
  margin-bottom: 16px;
}
.household-widget-slot{
  min-height: 0;
}
.mini-widget{
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
}
.mini-empty{
  border: 1px dashed var(--divider);
  background: transparent;
}
.mini-electricity{
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  text-align: center;
}
.mini-electricity-graph{
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: .35;
}
.mini-electricity-graph svg{
  display: block;
  position: absolute;
  width: 100% !important;
  height: 100% !important;
}
.mini-electricity-content{
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  color: var(--text) !important;
}
.mini-electricity svg{
  width: 25px;
  height: 25px;
  flex-shrink: 0;
}
.mini-electricity strong{
  display: block;
  font-size: 25px;
  line-height: 1.2;
}
.mini-electricity span{
  font-size: 15px;
  font-weight: normal;
}
.mini-electricity-cheap{
  background: #ecfdf500;
  color: #059618;
}
.mini-electricity-medium{
  background: #fefce8;
  color: #92660a;
}
.mini-electricity-expensive{
  background: #e2824a00;
  color: #b91c1c;
}
.mini-photoshow{
  background: var(--divider);
}
.mini-nowplaying{
  position: relative;
  background: var(--divider);
}
.mini-nowplaying-cover{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mini-nowplaying-cover[hidden]{
  display: none;
}
.mini-nowplaying-empty{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.mini-nowplaying-empty[hidden]{
  display: none;
}
.mini-nowplaying-empty svg{
  width: 24px;
  height: 24px;
}
.household-photo{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: opacity .6s ease;
}

.household-spotify{
  margin-top: auto;
  padding-top: 10px;
  border-top: none;
}
.agenda-upcoming{
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--divider);
}
.agenda-upcoming h2{
  margin-bottom: 25px;
}
/* TO-DO KORT: faneblade (lille og diskret) */
.todo-tabs{
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--divider);
}
.todo-tab{
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 6px;
  margin-top: -15px;
  font-size: 15px;
  color: var(--muted);
  min-height: auto;
  min-width: auto;
}
.todo-tab:hover{
  background: var(--bg) !important;
  border: none !important;
}
.todo-tab svg{
  width: 15px;
  height: 15px;
}
.todo-tab.active{
  color: var(--text);
  border-bottom-color: var(--main-solid);
  font-weight: 600;
}
.todo-tab-panel[hidden]{
  display: none;
}

/* LUMI - stemmestyring */
.lumi-mic-btn{
  position: absolute;
  right: 75px;
  bottom: -15px;
  z-index: 3;
  width: 50px;
  height: 50px;
  min-width: 50px;
  border-radius: 50%;
  background: var(--main-solid);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  transition: transform .15s ease;
}
.lumi-mic-btn:hover{
  transform: scale(1.05);
}
.lumi-mic-btn svg{
  width: 22px;
  height: 22px;
}
.lumi-mic-btn.active{
  background: #dc2626;
  color: #fff;
  animation: lumi-mic-pulse 1.4s ease-in-out infinite;
}
@keyframes lumi-mic-pulse{
  0%, 100%{ box-shadow: 0 0 0 0 rgba(220, 38, 38, .4); }
  50%{ box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

.lumi-tagline{
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray);
  text-align: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--divider);
}
.lumi-acronym{
  color: var(--text);
  font-weight: 700;
}
.lumi-intro{
  font-size: 13px;
  color: var(--gray);
  font-style: italic;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--divider);
}
.lumi-message p{
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
}
.lumi-message p + p{
  margin-top: 10px;
}

/* LUMI - flydende chat-widget nederst i højre hjørne */
.lumi-widget{
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 14px;
}
.lumi-fab-wrapper{
  position: relative;
  width: 100px;
  height: 100px;
}
.lumi-pulse{
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(226, 130, 74, .35);
  animation: lumi-pulse 2.4s ease-out infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes lumi-pulse{
  0%{ transform: scale(1); opacity: .6; }
  100%{ transform: scale(1.7); opacity: 0; }
}
.lumi-fab{
  position: relative;
  width: 100px;
  height: 100px;
  border: 0;
  cursor: pointer;
  box-shadow: 0 0 37px 9px rgba(226, 130, 74, .45);
  transition: transform .15s ease;
}
.lumi-fab:hover{
  transform: scale(1.05);
}
.lumi-fab svg{
  width: 42px;
  height: 42px;
  color: #fff;
}

.lumi-bubble{
  position: absolute;
  bottom: 100px;
  right: 80px;
  width: 330px;
  z-index: 5;
  background: var(--white);
  border-radius: 18px;
  border-bottom-right-radius: 4px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, .15);
  padding: 14px 16px;
  opacity: 0;
  transform: translateY(10px) scale(.96);
  transition: opacity .2s ease, transform .2s ease;
  cursor: pointer;
  border: 1px solid var(--main-hard);
}
.lumi-bubble.show{
  opacity: 1;
  transform: translateY(0) scale(1);
}
.lumi-bubble p{
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
#lumi-bubble-content{
  margin-top: 10px;
  display: flex;
  justify-content: center;
}
#lumi-bubble-content:empty{
  display: none;
  margin: 0;
}

.lumi-panel{
  position: absolute;
  bottom: 114px;
  right: -8px;
  width: 530px;
  z-index: 2;
  max-width: calc(100vw - 56px);
  max-height: 70vh;
  overflow-y: auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 25px 60px rgba(0, 0, 0, .18);
  padding: 22px;
  opacity: 0;
  transform: translateY(14px) scale(.96);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  border: 1px solid var(--main-hard);
}
.lumi-panel.open{
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.lumi-panel-header{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.lumi-panel-header .avatar{
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.lumi-panel-header h2{
  font-size: 25px;
  margin-bottom: 0;
}
.lumi-subtitle{
  font-size: 12px;
  color: var(--gray);
  margin-top: 2px;
}
.lumi-close{
  margin-left: auto;
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--gray);
  cursor: pointer;
  padding: 4px 6px;
}
.lumi-close:hover{
  color: var(--text);
}
.lumi-alerts{
  margin-bottom: 4px;
}
.lumi-alerts:empty{
  display: none;
}
.lumi-alert{
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c !important;
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.lumi-alert span{
  flex: 1;
}
.lumi-alert-dismiss{
  background: transparent;
  border: 0;
  color: #b91c1c;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  min-height: auto;
  min-width: auto;
}
.lumi-badge{
  position: absolute;
  top: -2px;
  right: -2px;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  background: #ff5656f7;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--page-bg);
  cursor: pointer;
  z-index: 2;
  transition: border-color .15s ease;
}
.lumi-badge:hover{
  border-color: #ff5656f7;
}
.lumi-badge[hidden]{
  display: none;
}
.lumi-widget.alert .lumi-pulse{
  background: rgba(220, 38, 38, .4);
}
.lumi-widget.alert .lumi-fab{
  box-shadow: 0 0 37px 9px rgba(220, 38, 38, .45);
}

/* LOGIN */
.login-screen{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card{
  width: 100%;
  max-width: 360px;
  height: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-card h1{
  font-size: 26px;
  text-align: center;
}
.login-subtitle{
  color: var(--gray);
  text-align: center;
  margin-top: -6px;
  margin-bottom: 4px;
  font-size: 14px;
}
.login-card label{
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
}
.login-card input{
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  font-size: 15px;
  font-family: inherit;
}
.login-card button{
  margin-top: 6px;
  background: var(--main);
  padding: 12px;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius);
}
.login-error{
  color: #dc2626;
  font-size: 13px;
  text-align: center;
}
.login-card input:disabled,
.login-card button:disabled{
  opacity: .5;
  cursor: not-allowed;
}

/* OPRET BEGIVENHED */
.add-event-btn svg{
  width: 18px;
  height: 18px;
  vertical-align: -3px;
}
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 20, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.modal-overlay.open{
  opacity: 1;
  pointer-events: auto;
}
.modal-card{
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 25px 60px rgba(0, 0, 0, .25);
  padding: 24px;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(12px) scale(.97);
  transition: transform .15s ease;
}
.modal-overlay.open .modal-card{
  transform: translateY(0) scale(1);
}
.modal-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.modal-header h2{
  font-size: 18px;
  margin-bottom: 0;
}
.modal-close{
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--gray);
  cursor: pointer;
  padding: 4px 6px;
}
.modal-close:hover{
  color: var(--text);
}
#create-event-form{
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#create-event-form label{
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
}
#create-event-form input[type="text"],
#create-event-form input[type="date"],
#create-event-form input[type="time"],
#create-event-form select{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  font-size: 14px;
  font-family: inherit;
}
.checkbox-row{
  display: block;
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}
.time-row{
  display: flex;
  gap: 12px;
}
.time-row label{
  flex: 1;
}
.modal-submit{
  margin-top: 4px;
  background: var(--main);
  color: #fff;
  padding: 12px;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius);
}
.modal-error{
  color: #dc2626;
  font-size: 13px;
}

/* SPOTIFY */
.spotify-empty{
  color: var(--muted);
  font-size: 14px;
}
.spotify-connect-btn{
  display: inline-block;
  margin-top: 12px;
  text-decoration: none;
  text-align: center;
}
.spotify-now{
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}
.spotify-cover{
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}
.spotify-cover-empty{
  background: var(--divider);
}
.spotify-meta{
  min-width: 0;
}
.spotify-meta strong{
  display: block;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotify-meta p{
  color: var(--gray);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.spotify-device{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.spotify-device svg{
  width: 12px;
  height: 12px;
}
.spotify-controls{
  display: flex;
  align-items: center;
  gap: 10px;
}
.spotify-btn{
  background: transparent;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--main);
  color: var(--text);
  border: var(--border-main);
  
}
.spotify-btn:hover{
  background: var(--main-hard);
  color:  var(--white);
  border: var(--border-main);
}
.spotify-play-pause{
  background: var(--main);
  color: var(--text);
  border: var(--border-main);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  min-width: 44px;
}
.spotify-play-pause:hover{
  background: var(--main-hard);
  color:  var(--white);
  border: var(--border-main);
  opacity: .85;
}
.spotify-volume{
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: transparent;
  cursor: pointer;
}

/* Track (selve stregen) */
.spotify-volume::-webkit-slider-runnable-track{
  height: 6px;
  border-radius: 999px;
  background: var(--main);
  border: var(--border-main);
}
.spotify-volume::-moz-range-track{
  height: 6px;
  border-radius: 999px;
  background: var(--main);
  border: var(--border-main);
}

/* Thumb (håndtaget man trækker i) */
.spotify-volume::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--main-hard);
  border: 2px solid var(--white);
  margin-top: -6px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.spotify-volume::-moz-range-thumb{
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--main-hard);
  border: 2px solid var(--white);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

/* Hover - samme vending som knapperne: mørk baggrund, lys detalje */
.spotify-volume:hover::-webkit-slider-runnable-track{
  background: var(--main-hard);
}
.spotify-volume:hover::-moz-range-track{
  background: var(--main-hard);
}
.spotify-volume:hover::-webkit-slider-thumb{
  background: var(--white);
  border-color: var(--main-hard);
}
.spotify-volume:hover::-moz-range-thumb{
  background: var(--white);
  border-color: var(--main-hard);
}
.spotify-control-error{
  margin-top: 10px;
  font-size: 12px;
  color: #dc2626;
}

.spotify-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}
.spotify-header h2{
  margin-bottom: 0;
}
.spotify-header-actions{
  display: flex;
  gap: 4px;
}
.spotify-icon-btn{
  background: transparent;
  min-width: 36px;
  min-height: 36px;
  padding: 6px;
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--main-hard); 
  border-radius: 100%;
}
.spotify-icon-btn:hover{
  background: var(--main-soft);
  color: var(--text);
}
#platform-toggle-btn{
  width: auto;
  min-width: auto;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
}
#spotify-only-actions,
#sonos-only-actions{
  display: flex;
  gap: 4px;
}
#spotify-only-actions[hidden],
#sonos-only-actions[hidden]{
  display: none;
}
.spotify-icon-btn svg{
  width: 18px;
  height: 18px;
}
.spotify-panel{
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 16px;
  border: 1px solid var(--divider);
  border-radius: 14px;
  padding: 6px;
}
.spotify-panel-item{
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border-radius: 10px;
  padding: 8px;
  text-align: left;
  font-size: 13px;
  color: var(--text);
  min-height: 40px;
}
.spotify-panel-item:hover{
  background: var(--main-soft);
}
.spotify-panel-item img,
.spotify-panel-thumb-empty{
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--divider);
}
.spotify-panel-item svg{
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--muted);
}
.spotify-panel-item span{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* RESPONSIVT - tablet og derunder */
@media (max-width: 900px){
  html{ height: auto; }
  body{ padding:20px; height: auto; overflow: visible; }
  .screen{ height: auto; }
  .grid{ grid-template-columns:1fr; grid-auto-rows: auto; flex: none; gap: 16px; }
  .g1, .g2, .g3{ grid-column:span 1; }

  /* Fuld højde til indholdet i stedet for en fast, evt. for lille boks der
     kræver intern scroll - "Storm Hjem" er en undtagelse, da dens 4 små felter
     og diasshow har brug for en vis mindste-højde for at se ordentlige ud. */
  .card{ height: auto; min-height: 200px; overflow-y: visible; }
  .household{ min-height: 460px; }

  .hero{ flex-direction:column; align-items:flex-start; padding: 20px; }
  .hero-main{ width: 100%; }
  .overview{ width: 100%; }
  .stat{ flex: 1; padding: 14px 16px; }
  .stat strong{ font-size: 22px; }

  .top-actions{ right: 16px; gap: 6px; }
  .icon-action-btn{ width: 36px; height: 36px; min-width: 36px; min-height: 36px; }

  .lumi-widget{ bottom: 16px; right: 16px; }
  .lumi-panel{ width: calc(100vw - 32px); right: -16px; }
  .lumi-bubble{ width: calc(100vw - 120px); right: 60px; }

  .household-widgets{ min-height: 220px; }
  .weather-forecast, .moon-forecast{ gap: 2px; }
  .weather-forecast-weekday{ font-size: 9px; }
}

/* RESPONSIVT - smalle telefoner */
@media (max-width: 600px){
  .hero h1{ font-size: 28px; }
  .analog-clock{ width: 70px !important; height: 70px !important; }
  .hero-main{ gap: 14px; }

  .top-actions{ top: 6px; right: 8px; gap: 4px; }
  .icon-action-btn{ width: 34px; height: 34px; min-width: 34px; min-height: 34px; }
  .icon-action-btn svg{ width: 16px; height: 16px; }

  .overview{ gap: 8px; }
  .stat{ padding: 10px 12px; }
  .stat strong{ font-size: 18px; }
  .stat span{ font-size: 12px; }

  .weather-main h1{ font-size: 70px; }
  .weather-main .icon svg{ width: 110px; height: 110px; }
  .weather-info{ margin-right: 0; }

  .household-widgets{ grid-template-columns: 1fr 1fr; min-height: 180px; }

  .lumi-fab-wrapper{ width: 80px; height: 80px; }
  .lumi-fab{ width: 80px; height: 80px; }
  .lumi-fab svg, .lumi-fab i{ width: 34px; height: 34px; }
  .lumi-mic-btn{ width: 42px; height: 42px; min-width: 42px; right: 60px; bottom: -10px; }
  .lumi-bubble{ width: calc(100vw - 90px); right: 46px; bottom: 82px; font-size: 13px; }
  .lumi-panel{ width: calc(100vw - 24px); right: -12px; padding: 16px; }
  .lumi-panel-header h2{ font-size: 20px; }

  .todo-tab{ font-size: 13px; padding: 6px 4px; }
  .todo-tab svg{ width: 14px; height: 14px; }

  .admin-drawer{ width: 100%; max-width: 100vw; padding: 18px; }
}
