:root {
  --bg: #f6f1ea; --card: #fffdf9; --ink: #1d1b19; --muted: #6b635b; --line: #e6dccf;
  --tan: #b08d6a; --tan-dark: #8a6b4e; --soft: #efe6da;
  --c-booking: #4a6a96; --c-airbnb: #d0695e; --c-direct: #b08d6a; --c-block: #a8a199;
  --ok: #4f7a52; --warn: #b5762a; --danger: #a8403a;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
a { color: var(--tan-dark); }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.2; }
h1 { font-size: 1.7rem; margin: .4rem 0 .6rem; }
h2 { font-size: 1.25rem; margin: 1.8rem 0 .7rem; }
h3 { font-size: 1.1rem; margin: 0 0 .5rem; }

.top {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--ink); color: var(--bg);
}
.brand { font-family: Georgia, serif; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mark { color: var(--tan); }
.who { color: #cbbfb1; font-size: .8rem; text-decoration: none; white-space: nowrap; }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px 24px; }

.bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.bottom a {
  flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 2px 9px;
  font-size: .72rem; color: var(--muted); text-decoration: none;
}
.bottom a span { font-size: 1.25rem; line-height: 1.2; }
.bottom a.on { color: var(--ink); font-weight: 600; }
.bottom a.on span { color: var(--tan); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.card.soft { background: var(--soft); }
.card.narrow { max-width: 420px; margin: 32px auto; }
.label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.big { font-size: 1.45rem; font-family: Georgia, serif; margin: 2px 0 4px; }
.small { font-size: .86rem; color: var(--muted); }
.muted { color: var(--muted); }
.lead { font-size: 1.05rem; margin-top: 0; }
.empty { color: var(--muted); font-style: italic; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.grid2 > .card { margin: 0; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; margin: 12px 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }

label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
input, select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; width: 100%; min-width: 0;
}
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--tan-dark); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--tan); outline-offset: 1px; }
input:disabled { background: var(--soft); color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  background: var(--ink); color: var(--bg); border: 1px solid var(--ink); border-radius: 999px;
  padding: 10px 18px; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.big { padding: 14px 18px; font-size: 1.05rem; background: var(--ok); border-color: var(--ok); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--tan-dark); text-decoration: underline; cursor: pointer; }
.link.danger { color: var(--danger); }
form.inline { display: inline; }

.msg { background: #e9f0e6; border: 1px solid #c9dac3; border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.msg.warn { background: #fbf0df; border-color: #ecd3ac; }

.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; color: #fff; vertical-align: middle; }
.badge.booking { background: var(--c-booking); }
.badge.airbnb { background: var(--c-airbnb); }
.badge.direct { background: var(--c-direct); }
.badge.block { background: var(--c-block); }
.badge.warn { background: var(--warn); }
.badge.ok { background: var(--ok); }

.code { text-align: center; }
.codeval { font-size: 2.6rem; font-weight: 700; letter-spacing: .18em; font-variant-numeric: tabular-nums; margin: 4px 0; }
.code details { margin-top: 10px; }
.code summary { cursor: pointer; color: var(--tan-dark); font-size: .9rem; }
.code form { margin-top: 10px; }

.clean { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--tan); border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; }
.clean.done { border-left-color: var(--ok); }
.clean.overdue { border-left-color: var(--danger); }
.clean-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.clean .date { font-size: 1.15rem; font-family: Georgia, serif; }
.clean p { margin: 8px 0; }
.donebox { color: var(--ok); font-weight: 600; }
.donebox .small { font-weight: 400; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; }
.list li > a, .list li > div:first-child:last-child { display: block; }
.list li > a { padding: 12px 14px; color: inherit; text-decoration: none; }
.list li:not(:has(a)) { padding: 12px 14px; }

.calhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.calhead h1 { margin: .3rem 0; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 8px; }
.wd { text-align: center; font-size: .75rem; color: var(--muted); padding: 4px 0; }
.day {
  position: relative; aspect-ratio: 1 / 1; border-radius: 8px; background-color: var(--card);
  border: 1px solid var(--line); color: var(--ink); text-decoration: none; overflow: hidden;
}
.day.empty { background: transparent; border-color: transparent; }
.day .n { position: absolute; top: 3px; left: 5px; font-size: .82rem; font-weight: 600; background: rgba(255,253,249,.85); border-radius: 6px; padding: 0 4px; }
.day .dot { position: absolute; bottom: 2px; right: 5px; font-size: .8rem; color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.5); }
.day.today { outline: 2px solid var(--ink); outline-offset: -2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.seg { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.seg label { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); }

.items { display: flex; flex-direction: column; gap: 6px; }
.item { display: grid; grid-template-columns: 1fr 64px 92px 76px; gap: 6px; }
.item.head span { padding-left: 4px; }
@media (max-width: 560px) {
  .item { grid-template-columns: 1fr 1fr 1fr; }
  .item > input[name="text[]"] { grid-column: 1 / -1; }
  .item.head { display: none; }
}

.copyrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; background: var(--soft); border-radius: 10px; padding: 8px 10px; }
.copyrow code { flex: 1 1 200px; font-size: .78rem; word-break: break-all; }
.person { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.person b { min-width: 90px; }
.person form.row input { width: 130px; }
.log { list-style: none; padding: 0; margin: 0; }
.log li { padding: 4px 0; border-bottom: 1px solid var(--line); }
code { font-family: ui-monospace, Menlo, monospace; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0; }
.grid3 > .card { margin: 0; }
@media (max-width: 560px) { .grid3 { grid-template-columns: 1fr; } }
.spread { display: flex; justify-content: space-between; gap: 8px; }
.dropzone {
  display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center;
  border: 2px dashed var(--tan); border-radius: var(--radius); background: var(--soft); padding: 18px 14px; cursor: pointer; color: var(--ink);
}
.dropzone .dz-title { font-weight: 600; font-size: 1.05rem; }
.dropzone input[type=file] { margin-top: 8px; background: transparent; border: 0; padding: 0; max-width: 100%; }
.preview img { max-width: 100%; max-height: 260px; border-radius: 10px; border: 1px solid var(--line); display: block; margin: 0 auto; }
#beleg-status.ok { color: var(--ok); font-weight: 600; }
#beleg-status.warn { color: var(--warn); font-weight: 600; }
.goal .bar { height: 10px; background: var(--soft); border-radius: 999px; overflow: hidden; margin: 8px 0 6px; }
.goal .bar span { display: block; height: 100%; background: var(--warn); border-radius: 999px; }
.goal.ok .bar span { background: var(--ok); }
.goal.low { border-color: #ecd3ac; }
.goal .hint { margin: 8px 0 0; font-size: .92rem; }
.chart { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 180px; padding: 0 2px; border-bottom: 1px solid var(--line); margin-top: 8px; }
.chart .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-decoration: none; color: var(--muted); position: relative; }
.chart .b { width: 100%; max-width: 34px; border-radius: 6px 6px 0 0; background: var(--warn); min-height: 2px; }
.chart .b.ok { background: var(--ok); }
.chart .b.est { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 4px, transparent 4px 8px); }
.chart .m { position: absolute; bottom: -20px; font-size: .7rem; }
.chart .col.sel .m { color: var(--ink); font-weight: 700; }
.chart .goal-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--ink); z-index: 1; pointer-events: none; }
.chart .goal-line span { position: absolute; right: 0; top: -18px; font-size: .7rem; background: var(--bg); padding: 0 4px; }
.chart + p { margin-top: 26px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; margin: 10px 0; background: var(--card); border-radius: 12px; overflow: hidden; }
.tbl th, .tbl td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; white-space: normal; }
.tbl th { font-weight: 600; color: var(--muted); background: var(--soft); }
.tbl tr.low td { color: var(--warn); }
.tbl tr.sum td { font-weight: 700; border-bottom: 0; }
.scrollx { overflow-x: auto; }
.card.grid3.inner { margin: 12px 0; }
.card.grid3.inner > div { min-width: 0; }
