/* Star ratings, the nickname bar, and the "added on the road" section.
   Colours come from the mint-green palette in styles.css; only the star gold is
   declared here because nothing else in the page needed a rating colour. */

:root {
  --ratings-star: #d0a03f;
  --ratings-star-empty: #cdd9d2;
}

/* ------------------------------------------------------------------ *
 * Identity bar — sits directly under the top bar on every view.
 * ------------------------------------------------------------------ */

.identity-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
  padding: 9px 18px;
  background: var(--lake-soft);
  border-bottom: 1px solid var(--line);
  color: var(--lake-deep);
  font-size: 12px;
  line-height: 1.5;
}

.identity-bar__who b {
  font-weight: 700;
  color: var(--lake-deep);
}

.identity-bar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ *
 * Rating block — appended inside every [data-rating-target] element.
 * ------------------------------------------------------------------ */

.ratings-block {
  margin: 9px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.ratings-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 11px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ratings-summary:hover {
  background: var(--lake-soft);
}

.ratings-summary-figures {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ratings-summary-chevron {
  flex: 0 0 auto;
  color: var(--lake);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.16s ease;
}

.ratings-summary[aria-expanded="true"] .ratings-summary-chevron {
  transform: rotate(45deg);
}

.ratings-stars {
  flex: 0 0 auto;
  color: var(--ratings-star);
  letter-spacing: 1px;
  line-height: 1;
}

.ratings-stars--summary { font-size: 13px; }
.ratings-stars--small { font-size: 11px; letter-spacing: 0.5px; }

.ratings-detail {
  padding: 4px 11px 11px;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------------ *
 * Existing ratings
 * ------------------------------------------------------------------ */

.ratings-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ratings-item {
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}

.ratings-item:last-child { border-bottom: 0; }

.ratings-item.is-own {
  background: var(--lake-soft);
  margin: 0 -11px;
  padding: 9px 11px;
  border-radius: 10px;
}

.ratings-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ratings-item-rater {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ratings-item-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.ratings-item-actions { margin-top: 6px; }

.ratings-empty {
  margin: 6px 0 2px;
  color: var(--muted);
  font-size: 11.5px;
}

/* ------------------------------------------------------------------ *
 * Editor
 * ------------------------------------------------------------------ */

.ratings-editor {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.ratings-editor-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ratings-editor-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.ratings-stars-input {
  display: flex;
  gap: 2px;
}

.ratings-stars-input button {
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--ratings-star-empty);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s ease, transform 0.12s ease;
}

.ratings-stars-input button:hover { transform: scale(1.12); }
.ratings-stars-input button.is-on { color: var(--ratings-star); }

.ratings-note-input {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
}

.ratings-note-input:focus {
  outline: 2px solid var(--lake);
  outline-offset: 1px;
}

.ratings-editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.ratings-editor-hint {
  min-width: 0;
  color: var(--warning);
  font-size: 11.5px;
}

/* ------------------------------------------------------------------ *
 * Buttons
 * ------------------------------------------------------------------ */

.ratings-primary-button {
  padding: 7px 14px;
  border: 1px solid var(--lake-deep);
  border-radius: 999px;
  background: var(--lake);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ratings-primary-button:hover { background: var(--lake-deep); }
.ratings-primary-button--small { padding: 4px 11px; font-size: 11.5px; }

.ratings-ghost-button {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ratings-ghost-button:hover { border-color: var(--lake); color: var(--lake-deep); }

.ratings-link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--lake);
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.ratings-link-button:hover { color: var(--lake-deep); }

.ratings-guest-prompt {
  display: block;
  width: 100%;
  margin-top: 9px;
  padding: 9px 12px;
  border: 1px dashed var(--lake);
  border-radius: 10px;
  background: none;
  color: var(--lake-deep);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ratings-guest-prompt:hover { background: var(--lake-soft); }

/* ------------------------------------------------------------------ *
 * Nickname dialog
 * ------------------------------------------------------------------ */

.ratings-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.ratings-dialog::backdrop { background: rgba(36, 51, 43, 0.4); }

.ratings-dialog-form { padding: 20px 20px 18px; }

.ratings-dialog-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
}

.ratings-dialog-copy {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.ratings-dialog-notice {
  margin: 8px 0 0;
  min-height: 16px;
  color: var(--terracotta);
  font-size: 11.5px;
  line-height: 1.5;
}

.ratings-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.ratings-field {
  display: block;
  margin: 0 0 10px;
}

.ratings-field > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ratings-field input,
.ratings-field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.ratings-field input:focus,
.ratings-field select:focus {
  outline: 2px solid var(--lake);
  outline-offset: 1px;
}

/* ------------------------------------------------------------------ *
 * "Added on the road"
 * ------------------------------------------------------------------ */

.custom-spot-form {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.custom-spot-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0 12px;
}

.ratings-field--wide { grid-column: 1 / -1; }

.custom-spot-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.custom-spot-groups {
  display: grid;
  gap: 16px;
}

.custom-spot-group-title {
  margin: 0 0 8px;
  color: var(--lake);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.custom-spot-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.custom-spot {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.custom-spot-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.custom-spot-name {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.custom-spot-type {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--lake-soft);
  color: var(--lake-deep);
  font-size: 10.5px;
  font-weight: 700;
}

.custom-spot-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.custom-spot-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.custom-spot-map { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }

.custom-spot-actions { margin-top: 7px; }

.custom-spot-empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* ------------------------------------------------------------------ *
 * A place added on the road, as it appears inside a day's timeline.
 * ------------------------------------------------------------------ */

.schedule-item.is-custom .schedule-time {
  color: var(--lake);
}

.schedule-custom-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--lake-soft);
  color: var(--lake-deep);
  font-size: 10px;
  font-weight: 700;
  vertical-align: 1px;
  white-space: nowrap;
}

.schedule-custom-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.schedule-custom-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  opacity: 0.85;
}

@media (max-width: 520px) {
  .ratings-summary-figures { font-size: 11px; }
  .identity-bar { padding: 8px 14px; }
  .custom-spot-form { padding: 13px; }
}
