/* Each column advances less than one cell width. Offset the even columns
   by half a row to connect the flat-topped facets. */
#v-cal {
    --hex: polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);
    --hex-h: clamp(39px, 11vw, 56px);
    --stagger: calc(var(--hex-h) / 2 + 2px);
    width: 100%;
    max-width: none;
    margin: 0;
    padding: clamp(17px,5vw,25px) 0 0;
    border: 1px solid rgba(255,255,255,.92);
    border-radius: clamp(29px,8vw,42px);
    background: linear-gradient(132deg,rgba(255,255,255,.31),rgba(255,242,219,.1) 60%,rgba(255,255,255,.28));
    box-shadow: inset 1px 2px 2px #fff, inset -2px -2px 3px #fff9eb, 0 7px 22px -16px #92632f;
    overflow: hidden;
    text-align: center;
}
.vcal-header, .vcal-week, .vcal-body {
    width: 86%;
    max-width: 454px;
    margin: 0 auto;
}
#v-cal .vcal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 12px;
}
#v-cal .vcal-header__label {
    color: var(--ink);
    font: 400 clamp(22px,6.1vw,30px)/1.2 var(--display);
    font-variant-numeric: lining-nums;
}
.vcal-header .vcal-btn {
    display: grid; place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 0;
    background: var(--clear-glass);
    border: 1px solid var(--rim);
    box-shadow: var(--edge);
    cursor: pointer;
}
.vcal-btn img { display: block; width: 21px; height: 21px; }
.vcal-btn:disabled { opacity: .45; }
.vcal-week, .vcal-body { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.vcal-week {
    margin-bottom: 10px;
    font: 650 clamp(11px,3vw,14px)/1.5 var(--ui-font);
    letter-spacing: .04em;
    color: var(--quiet);
    text-transform: uppercase;
}
.vcal-body { row-gap: 4px; padding-bottom: var(--stagger); }
.vcal-date {
    --facet: linear-gradient(128deg,#fffdf9 0%,#f9efdf 14%,#f8ead7 70%,#fffaf0 95%);
    --outline: linear-gradient(128deg,#fffaf0 9%,#f7d8a4 23%,#cc9846 67%,#fffaf0 93%);
    appearance: none;
    position: relative;
    isolation: isolate;
    justify-self: center;
    width: 119%;
    height: var(--hex-h);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--ink);
    font: 530 clamp(15px,4.2vw,20px)/1 var(--ui-font);
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    clip-path: var(--hex);
}
.vcal-date:nth-child(7n+2), .vcal-date:nth-child(7n+4), .vcal-date:nth-child(7n+6) {
    top: var(--stagger);
}
.vcal-date::before, .vcal-date::after {
    content: "";
    position: absolute;
    inset: 0;
    clip-path: var(--hex);
    pointer-events: none;
    z-index: -2;
    background: var(--outline);
}
.vcal-date::after { inset: 1.2px; z-index: -1; background: var(--facet); }
.vcal-date span { position: relative; z-index: 2; }
.vcal-date--placeholder { visibility: hidden; }
.vcal-date--disabled { opacity: .5; }
.vcal-date--dayreaded, .vcal-date--test_week_done {
    --facet: url("../img/honey-cell.webp") center / 100% 100% no-repeat;
    --outline: linear-gradient(150deg,#f6cd7e,#9b641c);
}
/* Keep the reading fill visible inside the darker test-day rim. */
.vcal-date--test_week, .vcal-date--test_week_locked, .vcal-date--test_week_done {
    --outline: linear-gradient(145deg,#e8ba70,#85521e 47%,#bd812e 74%,#f1cb88);
}
.vcal-date--test_week::after, .vcal-date--test_week_locked::after, .vcal-date--test_week_done::after { inset: 2px; }
.vcal-date--test_week:not(.vcal-date--dayreaded), .vcal-date--test_week_locked:not(.vcal-date--dayreaded) {
    --facet: linear-gradient(145deg,#fff5de,#f4d5a5 78%,#fbe7c4);
}
.vcal-date--test_week span, .vcal-date--test_week_locked span, .vcal-date--test_week_done span {
    display: inline-block; transform: translateY(-4px);
}
.vcal-date--today { --outline: linear-gradient(145deg,#fff2b0,#d18b16 48%,#ffbe22 85%); }
.vcal-date--today::after { inset: 2.5px; }
.vcal-date--today span { font-weight: 720; }
#v-cal .vcal-date--selected, #v-cal .vcal-date:focus-visible {
    --outline: #4a2b11;
    background: none !important;
    border-radius: 0;
}
#v-cal .vcal-date--selected::after, #v-cal .vcal-date:focus-visible::after { inset: 3px; }
.vcal-date--selected span { font-weight: 800; }
.vcal-indicator {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    pointer-events: none;
}
.vcal-indicator--star::before, .key-test::before { content: "☆"; }
.vcal-date--test_week_done .vcal-indicator--star::before, .key-test-done::before { content: "★"; }
.vcal-indicator--star { bottom: 4px; color: #633506; font: bold 12px/1 Arial,sans-serif; }
.vcal-indicator--lock {
    width: 8px; height: 6px; border-radius: 2px; background: currentColor;
}
.vcal-indicator--lock::before {
    content: ""; position: absolute; width: 4px; height: 4px; left: 1px;
    bottom: 4px; border: 1px solid currentColor; border-radius: 4px 4px 0 0;
}
.calendar-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; padding: 16px 8px; color: var(--quiet); font-size: 12px; }
.calendar-key span { display: inline-flex; gap: 5px; align-items: center; }
.key-today::before, .key-read::before {
    content: ""; width: 12px; height: 11px; clip-path: var(--hex); background: #724a19;
}
.key-today::before { background: center / 100% 100% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 11'%3E%3Cpath d='M3.3 1h5.4l2.4 4.5L8.7 10H3.3L.9 5.5z' fill='none' stroke='%23724a19' stroke-width='1.5'/%3E%3C/svg%3E"); }
.key-read::before { background: var(--liquid); }
.key-test::before, .key-test-done::before { font-size: 16px; }
.calendar-key .vcal-indicator--lock { position: relative; margin-top: 3px; }
.calendar-key[hidden], .calendar-key [hidden] { display: none; }
.under_calendar_box {
    margin: 0 8px 8px; padding: 18px clamp(14px,4.6vw,24px); text-align: left;
    border-radius: 12px 12px 24px 24px; border: 1px solid #fff9eb;
    background: linear-gradient(135deg,#fff9ece8,#fae9c9b8);
    box-shadow: inset 0 1px 0 #fff, 0 1px 4px #a4763826;
}
#date_picked {
    margin: 0; color: #795233; font: 660 12px/1.45 var(--ui-font);
    letter-spacing: .10em; text-transform: uppercase;
}
.selected-passage {
    margin: 4px 0 12px; text-align: left; font: italic 400 clamp(29px,7vw,37px)/1.14 var(--display);
    letter-spacing: -.025em; overflow-wrap: anywhere;
}
#date_bibliography { color: var(--ink); font: inherit; text-decoration: none; }
#date_bibliography[href]:hover { text-decoration: underline; }
.selected-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; }
.selected-actions a, #home_page #am_citit_under_calendar_box_button {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 44px; margin: 0; padding: 8px 15px; border-radius: 999px;
    font: 650 14px/1.25 var(--ui-font); color: var(--ink); text-decoration: none;
}
.selected-actions a { background: var(--clear-glass); border: 1px solid var(--rim); box-shadow: var(--edge); }
.selected-actions a img { margin-left: -2px; }
#home_page #am_citit_under_calendar_box_button {
    width: auto; min-width: 103px; background: var(--liquid) !important;
    border: 1px solid #c5872f !important; color: #472500; cursor: pointer; box-shadow: var(--edge);
}
#home_page #am_citit_under_calendar_box_button:disabled {
    min-width: 0; opacity: 1; background: #ffe4a0 !important; border-color: #e8bb64 !important;
    color: #64400c; -webkit-text-fill-color: currentColor; cursor: default; box-shadow: inset 0 1px 1px #fff5d5;
}
#locked_test_message, #start_test_dialog_div_in_calendar {
    margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid #d6b98e; color: var(--quiet);
    text-align: left; font-size: 14px;
}
#start_test_dialog_div_in_calendar h3 { margin: 0 0 4px; color: var(--ink); font: 400 22px/1.25 var(--display); }
#start_test_dialog_div_in_calendar p { margin: 3px 0; }
/* Keep the saved cell's glass shell visible as the honey climbs behind its number. */
#v-cal .vcal-date--filling::after {
    background: linear-gradient(140deg,#fffaf0,#f6e1ba);
}
.delivery-honey {
    position: absolute; z-index: 0; inset: -4% -9% -8%; pointer-events: none;
    border-radius: 50% 46% 0 0 / 9% 7% 0 0;
    border-top: 2px solid #fff0a6;
    background: linear-gradient(110deg, #dd8d12, #ffd258 26%, #ffbc29 63%, #e49919);
    box-shadow: inset 0 3px 4px #fff3ac, inset 0 -3px 6px #b36a11;
}
.honey-droplet {
    position: absolute; aspect-ratio: .86; pointer-events: none;
    border-radius: 60% 48% 56% 48%;
    background: radial-gradient(circle at 34% 26%, #fff8c0 8%, #ffd655 26%, #f5ad20 55%, #a96511);
    box-shadow: 0 1px 2px #85552542;
}
@media (hover: hover) { .vcal-date--active:hover { --outline: #75440d; } }

@media (prefers-reduced-transparency: reduce) {
    #v-cal { background: #fff7eb; }
}

.honeycomb-surface { position: relative; }
.honeybee-layer {
    position: absolute; inset: -26px 0; overflow: hidden; z-index: 3;
    pointer-events: none; user-select: none;
}
.honeybee {
    position: absolute; top: 0; left: 0; aspect-ratio: 96 / 77;
    pointer-events: none; filter: drop-shadow(0 1px 1px rgba(89,52,15,.28));
}
/* The body and wings share a canvas so their hinges stay registered in a turn. */
.honeybee::before, .honeybee-wing {
    position: absolute; inset: 0;
    background: url("../img/honeybee.webp") center / 100% 100% no-repeat;
}
.honeybee::before {
    content: "";
    background-image: url("../img/honeybee-body.webp");
}
.honeybee-wing.far-wing {
    transform-origin: 50% 35%;
    clip-path: polygon(8% 0, 40% 0, 52% 28%, 53% 34%, 49% 40%, 35% 40%, 21% 33%, 9% 22%);
}
.honeybee-wing.near-wing {
    transform-origin: 49% 57%;
    clip-path: polygon(49% 53%, 52% 56%, 48% 67%, 40% 77%, 35% 82%, 34% 92%, 7% 94%, 9% 79%, 21% 65%, 34% 57%);
}
@media (prefers-reduced-motion: reduce) {
    .honeybee-layer { display: none; }
}
