/* Panel - modale, toasty, responsywnosc */

.timeline-item.js-entry-open:hover,
.entry-row.js-entry-open:hover,
.expense-item.js-entry-open:hover,
.dashboard-expense-item.js-entry-open:hover {
  background: #f8fbff;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 15, 30, 0.55);
}

.modal.hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.modal-box {
  position: relative;
  width: min(900px, 100%);
  max-height: min(90vh, 90dvh);
  overflow: auto;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

#entryModalContent > h2:first-child,
.modal-entry-title,
.modal-box > h2:first-child {
  margin: 0 0 12px;
  padding: 7px 48px 0 0;
  min-height: 36px;
  box-sizing: border-box;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.modal-close {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dc3545;
  color: #fff;
  font-size: 0;
  line-height: 0;
  box-shadow: 0 8px 18px rgba(220, 53, 69, 0.22);
}

.modal-close span {
  display: block;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-1px);
  margin: 0;
  padding: 0;
}

.modal-close:hover {
  transform: scale(1.08);
  filter: brightness(1.05);
}

.modal-description {
  margin-top: 20px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.modal-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.modal-gallery img {
  width: 160px;
  height: 120px;
  object-fit: cover;
  border-radius: 14px;
}

.entry-modal {
  display: grid;
  gap: 14px;
}

.entry-modal-type {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
}

.entry-modal-field {
  display: grid;
  gap: 6px;
}

.entry-modal-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.entry-modal-lead {
  margin: 0;
  font-size: 13px;
}

.entry-modal-linked {
  margin: 0;
}

.entry-modal-linked-banner {
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--blue) 6%, var(--panel));
}

.entry-modal-linked-lead {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--text);
}

