:root {
  --ink: #1d2730; --muted: #5d6b77; --line: #d3dae0; --bg: #f2f4f6; --card: #fff;
  --accent: #17604f; --accent-ink: #fff; --danger: #a8352a; --warn: #8a5a00;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #2f8f78; outline-offset: 2px; }

.login { max-width: 22rem; margin: 12vh auto; padding: 2rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.login h1 { margin: 0 0 1.25rem; font-size: 1.5rem; }

header.top { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1.25rem; background: var(--card); border-bottom: 1px solid var(--line); }
header.top h1 { margin: 0; font-size: 1.15rem; }
main { max-width: 56rem; margin: 0 auto; padding: 1.25rem 1.25rem 7rem; }
.bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin-bottom: 1rem; }
.bar .grow { flex: 1 1 14rem; }

label { display: block; font-weight: 600; margin-bottom: .75rem; }
label > input, label > select, label > textarea { display: block; width: 100%; margin-top: .25rem; font-weight: 400; }
input, select, textarea { padding: .5rem .6rem; border: 1px solid #aeb8c0; border-radius: 6px; background: #fff; }
textarea { resize: vertical; }

button { padding: .5rem .9rem; border: 1px solid #aeb8c0; border-radius: 6px; background: #fff; cursor: pointer; }
button:hover:not(:disabled) { background: #eef1f3; }
button:disabled { opacity: .55; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover:not(:disabled) { background: #11493c; }
button.danger { color: var(--danger); border-color: #d9aaa5; }
button.small { padding: .25rem .6rem; font-size: .875rem; }

#list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
#list li { display: grid; grid-template-columns: 8.5rem 1fr auto auto; gap: .75rem; align-items: center; padding: .65rem .9rem; border-top: 1px solid var(--line); }
#list li:first-child { border-top: 0; }
#list li.gone .title { color: var(--muted); text-decoration: line-through; }
#list .date { font-variant-numeric: tabular-nums; color: var(--muted); }
#list .title small { display: block; color: var(--muted); }
#list .empty { display: block; color: var(--muted); }
.badge { font-size: .8rem; padding: .1rem .5rem; border-radius: 99px; border: 1px solid var(--line); }
.badge.aktív { color: var(--accent); border-color: #9cc5ba; }
.badge.törölt { color: var(--danger); border-color: #d9aaa5; }
.actions { display: flex; gap: .4rem; }

footer.publish { position: fixed; inset: auto 0 0 0; display: flex; justify-content: flex-end; align-items: center; gap: 1rem; padding: .75rem 1.25rem; background: var(--card); border-top: 1px solid var(--line); }
footer.publish .state { color: var(--muted); }
footer.publish .state.dirty { color: var(--warn); font-weight: 600; }

dialog { width: min(40rem, 94vw); max-height: 94vh; padding: 1.25rem; border: 1px solid var(--line); border-radius: 8px; }
dialog::backdrop { background: rgba(20, 30, 38, .45); }
dialog h2 { margin: 0 0 1rem; font-size: 1.2rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.imgfield { display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.imgfield .t { font-weight: 600; width: 6.5rem; }
.imgfield img { width: 5rem; height: 3.5rem; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); }
.imgfield .none { width: 5rem; height: 3.5rem; display: grid; place-items: center; color: var(--muted); font-size: .8rem; border: 1px dashed var(--line); border-radius: 4px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.err { color: var(--danger); min-height: 1.5rem; margin: 0 0 .5rem; }

#toast { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 10; }
#toast div { padding: .6rem 1rem; border-radius: 6px; background: var(--ink); color: #fff; }
#toast div.bad { background: var(--danger); }

@media (max-width: 40rem) {
  #list li { grid-template-columns: 1fr auto; }
  #list .date { grid-column: 1 / -1; }
  .row2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) { button { transition: background .12s; } }
