.restaurants-shell {
  display: grid;
  gap: 18px;
}

.restaurants-topbar {
  margin-bottom: 0;
}

.restaurant-quick-add {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(360px, 1.3fr);
  align-items: end;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.restaurant-quick-add h2,
.restaurant-library-heading h2 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.restaurant-quick-add form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.restaurant-quick-add .daily-primary-button {
  min-height: 46px;
  white-space: nowrap;
}

.restaurant-quick-add .form-message {
  grid-column: 1 / -1;
}

.restaurant-library {
  display: grid;
  gap: 14px;
  padding: 10px 0 32px;
}

.restaurant-library-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 470px);
  align-items: end;
  gap: 18px;
}

.restaurant-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
}

.restaurant-search label {
  position: relative;
  display: block;
  min-width: 0;
}

.restaurant-search .search-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  display: grid;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.restaurant-search .search-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.restaurant-search input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
}

.restaurant-search input:focus,
.restaurant-toolbar select:focus,
.restaurant-edit-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(36, 82, 59, 0.1);
}

.restaurant-search button {
  min-width: 46px;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.restaurant-search-clear {
  background: #eee8e1;
  color: var(--muted);
  font-size: 22px;
}

.restaurant-search-submit {
  background: var(--primary);
  color: #fff;
}

.restaurant-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.restaurant-scope-filter {
  grid-template-columns: repeat(3, minmax(76px, 1fr));
}

.restaurant-toolbar > label {
  display: grid;
  gap: 4px;
}

.restaurant-toolbar > label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.restaurant-toolbar select,
.restaurant-edit-form select {
  min-height: 40px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.restaurant-result-count {
  margin-left: auto;
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.restaurant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.restaurant-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.restaurant-photo {
  display: grid;
  place-items: center;
  min-height: 190px;
  background: #eaf2ee;
  color: #24523b;
  font-size: 36px;
  font-weight: 1000;
}

.restaurant-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.restaurant-card-body {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 16px;
}

.restaurant-card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.restaurant-card-meta time {
  margin-left: auto;
  white-space: nowrap;
}

.restaurant-card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.restaurant-card-heading h3 {
  margin: 2px 0 0;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.restaurant-category {
  color: #8a5a30;
  font-size: 11px;
  font-weight: 950;
}

.restaurant-status {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-radius: 6px;
  background: #edf3f8;
  color: #315b7a;
  font-size: 10px;
  font-weight: 950;
}

.restaurant-status.is-visited {
  background: #e9f4ed;
  color: #245e3f;
}

.restaurant-place,
.restaurant-menu,
.restaurant-note,
.restaurant-rating {
  margin: 0;
  color: #5c5149;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.restaurant-menu strong {
  color: #8a5a30;
}

.restaurant-note {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.restaurant-rating {
  color: #d58d00;
  letter-spacing: 0;
}

.restaurant-rating small {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 900;
}

.restaurant-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
}

.restaurant-card-actions a,
.restaurant-card-actions button,
.restaurant-photo-editor button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 32px;
  text-decoration: none;
}

.restaurant-card-actions .is-danger,
.restaurant-photo-editor .is-danger {
  border-color: #f0c0b3;
  color: #c33d20;
}

.restaurant-empty {
  grid-column: 1 / -1;
}

.restaurant-edit-modal {
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  overflow-y: auto;
}

.restaurant-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.restaurant-edit-name,
.restaurant-edit-address,
.restaurant-edit-map,
.restaurant-edit-menu,
.restaurant-edit-scope,
.restaurant-edit-note,
.restaurant-edit-form .daily-form-footer {
  grid-column: 1 / -1;
}

.restaurant-visit-fields {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(260px, 1.3fr);
  gap: 13px;
  grid-column: 1 / -1;
}

.restaurant-visit-fields[hidden] {
  display: none;
}

.restaurant-rating-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.restaurant-rating-field legend {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.restaurant-star-rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.restaurant-star-rating input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.restaurant-star-rating label {
  color: #c9c1b8;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.restaurant-star-rating input:checked ~ label,
.restaurant-star-rating label:hover,
.restaurant-star-rating label:hover ~ label {
  color: #e2a21a;
}

.restaurant-rating-field > button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
}

.restaurant-photo-editor {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.restaurant-photo-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f7f4f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.restaurant-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.restaurant-photo-editor form {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 8px;
}

.restaurant-photo-picker {
  display: grid;
  width: 100%;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.restaurant-photo-picker input {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.restaurant-photo-editor .form-message {
  width: 100%;
}

@media (max-width: 1080px) {
  .restaurant-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .restaurant-quick-add,
  .restaurant-library-heading {
    grid-template-columns: 1fr;
  }

  .restaurant-quick-add {
    gap: 16px;
    padding: 18px;
  }

  .restaurant-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .restaurant-scope-filter,
  .restaurant-result-count {
    grid-column: 1 / -1;
  }

  .restaurant-toolbar select {
    width: 100%;
  }

  .restaurant-result-count {
    margin-left: 0;
    padding: 0;
  }

  .restaurant-card {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .restaurant-photo {
    min-height: 180px;
  }

  .restaurant-edit-form,
  .restaurant-visit-fields {
    grid-template-columns: 1fr;
  }

  .restaurant-edit-name,
  .restaurant-edit-address,
  .restaurant-edit-map,
  .restaurant-edit-menu,
  .restaurant-edit-scope,
  .restaurant-edit-note,
  .restaurant-edit-form .daily-form-footer,
  .restaurant-visit-fields {
    grid-column: 1;
  }
}

@media (max-width: 520px) {
  .restaurant-quick-add form,
  .restaurant-search,
  .restaurant-photo-editor {
    grid-template-columns: 1fr;
  }

  .restaurant-quick-add .daily-primary-button,
  .restaurant-search-submit {
    width: 100%;
  }

  .restaurant-search-clear {
    display: none;
  }

  .restaurant-card {
    grid-template-columns: 1fr;
  }

  .restaurant-photo {
    min-height: 150px;
    max-height: 210px;
  }

  .restaurant-card-meta {
    flex-wrap: wrap;
  }

  .restaurant-card-meta time {
    margin-left: 0;
  }

  .restaurant-photo-preview {
    width: 150px;
  }
}
