:root {
  --bg: #0d1017;
  --bg-soft: #161d29;
  --panel: rgba(16, 23, 35, 0.88);
  --panel-strong: rgba(23, 30, 46, 0.94);
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef3ff;
  --text-soft: rgba(238, 243, 255, 0.7);
  --accent: #ff6f3c;
  --accent-2: #ffd166;
  --success: #4ce0b3;
  --danger: #ff6b6b;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 111, 60, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.14), transparent 28%),
    linear-gradient(180deg, #0a0f17 0%, #111827 100%);
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
}

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

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at center, black 55%, transparent 100%);
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.topbar,
.hero-card,
.members-card,
.timeline-wrap,
.month-section,
.booking-modal {
  width: min(100%, 460px);
  margin: 0 auto;
}

.topbar {
  position: relative;
  z-index: 9;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0 12px;
}

.topbar-copy {
  flex: 1;
  min-width: 0;
}

.topbar h1 {
  margin: 2px 0 0;
  font-family: "Bebas Neue", "Noto Sans SC", sans-serif;
  font-size: clamp(1.9rem, 5.7vw, 2.45rem);
  line-height: 0.88;
  letter-spacing: 0.03em;
}

.eyebrow,
.hero-label,
.month-caption,
.car-badge {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.primary-button,
.ghost-button,
.icon-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

.primary-button:active,
.ghost-button:active,
.icon-button:active {
  transform: scale(0.97);
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #ff8f5a);
  color: #1b1210;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(255, 111, 60, 0.28);
  padding: 11px 16px;
  white-space: nowrap;
}

.ghost-button {
  padding: 12px 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.compact-button {
  padding: 8px 12px;
  font-size: 0.88rem;
  white-space: nowrap;
}

.ghost-button.danger {
  color: #ffd3d3;
  background: rgba(255, 107, 107, 0.12);
}

.icon-button {
  width: 40px;
  height: 40px;
  font-size: 1.8rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.hero-card,
.members-card,
.timeline-wrap,
.month-section,
.booking-modal {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 111, 60, 0.16), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
    var(--panel);
}

.current-status {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
}

.status-pill,
.member-chip,
.month-booking-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
}

.month-action-button {
  flex-shrink: 0;
}

.hero-meta,
.section-heading p,
.board-subtitle,
.board-meta,
.form-hint {
  margin: 0;
  color: var(--text-soft);
}

.board-card {
  border-radius: var(--radius-lg);
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.board-header,
.board-actions,
.comment-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.board-subtitle {
  margin-top: 4px;
  font-size: 0.92rem;
}

.board-meta {
  margin-top: 10px;
  font-size: 0.8rem;
}

.board-content {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
}

.board-form,
.comment-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.board-form label,
.comment-form label,
.inline-field {
  display: grid;
  gap: 8px;
}

.board-form span,
.comment-form span {
  font-weight: 700;
}

.board-form textarea,
.board-form select,
.comment-form textarea,
.comment-form select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 14px;
}

.board-form textarea,
.comment-form textarea {
  resize: vertical;
}

.comments-wrap {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.comments-header {
  margin-bottom: 2px;
}

.inline-field {
  min-width: 132px;
  flex: 1;
}

.comment-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  max-height: 176px;
  overflow-y: auto;
  padding-right: 4px;
}

.comment-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.comment-item-head strong {
  font-size: 0.98rem;
}

.comment-time {
  color: var(--text-soft);
  font-size: 0.8rem;
  white-space: nowrap;
}

.comment-body {
  margin: 8px 0 0;
  color: var(--text);
  line-height: 1.5;
}

.empty-comments {
  padding: 12px 0 2px;
  color: var(--text-soft);
}

.members-card,
.timeline-wrap {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius-xl);
}

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

.section-heading h2,
.month-title,
.modal-header h2 {
  margin: 0;
}

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

.member-chip {
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.member-chip strong {
  font-size: 1rem;
}

.calendar-months {
  display: grid;
  gap: 18px;
  align-content: start;
}

.month-section {
  min-height: auto;
  padding: 18px 14px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 24%),
    var(--panel-strong);
}

.month-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.month-title {
  font-size: 1.55rem;
}

.weekday-row,
.week-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 0.8rem;
  text-align: center;
}

.week-row {
  position: relative;
  margin-bottom: 10px;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.week-days {
  position: relative;
  z-index: 1;
}

.day-cell {
  min-height: 84px;
  padding: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  background: transparent;
  color: inherit;
  text-align: left;
}

.day-cell:last-child {
  border-right: 0;
}

.day-cell button {
  appearance: none;
  width: 100%;
  min-height: 84px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  position: relative;
  display: block;
}

.day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: 700;
  position: absolute;
  top: 7px;
  left: 7px;
}

.day-cell.other-month {
  opacity: 0.3;
}

.day-cell.today .day-number {
  background: linear-gradient(135deg, var(--accent), #ffb36f);
  color: #111;
}

.day-cell.has-booking button {
  opacity: 0.95;
}

.day-cell.can-create {
  cursor: pointer;
}

.week-bookings {
  position: absolute;
  inset: 36px 8px 8px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  z-index: 3;
}

.booking-bar {
  appearance: none;
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  padding: 6px 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.booking-bar small {
  display: inline;
  opacity: 0.86;
  font-weight: 500;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 8, 14, 0.68);
  backdrop-filter: blur(16px);
}

.booking-modal {
  border-radius: 28px;
  padding: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.booking-form {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.booking-form label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.booking-form span {
  font-weight: 700;
}

.booking-form input,
.booking-form select,
.booking-form textarea {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  background-clip: padding-box;
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
  padding: 14px;
}

.booking-form textarea {
  resize: vertical;
  min-height: 104px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.hidden {
  display: none !important;
}

@media (min-width: 700px) {
  .app-shell {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 430px) {
  .topbar {
    gap: 10px;
  }

  .topbar h1 {
    font-size: clamp(1.7rem, 5.2vw, 2.1rem);
  }

  .eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }

  .primary-button {
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  .board-header,
  .board-actions,
  .comment-item-head {
    flex-direction: column;
    align-items: stretch;
  }

  .board-meta {
    text-align: left;
  }
}
