:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #667384;
  --line: #d9e0e7;
  --panel: #ffffff;
  --page: #f4f7f8;
  --accent: #087f8c;
  --accent-strong: #045e68;
  --warm: #f5b841;
  --soft: #e9f5f6;
  --danger: #b33a3a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
}

button,
input {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

button,
.file-button {
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  padding: 10px 14px;
  cursor: pointer;
  min-height: 40px;
}

button:hover,
.file-button:hover {
  background: var(--accent-strong);
}

#clearSchedule {
  background: #ffffff;
  color: var(--accent);
}

.file-button input {
  display: none;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 18px;
  padding: 18px;
  min-height: calc(100vh - 86px);
}

.sidebar,
.planner {
  min-width: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.upload-panel {
  padding: 16px;
  margin-bottom: 12px;
}

.upload-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.status.error {
  color: var(--danger);
}

#searchInput {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}

.field-info {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.attraction-list {
  display: grid;
  gap: 10px;
  padding: 12px;
  max-height: calc(100vh - 244px);
  overflow: auto;
}

.empty-state {
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

.attraction-card,
.scheduled-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(23, 33, 43, 0.05);
}

.attraction-card:active,
.scheduled-card:active {
  cursor: grabbing;
}

.card-title,
.scheduled-title {
  font-weight: 700;
  line-height: 1.25;
}

.card-meta,
.scheduled-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.scheduled-meta:empty {
  display: none;
}

.card-notes {
  margin-top: 8px;
  color: #415160;
  font-size: 13px;
  line-height: 1.4;
}

.planner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.planner-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.field-group {
  display: grid;
  gap: 5px;
}

.field-group label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.field-group input {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 38px;
  padding: 8px 10px;
  background: #ffffff;
}

.field-group.compact {
  width: 112px;
}

.schedule-shell {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.schedule-grid {
  display: grid;
  min-width: 840px;
}

.time-header,
.day-header,
.time-cell,
.slot {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.time-header,
.day-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f9fbfb;
  min-height: 58px;
  padding: 12px;
  font-weight: 800;
}

.time-header {
  left: 0;
  z-index: 3;
}

.day-header span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-top: 3px;
}

.time-cell {
  position: sticky;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 10px;
  min-height: 84px;
  color: var(--muted);
  background: #f9fbfb;
  font-size: 13px;
}

.slot {
  min-height: 84px;
  padding: 8px;
  background: #ffffff;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.slot.drag-over {
  background: var(--soft);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.scheduled-card {
  position: relative;
  border-color: #8fc9ce;
  background: #f8fdfd;
  padding-right: 34px;
  margin-bottom: 6px;
}

.scheduled-card .remove {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.scheduled-card .remove:hover {
  border-color: var(--line);
  background: #ffffff;
  color: var(--danger);
}

.dragging {
  opacity: 0.45;
}

@media (max-width: 900px) {
  .topbar,
  .layout {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .attraction-list {
    max-height: 340px;
  }
}
