.p19-tyokalut {
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  align-items:center;
  gap:5px;
  margin:8px 0 3px;
}
.p19-tyokalut button, .p19-linkki {
  min-height:44px;
  min-width:44px;
  background:#fff5df;
  border:1px solid #bd9868;
  border-radius:13px;
  color:#533429;
  font-size:.83rem;
  padding:5px 9px;
}
.p19-tyokalut button:first-child { background:#ffdb93; color:#53301f; }
.p19-dialogi {
  --p19-reuna:#c39864;
  --p19-paperi:#fff6e4;
  width:min(600px,calc(100% - 20px));
  max-width:calc(100% - 20px);
  max-height:calc(100% - 20px);
  padding:clamp(13px,3vw,24px);
  color:#352820;
  background-color:var(--p19-paperi);
  background-image:var(--paperipinta);
  border:2px solid var(--p19-reuna);
  border-radius:24px;
  box-shadow:0 5px 0 #865532,0 16px 64px #14243a80;
  font:500 1rem/1.35 var(--tekstikirjasin);
  overflow:auto;
  overscroll-behavior:contain;
}
.p19-dialogi::backdrop { background:#152944b5; }
.p19-dialogi h2,.p19-dialogi h3 { font-family:var(--otsikkokirjasin); color:#2c5848; margin:0; line-height:1.04; }
.p19-otsikko { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.p19-otsikko h2 { font-size:clamp(1.48rem,4.7vw,2.3rem); text-align:start; }
.p19-dialogi button,.p19-hyllynappi {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  min-width:44px;
  padding:7px 12px;
  border:1.5px solid #b78453;
  border-radius:14px;
  background:#ffeed0;
  color:#4a3125;
  font:750 .89rem/1.18 var(--tekstikirjasin);
  text-align:center;
  text-decoration:none;
  cursor:pointer;
}
.p19-dialogi .p19-risti { font-size:1.45rem; border-radius:50%; background:#f9e8c9; flex:none; width:44px; }
.p19-dialogi .p19-tee { background:#32634f; color:#fff8eb; border-color:#234738; box-shadow:0 3px 0 #234738; }
.p19-dialogi button:disabled { opacity:.58; cursor:default; }
.p19-dialogi button[aria-pressed=true] { background:#32634f; border-color:#234738; color:#fff8eb; }
.p19-dialogi :focus-visible { outline:3px solid #15678e; outline-offset:2px; }
.p19-form { display:grid; gap:10px; }
.p19-form label { font-weight:700; }
.p19-form input[type=text] { color:#392c25; background:#fffdf5; border:2px solid #bf9b6d; border-radius:13px; min-height:50px; width:100%; padding:10px 12px; font:inherit; }
.p19-rivi, .p19-lajit, .p19-sivut { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; }
.p19-lajit { justify-content:flex-start; }
.p19-rivi .p19-tee { margin-inline-start:auto; }
.p19-dialogi p { margin:8px 0; }
.p19-dialogi p:empty { margin:0; }
.p19-vati {
  position:relative;
  height:clamp(188px,38dvh,320px);
  overflow:hidden;
  background:radial-gradient(ellipse at 70% 25%,#b9d5e4 0,transparent 46%),
    radial-gradient(ellipse at 21% 91%,#d7ebf4aa 0,transparent 54%),linear-gradient(160deg,#355773,#738ba7 65%,#bfcfe2);
  border:1px solid #57758c;
  border-radius:17px;
}
.p19-vati::before,.p19-vati::after {
  content:"";
  pointer-events:none;
  position:absolute;
  width:3px;
  height:3px;
  border-radius:50%;
  background:#fff6e5;
  inset:20% auto auto 24%;
  box-shadow:39px -13px 0 #fff6e5bf, -28px 32px 0 1px #fff6e5aa, 14px 72px 0 #fff6e5aa, -13px -14px 0 #fff6e58a;
}
.p19-vati::after { inset:42% 20% auto auto; transform:rotate(170deg); }
.p19-vati :is(canvas,img,.p19-varatonttu) { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
.p19-nimi { text-align:center; font-weight:760; }
.p19-vaatehuone { display:grid; grid-template-columns:minmax(130px,.84fr) minmax(0,1.2fr); gap:12px; align-items:center; }
.p19-valinnat { display:grid; gap:5px; }
.p19-valinnat fieldset { border:1px solid #d5b98f; border-radius:13px; margin:0; min-width:0; padding:3px 5px 6px; }
.p19-valinnat legend { padding:0 4px; font-size:.75rem; font-weight:800; }
.p19-valinnat div { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:3px; }
.p19-valinnat fieldset:last-child div { grid-template-columns:repeat(4,minmax(0,1fr)); }
.p19-valinnat button { position:relative; min-width:0; min-height:44px; padding:2px; border-radius:10px; }
.p19-valinnat button[aria-pressed=true] { background:#d8e6d2; border:2px solid #315847; }
.p19-valinnat svg { width:100%; max-width:29px; height:30px; display:block; overflow:visible; }
.p19-vaatehuone + .p19-rivi { margin-top:12px; }
.p19-kirjasto { width:min(820px,calc(100% - 20px)); }
.p19-hylly { padding:0; margin:13px 0; list-style:none; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; }
.p19-hylly li { min-width:0; display:grid; gap:6px; align-content:start; background:#fce9c9; border:1px solid #bd996a; padding:8px; border-radius:15px; box-shadow:0 3px 0 #bd996a; }
.p19-hylly img { display:block; width:100%; height:auto; aspect-ratio:1.24; object-fit:contain; border-radius:10px; background:#dce9f0; }
.p19-hylly h3 { font-size:clamp(.88rem,2.5vw,1.15rem); margin-top:3px; overflow-wrap:anywhere; }
.p19-kirjatiedot { display:flex; gap:2px 7px; justify-content:space-between; flex-wrap:wrap; align-items:center; font-size:.75rem; }
.p19-kirjatiedot a { font-weight:800; color:#315c4d; padding-block:6px; }
.p19-hyllynappi { width:100%; }
@media(max-width:620px) {
  .p19-hylly { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
}
@media(max-width:515px) {
  .p19-vaatehuone { grid-template-columns:1fr; gap:8px; }
  .p19-vaatehuone .p19-vati { height:clamp(126px,23dvh,220px); }
}
@media(max-height:515px) and (orientation:landscape) {
  .p19-vati { height:162px; }
}
.p19-oma-rivi { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px; border-top:1px solid #d9b98f; padding:10px 0 2px; margin-top:9px; }
.p19-kylan-nappi { min-height:44px; padding-inline:8px; }

.p19-kirjasto:has(.p19-hylly li:only-child) { width:min(540px,calc(100% - 20px)); }
.p19-hylly:has(li:only-child) { grid-template-columns:minmax(0,1fr); }
.p19-hylly li:only-child { grid-template-columns:minmax(90px,.94fr) minmax(0,1.06fr); align-items:center; column-gap:12px; }
.p19-hylly li:only-child img { grid-row:span 3; height:100%; aspect-ratio:1.1; }
