* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  margin: 0;
  background: #f5f5f7;
  color: #1c1c1e;
}
.container { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
h1 { margin: 8px 0; }
h2 { margin: 0 0 12px; font-size: 1.1rem; }
.subtitle { color: #6c6c70; margin-top: 0; }
.muted { color: #8a8a8e; font-size: 0.875rem; }
.card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
form { display: flex; gap: 8px; }
input[type=text], input:not([type]) {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d1d1d6;
  font-size: 1rem;
}
button {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: #03aa5a;
  color: white;
  font-size: 1rem;
  cursor: pointer;
}
button:hover { background: #029950; }
button:disabled { background: #c7c7cc; cursor: not-allowed; }
.room-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.room-header h1 { margin: 0; }
.back { color: #03aa5a; text-decoration: none; font-size: 0.9rem; }

.room-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.room-list__item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: box-shadow 0.15s, transform 0.15s;
}
.room-list__item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}
.room-list__link {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
}
.room-list__delete {
  margin-right: 12px;
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 0.85rem;
  background: transparent;
  border: 1px solid #f4c2c0;
  color: #d93025;
}
.room-list__delete:hover { background: #fdeceb; }
.room-list__delete:disabled { opacity: 0.5; }
.room-list__main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.room-list__name { font-size: 1.05rem; font-weight: 600; }
.room-list__meta { margin-top: 4px; }

.place-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.place-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}
.place-card__header { margin-bottom: 8px; }
.place-card__header h3 { margin: 0 0 2px; font-size: 1.05rem; }
.place-card__status {
  font-size: 0.85rem;
  color: #8a8a8e;
  margin-bottom: 8px;
  min-height: 1.2em;
}
.place-card__status.is-error { color: #d93025; }
.place-card__menus {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  flex: 1;
  max-height: 320px;
  overflow-y: auto;
}
.place-card__menus li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f2;
  font-size: 0.9rem;
}
.place-card__menus li:last-child { border-bottom: none; }
.place-card__menus .menu-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: #f0f0f2;
  cursor: zoom-in;
  transition: transform 0.15s;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.place-card__menus .menu-thumb:hover { transform: scale(1.05); }
.place-card__menus .menu-thumb:active { transform: scale(0.95); }
.place-card__menus .menu-text { flex: 1; min-width: 0; }
.place-card__menus .menu-name {
  color: #1c1c1e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.place-card__menus .menu-price { color: #6c6c70; white-space: nowrap; }
.place-card__menus .menu-desc {
  font-size: 0.75rem;
  color: #8a8a8e;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.place-card__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
}
.place-card__actions .place-card__source {
  flex: 1;
  color: #03aa5a;
  text-decoration: none;
}
.place-card__retry, .place-card__delete {
  padding: 6px 10px;
  font-size: 0.85rem;
  background: transparent;
  border: 1px solid #d1d1d6;
  color: #1c1c1e;
}
.place-card__retry:hover, .place-card__delete:hover { background: #f5f5f7; }
.place-card__delete { color: #d93025; border-color: #f4c2c0; }
.hidden { display: none !important; }

.form-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 12px;
}
.form-meta p { margin: 0; flex: 1; }
.link-btn {
  background: transparent;
  color: #03aa5a;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}
.link-btn:hover { background: transparent; opacity: 0.7; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.hidden { display: none; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.modal__content {
  position: relative;
  background: white;
  border-radius: 14px;
  max-width: 520px;
  width: calc(100% - 24px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}
.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f2;
  position: sticky;
  top: 0;
  background: white;
  border-radius: 14px 14px 0 0;
}
.modal__header h2 { margin: 0; font-size: 1rem; }
.modal__close {
  background: transparent;
  color: #6c6c70;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0 6px;
  border: none;
  cursor: pointer;
}
.modal__close:hover { background: transparent; color: #1c1c1e; }

.help-steps {
  list-style: none;
  padding: 16px;
  margin: 0;
}
.help-steps li { margin-bottom: 24px; }
.help-steps li:last-child { margin-bottom: 0; }
.help-steps h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1c1c1e;
}
.help-steps .help-img,
.help-steps .help-img-single {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid #f0f0f2;
}
.help-steps .help-img { display: none; }
.help-steps .help-img.is-active { display: block; }
.help-steps p { margin: 8px 0 0; font-size: 0.85rem; }

.help-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: #f0f0f2;
  border-radius: 8px;
  padding: 3px;
  max-width: 200px;
}
.help-tab {
  flex: 1;
  background: transparent;
  color: #6c6c70;
  border: none;
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
}
.help-tab.is-active {
  background: white;
  color: #1c1c1e;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.help-tab:hover { background: rgba(255, 255, 255, 0.5); }
.help-tab.is-active:hover { background: white; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 24px;
}
.lightbox.hidden { display: none; }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  cursor: default;
}
.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  font-size: 1.8rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__close:hover { background: rgba(0, 0, 0, 0.7); }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #d1d1d6;
  border-top-color: #03aa5a;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 4px;
}
