/* Entry side panel (js/entry-panel.js), on index.html. A <dialog> opened
   with showModal(), so the browser handles focus, Esc and the backdrop.
   Loads after css/common.css. */

/* --- Header button ------------------------------------------------------- */
.new-entry-btn { text-decoration: none; }
.new-entry-btn svg { width: 14px; height: 14px; }
@media (max-width: 640px) {
  .new-entry-btn span { display: none; }
  .new-entry-btn { padding: 6px 9px; }
}

/* --- The panel ------------------------------------------------------------- */
dialog.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(460px, 100vw);
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  border-left: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
dialog.drawer[open] {
  display: flex;
  flex-direction: column;
  animation: drawer-in .22s cubic-bezier(.2, .8, .2, 1);
}
/* Light enough that the list stays readable behind it. */
dialog.drawer::backdrop {
  background: color-mix(in srgb, var(--scrim) 45%, transparent);
  animation: fade-in .2s ease-out;
}
@keyframes drawer-in { from { transform: translateX(32px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  dialog.drawer[open], dialog.drawer::backdrop { animation: none; }
}

.drawer-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-4) var(--s-4) var(--s-6);
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 17px; }
.drawer-head .icon-btn { margin-left: auto; align-self: center; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-5) var(--s-6) var(--s-6);
}

.drawer-foot {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  padding: var(--s-4) var(--s-6) var(--s-2);
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.drawer-foot .spacer { flex: 1; }
.drawer-hint {
  padding: 0 var(--s-6) var(--s-4);
  font-size: 11.5px;
  color: var(--ink-faint);
  text-align: right;
}
@media (hover: none) { .drawer-hint { display: none; } .drawer-foot { padding-bottom: var(--s-4); } }

/* --- Prefill chips ---------------------------------------------------------- */
.prefills { margin-bottom: var(--s-5); }
.prefills-label {
  font-size: var(--fs-xs);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-faint);
  margin-bottom: var(--s-2);
}
.pf-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-skel { width: 96px; height: 30px; border-radius: 999px; }
.pf-chip {
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  font-family: inherit;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.pf-chip:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pf-empty { margin: 0; font-size: var(--fs-sm); color: var(--ink-soft); line-height: 1.5; }

/* --- Form --------------------------------------------------------------------- */
.drawer .row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Hours gets the larger input: it's the field touched on every entry. */
.hours-input { font-size: 20px; font-weight: 650; padding: 6px 12px; height: 41px; }
.key-row input[type="date"] { height: 41px; }
.details { padding-top: var(--s-5); border-top: 1px solid var(--line); min-width: 0; }
.details-head {
  margin-bottom: var(--s-3);
  font-size: var(--fs-xs);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-faint);
}

/* "= 1h 30m" next to the Hours label, from what's typed (js/entry-panel.js). */
.hours-hint { font-weight: 500; color: var(--ink-faint); margin-left: var(--s-1); font-variant-numeric: tabular-nums; }
