/* The room's keepsakes (js/keepsakes.js): the morning-pages book and the postcard pinboard, as a sheet over the room. */

/* Over the room: a lighter dim and no blur, so the room stays in sight above the sheet. */
#overlay.over-room { align-items: flex-end; background: rgba(30, 26, 66, .3); backdrop-filter: none; -webkit-backdrop-filter: none; }
#overlay.over-room .sheet { min-height: 0; max-height: 86vh; max-height: 86dvh; border-radius: 26px 26px 0 0; box-shadow: 0 -10px 30px rgba(30, 26, 66, .25); animation: ks-up .32s cubic-bezier(.2, .9, .3, 1.08); }
@keyframes ks-up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 960px) {
  /* The room fills the left; the sheet takes the dashboard's place on the right. */
  #overlay.over-room { align-items: center; justify-content: flex-end; padding: 24px; }
  #overlay.over-room .sheet { max-width: 460px; max-height: calc(100vh - 48px); border-radius: 30px; }
}
@media (prefers-reduced-motion: reduce) { #overlay.over-room .sheet { animation: none; } }

.ks { display: grid; gap: 12px; padding: 14px 16px calc(22px + env(safe-area-inset-bottom)); }
.ks-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.ks-head h2 { margin: 0; font-size: var(--fs-xl); }
.ks-head .small { margin: 2px 0 0; }
.ks-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: #FFF1C9; font-size: 24px; color: #8C6A4F; }
.ks-board .ks-ic { background: #E6F1F8; color: #4E7FA0; }
.ks-focus:focus { outline: none; }
.ks-empty { text-align: center; padding: 10px 0 6px; }
.ks-empty p { margin: 6px 0 0; }
.ks-hint { background: #fff; border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); margin: 0; }
.ks-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ks-foot .pg-more { margin: 0; }
.ks-foot .tiny { color: var(--muted); }

/* Tabs: Pages · Ideas · Today I will (the book), The board · Every note (the pinboard). */
.ks-tabs { display: flex; gap: 4px; padding: 4px; background: #F3EADC; border-radius: 999px; }
.ks-tabs button { flex: 1; border: 0; background: none; font: inherit; font-weight: 800; font-size: var(--fs-sm); color: var(--muted); padding: 8px 6px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.ks-tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.ks-tabs button:focus-visible { outline: 2.5px solid var(--btn-edge); outline-offset: 1px; }

/* The book's pages: the My pages entries, a little tighter. */
.ks-pages { display: grid; gap: 8px; }
.ks-pages .pg-month { margin-top: 4px; }
.pg-tag.post { background: #E6F1F8; color: #4E7FA0; }

/* Ideas: every starred idea as a sticky note. */
.ks-notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 12px; padding: 4px 2px; }
.ks-sticky { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 104px; text-align: left; border: 0; cursor: pointer;
  background: linear-gradient(#FFF0A8, #FFE58A); padding: 16px 12px 10px; border-radius: 3px 3px 14px 3px; box-shadow: 0 6px 12px rgba(120, 90, 20, .16); color: #4A3B2A;
  transform: rotate(-1.5deg); transition: transform .12s; font: inherit; }
.ks-sticky:nth-child(3n + 2) { transform: rotate(1.8deg); background: linear-gradient(#FFE1E6, #FFD0D8); }
.ks-sticky:nth-child(3n) { transform: rotate(-.6deg); background: linear-gradient(#E3F4D9, #D2EBC4); }
.ks-sticky::before { content: ''; position: absolute; top: -7px; left: 50%; width: 46px; height: 14px; margin-left: -23px; background: rgba(255, 255, 255, .6); border-radius: 2px; transform: rotate(-3deg); }
.ks-sticky span { font-family: var(--font-hand); font-size: var(--fs-lg); line-height: 1.2; overflow-wrap: anywhere; }
.ks-sticky small { font-size: var(--fs-2xs); font-weight: 800; opacity: .65; }
.ks-sticky:active { transform: scale(.97); }
.ks-sticky:focus-visible { outline: 2.5px solid var(--btn-edge); outline-offset: 3px; }

/* Today I will: every intention, ticked when it happened. */
.ks-goals, .ks-letters, .ks-rows { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ks-goals button, .ks-letters button { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: #fff; border-radius: 16px; padding: 10px 12px; box-shadow: 0 2px 0 var(--line), var(--shadow); font: inherit; color: var(--ink); cursor: pointer; }
.ks-goals small, .ks-letters small { display: block; color: var(--muted); font-weight: 700; font-size: var(--fs-xs); }
.ks-goals .ks-ri { color: #8DB36B; font-size: 22px; }
.ks-goals .done b { text-decoration: line-through; text-decoration-color: rgba(79, 138, 58, .5); text-decoration-thickness: 2px; }
.ks-goals .done .ks-ri { color: #4F8A3A; }

/* The pinboard: every postcard on a cork board, each on its own tack. */
.ks-cork { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 18px 14px; padding: 18px 14px 16px; border-radius: 16px;
  background: radial-gradient(circle at 20% 30%, rgba(140, 95, 50, .18) 1px, transparent 1.6px) 0 0 / 11px 11px, radial-gradient(circle at 70% 60%, rgba(255, 240, 210, .35) 1px, transparent 1.6px) 0 0 / 13px 13px, #D2A878;
  box-shadow: inset 0 0 0 6px #B98A5E, inset 0 2px 10px rgba(70, 40, 10, .3); }
.ks-pin { position: relative; display: block; border: 0; padding: 6px 6px 4px; background: #FFFDF8; border-radius: 4px; box-shadow: 0 6px 12px rgba(60, 35, 10, .28); transform: rotate(var(--r, 0deg)); cursor: pointer; font: inherit; color: var(--ink); text-align: left; transition: transform .14s; }
.ks-pin::before { content: ''; position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .7) 0 2px, transparent 3px), var(--tack, #E25B4A); box-shadow: 0 2px 2px rgba(0, 0, 0, .25); z-index: 1; }
.ks-pin svg { display: block; width: 100%; aspect-ratio: 240 / 150; border-radius: 2px; }
.ks-pin small { display: block; margin-top: 4px; font-weight: 800; font-size: var(--fs-xs); line-height: 1.2; }
.ks-pin small span { display: block; font-weight: 700; color: var(--muted); font-size: var(--fs-2xs); }
.ks-pin small .ico { color: #D9825B; }
.ks-pin:hover { transform: rotate(0deg) scale(1.03); }
.ks-pin:active { transform: scale(.97); }
.ks-pin:focus-visible { outline: 2.5px solid #fff; outline-offset: 3px; }

/* Every note: the postcards' words, as letters. */
.ks-letters button { grid-template-columns: 1fr; gap: 4px; background: #FFFDF8; }
.ks-hand { font-family: var(--font-hand); font-size: var(--fs-lg); line-height: 1.3; color: #4A3B6A; }

/* One page / one postcard: back, ‹ date ›, the thing itself, then that morning. */
.ks-read { gap: 12px; }
/* Back and close stay in reach while a long page scrolls. */
.ks-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; margin: -14px -16px 0; padding: 12px 16px 8px; background: var(--paper) var(--grain); border-radius: 26px 26px 0 0; }
.ks-daynav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; text-align: center; }
.ks-daynav b { font-size: var(--fs-md); }
.ks-daynav small { display: block; font-weight: 700; color: var(--muted); font-size: var(--fs-xs); }
.ks-daynav .btn[disabled] { opacity: .35; }
.ks-read .pg-prompt { flex: none; }
.ks-quiet { margin: 0; background: #fff; border-radius: 16px; padding: 14px; box-shadow: var(--shadow); font-weight: 700; color: var(--muted); }
.ks-pc { margin: 4px 8px 0; }
.ks-where { margin: 0; text-align: center; font-weight: 800; color: var(--muted); font-size: var(--fs-sm); }

/* That morning. */
.ks-day { background: #fff; border-radius: 20px; padding: 12px 14px 10px; box-shadow: 0 2px 0 var(--line), var(--shadow); }
.ks-day h3 { margin: 0 0 8px; font-size: var(--fs-md); }
.ks-day h3 .ico { color: #F2A33A; }
.ks-day .pg-more { margin-top: 10px; }
.ks-rows li { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); flex-wrap: wrap; }
.ks-rows li > span:nth-child(2) { flex: 1; min-width: 0; }
.ks-ri { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--cream); font-size: 18px; color: #8C6A4F; }
.ks-ri.gift { background: #FFF1D6; overflow: hidden; }
.ks-cards { display: flex; gap: 4px; color: #7B6AA8; }
.ks-cards i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: #EDE6FA; font-style: normal; font-size: 14px; }
.ks-link { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: var(--cream); border-radius: 14px; padding: 8px 10px; font: inherit; color: var(--ink); cursor: pointer; }
.ks-link small { display: block; color: var(--muted); font-weight: 700; font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ks-link > span:nth-child(2) { min-width: 0; }
.ks-link:active { transform: scale(.985); }
.ks-link:focus-visible { outline: 2.5px solid var(--btn-edge); outline-offset: 2px; }
.ks-thumb { display: block; width: 56px; aspect-ratio: 240 / 150; border-radius: 4px; overflow: hidden; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .15); transform: rotate(-3deg); }
.ks-thumb svg { display: block; width: 100%; height: 100%; }
.ks-thumb.page { display: grid; place-items: center; background: #FFF9F1; color: #8C6A4F; font-size: 20px; }
