.aamuposti {
  color: var(--ink); position: relative; max-width: min(270px, 100%); width: fit-content;
  font-family: var(--tekstikirjasin); z-index: 4; pointer-events: auto;
}
.aamuposti summary, #paivan-luukku, #juhlapäivä {
  color: var(--ink); background: var(--paper); -webkit-tap-highlight-color: #d7b27b66; border: 1px solid #a680598c; box-shadow: 0 2px 9px #27374625;
}
.aamuposti summary {
  list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer;
  min-height: 44px; padding: .31rem .68rem .32rem .55rem; border-radius: 8px;
  font: 700 .95rem/1.05 var(--otsikkokirjasin);
}
.aamuposti summary::-webkit-details-marker { display: none; }
.aamuposti summary::after { content: "⌄"; color: #894638; margin-left: .08rem; font-family: Georgia,serif; }
.aamuposti[open] summary::after { transform: rotate(180deg); }
.aamuposti svg, #paivan-luukku svg, #luukkumerkki svg {
  width: 23px; height: 23px; color: #974537; fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none;
}
.aamuposti-sisalto {
  position: absolute; z-index: 2; inset-inline-start: 0; top: calc(100% + 5px);
  width: min(268px, calc(100vw - 48px)); padding: .75rem .85rem .82rem; border-radius: 8px;
  color: var(--ink); background: #fff8eb; border: 1px solid #a68059; box-shadow: 0 8px 24px #2637463d;
  font-size: .86rem; text-align: left;
}
.aamuposti-sisalto p { margin: .2rem 0 .54rem; }
.aamuposti-uudet { font-weight: 790; color: #783329; }
.aamuposti-sisalto .aamuposti-seuraava { margin: .55rem 0 .1rem; border-top: 1px solid #d8bf9b; padding-top: .55rem; }
.aamuposti-seuraava small { display: block; font-size: .8rem; margin-top: .2rem; }
.aamuposti-sisalto button { min-height: 44px; color: #783329; border: 0; background: transparent; font-weight: 750; padding-inline: 0; }
.kylaposti { display: flex; align-items: start; gap: .32rem; margin-top: .42rem; flex-wrap: wrap; }
#paivan-luukku { pointer-events: auto; min-height: 44px; display: inline-flex; gap: .42rem; align-items: center; text-align: left; border-radius: 8px; padding: .24rem .66rem .25rem .47rem; }
#paivan-luukku:hover, .aamuposti summary:hover { background: #f3e3c9; }
#paivan-luukku strong, #luukun-numero { display: block; }
#paivan-luukku strong { font: 700 .93rem/1.08 var(--otsikkokirjasin); }
#luukun-numero { color: #83503e; font-size: .71rem; margin-top: .13rem; }
#juhlapäivä { margin-top: .36rem; width: fit-content; max-width: 100%; border-radius: 8px; padding: .48rem .68rem; }
#kortti:has(.aamuposti[open]) #seuraava { visibility: hidden; }
#juhlapäivä:has(button:not([hidden])) { pointer-events: auto; }
#juhlapäivä strong { display: block; font: 700 .94rem/1.05 var(--otsikkokirjasin); color: #7d392d; }
#juhlan-teksti { display: block; font-size: .78rem; margin-top: .22rem; }
#juhlan-teksti:empty { display: none; }
#juhlapäivä button { cursor: pointer; display: block; min-height: 44px; margin: -.18rem 0 -.41rem; border: 0; background: none; font-size: .78rem; padding: 0; text-decoration: underline; font-weight: 750; }
#luukkumerkki {
  position: absolute; z-index: 3; top: -53px; left: -22px; width: 44px; height: 44px;
  display: grid; place-items: center; border-radius: 50%; border: 1px solid #94643d;
  background: #fff1c9; box-shadow: 0 0 0 3px #ffe29b7a, 0 2px 17px #8f511a7a; padding: 0;
}
#luukkumerkki::before { content: ""; width: 10px; height: 10px; transform: rotate(45deg); border: solid #94643d; border-width: 0 1px 1px 0; background: inherit; position: absolute; bottom: -6px; left: 16px; }
#juhlataivas { z-index: 2; pointer-events: none; }
#luukku-dialogi {
  border: 1px solid #b79067; color: var(--ink); width: min(335px, calc(100vw - 32px));
  border-radius: 16px; padding: 1.15rem 1.28rem 1.28rem; background: #fff5e2; text-align: center;
  box-shadow: 0 20px 65px #1a334485;
}
#luukku-dialogi::backdrop { background: #2638446b; }
#luukku-sulje { position: absolute; top: 8px; right: 8px; color: #753a30; background: #fbedd6; border: 1px solid #bea481; border-radius: 50%; width: 44px; height: 44px; font: 500 1.6rem/1 Georgia,serif; }
#luukku-paiva { margin-block: .14rem .4rem; color: #824637; font-weight: 800; font-size: .8rem; }
#luukku-otsikko { font: 700 1.68rem/1.04 var(--otsikkokirjasin); margin: 0 0 .55rem; text-wrap: balance; }
.luukku-kuvitus {
  display: grid; place-items: center; position: relative; height: 130px; background: radial-gradient(ellipse, #fff3c8, #ead1a8 59%, #eee0c7 78%);
  border-radius: 50% 50% 9px 9px; margin: .8rem 0 .85rem; overflow: hidden;
}
.luukku-kuvitus .luukun-ikkuna { width: 72px; height: 82px; display: block; color: #763a2e; stroke-width: 1.28; stroke: currentColor; fill: #f7c46d; filter: drop-shadow(0 4px 8px #98643a60); }
#luukku-dialogi[data-auki="1"] .luukku-kuvitus:has(img:not([hidden])) svg { display: none; }
#luukku-lahja { height: 128px; width: 128px; object-fit: contain; }
#luukku-viesti { margin: 0 0 .65rem; font-size: .96rem; }
#luukku-viesti:empty { display: none; }
.luukku-teko { cursor: pointer; display: inline-flex; padding: .65rem 1rem; min-height: 46px; align-items: center; border: 1px solid #71392f; border-radius: 9px; text-decoration: none; color: #fff8e8; background: #8b3c31; font-weight: 800; }
.luukku-teko:hover { color: #fff8e8; background: #703027; }
.luukku-teko:disabled { opacity: .75; }
.rakentajan-posti { margin-block: .48rem .72rem; }
#omatalo-kynttilat { margin: .25rem 0; font-size: .82rem; font-weight: 730; }
#omatalo-kynttilat::before { content: "✦ "; color: #d58047; }
#pukin-kalenteri { margin-top: .62rem; }
#pukin-kalenteri small { display: block; margin-top: .18rem; }
@media (max-width: 620px) {
  .kylaposti { flex-wrap: nowrap; }
  .kylaposti summary { font-size: .84rem; gap: .32rem; }
  .kylaposti :is(summary,#paivan-luukku) { padding-inline: .4rem; white-space: nowrap; }
  .kylaposti :is(svg,#paivan-luukku svg) { width: 18px; height: 18px; }
  #paivan-luukku strong { font-size: .83rem; }
  #juhlapäivä { max-width: 250px; }
}

#luukku-otsikko:focus { outline: none; }
#juhlapäivä[data-juhla="joulurauha"] button:not([hidden]) { display: inline-block; margin-inline-end: .65rem; }
#juhlapäivä:has(#juhlan-avaa:not([hidden])) { padding-block: 0; }
#juhlapäivä #juhlan-avaa {
  margin: 0; text-decoration: none; color: #7d392d;
  font: 700 .94rem/1.05 var(--otsikkokirjasin);
}
#juhlan-avaa::after { content: " ⌄"; }
#juhlan-avaa[aria-expanded="true"]::after { content: " ⌃"; }
#juhlapäivä[data-juhla="joulurauha"] #juhlan-sisalto {
  display: grid; grid-template-columns: repeat(2, max-content); column-gap: .75rem; align-items: center;
}
#juhlapäivä[data-juhla="joulurauha"] #juhlan-teksti { grid-column: 1 / -1; }
#juhlapäivä[data-juhla="joulurauha"] #juhlan-sisalto button { margin: 0; text-align: start; }

@media (max-width: 620px) {
  #juhlapäivä[data-juhla="joulurauha"] { max-width: min(320px,calc(100vw - 48px)); }
  #juhlapäivä[data-juhla="joulurauha"] button:not([hidden]) { min-height: 44px; }
}
@media (max-width: 620px) and (max-height: 760px) {
  #kortti:has(#juhlan-avaa[aria-expanded="true"]:not([hidden])) #zoomi { visibility: hidden; }
}
