* { box-sizing: border-box; }

:root {
  --accent: #ff642f;
  --accent-dark: #e24f1c;
  --link: #c2410c;
  --ink: #272727;
  --muted: #6d6c6c;
  --paper: #ffffff;
  --cream: #faf6f1;
  --line: #eadfd2;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
}

a { color: var(--link); }

h1, h2 { font-family: 'Quicksand', system-ui, sans-serif; font-weight: 700; margin: 0 0 12px; line-height: 1.2; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 20px;
  background: var(--ink);
  border-bottom: 4px solid var(--accent);
}
.brand { display: block; line-height: 0; }
.brand img { height: 44px; width: auto; }
.topbar .link { color: #fff; }
.logout { display: flex; align-items: center; gap: 12px; margin: 0; }
.who { color: #d6d6d6; font-size: 0.9rem; }

.container { max-width: 760px; margin: 0 auto; padding: 28px 16px 40px; }
.footer { text-align: center; padding: 0 16px 32px; color: var(--muted); font-size: 0.9rem; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(39, 39, 39, 0.06);
}
.card.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.card p:last-child { margin-bottom: 0; }

.lead { color: var(--muted); }
.small { font-size: 0.88rem; color: var(--muted); }
.dates { color: var(--muted); }
.emblem { display: block; width: 120px; height: 120px; margin: 0 auto 16px; }
.back { margin: 0 0 16px; }

.stack { display: flex; flex-direction: column; gap: 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
input[type="text"], input[type="password"], input[type="date"], textarea {
  font: inherit;
  padding: 12px 14px;
  border: 1px solid #d9cfc3;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid rgba(255, 100, 47, 0.55); outline-offset: 2px; }

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 13px 22px;
  border: 0;
  border-radius: 999px;
  font-family: 'Quicksand', system-ui, sans-serif;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; cursor: pointer; }

.notice { padding: 12px 16px; border-radius: 12px; margin: 0 0 20px; font-weight: 500; }
.notice.error { background: #fbe9e7; color: #8c2f1f; border: 1px solid #f0b8ae; }
.notice.ok { background: #edf5e4; color: #3f5f1f; border: 1px solid #c4dba6; }

.drop {
  position: relative;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 20px;
  border: 2px dashed var(--accent);
  border-radius: 16px;
  background: var(--cream);
  text-align: center;
  cursor: pointer;
}
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.memorials, .photos { list-style: none; margin: 0; padding: 0; }
.memorials li { margin-bottom: 12px; }
.memorial {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 12px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  text-decoration: none;
}
.thumb { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: var(--cream); display: flex; align-items: center; justify-content: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.placeholder { font-size: 1.6rem; }
.info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.info strong { overflow-wrap: anywhere; }
.info span { color: var(--muted); font-size: 0.9rem; }
.arrow { font-size: 1.6rem; color: var(--accent); }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.photos li { display: flex; flex-direction: column; gap: 6px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); background: var(--cream); }
.photos form { margin: 0; text-align: center; }
.remove { font: inherit; font-size: 0.88rem; background: none; border: 0; padding: 4px 8px; color: #8c2f1f; text-decoration: underline; cursor: pointer; }

textarea { resize: vertical; min-height: 120px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row label { flex: 1 1 180px; }
