:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --accent: #14b8a6;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 8px 24px rgba(15,23,42,.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

header h1 { font-size: 1.5rem; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 20px; font-size: .95rem; }

form {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
label { font-weight: 600; font-size: .88rem; }

input, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20,184,166,.15);
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.addr-row { position: relative; }
.ac-list {
  position: absolute;
  top: 100%; left: 0; right: 0;
  z-index: 30;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow-y: auto;
}
.ac-list li {
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: .9rem;
}
.ac-list li:hover { background: #eef2f6; }

.fav-row { display: flex; gap: 6px; align-items: center; }
.fav-row .favsel { flex: 1; padding: 7px 8px; font-size: .85rem; }

.mini {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: .82rem;
  cursor: pointer;
  white-space: nowrap;
  color: var(--ink);
}
.mini:hover { background: #eef2f6; }
.mini.del { color: var(--danger); }

button.primary {
  background: var(--brand);
  color: var(--brand-ink);
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
button.primary:hover { filter: brightness(1.05); }
button.primary:disabled { opacity: .6; cursor: progress; }
button.primary.outline {
  background: #fff;
  color: var(--brand);
  border: 1.5px solid var(--brand);
}

.error {
  margin-top: 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: .9rem;
}

#result {
  margin-top: 20px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.result-hero {
  text-align: center;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}
.result-label { display: block; font-size: .85rem; opacity: .9; }
.result-time { display: block; font-size: 2.6rem; font-weight: 700; letter-spacing: -1px; }

.timeline { list-style: none; margin: 0 0 18px; padding: 0; }
.timeline li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.timeline li:last-child { border-bottom: none; }
.tl-icon { font-size: 1.2rem; width: 1.6rem; text-align: center; flex: none; }
.tl-body { flex: 1; }
.tl-title { font-weight: 600; }
.tl-meta { color: var(--muted); font-size: .82rem; }
.tl-time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.cal-buttons { display: flex; gap: 10px; }
.cal-buttons button { flex: 1; padding: 12px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: .95rem; }
#ics { background: #f8fafc; border: 1px solid var(--line); color: var(--ink); }
#ics:hover { background: #eef2f6; }

footer { margin-top: 24px; text-align: center; }
footer p { color: var(--muted); font-size: .78rem; }
