/* <x-detail>: the detail panel, same look as the Bouwplan prototype. */
x-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);

  > .empty-state { flex: 1; display: grid; place-items: center; text-align: center; padding: 40px; }
  .empty-title { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
  .empty-text { color: var(--fg-3); }

  > .main { flex: 1; min-height: 0; display: flex; flex-direction: column; }

  .head { padding: 20px 24px 14px; flex: none; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
  .head .title { font-size: 20px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
  .head .sub { color: var(--fg-3); font-size: 14px; }

  /* The tab bar is an <x-tabs> (components/x-tabs); only its place in the panel is set here */
  .tabs { padding: 0 16px; flex: none; }

  .body { flex: 1; overflow-y: auto; padding: 24px; container-type: inline-size; }
  .body.fade { animation: detail-fade 0.35s var(--ease); }

  .foot { flex: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 24px; border-top: 1px solid var(--line); min-height: 61px; }
  .actions, .confirm { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; align-items: center; }
  .actions[hidden], .confirm[hidden] { display: none; }
  .confirm-text { color: var(--danger); font-weight: 600; font-size: 13.5px; }
  .confirm-text.neutral { color: var(--fg); font-weight: 500; }

  .save-state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-3); transition: opacity 0.5s var(--ease); }
  .save-state .ic { width: 16px; height: 16px; }
  .save-state.saving .ic { animation: detail-spin 1s linear infinite; }
  .save-state.saved { color: var(--ok); font-weight: 600; animation: detail-fade 0.35s var(--ease); }
  .save-state.saved .ic { stroke-width: 2.5; }
  .save-state.failed { color: var(--danger); font-weight: 600; }
  .save-state.fading { opacity: 0; }
}

@keyframes detail-fade { from { opacity: 0; } }
@keyframes detail-spin { to { transform: rotate(360deg); } }

/* Mobile: the detail is part of the page scroll, under the sticky list bar */
@media (max-width: 767px) {
  x-detail {
    border-radius: 0;
    border-width: 0;
    overflow: visible;

    .head { padding: 18px 16px 12px; }
    .tabs { padding: 0 6px; }
    .body { overflow: visible; padding: 20px 16px 28px; }
    .foot { padding: 12px 16px; }
  }
}
