:root {
  --ink: #2d241d;
  --muted: #75695f;
  --line: #ded3c7;
  --surface: #fffdf9;
  --surface-soft: #f4efe9;
  --primary: #7a4f32;
  --primary-dark: #56351f;
  --primary-soft: #efe2d5;
  --accent: #d3a35b;
  --danger: #a34b3f;
  --shadow: 0 18px 50px rgba(73, 50, 33, 0.12);
  --radius-lg: 24px;
  --radius-md: 15px;
}

.leader-avatar, .member-avatar, .applicant-avatar { overflow: hidden; }
.leader-avatar img, .member-avatar img, .applicant-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface-soft);
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(222, 211, 199, 0.9);
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 44px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px 11px 11px 3px;
  color: white;
  background: var(--primary);
  font-family: Georgia, serif;
  font-size: 20px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-right: auto;
}

.main-nav a {
  position: relative;
  padding: 28px 0 25px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--primary-dark);
}

.main-nav a.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--primary);
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 로그인한 회원의 공통 알림함: 헤더와 분리해 작은 화면에서도 잘리지 않게 표시합니다. */
.notification-control { display: inline-flex; flex: 0 0 auto; }
.notification-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--primary-dark); background: var(--surface); cursor: pointer; }
.notification-bell:hover, .notification-bell[aria-expanded="true"] { background: var(--primary-soft); }
.notification-bell:focus-visible, .notification-panel button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.notification-count { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 10px; color: white; background: #b34c46; font-size: 10px; font-weight: 800; line-height: 1; }
.notification-count[hidden], .notification-panel[hidden], .notification-panel [hidden] { display: none !important; }
.notification-bell[data-state="error"] { color: var(--danger); }
.notification-panel { position: fixed; z-index: 1001; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 14px; outline: none; color: var(--ink); background: var(--surface); box-shadow: 0 14px 40px #2d241d26; }
.notification-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.notification-header h2 { margin: 0; font-size: 17px; }
.notification-actions { display: flex; align-items: center; gap: 8px; }
.notification-panel button { font: inherit; cursor: pointer; }
.notification-actions button { min-height: 28px; padding: 3px 4px; border: 0; border-radius: 5px; color: var(--primary); background: transparent; font-size: 11px; }
.notification-actions .notification-close { width: 28px; font-size: 22px; line-height: 1; }
.notification-panel button:disabled { cursor: not-allowed; opacity: .5; }
.notification-help, .notification-message { margin: 0; padding: 10px 14px; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.notification-message[data-error="true"] { color: var(--danger); }
.notification-list { list-style: none; padding: 0; margin: 0; }
.notification-list li { border-top: 1px solid #ece4dc; }
.notification-item { display: grid; gap: 6px; width: 100%; padding: 14px; border: 0; color: var(--ink); background: var(--surface); text-align: left; overflow-wrap: anywhere; }
.notification-item[data-read="false"] { background: #fbf3e9; }
.notification-item:hover { background: var(--primary-soft); }
.notification-item strong { font-size: 13px; }
.notification-body { color: var(--muted); font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.notification-read-state { color: var(--primary); font-size: 10px; font-weight: 750; }
.notification-item[data-read="true"] .notification-read-state { color: var(--muted); font-weight: 400; }
.notification-item time { color: var(--muted); font-size: 10px; }
.notification-target-note { color: var(--muted); font-size: 11px; line-height: 1.5; }
.notification-more { display: block; width: calc(100% - 28px); margin: 12px 14px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--primary); background: var(--surface); font-size: 12px; }
@media (max-width: 620px) {
  .header-inner { flex-wrap: wrap; column-gap: 12px; row-gap: 8px; }
  .account-actions { max-width: 100%; min-width: 0; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
  .account-actions .button-ghost { min-width: 0; overflow-wrap: anywhere; }
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-ghost {
  color: var(--muted);
  background: transparent;
}

.button-dark {
  color: white;
  background: var(--ink);
}

.button-primary {
  color: white;
  background: var(--primary);
}

.button-primary:hover {
  background: var(--primary-dark);
}

.button-secondary {
  color: var(--primary-dark);
  border-color: #cdb8a4;
  background: white;
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 30px max(40px, calc((100% - 1180px) / 2));
  color: white;
  background-color: #68432c;
  background-image: url("../assets/wood-texture.png");
  background-position: center 48%;
  background-size: cover;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero::before {
  background:
    linear-gradient(90deg, rgba(38, 22, 13, 0.83) 0%, rgba(65, 36, 20, 0.72) 45%, rgba(73, 41, 23, 0.55) 100%),
    linear-gradient(180deg, rgba(40, 23, 13, 0.2), rgba(40, 23, 13, 0.38));
}

.hero::after {
  background: linear-gradient(90deg, rgba(31, 18, 10, 0.18), transparent 38%, rgba(112, 71, 42, 0.08));
  box-shadow: inset 0 -28px 44px rgba(38, 22, 13, 0.16);
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 54px);
  line-height: 1.16;
  letter-spacing: -0.045em;
}

.hero-description {
  max-width: 620px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 16px;
  line-height: 1.7;
}

.hero-stat {
  min-width: 180px;
  padding: 22px 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.hero-stat span {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.hero-stat strong {
  display: inline-block;
  margin: 4px 4px 2px 0;
  font-family: Georgia, serif;
  font-size: 44px;
  font-weight: 500;
}

.search-section,
.study-section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.search-section {
  position: relative;
  z-index: 2;
  margin-top: 28px;
}

.search-panel {
  padding: 30px;
  border: 1px solid rgba(222, 211, 199, 0.9);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-heading,
.list-heading,
.search-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.section-kicker {
  margin-bottom: 7px;
  color: var(--primary);
}

.search-heading h2,
.list-heading h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.025em;
}

.reset-button {
  padding: 8px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.search-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 0.9fr 0.9fr;
  gap: 14px;
  margin-top: 28px;
}

.field {
  min-width: 0;
}

.field span {
  display: block;
  margin-bottom: 9px;
  color: #5e5147;
  font-size: 13px;
  font-weight: 750;
}

.field input,
.field select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: #fcfaf7;
  font-size: 14px;
}

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(122, 79, 50, 0.12);
}

.field input::placeholder {
  color: #aa9c8f;
}

.search-footer {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid #eee7df;
}

.saved-time-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.availability-link {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 750;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.saved-time-toggle:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.62;
}

.saved-time-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 20px;
  background: #cfc3b8;
  transition: background-color 160ms ease;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(62, 42, 27, 0.22);
  transition: transform 160ms ease;
}

.saved-time-toggle input:checked+.toggle-track {
  background: var(--primary);
}

.saved-time-toggle input:checked+.toggle-track::after {
  transform: translateX(20px);
}

.saved-time-toggle strong,
.saved-time-toggle small {
  display: block;
}

.saved-time-toggle strong {
  font-size: 14px;
}

.saved-time-toggle small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.search-button {
  min-width: 150px;
}

.study-section {
  padding: 64px 0 100px;
}

.result-count {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.result-count strong {
  color: var(--primary);
  font-size: 18px;
}

.list-tools,
.view-switcher {
  display: flex;
  align-items: center;
}

.list-tools {
  gap: 18px;
}

.view-switcher {
  overflow: hidden;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.view-button {
  width: 36px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: #9a8e83;
  background: transparent;
}

.view-button:hover {
  color: var(--primary);
}

.view-button.is-active {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.grid-icon {
  width: 15px;
  height: 15px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
}

.grid-icon i {
  border: 1.7px solid currentColor;
  border-radius: 1px;
}

.list-icon {
  width: 16px;
  display: grid;
  gap: 3px;
}

.list-icon i {
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
  margin: 20px 0;
}

.filter-chip {
  padding: 7px 10px;
  border-radius: 100px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 700;
}

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

.study-grid.list-view {
  grid-template-columns: 1fr;
}

.study-grid.list-view .study-card {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(260px, 1fr) minmax(250px, 0.9fr);
  align-items: center;
  gap: 26px;
  padding: 22px 24px;
}

.study-grid.list-view .card-top {
  position: absolute;
  top: 19px;
  left: 24px;
  right: 22px;
}

.study-grid.list-view .study-card h3 {
  margin: 42px 0 7px;
}

.study-grid.list-view .study-goal {
  min-height: auto;
}

.study-grid.list-view .study-meta {
  margin: 0;
  padding: 0 26px;
  border: 0;
  border-right: 1px solid #eee7df;
  border-left: 1px solid #eee7df;
}

.study-grid.list-view .card-footer {
  align-self: stretch;
}

.study-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.study-card:hover {
  transform: translateY(-3px);
  border-color: #cbb7a3;
  box-shadow: 0 16px 34px rgba(73, 50, 33, 0.11);
}

.card-top,
.card-footer,
.capacity-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.subject-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 750;
}

.subject-badge {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.status-badge {
  color: #76551d;
  background: #f9edce;
}

.study-card h3 {
  margin: 20px 0 9px;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.study-goal {
  min-height: 45px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.study-meta {
  display: grid;
  gap: 10px;
  margin: 22px 0;
  padding: 18px 0;
  border-top: 1px solid #eee7df;
  border-bottom: 1px solid #eee7df;
}

.meta-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  color: #62564b;
  font-size: 13px;
}

.meta-icon {
  color: var(--primary);
  font-size: 15px;
  text-align: center;
}

.capacity-info {
  flex: 1;
}

.capacity-label {
  color: var(--muted);
  font-size: 12px;
}

.capacity-label strong {
  color: var(--ink);
  font-size: 14px;
}

.capacity-track {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 10px;
  background: #ebe3db;
}

.capacity-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.detail-button {
  min-width: 94px;
}

.empty-state {
  padding: 70px 20px;
  border: 1px dashed #cfc3b8;
  border-radius: var(--radius-md);
  background: white;
  text-align: center;
}

.empty-icon {
  display: block;
  color: #a69a8e;
  font-size: 44px;
}

.empty-state h3 {
  margin: 16px 0 8px;
}

.empty-state p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.study-dialog {
  width: min(620px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 30px 100px rgba(50, 34, 23, 0.3);
}

.study-dialog::backdrop {
  background: rgba(43, 30, 21, 0.58);
  backdrop-filter: blur(4px);
}

.dialog-content {
  position: relative;
  padding: 34px;
}

.dialog-close {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 24px;
  line-height: 1;
}

.dialog-content h2 {
  margin: 18px 45px 8px 0;
  font-size: 27px;
  letter-spacing: -0.035em;
}

.dialog-goal {
  color: var(--muted);
  line-height: 1.7;
}

.dialog-detail-list {
  display: grid;
  gap: 0;
  margin: 24px 0;
  border-top: 1px solid var(--line);
}

.dialog-detail-list div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.dialog-detail-list dt {
  color: var(--muted);
}

.dialog-detail-list dd {
  margin: 0;
  font-weight: 650;
}

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

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  padding: 14px 18px;
  border-radius: 12px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 650;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
