:root {
  --brand: #ff7a1a;
  --brand-dark: #d95f00;
  --brand-2: #ffad33;
  --green: #1fb56b;
  --green-dark: #128a4f;
  --green-soft: #e4f7ec;
  --accent: #e5484d;
  --sun: #ffb020;
  --ink: #2b1d12;
  --muted: #7a6656;
  --line: #f1e4d8;
  --bg: #fff8f1;
  --card: #ffffff;
  --yes: #1fb56b;
  --yes-bg: #dcf5e7;
  --maybe: #d99a00;
  --maybe-bg: #fff3c9;
  --no: #e5484d;
  --no-bg: #fde4e4;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(120, 60, 10, .08), 0 2px 6px rgba(120, 60, 10, .05);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(255, 122, 26, .12), transparent 60%),
    radial-gradient(700px 450px at -10% 0%, rgba(31, 181, 107, .16), transparent 60%),
    radial-gradient(600px 400px at 50% 110%, rgba(255, 173, 51, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.5;
}
a { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); letter-spacing: -.02em; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, .7);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 1.2rem; }
.brand b { color: var(--brand); }
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 28px clamp(14px, 3vw, 28px) 60px; flex: 1; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 18px; }
.loading { text-align: center; color: var(--muted); padding: 80px 0; }

