:root{
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #000;
  --muted: #6b7280;
  --line: #e5e7eb;

  /* Akzentlinie */
  --blue: #2f5bea;;
  --violet: #4b2ea6;
  --magenta: #d20052;

  /* Deine Farben */
  --holidayColor:   #44b938; /* Feiertage */
  --schoolColor: #ffce86;          /* Schulferien */

  --radius: 18px;
}


*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: var(--bg);
  color: var(--text);
}

.wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px;
}

/* Header */
.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar__inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand__title{
  font-size: 1.25rem;
  font-weight: 850;
  letter-spacing: .2px;
}
.brand__title a{
	text-decoration: none;
  color: var(--blue);
}
.accentLine{
  height: 4px;
  background: var(--blue);
}

/* Controls */
.controls{
  display:flex;
  align-items:flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.yearCtrl{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.yearCtrl__value{
  min-width: 62px;
  text-align:center;
  font-weight: 850;
  letter-spacing: .4px;
}

.iconBtn{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}
.iconBtn:hover{ background: #f3f4f6; }
.iconBtn:active{ transform: translateY(1px); }

.field{
  display:flex;
  flex-direction:column;
  gap: 6px;
}
.label{
  font-size: .82rem;
  color: var(--muted);
}
.select{
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  outline: none;
}

.check{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  user-select:none;
  cursor:pointer;
  font-size: .82rem;
}
.check input{ accent-color: var(--holidayColor); }

/* Panels */
.panel{
  margin-top: 14px;
  background: var(--surface);
   padding: 14px;
}
.panel--calendar{
  padding: 14px;
}

/* ===== Kalender Layout ===== */
.monthsGrid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 24px 28px;
}
@media (min-width: 760px){
  .monthsGrid{ grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1020px){
  .monthsGrid{ grid-template-columns: 1fr 1fr 1fr; }
}

.monthCard{ padding: 0; }
.monthTitle{
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  font-weight:bold
}

/* Table */
.cal{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.cal thead th{
  font-size: .78rem;
  color: var(--text);
  padding: 6px 6px 10px 6px;
  text-align: left;
  letter-spacing: .02em;
}
.cal tbody td{
  padding: 0;
  width: 40px;
  height: 40px;
  text-align: center;
  vertical-align: middle;
}

.kw{
  width: 36px;
  color: var(--muted);
  font-size: .86rem;
  font-variant-numeric: tabular-nums;
}

.dayCell{ position: relative; }

.dayNum{
  width: 34px;
  height: 34px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: #fafafa;
  font-variant-numeric: tabular-nums;
  border-radius: 5px;
}

.dayNum.muted{
	background: ;
  color: transparent;
}

/* Circle highlights */
.dayNum.circle{ }
.dayNum.holiday{ background: color-mix(in srgb, var(--holidayColor) 25%, white) !important; }
.dayNum.school{ background: color-mix(in srgb, var(--schoolColor) 40%, white) !important; }

/* Fallback for browsers without color-mix(): keep a decent look */
@supports not (color-mix(in srgb, white, black)){
  .dayNum.holiday{ background: rgba(82,82,82,.25); }
  .dayNum.school{ background: rgba(255,171,49,.35); }
}

.hasEvents{ cursor: pointer; }
.hasEvents:hover .dayNum{ filter: brightness(.98); }

.yearNavBottom{
  margin-top: 48px;
  text-align: center;
}

.yearNextBtn{
  display: inline-block;
  padding: 14px 26px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: 0.2s;
}

.yearNextBtn:hover{
  background: var(--text);
  color: var(--bg);
}

/* Tooltip */
.tooltip{
  position: fixed;
  max-width: min(360px, calc(100vw - 24px));
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 50px rgba(0,0,0,.14);
  padding: 10px 12px;
  z-index: 100;
  display:none;
}
.tooltip[aria-hidden="false"]{ display:block; }
.ttTitle{ font-weight: 850; margin: 0 0 6px 0; font-size: .92rem; }
.ttList{ margin:0; padding-left: 18px; font-size: .92rem; color: var(--text); }
.ttBadge{
  display:inline-block;
  font-size:.75rem;
  font-weight:800;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  margin-left:8px;
  background:#f9fafb;
}

/* Lists */
.h2{ margin: 0 0 10px 0; font-size: 1.15rem; font-weight: 900; }
.h3{ margin: 18px 0 10px 0; font-size: 1.02rem; font-weight: 850; }
.list{ margin: 0; padding-left: 18px; line-height: 1.65; list-style-type: none;}


.h2 a {color: var(--text);}
.h3 a {color: var(--text);}

.pill{
  display:inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 10px;
  transform: translateY(1px);
}
.pill--holiday{ background: var(--holidayColor); }
.pill--school{ background: var(--schoolColor); }

.divider{
  height: 1px;
  background: var(--line);
  margin: 14px 0;
}

.divider-m{
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line), transparent);
  margin: 14px 0;
}

/* Footer */
.footer{
  margin: 18px 0 10px 0;
  color: var(--muted);
  font-size: .9rem;
}
.footer a{
	color: var(--muted);
	text-decoration: none;
	}

/* Mobile tweaks */
@media (max-width: 520px){
  .select{ min-width: 100%; }
  .controls{ width: 100%; }
  .yearCtrl{ width: 100%; justify-content:space-between; }
  .check{ justify-content:center; }  	
}

.dayNum.today{ background: var(--blue) !important; color:white !important;font-weight: bold !important;}

/* Heute Link*/
.TodayLink{
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
}

/* SA/So */
.cal tbody td:nth-child(7) .dayNum, .cal tbody td:nth-child(8) .dayNum{
  background: #ecebeb;
}

.dayNum.nextMonth{
  background: none !important;
}

.monthCard.isPastMonth .monthTitle {
  color: #6b7280;
}

.monthsGrid:has(.monthCard.isPastMonth:hover) .monthCard.isPastMonth{
  opacity: 1;
}
.monthCard{
  transition: opacity .2s ease;
}

#ferienkalenderBT{color: var(--blue);}
.infoItem--past {
  opacity: 0.5;
}

.infoItem--current {
  font-weight: 600;
}

.stateBadge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1.2;
}

.stateBadge--current {
  background: #dcfce7;
  color: #166534;
}

.stateBadge--past {
  background: #f3f4f6;
  color: #6b7280;
}

.stateBadge--future {
  background: #dbeafe;
  color: #1d4ed8;
}
a{
	color: var(--blue);
}
.linkgruppen {
  margin: 0;
  list-style: none;
  padding: 0;
}

.linkgruppen > li {
  margin-bottom: 1.2rem;
}

.linkgruppen > li > a {
  font-weight: 600;
}

.badge-liste {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
}

.badge-liste li {
  margin: 0;
}

.badge-liste a {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  background: #f5f5f5;
  text-decoration: none;
  line-height: 1.2;
}

.badge-liste a:hover,
.badge-liste a:focus {
  background: #ececec;
  text-decoration: none;
}


.pastMonthsToggleWrap {
  margin-bottom: 22px;
  text-align:right;
}

.pastMonthsToggle {
  font-size: 13px;
  color: #6b7280;
  background: none;
  border: none;
  padding: 2px 6px;
}

.pastMonthsToggle:hover {
  text-decoration: underline;
}.pastMonthsToggleWrap {
  margin-bottom: 22px;
}



.monthCard {
  transition: opacity .28s ease, transform .28s ease;
}

.monthCard.isCollapsingPastMonth {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.morelinks li {padding:8px}

.infoItem--schoolYear {
  list-style: none;
  margin: 20px 0 16px;
}

.infoItem--schoolYear span {
  background: #ecebeb;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.school-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  background: #fff;
}

.school-table th,
.school-table td {
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  text-align: left;
}

.school-table th {
  background: #f3f4f6;
  font-weight: 600;
}

.school-table tr:nth-child(even), .school-table tr:nth-child(even) td {
  background: #fafafa;
}


.school-table tbody tr:hover {
  background: #f1f5f9;
}

@media (max-width: 700px) {

  .school-table thead {
    display: none;
  }

  .school-table,
  .school-table tbody,
  .school-table tr,
  .school-table td {
    display: block;
    width: 100%;
  }

  .school-table tr {
    margin-bottom: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
  }

  .school-table td {
    border: none;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 50%;
    background: #fff;
  }

  .school-table td:last-child {
    border-bottom: none;
  }

  .school-table td::before {
    position: absolute;
    left: 14px;
    top: 12px;
    width: 45%;
    white-space: nowrap;
    font-weight: 600;
    color: #374151;
  }


.school-table--schoolyear td:nth-of-type(1)::before {content: "Schuljahr";}
.school-table--schoolyear td:nth-of-type(2)::before {content: "Schulbeginn";}
.school-table--schoolyear td:nth-of-type(3)::before {content: "Schulschluss";}

.school-table--autonom td:nth-of-type(1)::before { content: "Schuljahr"; }
.school-table--autonom td:nth-of-type(2)::before { content: "Datum"; }
.school-table--autonom td:nth-of-type(3)::before { content: "Wochentag"; }
.school-table--autonom td:nth-of-type(4)::before { content: "Max. Tage"; }
}
.schoolHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.schoolInfo h3{
	font-size: 20px;margin: 0 0 6px 0;
}

.schoolButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 12px 18px;
  background: var(--blue);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;

  transition: 0.2s;
  white-space: nowrap;
}

.schoolButton:hover {
  background: #1e4fd1;
  transform: translateY(-1px);
}

.schoolButtonWrap.center {
  align-self: center;
}

/* MOBILE */
@media (max-width: 700px) {
  .schoolHeader {
    flex-direction: column;
  }

  .schoolButton {
    width: 100%;
  }
  
 
  .infoBox{
    padding: 14px;
  }

  .infoBox .schoolButton{
    width: 100%;
  }
}

.pageLinks{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:10px 16px;
  margin: 0 0 8px 0;
}

.pageLinks__main,
.pageLinks__actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}

.pageLinks__actions{
  margin-left:auto;
}

/* Trenner dezenter */
.sep{
  color: var(--muted);
}

/* Alte Styles neutralisieren */
#termineBT,
#ferienkalenderBT{
  display:inline-flex;
  align-items:center;
  gap:4px;
  min-width:auto !important;
  float:none !important;
}

/* Mobile */
@media (max-width: 520px){
  .pageLinks{
    flex-direction:column;
    align-items:flex-start;
  }

  .pageLinks__actions{
    width:100%;
    margin-left:0;
    justify-content:space-between;
  }
}

.infoBox{
  margin: 0 0 22px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.infoBox__text{
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  flex: 1 1 420px;
}

.infoBox .schoolButton{
  flex: 0 0 auto;
}

[id] {
  scroll-margin-top: 150px;
}

.copyinfo{
	font-size: 0;
}

.metaBar{
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 14px 10px;
  font-size: .9rem;
  color: var(--muted);

  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.metaBar::-webkit-scrollbar{
  display: none;
}

.metaBar a{
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}