:root {
  color-scheme: dark;
  --bg: #09121b;
  --bg-alt: #0e1823;
  --panel: rgba(16, 26, 36, 0.9);
  --panel-2: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 190, 92, 0.38);
  --text: #eef4f8;
  --muted: #8ea0b0;
  --muted-2: #667788;
  --accent: #ffbe5c;
  --accent-soft: rgba(255, 190, 92, 0.14);
  --accent-2: #4fd28b;
  --danger: #ef6b64;
  --btn-text: #1b1408;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.22);
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f8;
  --bg-alt: #e9edf2;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-2: rgba(11, 25, 43, 0.035);
  --line: rgba(11, 25, 43, 0.09);
  --line-strong: rgba(204, 136, 24, 0.32);
  --text: #122033;
  --muted: #516171;
  --muted-2: #728294;
  --accent: #d99324;
  --accent-soft: rgba(217, 147, 36, 0.12);
  --accent-2: #1f9c66;
  --danger: #d14d47;
  --btn-text: #fffaf0;
  --shadow: 0 18px 50px rgba(32, 52, 73, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 190, 92, 0.08), transparent 25%),
    radial-gradient(circle at 88% 14%, rgba(79, 210, 139, 0.08), transparent 24%),
    linear-gradient(135deg, var(--bg), var(--bg-alt));
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

.ambient-a {
  width: 340px;
  height: 340px;
  top: -100px;
  right: -80px;
  background: rgba(255, 190, 92, 0.09);
}

.ambient-b {
  width: 280px;
  height: 280px;
  bottom: -60px;
  left: -60px;
  background: rgba(79, 210, 139, 0.08);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar,
.hero-card,
.auth-card,
.panel,
.feed-section,
.section-tabs {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar,
.hero-card,
.auth-card,
.panel,
.feed-section,
.section-tabs {
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
}

.brand,
.hero-card h2,
.panel h3,
.feed-head h2 {
  margin: 10px 0 0;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  line-height: 0.98;
}

.brand {
  font-size: clamp(2rem, 5vw, 3.6rem);
}

.theme-toggle,
.tab-button,
.ghost-button,
.submit-button,
.kakao-login-btn,
.chip-button,
.action-button,
.text-button,
.primary-link {
  border: 0;
  cursor: pointer;
  border-radius: 16px;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.theme-toggle,
.tab-button,
.ghost-button,
.chip-button,
.action-button,
.text-button {
  padding: 11px 14px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.section-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.tab-button {
  min-width: 82px;
}

.tab-button.is-active {
  background: linear-gradient(135deg, var(--accent), #ffd48d);
  color: var(--btn-text);
  border-color: transparent;
}

.tab-panel {
  display: none;
  margin-top: 16px;
}

.tab-panel.is-active {
  display: block;
}

.status-pill,
.tiny-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.status-dot.done {
  background: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(79, 210, 139, 0.12);
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(239, 107, 100, 0.12);
}

.hero-grid,
.dashboard-grid,
.compose-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
}

.hero-card h2 {
  font-size: clamp(2rem, 4.3vw, 4rem);
}

.hero-copy,
.auth-detail,
.auth-status,
.place-copy,
.area-copy,
.post-content,
.comment-text,
.review-line,
.mini-item p,
.profile-box span {
  margin: 14px 0 0;
  line-height: 1.7;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.share-debug-line {
  margin: 12px 0 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

.share-debug-link {
  color: var(--accent-2);
  font-weight: 700;
  word-break: break-all;
}

.kakao-login-btn {
  margin-top: 14px;
  width: 100%;
  padding: 14px 18px;
  font-weight: 800;
  color: #191300;
  background: #fee500;
}

.submit-button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  font-weight: 700;
  text-decoration: none;
  color: var(--btn-text);
  background: linear-gradient(135deg, var(--accent), #ffd48d);
}

.kakao-login-btn:disabled,
.submit-button:disabled,
.theme-toggle:disabled,
.ghost-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.profile-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.profile-box strong,
.profile-box span {
  display: block;
}

.panel-head,
.feed-head,
.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.date-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.panel-body {
  margin-top: 16px;
}

.place-badge {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
}

.place-panel h3,
.area-panel h3,
.mini-section h3,
.feed-head h2 {
  font-size: clamp(1.7rem, 4vw, 2.7rem);
}

.detail-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.detail-card,
.metric-card,
.mini-item,
.post-card,
.comment-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-2);
}

.detail-card,
.metric-card,
.mini-item {
  padding: 14px;
}

.detail-card span,
.metric-card span {
  display: block;
  font-size: 0.84rem;
  color: var(--muted);
}

.detail-card strong,
.metric-card strong {
  display: block;
  margin-top: 8px;
}

.primary-link {
  margin-top: 16px;
}

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

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

label span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
  color: var(--text);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--line-strong);
}

.photo-preview-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-2);
}

.photo-preview-wrap img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
}

.mini-section + .mini-section {
  margin-top: 18px;
}

.mini-list,
.feed-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.feed-section {
  margin-top: 0;
}

.post-card,
.comment-card {
  padding: 16px;
}

.post-head,
.post-actions,
.comment-row,
.comment-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.post-type {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  color: var(--accent);
  background: var(--accent-soft);
}

.post-meta,
.comment-meta,
.mini-item span {
  color: var(--muted-2);
  font-size: 0.82rem;
}

.post-title {
  margin: 12px 0 0;
  font-size: 1.25rem;
}

.post-image {
  width: 100%;
  margin-top: 14px;
  max-height: 260px;
  object-fit: cover;
  border-radius: 16px;
}

.post-actions,
.comments-wrap {
  margin-top: 14px;
}

.comments-wrap {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.comment-author {
  font-size: 0.88rem;
  font-weight: 600;
}

.comment-form-row {
  align-items: stretch;
}

.comment-form-row input {
  min-width: 0;
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  z-index: 20;
}

@media (max-width: 960px) {
  .hero-grid,
  .dashboard-grid,
  .compose-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100%, calc(100% - 14px));
    padding: 16px 0 36px;
  }

  .topbar,
  .section-tabs,
  .hero-card,
  .auth-card,
  .panel,
  .feed-section {
    padding: 16px;
    border-radius: 20px;
  }

  .topbar,
  .topbar-actions,
  .panel-head,
  .feed-head,
  .auth-head,
  .post-head,
  .post-actions,
  .comment-row,
  .comment-form-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .field-row,
  .detail-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .theme-toggle,
  .ghost-button,
  .submit-button,
  .kakao-login-btn,
  .primary-link,
  .tab-button {
    width: 100%;
  }
}
