/* The office's own date field (datefield.js): the box as the office writes a date, and its calendar. */
.df-wrap { position: relative; display: inline-flex; align-items: center; max-width: 100%; vertical-align: middle; }
.fld .df-wrap, .df-wrap:has(> .df-box[style*="width"]) { display: flex; }
.df-native { position: absolute !important; inset: 0 !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; border: 0 !important; padding: 0 !important; margin: 0 !important; }
.df-box { flex: 1 1 auto; min-width: 9.5em; padding-inline-end: 34px !important; font-variant-numeric: tabular-nums; }
.df-box.df-bad { border-color: #9a3b2e !important; box-shadow: 0 0 0 2px rgba(154, 59, 46, .15); }
.df-btn { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ui-ink-2, #5a554b); border-radius: 6px; cursor: pointer; }
.df-btn:hover { background: rgba(189, 183, 151, .2); }
.df-off .df-btn { opacity: .4; cursor: default; }
.df-pop { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 80; width: 280px; max-width: calc(100vw - 24px); background: var(--ui-card, #fffdf8); border: 1px solid var(--ui-line-2, #e3dbc6); border-radius: 12px; box-shadow: 0 12px 32px -12px rgba(20, 18, 16, .35); padding: 10px; font-family: var(--ui-font); }
.df-pop.df-flip { inset-inline-start: auto; inset-inline-end: 0; }
.df-pop.df-up { top: auto; bottom: calc(100% + 6px); }
.df-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.df-head b { font-size: 14.5px; font-weight: 600; }
.df-head button { width: 32px; height: 32px; border: 1px solid var(--ui-line, #e6dfcc); background: transparent; border-radius: 8px; font-size: 18px; line-height: 1; cursor: pointer; color: inherit; }
.df-days, .df-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.df-days i { font-style: normal; font-size: 11px; color: var(--ui-ink-2, #7a7468); padding: 4px 0; }
.df-grid button { height: 34px; border: 0; background: transparent; border-radius: 8px; font-size: 13.5px; cursor: pointer; color: inherit; font-variant-numeric: tabular-nums; }
.df-grid button:hover { background: rgba(189, 183, 151, .2); }
.df-grid button.today { box-shadow: inset 0 0 0 1px var(--ui-gold-2, #8f8a68); }
.df-grid button.on { background: var(--ui-ink, #211f1c); color: #f4eee0; }
.df-grid button:disabled { opacity: .3; cursor: default; }
.df-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.df-foot button { border: 1px solid var(--ui-line, #e6dfcc); background: transparent; border-radius: 99px; padding: 5px 14px; font-size: 13px; cursor: pointer; color: inherit; }
@media (max-width: 760px) { .df-box { min-width: 0; } .df-grid button { height: 38px; } }
@media print { .df-btn, .df-pop { display: none !important; } }
/* The icon sits at the line's end in either language, and the date keeps clear of it. */
html[dir="ltr"] .df-box { padding-right: 34px !important; padding-left: 10px !important; text-align: left; }
html[dir="rtl"] .df-box { padding-left: 34px !important; padding-right: 10px !important; text-align: right; }

/* The calendar laid whole in the middle of the screen, where there is no room beside its box (a phone). */
.df-pop.df-mid { position: fixed; top: 50%; bottom: auto; left: 50%; right: auto; inset-inline: auto; left: 50%; transform: translate(-50%, -50%); z-index: 300; width: min(320px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.df-shade { position: fixed; inset: 0; z-index: 299; background: rgba(20, 18, 15, .35); }
@media (pointer: coarse) { .df-pop .df-grid button { min-height: 40px; } .df-pop .df-head button, .df-pop .df-foot button { min-height: 40px; min-width: 44px; } }
