/* Calendar, events, random encounters and scenes (timekeeper.js). */

.tk-body { display: flex; flex-direction: column; gap: 12px; }
.tk-body .kicker, .tk-sc .kicker { font: 700 8px var(--mono); letter-spacing: .26em; text-transform: uppercase; color: var(--dim); }
.tk-empty { padding: 10px 4px; }

/* date + time picker */
.tk-when { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.tk-when .tk-year { width: 70px; }
.tk-when .tk-dayin { width: 50px; }
.tk-when .tk-month { max-width: 150px; }
.tk-at, .tk-daylbl, .tk-unit { font: 9px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim-2); }
.tk-time { width: 112px; font-family: var(--mono); }
.tk-modal { width: min(460px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 12px; }

/* month view */
.tk-month { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: start; }
.tk-grid-wrap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tk-mhead { display: flex; align-items: center; gap: 8px; }
.tk-mtitle { display: flex; flex-direction: column; align-items: center; min-width: 150px; }
.tk-mtitle b { font: 400 20px var(--serif); letter-spacing: .08em; text-transform: uppercase; color: #eee7d9; font-weight: 400; }
.tk-grid { display: grid; grid-template-columns: repeat(var(--cols, 7), minmax(0, 1fr)); gap: 3px; }
.tk-wd { font: 700 7.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim-2); text-align: center; padding: 3px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-cell {
  position: relative; min-height: 58px; padding: 4px 5px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; text-align: left;
  background: rgba(10, 15, 24, .7); border: 1px solid var(--rule); border-radius: 3px; color: var(--ink-2); font: 11px var(--sans); overflow: hidden; box-shadow: none !important;
}
.tk-cell.pad { background: transparent; border-color: transparent; }
.tk-cell.past { opacity: .55; }
.tk-cell:hover:not(:disabled) { border-color: var(--rule-2); background: rgba(20, 27, 40, .9); }
.tk-cell.sel { border-color: var(--accent-dim); box-shadow: inset 0 0 0 1px var(--accent-dim) !important; }
.tk-cell.today { border-color: var(--accent); background: linear-gradient(160deg, rgba(220, 179, 92, .16), rgba(220, 179, 92, .03)); opacity: 1; }
.tk-cell.today .tk-dnum { color: var(--accent); }
.tk-cell.today::after { content: "today"; position: absolute; right: 4px; top: 4px; font: 700 6.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.tk-dnum { font: 600 13px var(--serif); color: #eee7d9; }
.tk-ev { display: block; font: 9.5px/1.3 var(--sans); color: #d9cfae; background: rgba(220, 179, 92, .1); border-left: 2px solid var(--accent); padding: 1px 4px; border-radius: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-ev.gm { color: #b7c7e6; background: rgba(74, 143, 212, .12); border-left-color: var(--mana); }
.tk-more { font: 8px var(--mono); color: var(--dim); }
.tk-daily { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tk-daily .tk-ev { display: inline-block; }
.tk-dayside { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--rule); border-radius: 4px; background: rgba(5, 8, 13, .4); }
.tk-dtitle { margin: 0; font-size: 22px; }
.tk-now { font: 11px var(--mono); color: var(--accent); }
.tk-dayevents { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.tk-devent { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--ink-2); padding: 4px 0; border-bottom: 1px solid rgba(37, 48, 74, .5); }
.tk-devent .tag { font-size: 7px; padding: 1px 4px; }
.tk-dt { font: 10px var(--mono); color: var(--accent); }
.tk-devent.gm .tk-dt { color: var(--mana); }
.tk-dayacts { gap: 5px; }
.tk-dayacts button { text-align: left; }

/* events */
.tk-events { display: flex; flex-direction: column; gap: 10px; }
.tk-events > .row p { margin: 0; }
.tk-evform { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--accent-dim); border-radius: 4px; background: rgba(220, 179, 92, .04); }
.tk-evtext { width: 100%; font-size: 13px; }
.tk-evlist { display: flex; flex-direction: column; }
.tk-evrow { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid rgba(37, 48, 74, .5); }
.tk-evrow.past { opacity: .5; }
.tk-evdate { flex: none; width: 190px; font: 10.5px var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-evdate b { color: var(--accent); font-weight: 400; }
.tk-evtxt { flex: 1; min-width: 0; font: 14px var(--serif); color: #eee7d9; }

/* setup */
.tk-setcols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; }
.tk-setsec { display: flex; flex-direction: column; gap: 6px; }
.tk-setsec h4 { margin: 0 0 4px; }
.tk-setsec h4 + * { margin-top: 0; }
.tk-listed { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.tk-lrow { display: flex; align-items: center; gap: 6px; width: 100%; }
.tk-lrow .tb-n { padding-top: 0; width: 18px; flex: none; }
.tk-lrow .tb-ctl { padding-top: 0; }
.tk-listed > button { margin-top: 4px; }
.tk-setfoot { padding-top: 10px; border-top: 1px solid var(--rule); }

/* encounters */
.tk-enc p { margin: 0; }
.tk-big { font-size: 14px !important; color: var(--ink) !important; }

/* scenes */
.tk-sc { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.tk-sclist { display: flex; flex-direction: column; gap: 10px; padding: 12px 10px; border-right: 1px solid var(--rule); overflow-y: auto; background: rgba(5, 8, 13, .35); }
.tk-scnew { flex: none; gap: 5px; }
.tk-scitem { display: flex; align-items: stretch; gap: 3px; border-radius: 4px; }
.tk-scpick { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 9px; text-align: left; background: transparent; border-color: transparent; color: var(--ink-2); box-shadow: none !important; }
.tk-scpick:hover:not(:disabled) { background: rgba(255, 255, 255, .03); border-color: var(--rule); }
.tk-scitem.on .tk-scpick { color: #fff; border-color: var(--accent-dim); background: linear-gradient(90deg, rgba(220, 179, 92, .12), rgba(220, 179, 92, .02)); box-shadow: inset 2px 0 var(--accent) !important; }
.tk-scn { font: 14px var(--serif); letter-spacing: .03em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-scsub { font: 8.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim-2); }
.tk-scgo { width: 38px; padding: 0; font-size: 13px; color: var(--accent); border-color: var(--accent-dim); }
.tk-scgo:hover:not(:disabled) { color: #1b1408; background: var(--accent); }
.tk-scform { display: flex; flex-direction: column; gap: 10px; padding: 14px; overflow-y: auto; min-width: 0; }
.tk-apply { padding: 10px 18px; font-size: 11px; }
.tk-scsec { border: 1px solid var(--rule); border-radius: 4px; padding: 8px 12px; background: rgba(5, 8, 13, .3); display: flex; flex-direction: column; gap: 8px; }
.tk-scsec:not(.on) { opacity: .75; }
.tk-scsec.on { border-color: var(--rule-2); }
.tk-sch { font: 700 9px var(--mono) !important; letter-spacing: .22em !important; text-transform: uppercase; color: var(--accent) !important; }
.tk-scbody { display: flex; flex-direction: column; gap: 8px; }
.tk-scbody p { margin: 0; }
.tk-rng { flex-direction: row; align-items: center; gap: 6px; }
.tk-rng input { width: 90px; }
.tk-tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; }
.tk-pl { font: 8px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim-2); }
.tk-sprow { align-items: flex-start; gap: 10px; }
.tk-sprow .col { flex: none; gap: 5px; }
.tk-scfoot { padding-top: 4px; }

@media (max-width: 680px) {
  .tk-month, .tk-setcols { grid-template-columns: 1fr; }
  .tk-sc { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .tk-sclist { max-height: 170px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .tk-evdate { width: 120px; }
}