.entry-modal-linked-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.entry-modal-linked-note {
  margin: 8px 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.entry-modal-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.entry-modal-meta-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.entry-modal-meta-item span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.entry-modal-meta-item strong {
  font-size: 14px;
}

.entry-modal-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.entry-modal-description {
  margin-top: 0;
}

.entry-modal-description-box {
  grid-column: 1 / -1;
}

.entry-modal-description-body {
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.entry-modal-description-body .bbcode-quote,
.entry-modal-description-body blockquote {
  margin: 0 0 8px;
  padding: 8px 12px;
  border-left: 4px solid var(--blue);
  background: color-mix(in srgb, var(--blue) 8%, var(--panel));
  border-radius: 0 10px 10px 0;
  line-height: 1.45;
}

.entry-modal-description-body .bbcode-quote:empty,
.entry-modal-description-body blockquote:empty {
  display: none;
}

.entry-modal-description-body .bbcode-list,
.entry-modal-description-body ul,
.entry-modal-description-body ol {
  margin: 0 0 10px;
  padding-left: 20px;
}

.entry-modal-description-body .bbcode-list-dash {
  list-style: none;
  padding-left: 0;
}

.entry-modal-description-body .bbcode-list-dash li::before {
  content: "– ";
  color: var(--muted);
}

.entry-modal-section-items {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.entry-modal-items-table {
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
}

.entry-modal-items-table thead th {
  background: color-mix(in srgb, var(--blue) 8%, var(--panel));
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.entry-modal-items-table tbody tr + tr {
  border-top: 1px solid var(--line);
}

.entry-modal-items-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--line) 24%, transparent);
}

.entry-modal-items-table td,
.entry-modal-items-table th {
  padding: 12px 14px;
}

.entry-modal-items-table .items-table-name {
  font-weight: 600;
}

.entry-modal-files {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.entry-file-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.entry-file-preview {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
}

.entry-file-preview img {
  width: 100%;
  min-height: 220px;
  max-height: 320px;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  background: color-mix(in srgb, var(--line) 55%, var(--panel));
}

.entry-file-ext {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 6px 12px;
  border-radius: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.entry-file-ext.is-jpg { background: #ea580c; }

.entry-file-ext.is-png { background: #2563eb; }

.entry-file-ext.is-pdf { background: #dc2626; }

.entry-file-ext.is-webp { background: #7c3aed; }

.entry-file-ext.is-gif { background: #059669; }

.entry-file-ext.is-file { background: #334155; }

.entry-file-ext.is-xls { background: #15803d; }

.entry-file-preview.is-pdf-embed {
  position: relative;
  min-height: 280px;
  border-radius: 12px;
  overflow: hidden;
  background: #f1f5f9;
}

.entry-file-preview.is-pdf-embed iframe {
  width: 100%;
  height: 280px;
  border: 0;
  display: block;
  background: #fff;
}

.entry-file-open-link {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
}

.entry-file-open-link:hover {
  text-decoration: underline;
}

.entry-file-preview.is-pdf-preview,
.entry-file-preview.is-file-preview {
  display: grid;
  place-items: center;
  min-height: 180px;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  text-decoration: none;
}

.entry-file-generic-label {
  font-size: 18px;
  font-weight: 800;
  color: #475569;
}

.entry-file-pdf-label {
  font-size: 28px;
  font-weight: 800;
  color: #1d4ed8;
}

.entry-file-copy strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.entry-file-copy small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.modal-image-zoom {
  position: fixed;
  inset: 0;
  z-index: 3500;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.92);
}

.modal-image-zoom-figure {
  margin: 0;
  max-width: min(96vw, 1200px);
  max-height: 90vh;
  text-align: center;
}

.modal-image-zoom-figure img {
  max-width: 100%;
  max-height: 86vh;
  border-radius: 14px;
  object-fit: contain;
  background: #0f172a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.modal-image-zoom-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-size: 0;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.modal-image-zoom-close span {
  display: block;
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
}

body.modal-zoom-open {
  overflow: hidden;
}

.rich-editor-surface a.bbcode-link,
.entry-modal-description-body a.bbcode-link,
.bbcode-link {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.entry-modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* Wiersz "link do skopiowania" - używany na stronie Kalendarz (subskrypcja iCal)
   oraz w modalu "Udostępnij projekt" na Pulpicie. */
.cal-subscribe-link-row {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.cal-subscribe-input {
  flex: 1;
  min-width: 0;
  padding: .45rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: .8rem;
  font-family: monospace;
  cursor: text;
}
.cal-subscribe-input:focus { outline: 2px solid #2563eb; }
.cal-subscribe-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.cal-subscribe-copy-btn:hover { background: color-mix(in srgb, #2563eb 10%, var(--panel)); color: #2563eb; }
.cal-subscribe-copy-btn.is-copied { background: color-mix(in srgb, #16a34a 12%, var(--panel)); color: #16a34a; border-color: #16a34a; }

@media (max-width: 640px) {
  .cal-subscribe-input {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    font-size: .75rem;
  }
  .cal-subscribe-copy-btn {
    flex: 1;
    justify-content: center;
  }
}

/* Edytor sekcji w modalu "Udostępnij projekt" - podgląd kafelków (jak mockup),
   przeciąganie = zamiana miejsc, zapis jednym przyciskiem. Pozycje inline z JS. */
.share-modal {
  max-width: min(920px, 96vw);
}

.share-sections-editor {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.share-sections-title {
  margin: 0 0 4px;
  font-size: .95rem;
}

.share-sections-desc {
  margin: 0 0 .75rem;
  font-size: .8rem;
}

.share-layout-editor-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(72px, auto)) minmax(72px, auto);
  grid-auto-rows: minmax(72px, auto);
  grid-auto-flow: row dense;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 14px;
}

.share-editor-drop-rows {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, #2563eb 4%, var(--bg));
}

.share-editor-drop-label {
  font-size: .74rem;
  font-weight: 700;
  color: var(--muted);
  margin-right: 4px;
}

.share-editor-drop-btn {
  border: 1px solid color-mix(in srgb, #2563eb 30%, var(--line));
  border-radius: 999px;
  background: var(--panel);
  color: #2563eb;
  font-size: .72rem;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
}

.share-editor-drop-btn:hover,
.share-editor-drop-btn.is-drop-target {
  background: color-mix(in srgb, #2563eb 12%, var(--panel));
  border-color: #2563eb;
}

.share-editor-tile {
  position: relative;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 24px 30px;
  border: 2px solid color-mix(in srgb, #2563eb 45%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, #2563eb 6%, var(--bg));
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  cursor: grab;
  user-select: none;
  transition: box-shadow .12s ease, border-color .12s ease, opacity .12s ease;
}

.share-editor-tile:active {
  cursor: grabbing;
}

.share-editor-tile.is-dragging {
  opacity: .45;
}

.share-editor-tile.is-drop-target {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px color-mix(in srgb, #2563eb 35%, transparent);
}

.share-editor-tile-grip {
  position: absolute;
  top: 5px;
  left: 6px;
  font-size: .9rem;
  line-height: 1;
  color: color-mix(in srgb, #2563eb 70%, var(--text));
  opacity: .85;
}

.share-editor-tile-label {
  line-height: 1.25;
  padding: 0 4px;
}

.share-editor-tile-hide {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.share-editor-tile-hide:hover {
  background: color-mix(in srgb, #ef4444 14%, transparent);
  color: #ef4444;
}

.share-editor-tile-size {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 4px;
  display: grid;
  gap: 2px;
  pointer-events: auto;
}

.share-editor-tile-slider {
  width: 100%;
  height: 14px;
  margin: 0;
  cursor: pointer;
  accent-color: #2563eb;
}

.share-editor-tile-size-label {
  font-size: .62rem;
  font-weight: 800;
  line-height: 1;
  color: #2563eb;
  text-align: center;
}

.share-layout-editor-actions-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.share-layout-editor-reset {
  font-size: .78rem;
  padding: 6px 10px;
}

.share-layout-editor-hidden-label {
  margin: 0 0 6px;
  font-size: .78rem;
  color: var(--muted);
}

.share-layout-editor-hidden {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  transition: border-color .12s ease, background .12s ease;
}

.share-layout-editor-hidden.is-drop-target {
  border-color: #2563eb;
  background: color-mix(in srgb, #2563eb 6%, transparent);
}

.share-layout-editor-hidden-empty {
  font-size: .78rem;
  color: var(--muted);
}

.share-editor-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 8%, var(--bg));
  font-size: .78rem;
  color: var(--muted);
}

.share-editor-chip-show {
  border: none;
  background: none;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
  color: #2563eb;
  cursor: pointer;
}

.share-editor-chip-show:hover {
  background: color-mix(in srgb, #2563eb 12%, transparent);
}

.share-layout-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.share-layout-editor-dirty {
  font-size: .78rem;
  color: var(--muted);
}

.share-layout-editor-dirty.is-dirty {
  color: #d97706;
  font-weight: 700;
}

@media (max-width: 560px) {
  .share-layout-editor-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .share-editor-tile {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }
}

.journal-important-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, #ef4444 12%, var(--panel));
  border: 1px solid color-mix(in srgb, #ef4444 40%, var(--line));
  color: #b91c1c;
  font-weight: 800;
  font-size: 0.88rem;
  box-shadow: 0 0 0 1px color-mix(in srgb, #ef4444 12%, transparent);
}

.entry-modal-delete {
  display: contents;
}

.modal-box .form-message.full {
  margin-top: 0;
}

.toast-root {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  right: 16px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(440px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  color: #0f172a;
  transform: translateY(-8px) scale(0.98);
  opacity: 0;
  transition: opacity .22s ease, transform .22s ease;
  overflow: hidden;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.is-hiding {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

.toast-body {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 16px 18px;
}

.toast-message {
  flex: 1;
  display: block;
  min-height: 44px;
  padding: 10px 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  color: inherit;
}

.toast-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.toast-link:hover {
  opacity: 0.85;
}

.toast-close {
  display: grid;
  place-items: center;
  width: 46px;
  min-width: 46px;
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.48);
  color: inherit;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  padding: 0;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.72);
}

.toast-progress {
  height: 4px;
  background: rgba(15, 23, 42, 0.08);
}

.toast-progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: right center;
  animation-name: toast-progress-shrink;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.toast-success .toast-progress-bar {
  background: #16a34a;
}

.toast-error .toast-progress-bar {
  background: #dc2626;
}

.toast-info .toast-progress-bar {
  background: #2563eb;
}

.toast-warning .toast-progress-bar {
  background: #d97706;
}

.toast-success {
  background: #ecfdf5;
  border-color: rgba(16, 185, 129, 0.26);
  color: #065f46;
}

.toast-error {
  background: #fef2f2;
  border-color: rgba(239, 68, 68, 0.26);
  color: #991b1b;
}

.toast-info {
  background: #eff6ff;
  border-color: rgba(59, 130, 246, 0.24);
  color: #1d4ed8;
}

.toast-warning {
  background: #fff7ed;
  border-color: rgba(249, 115, 22, 0.24);
  color: #c2410c;
}

.is-busy-host .app-busy-overlay {
  pointer-events: auto;
}

.app-busy-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  backdrop-filter: blur(2px);
}

.app-busy-overlay-page {
  position: fixed;
  z-index: 2500;
  background: rgba(15, 23, 42, 0.18);
}

.app-busy-spinner {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px 22px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  color: var(--text);
}

.app-busy-spinner span {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid color-mix(in srgb, var(--blue) 18%, transparent);
  border-top-color: var(--blue);
  animation: app-busy-spin 0.8s linear infinite;
}

.app-busy-spinner small {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.expense-modal-ocr-toolbar {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 4px;
}

.expense-modal-ocr-toolbar .js-expense-ocr-trigger {
  width: auto;
}

@media (max-width: 640px) {
  .toast-root {
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    left: 12px;
    right: 12px;
    width: auto;
  }

  .toast-body {
    min-height: 72px;
    padding: 14px 14px 14px 16px;
  }

  .toast-message {
    font-size: 15px;
  }

  .toast-close {
    width: 44px;
    min-width: 44px;
    height: 44px;
    font-size: 30px;
  }
}

.confirm-modal-box {
  width: min(520px, 100%);
  padding: 28px;
}

.confirm-modal-box h2 {
  margin: 0 0 12px;
}

.confirm-modal-message {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.confirm-modal-password {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  font-weight: 600;
}

.confirm-modal-password[hidden] {
  display: none;
}

.confirm-modal-password input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
}

.confirm-plan-name.is-pro {
  color: #2563eb;
  font-weight: 800;
}

.confirm-plan-name.is-max {
  color: #7c3aed;
  font-weight: 800;
}

.confirm-plan-name.is-free {
  color: #111827;
  font-weight: 800;
}

.confirm-plan-days {
  color: #dc2626;
  font-weight: 800;
}

.confirm-plan-date {
  color: inherit;
  font-weight: 800;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.entry-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.entry-row:last-child {
  border-bottom: 0;
}

.entry-media {
  width: 118px;
}

.entry-content {
  min-width: 0;
}

.entry-content strong {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
}

.entry-content p {
  margin: 0 0 8px;
  overflow: hidden;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.entry-content small {
  color: #475569;
  font-size: 14px;
}

.entry-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.entry-actions form {
  margin: 0;
  display: flex;
}

@media (max-width: 720px) {
  .entry-row {
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
  }

  .entry-media {
    width: 72px;
  }

  .entry-actions {
    grid-column: 2;
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .entry-actions .action-button,
  .entry-actions .details-button,
  .entry-actions .danger {
    width: 52px;
    min-width: 52px;
    height: 46px;
    padding: 0;
    border-radius: 12px;
    font-size: 0;
  }

  .entry-actions .danger {
    width: auto;
    min-width: 82px;
    padding: 0 14px;
    font-size: 17px;
  }

  .entry-actions .mobile-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    text-transform: lowercase;
  }

  .timeline-photo img,
  .thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
  }

  .dashboard-expense-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dashboard-expense-amount {
    text-align: left;
  }

  .mini-card form .action-button,
  .mini-card form .danger {
    width: 100%;
    min-width: 0;
    margin-top: 14px;
  }

  .form-panel button.action-button,
  .form-panel .action-button {
    width: 100%;
    min-width: 0;
  }
}

.entry-modal-status-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.entry-modal-actions-schedule {
  margin-top: 4px;
}

@media (max-width: 720px) {
  .entry-modal-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .entry-modal-actions .entry-modal-delete {
    display: block;
    width: 100%;
  }

  .entry-modal-actions .entry-modal-delete form {
    width: 100%;
    display: flex;
  }

  .entry-modal-actions .action-button,
  .entry-modal-actions .secondary-button,
  .entry-modal-actions .danger {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    white-space: normal;
    text-align: center;
    font-size: 14px;
  }
}

.entry-modal-schedule-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.entry-modal-schedule-toolbar .entry-modal-status-buttons {
  flex: 1 1 auto;
  min-width: 0;
}

.entry-modal-schedule-toolbar .entry-modal-delete {
  flex-shrink: 0;
  margin: 0;
}

.entry-modal-schedule-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}

@media (max-width: 720px) {
  .entry-modal-schedule-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .entry-modal-schedule-toolbar .entry-modal-status-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }

  .entry-modal-schedule-toolbar-right {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .entry-modal-schedule-toolbar-right .action-button,
  .entry-modal-schedule-toolbar-right .danger,
  .entry-modal-schedule-toolbar-right .entry-modal-delete,
  .entry-modal-schedule-toolbar-right form {
    width: 100%;
  }
}

.entry-modal-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.entry-modal-journal-actions {
  margin-bottom: 8px;
}

.entry-modal-status-item strong {
  display: inline-flex;
  align-items: center;
}

.entry-modal-status {
  margin: 0;
}

.journal-edit-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.journal-edit-photo {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}

.journal-edit-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.journal-edit-photo .expense-attachment-preview {
  width: 100%;
  min-height: 0;
}

.journal-edit-photo .expense-attachment-preview img {
  width: 100%;
  max-height: none;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.journal-edit-photo .expense-attachment-preview.is-file {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-height: 0;
  padding: 10px 8px;
  gap: 0;
  overflow: hidden;
}

.journal-edit-photo .expense-attachment-preview.is-file .expense-attachment-preview-badge {
  min-width: 52px;
  width: 52px;
  height: 52px;
  font-size: 0.78rem;
}

.journal-edit-photo .expense-attachment-preview-name {
  display: none;
}

.journal-photos-modal-box {
  padding-top: 28px;
}

.journal-photos-modal-box > h2 {
  margin: 0 48px 18px 0;
  padding-right: 8px;
}

.journal-photos-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.journal-photos-modal-item {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.journal-photos-modal-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}
