:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d8dde8;
  --blue: #2563eb;
  --green: #059669;
  --rose: #e11d48;
  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;
  background: var(--bg);
  color: var(--ink);
}

.hidden { display: none !important; }
.album-only-mode .app {
  width: min(1120px, calc(100% - 32px));
}

.album-only-mode nav [data-view-link]:not([data-view-link="album-view"]) {
  display: none;
}

.album-only-mode nav [data-view-link="album-view"] {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.album-only-mode .album-panel {
  min-height: calc(100vh - 150px);
}

.app {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  letter-spacing: 0;
}

.eyebrow, .label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

a, button {
  color: inherit;
}

nav a, button {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 10px 13px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.2;
}

nav a.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.nav-button {
  min-height: 41px;
}

button {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

button.ghost {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}

button.danger-button {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-card {
  min-height: 148px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
}

.dashboard-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dashboard-card strong {
  font-size: 34px;
  line-height: 1;
}

.dashboard-card p {
  min-height: 38px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.column {
  display: grid;
  gap: 14px;
  align-content: start;
}

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

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head > * {
  min-width: 0;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
}

.section-head a {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.section-head span, .empty, .item span, .item p {
  color: var(--muted);
  font-size: 13px;
}

.list, .cards, .households {
  display: grid;
  gap: 10px;
}

.item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.item p {
  margin: 4px 0 0;
  line-height: 1.45;
}

.compact-list {
  min-height: 206px;
}

.compact-item {
  min-height: 62px;
}

.compact-deals {
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.refrigerator-panel {
  margin-bottom: 14px;
}

.album-panel {
  min-height: 520px;
}

.album-people {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.album-people button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 11px 6px 7px;
  background: #f8fafc;
  color: #334155;
  border-color: var(--line);
}

.album-people button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.album-people img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
}

.album-people span {
  color: inherit;
  font-size: 12px;
  opacity: 0.82;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.album-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.album-actions button {
  min-width: 140px;
}

.album-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f7;
}

.album-tile img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.album-tile span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 8px 7px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0));
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  background: rgba(15, 23, 42, 0.88);
}

.lightbox img {
  align-self: center;
  justify-self: center;
  max-width: 100%;
  max-height: calc(100vh - 112px);
  border-radius: 8px;
  object-fit: contain;
}

.lightbox-actions {
  justify-self: end;
  display: flex;
  gap: 8px;
}

.lightbox-close,
.lightbox-download {
  background: #fff;
  color: var(--ink);
}

.lightbox-download {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.2;
}

.lightbox p {
  margin: 0;
  color: #fff;
  text-align: center;
  font-weight: 800;
}

.inventory-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.inventory-stat {
  min-height: 88px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.inventory-stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.inventory-stat strong {
  font-size: 28px;
  line-height: 1;
}

.inventory-list {
  display: grid;
  gap: 14px;
}

.inventory-category {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.inventory-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #eef2f7;
}

.inventory-category-head h3 {
  margin: 0;
  font-size: 16px;
}

.inventory-category-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.inventory-items {
  display: grid;
}

.inventory-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.inventory-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.inventory-flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 180px;
}

.inventory-flags span {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 5px 8px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.calendar-panel {
  margin-bottom: 14px;
}

.schedule-mode-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  background: #f8fafc;
}

.schedule-mode-toggle button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.schedule-mode-toggle button.active {
  background: #111827;
  color: #fff;
}

.calendar-head {
  align-items: center;
}

.calendar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-actions button {
  min-width: 74px;
  padding: 8px 10px;
  white-space: nowrap;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  background: #f8fafc;
}

.calendar-weekdays span {
  padding: 10px 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.calendar-weekdays span:first-child {
  color: var(--rose);
}

.calendar-weekdays span:last-child {
  color: var(--blue);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.calendar-day {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px;
  background: white;
  overflow: hidden;
}

.calendar-day.outside-month {
  background: #f8fafc;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px var(--blue);
}

.calendar-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.calendar-date span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 800;
}

.calendar-day.today .calendar-date span {
  background: var(--blue);
  color: white;
}

.calendar-date em {
  display: none;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.outside-month .calendar-date span {
  color: #98a2b3;
}

.calendar-events {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.calendar-event {
  min-height: 24px;
  overflow: hidden;
  border-radius: 6px;
  padding: 5px 7px;
  background: #dbeafe;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-more {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.item-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex: 0 0 auto;
}

.item-actions button {
  padding: 8px 10px;
  white-space: nowrap;
}

.kakao-request-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.kakao-profile {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--line);
  flex: 0 0 auto;
}

.empty-profile {
  display: inline-block;
}

.kakao-link-actions {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 8px;
  min-width: min(320px, 100%);
}

.form {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.form.split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form.split button {
  grid-column: 1 / -1;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
  background: white;
  color: var(--ink);
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.check input {
  width: auto;
}

.household {
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 12px;
}

.household h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.household div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.household span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  background: #fbfcff;
  font-size: 13px;
}

.task {
  justify-content: flex-start;
}

.task input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.done {
  text-decoration: line-through;
  color: var(--muted);
}

.hotdeal-panel {
  width: 100%;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 12px;
}

.category-filter button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  min-height: 32px;
  border-color: #cbd5e1;
  border-radius: 999px;
  padding: 6px 11px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.category-filter button span {
  min-width: 18px;
  border-radius: 999px;
  padding: 2px 6px;
  background: #eef2f7;
  color: #64748b;
  font-size: 11px;
  line-height: 1;
}

.category-filter button.active {
  border-color: var(--blue);
  background: #eff6ff;
  color: #1d4ed8;
}

.category-filter button.active span {
  background: #dbeafe;
  color: #1e40af;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.keyword-chip {
  width: auto;
  background: #fff7ed;
  border-color: #fb923c;
  color: #9a3412;
  padding: 8px 10px;
}

.keyword-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 14px;
}

.keyword-form button {
  white-space: nowrap;
}

.deal-list {
  display: grid;
  gap: 10px;
}

.deal-card {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcff;
  min-width: 0;
}

.deal-thumb {
  display: block;
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #eef2f7;
}

.deal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.deal-body {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.deal-details {
  display: grid;
  grid-column: 2;
  gap: 5px;
  min-width: 0;
}

.deal-card.no-image {
  grid-template-columns: minmax(0, 1fr);
}

.deal-card.no-image .deal-details {
  grid-column: 1;
}

.deal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.deal-chips span {
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #eef2f7;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  line-height: 16px;
}

.deal-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 2px;
  width: fit-content;
  min-width: 30px;
  height: 16px;
  padding: 0 5px;
  border-radius: 5px;
  background: #f59e0b;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  font-weight: 900;
  letter-spacing: 0;
  vertical-align: baseline;
}

.deal-rank-badge .deal-rank-label {
  color: inherit;
  font-size: 8px;
  line-height: 1;
  font-weight: 900;
}

.deal-card .deal-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1.35;
  min-width: 0;
}

.deal-title-text {
  min-width: 0;
}

.deal-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.deal-category span {
  color: #64748b;
  font-size: 11px;
}

.deal-card .deal-meta,
.deal-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.deal-card .deal-period {
  color: #334155;
  font-weight: 800;
}

.deal-card .deal-price {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #e11d48;
  font-size: 16px;
  font-weight: 900;
}

.deal-card .deal-price span {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fee2e2;
  color: #be123c;
  font-size: 11px;
  line-height: 18px;
  font-weight: 900;
}

.deal-comments {
  display: grid;
  gap: 6px;
  margin: 2px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.deal-comments li {
  display: grid;
  gap: 2px;
}

.deal-comments span {
  font-size: 12px;
  color: #64748b;
}

.deal-comments p {
  color: #334155;
}

.deal-reactions {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.deal-reactions > strong {
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.deal-reactions ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.deal-reactions li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
}

.deal-reactions li span {
  display: inline-flex;
  justify-content: center;
  min-height: 20px;
  padding: 2px 5px;
  border-radius: 6px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
  line-height: 16px;
  font-weight: 900;
}

.deal-reactions li p {
  color: #334155;
}

.deal-card.keyword-hit {
  border: 2px solid #f97316;
  background: #fff7ed;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12);
}

.deal-alert {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: #ea580c;
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.sort-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.sort-toggle button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.sort-toggle button.active {
  background: #111827;
  color: #fff;
}

@media (max-width: 820px) {
  .deal-card {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .deal-thumb {
    width: 76px;
    height: 76px;
  }

  .deal-card.has-image .deal-details {
    grid-column: 1 / -1;
  }
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(420px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  display: grid;
  gap: 12px;
}

.login-panel h1 {
  margin: 0;
}

#password-login {
  display: grid;
  gap: 12px;
}

.kakao-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 8px;
  background: #fee500;
  color: #191600;
  font-weight: 800;
  text-decoration: none;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.error {
  margin: 0;
  min-height: 20px;
  color: var(--rose);
}

.success {
  color: var(--green);
}

.signup-panel {
  width: min(720px, 100%);
}

.board-panel {
  min-height: 520px;
}

.board-list {
  display: grid;
  gap: 10px;
}

.compact-board-list {
  gap: 8px;
}

.board-post-card {
  width: 100%;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.board-post-card.compact {
  padding: 12px;
}

.board-post-card strong {
  font-size: 17px;
  line-height: 1.35;
}

.board-post-card p {
  margin: 0;
  color: #344054;
  font-size: 14px;
  line-height: 1.55;
}

.board-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.board-category,
.availability {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
}

.board-category {
  background: #e0ecff;
  color: #1d4ed8;
}

.availability {
  background: #dcfce7;
  color: #047857;
}

.availability.reported_closed {
  background: #fef3c7;
  color: #92400e;
}

.availability.closed {
  background: #ffe4e6;
  color: #be123c;
}

.board-place,
.board-stats {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.post-detail-panel {
  margin-bottom: 14px;
}

.post-edit-form {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.post-detail-body {
  display: grid;
  gap: 12px;
}

.post-detail-card {
  display: grid;
  gap: 12px;
}

.post-detail-card h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
}

.post-detail-card p {
  margin: 0;
  color: #344054;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.post-detail-meta,
.post-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-detail-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.post-detail-place-line {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.comment-list {
  display: grid;
  gap: 10px;
}

.comment-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.comment-item strong {
  font-size: 14px;
}

.comment-delete-button {
  min-height: 31px;
  padding: 6px 9px;
  font-size: 12px;
}

.comment-item p {
  margin: 0;
  color: #344054;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.comment-item span {
  color: var(--muted);
  font-size: 12px;
}

.post-place-box {
  display: grid;
  gap: 10px;
}

.place-detail-panel {
  margin-bottom: 14px;
}

.place-detail-summary {
  display: grid;
  gap: 12px;
}

.place-detail-card {
  display: grid;
  gap: 10px;
}

.place-detail-card strong {
  font-size: 24px;
  line-height: 1.3;
}

.place-detail-card p,
.place-detail-line {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.map-panel {
  min-height: 620px;
}

.write-layout {
  align-items: start;
}

.place-search-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.manual-place-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.manual-place-form button {
  grid-column: 1 / -1;
}

.place-search-results {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.place-result {
  width: 100%;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.place-result.active {
  border-color: var(--blue);
  box-shadow: inset 4px 0 0 var(--blue);
}

.place-result strong {
  font-size: 16px;
}

.place-result p,
.place-result span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.write-form textarea {
  min-height: 180px;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.place-map {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), transparent 45%),
    linear-gradient(315deg, rgba(5, 150, 105, 0.16), transparent 42%),
    #eef5f3;
}

.map-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(23, 32, 51, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 51, 0.08) 1px, transparent 1px);
  background-size: 56px 56px;
}

.map-pin {
  position: absolute;
  width: var(--pin-size);
  height: var(--pin-size);
  min-width: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 0;
  background: #e11d48;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.22);
}

.map-pin span {
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.place-map-list {
  max-height: 520px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
}

.place-card {
  width: 100%;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.place-card strong {
  font-size: 16px;
}

.place-card p,
.place-card span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.member-forms {
  display: grid;
  gap: 12px;
}

.member-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  background: #fbfcff;
}

.member-form legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 0 6px;
}

.member-form .remove-member {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .app {
    width: min(100% - 20px, 720px);
    padding: 14px 0 32px;
  }
  .topbar {
    grid-template-columns: 1fr;
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
  }
  .topbar h1 {
    font-size: 24px;
  }
  nav {
    flex-wrap: nowrap;
    width: calc(100vw - 20px);
    margin-inline: -1px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  nav::-webkit-scrollbar {
    display: none;
  }
  nav a,
  nav button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 9px 12px;
    white-space: nowrap;
  }
  .dashboard,
  .dashboard-grid,
  .layout,
  .map-layout,
  .inventory-summary {
    grid-template-columns: 1fr;
  }
  .dashboard {
    gap: 10px;
  }
  .dashboard-card {
    min-height: 112px;
    padding: 14px;
  }
  .dashboard-card strong {
    font-size: 28px;
  }
  .panel {
    padding: 14px;
  }
  .section-head {
    align-items: flex-start;
  }
  .section-head h2 {
    font-size: 18px;
    line-height: 1.35;
  }
  .board-post-card,
  .place-card,
  .place-result {
    padding: 12px;
  }
  .board-post-card strong {
    font-size: 16px;
    overflow-wrap: anywhere;
  }
  .board-post-card p,
  .post-detail-card p,
  .comment-item p {
    overflow-wrap: anywhere;
  }
  .post-detail-card h3,
  .place-detail-card strong {
    font-size: 21px;
    overflow-wrap: anywhere;
  }
  .post-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .post-detail-actions button {
    width: 100%;
    min-height: 42px;
    padding-inline: 8px;
  }
  .comment-head {
    align-items: flex-start;
  }
  .comment-delete-button {
    flex: 0 0 auto;
  }
  .place-map {
    min-height: 360px;
  }
  .place-map-list {
    max-height: none;
  }
  .form.split {
    grid-template-columns: 1fr;
  }
  .member-form {
    grid-template-columns: 1fr;
  }
  .keyword-form {
    grid-template-columns: 1fr;
  }
  .place-search-form {
    grid-template-columns: 1fr;
  }
  .manual-place-form {
    grid-template-columns: 1fr;
  }
  .form button,
  .place-search-form button,
  .manual-place-form button {
    min-height: 44px;
  }
  .schedule-mode-toggle {
    width: 100%;
  }
  .schedule-mode-toggle button {
    flex: 1;
  }
  #schedule-view .item {
    display: grid;
  }
  .album-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .calendar-head {
    align-items: flex-start;
    display: grid;
  }
  .calendar-weekdays {
    display: grid;
  }
  .calendar-weekdays span {
    padding: 7px 2px;
    font-size: 11px;
  }
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-radius: 8px;
    overflow: hidden;
  }
  .calendar-day {
    min-height: 112px;
    gap: 5px;
    padding: 5px 3px;
  }
  .calendar-date {
    justify-content: center;
  }
  .calendar-date span {
    width: 23px;
    height: 23px;
    font-size: 12px;
  }
  .calendar-date em {
    display: none;
  }
  .calendar-events {
    gap: 4px;
  }
  .calendar-event {
    min-height: 19px;
    border-radius: 5px;
    padding: 3px 4px;
    font-size: 10px;
    line-height: 13px;
    max-width: 100%;
  }
  .calendar-more {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .inventory-row {
    display: grid;
  }
  .inventory-flags {
    justify-content: flex-start;
    flex-basis: auto;
  }
}

@media (max-width: 520px) {
  .app {
    width: min(100% - 14px, 520px);
    padding-top: 10px;
  }
  nav {
    width: calc(100vw - 14px);
  }
  .dashboard-card {
    min-height: 96px;
  }
  .section-head {
    display: grid;
    gap: 6px;
  }
  .post-detail-actions {
    grid-template-columns: 1fr;
  }
  .board-card-top,
  .post-detail-meta {
    gap: 5px;
  }
  .board-category,
  .availability,
  .post-detail-meta span {
    font-size: 11px;
  }
  .map-panel {
    min-height: auto;
  }
  .place-map {
    min-height: 300px;
  }
  .album-grid {
    gap: 8px;
  }
}