.hero { text-align: center; margin: 10px 0 28px; }
.hero p { color: var(--muted); font-size: 1.1rem; }
.hero .grad {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 28px); margin-bottom: 20px; border: 1px solid rgba(255,255,255,.8);
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.step {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700;
}
.card-head h2 { margin: 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-cal { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 24px; align-items: start; }
@media (max-width: 760px) { .grid2, .grid-cal { grid-template-columns: 1fr; } }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
label.field > span small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=date], input[type=time], select, textarea {
  width: 100%; font: inherit; color: inherit;
  padding: 11px 13px; border-radius: 12px; border: 1.5px solid var(--line); background: #fffdfb;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255, 122, 26, .15); }
input.sm { padding: 7px 9px; border-radius: 9px; font-size: .9rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  border: none; border-radius: 12px; padding: 11px 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  box-shadow: 0 6px 16px rgba(255, 122, 26, .25);
  transition: transform .08s, box-shadow .15s, filter .15s;
}
.btn:hover { filter: brightness(1.05); box-shadow: 0 8px 20px rgba(255, 122, 26, .3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; border-radius: 14px; }
.btn-sm { padding: 7px 12px; font-size: .88rem; border-radius: 10px; }
.btn-ghost { background: #fff; color: var(--brand-dark); box-shadow: none; border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--brand); box-shadow: none; }
.btn-danger { background: var(--accent); box-shadow: 0 6px 16px rgba(255, 173, 51, .3); }
.btn-ghost.danger { color: #d64545; }
.btn-ghost.danger:hover { border-color: var(--accent); }
.btn-icon { padding: 6px 9px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

.switch { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  flex: none; width: 46px; height: 26px; border-radius: 99px; background: #eadfd5; position: relative; transition: background .2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s;
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px rgba(255, 122, 26, .25); }
.switch .txt b { display: block; }
.switch .txt small { color: var(--muted); }

/* Kalender */
.cal { user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head strong { font-size: 1.05rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font-size: .75rem; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cal-day {
  aspect-ratio: 1; border: none; border-radius: 12px; background: #fbf4ee; font: inherit; cursor: pointer; color: var(--ink);
  transition: background .12s, transform .08s;
}
.cal-day:hover:not(:disabled) { background: #ffe8d4; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--brand); }
.cal-day.sel { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700; }
.cal-day:disabled { opacity: .35; cursor: default; background: transparent; }
.cal-day.blank { visibility: hidden; }
.hint { color: var(--muted); font-size: .88rem; }

.sel-list { display: flex; flex-direction: column; gap: 10px; }
.sel-empty {
  border: 2px dashed var(--line); border-radius: 14px; padding: 30px; text-align: center; color: var(--muted);
}
.sel-item { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; background: #fffdfb; }
.sel-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sel-item-head strong { font-size: .98rem; }
.slot { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.slot .time-in { width: 84px; }
.time-in { text-align: center; font-variant-numeric: tabular-nums; }
input.bad { border-color: var(--no); box-shadow: 0 0 0 3px rgba(239, 93, 93, .15); }
.slot .dash { color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600;
  padding: 3px 10px; border-radius: 99px; background: #fff0e3; color: var(--brand-dark);
}
.chip.red { background: var(--no-bg); color: #c03b3b; }
.chip.sun { background: var(--maybe-bg); color: #9a6200; }

/* Umfrage */
.poll-head { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.poll-head .info { flex: 1; min-width: 240px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: .92rem; margin-bottom: 10px; }
.desc { white-space: pre-wrap; }
.banner {
  border-radius: 14px; padding: 14px 18px; margin-bottom: 18px; display: flex; gap: 12px; align-items: center;
  background: linear-gradient(135deg, #e9f9ef, #fff4e8); border: 1px solid #cdeedb;
}
.banner.final { background: linear-gradient(135deg, #fff1e0, #ffe6d1); border-color: #ffdcb8; }
.banner .big { font-size: 1.6rem; }
.linkbox { display: flex; gap: 8px; align-items: stretch; margin: 6px 0 16px; }
.linkbox input { flex: 1; font-family: Consolas, ui-monospace, monospace; font-size: .88rem; }

.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
table.votes { border-collapse: separate; border-spacing: 0; width: 100%; min-width: max-content; }
.votes th, .votes td { border-bottom: 1px solid var(--line); padding: 8px; text-align: center; vertical-align: middle; }
.votes th { background: #fffaf5; font-weight: 600; }
.votes .namecol {
  position: sticky; left: 0; background: #fff; z-index: 2; text-align: left; min-width: 190px; max-width: 260px;
  border-right: 1px solid var(--line);
}
.votes th.namecol { background: #fffaf5; }
.opt-h { min-width: 84px; }
.opt-h .mon { font-size: .72rem; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.opt-h .day { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.opt-h .wd { font-size: .8rem; color: var(--muted); }
.opt-h .time { font-size: .78rem; margin-top: 3px; color: var(--brand-dark); font-weight: 600; white-space: nowrap; }
.opt-h.best { background: #e4f7ec; }
.opt-h.final, td.final { box-shadow: inset 0 0 0 2px var(--sun); }
.pname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.pmail { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--brand); color: #fff; margin-left: 6px; vertical-align: middle; }
.cell { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; font-weight: 800; font-size: 1.05rem; }
.cell.yes { background: var(--yes-bg); color: var(--yes); }
.cell.maybe { background: var(--maybe-bg); color: var(--maybe); }
.cell.no { background: var(--no-bg); color: var(--no); }
button.cell { border: none; cursor: pointer; font-family: inherit; transition: transform .08s; }
button.cell:hover { transform: scale(1.07); }
button.cell.no { background: #f6f1ec; color: #cbbbae; }
button.cell.no.set { background: var(--no-bg); color: var(--no); }
tr.me td { background: #f1fbf5; }
tr.me td.namecol { background: #f1fbf5; }
tr.newrow td { background: #fffcf8; }
tr.newrow td.namecol { background: #fffcf8; }
.newrow .namecol input { margin-bottom: 6px; }
.actions { white-space: nowrap; }
tfoot td { background: #fffaf5; font-weight: 700; }
tfoot td.namecol { background: #fffaf5; }
.sum-yes { color: var(--yes); }
.sum-maybe { color: var(--maybe); font-size: .85rem; }
.sum.best { background: #e4f7ec; }
.crown { display: block; font-size: .72rem; color: var(--brand-dark); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin: 10px 2px 0; }
.legend .cell { width: 22px; height: 22px; font-size: .75rem; border-radius: 6px; margin-right: 4px; vertical-align: middle; }

.admin-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-edit { display: grid; grid-template-columns: 1fr 90px 90px 150px auto; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 560px) { .opt-edit { grid-template-columns: 1fr 1fr; } }

.mine-list { list-style: none; margin: 0; padding: 0; }
.mine-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mine-list li:last-child { border-bottom: none; }
.mine-list a { font-weight: 600; text-decoration: none; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 8px; }
.feature { text-align: center; padding: 14px; color: var(--muted); font-size: .92rem; }
.feature .ic { font-size: 1.6rem; }
.feature b { display: block; color: var(--ink); }
@media (max-width: 700px) { .features { grid-template-columns: 1fr; } }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow);
  transition: opacity .2s, transform .2s; z-index: 100; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #c03b3b; }

.modal-bg {
  position: fixed; inset: 0; background: rgba(40, 20, 5, .45); display: grid; place-items: center; z-index: 90; padding: 16px;
  animation: fade .15s;
}
.modal { background: #fff; border-radius: var(--radius); padding: 24px; max-width: 520px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
@keyframes fade { from { opacity: 0; } }
.center { text-align: center; }
.mt { margin-top: 14px; }
.success-ic { font-size: 3rem; }
@media (max-width: 600px) {
  .votes .namecol { min-width: 128px; max-width: 150px; }
  .opt-h { min-width: 62px; }
  .cell { width: 34px; height: 34px; }
  .votes th, .votes td { padding: 6px 5px; }
  .topbar .btn { font-size: .8rem; }
}

/* Zeitwahl */
[hidden] { display: none !important; }
.tp { position: relative; display: inline-block; }
.opt-edit .tp { display: block; }
.opt-edit .time-in { width: 100%; }
.tp-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 168px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px;
  box-shadow: 0 14px 36px rgba(120, 60, 10, .18);
  animation: fade .12s;
}
.tp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tp-lbl { font-size: .68rem; color: var(--muted); text-align: center; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.tp-col { position: relative; height: 196px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.tp-item {
  border: none; background: transparent; font: inherit; font-size: .92rem; padding: 5px 0; border-radius: 8px;
  cursor: pointer; color: var(--ink); font-variant-numeric: tabular-nums; flex: none;
}
.tp-item:hover { background: #fff0e3; }
.tp-item.on { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700; }
.tp-clear {
  margin-top: 8px; width: 100%; border: none; background: #fbf4ee; border-radius: 8px; padding: 7px;
  font: inherit; font-size: .8rem; cursor: pointer; color: var(--muted);
}
.tp-clear:hover { background: #fff0e3; color: var(--brand-dark); }
.tp-pop.right { left: auto; right: 0; }
.tp-min { height: auto; }

/* Grüne Akzente */
.hero .grad { background: linear-gradient(90deg, var(--brand), var(--green)); -webkit-background-clip: text; background-clip: text; }
.step { background: linear-gradient(135deg, var(--green), #45cf8c); }
.chip { background: var(--green-soft); color: var(--green-dark); }
.switch input:checked + .track { background: var(--green); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px rgba(31, 181, 107, .25); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--green); }
.badge { background: var(--green); }
.opt-h .time { color: var(--green-dark); }
.opt-h.best, .sum.best { background: var(--green-soft); }
.crown { color: var(--green-dark); }
.opt-h.final, td.final { box-shadow: inset 0 0 0 2px var(--brand); }
.btn-ghost:hover { border-color: var(--green); color: var(--green-dark); }

/* Dauer */
select.dur-sel {
  width: 150px; cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23d95f00' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
select.dur-sel:disabled { opacity: .45; cursor: not-allowed; }
.opt-edit select.dur-sel { width: 100%; }
select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255, 122, 26, .15); }
.opt-h .dur { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.time-in:disabled { opacity: .45; cursor: not-allowed; }
.slot .dash { font-size: .85rem; }
