@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;800;900&display=swap');

/* =================================
   KW CAP Lab · Shared Stylesheet
   ================================= */

:root {
  --navy:      #183A5A;
  --navy-2:    #25506F;
  --red:       #B51F2B;
  --red-2:     #8B1520;
  --ink:       #1F2933;
  --muted:     #667085;
  --line:      #D9E2EC;
  --bg:        #FAFAF8;
  --surface:   #FFFFFF;
  --navy-deep: #0F2540;
  --gold:      #D4A726;
  --blue-soft: #EAF2F8;
  --red-soft:  #FCE8EA;
  --green-soft:#EAF7EF;
  --shadow:    0 18px 42px rgba(24, 58, 90, 0.09);
  --radius:    8px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: normal;
  line-break: strict;
  hyphens: none;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* ---- Skip link ---- */
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  padding: 10px 14px; border-radius: 6px;
  background: var(--navy); color: #fff; font-weight: 700;
}
.skip-link:focus { top: 16px; }

/* ---- Header / Navigation ---- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  border-bottom: 3px solid var(--navy);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: none;
}
.nav-shell {
  display: grid; align-items: center;
  grid-template-columns: minmax(230px, 1fr) minmax(680px, auto) minmax(220px, 1fr);
  width: min(1180px, calc(100% - 32px));
  min-height: 72px; margin: 0 auto; gap: 12px;
}
.brand {
  display: flex; align-items: center; justify-self: start; min-width: 0; gap: 10px;
}
.brand-mark {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 0; background: var(--navy);
  gap: 1px;
}
.brand-mark .bm-kw {
  color: rgba(255,255,255,0.6); font-size: 0.5rem;
  font-weight: 900; letter-spacing: 0.1em; line-height: 1;
}
.brand-mark .bm-cap {
  color: #fff; font-size: 0.78rem;
  font-weight: 900; letter-spacing: 0.04em; line-height: 1.1;
}
.brand-name { display: grid; gap: 1px; }
.brand-name strong {
  color: var(--navy); font-size: 0.9rem; line-height: 1.22;
  white-space: nowrap;
}
.brand-name span {
  color: var(--muted); font-size: 0.62rem;
  line-height: 1.28; white-space: normal; max-width: 300px;
}

.nav-links {
  display: flex; align-items: stretch; justify-content: center;
  flex-wrap: nowrap; gap: 2px;
}
.nav-links a {
  display: flex; flex-direction: column; justify-content: center;
  min-width: 82px; min-height: 48px; padding: 7px 10px;
  border-radius: 0; border-bottom: 3px solid transparent;
  color: var(--navy); font-weight: 800;
  text-align: center; transition: border-color 0.15s, background 0.15s; font-size: 0.9rem;
  margin-bottom: -3px;
}
.nav-links a:hover { background: transparent; border-bottom-color: var(--red); }
.nav-links a[hidden] { display: none; }
.nav-links small { color: var(--muted); font-size: 0.68rem; font-weight: 700; display: block; }
.nav-links a[aria-current="page"] {
  background: transparent;
  border-bottom-color: var(--navy);
  box-shadow: none;
}

.nav-links .apply {
  background: var(--navy); color: #fff; border-bottom-color: transparent;
}
.nav-links .apply small { color: rgba(255, 255, 255, 0.76); }
.nav-links .apply:hover { background: var(--navy-2); border-bottom-color: transparent; }
.nav-links .apply[aria-current="page"] {
  background: var(--navy);
  box-shadow: inset 0 -2px 0 var(--red);
}
.nav-links .lab-nav-link {
  min-width: 82px; min-height: 44px;
  border: 1px solid var(--red); border-radius: 0 !important;
  background: var(--red-soft); color: var(--red);
}
.nav-links .lab-nav-link small {
  color: rgba(181, 31, 43, 0.72);
}
.nav-links .lab-nav-link:hover,
.nav-links .lab-nav-link[aria-current="page"] {
  background: var(--red); color: #fff; box-shadow: none;
}
.nav-links .lab-nav-link:hover small,
.nav-links .lab-nav-link[aria-current="page"] small {
  color: rgba(255, 255, 255, 0.78);
}
.nav-toggle {
  display: none;
  min-height: 38px; padding: 6px 12px;
  border: 1px solid var(--navy); border-radius: 0;
  background: #fff; color: var(--navy);
  font-family: inherit; font-weight: 900; cursor: pointer;
}

/* ---- Typography ---- */
h1, h2, h3 {
  margin: 0; color: var(--navy); line-height: 1.22;
}
h1 { font-size: clamp(1.7rem, 3.2vw, 3rem); max-width: 820px; }
h2 { font-size: clamp(1.55rem, 2.4vw, 2.35rem); }
h3 { font-size: 1.12rem; }

.eyebrow, .tagline {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px;
  color: var(--red); font-size: 0.84rem;
  font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em;
}
.tagline::before {
  content: ""; display: block; width: 20px; height: 3px;
  background: var(--red); flex-shrink: 0;
}
.lead {
  max-width: 760px; margin: 24px 0 0;
  color: #364152; font-size: 1rem;
}
.en {
  display: block; margin-top: 7px;
  color: var(--muted); font-size: 0.92em;
}

/* ---- Buttons ---- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 20px;
  border: 1px solid var(--navy); border-radius: 0;
  background: var(--navy); color: #fff;
  font-weight: 800; font-size: 0.95rem;
  transition: background 0.15s;
}
.button:hover { background: var(--navy-2); border-color: var(--navy-2); }
.button.secondary { background: #fff; color: var(--navy); }
.button.secondary:hover { background: var(--blue-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero-actions .button {
  width: auto;
  white-space: nowrap;
}

/* ---- Hero (Home page) ---- */
.hero {
  position: relative;
  min-height: calc(100vh - 72px);
  border-bottom: 0;
  background: var(--navy-deep);
  overflow: hidden;
}
.hero-bg-pattern {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Crect x='0' y='0' width='120' height='120' fill='none'/%3E%3Cline x1='0' y1='0' x2='120' y2='120' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3Cline x1='120' y1='0' x2='0' y2='120' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3Ccircle cx='0' cy='0' r='40' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='1'/%3E%3Ccircle cx='120' cy='120' r='40' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 120px 120px;
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  width: 100%;
  min-height: calc(100vh - 72px);
  margin: 0; padding: 0;
}
.hero-content {
  display: flex; flex-direction: column; justify-content: center;
  min-height: auto;
}
.hero-left {
  padding: 80px min(80px, 5vw) 80px max(16px, calc((100vw - 1180px) / 2 + 16px));
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.mag-label {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.mag-label-line {
  width: 40px; height: 3px; background: var(--red);
  flex-shrink: 0;
}
.mag-label-text {
  margin: 0;
  color: var(--red);
  font-size: 0.78rem; font-weight: 900;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.hero h1 {
  max-width: 640px;
  color: #fff;
  font-size: clamp(2.2rem, 3.8vw, 3.8rem);
  line-height: 1.15;
}
.hero-rule {
  width: 60px; height: 2px;
  margin: 28px 0;
  background: rgba(255, 255, 255, 0.2);
}
.hero .lead {
  max-width: 540px;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1rem;
  line-height: 1.8;
}
.hero .lead .en {
  color: rgba(255, 255, 255, 0.38);
}
.hero-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  max-width: 680px; margin-top: 28px;
}
.hero-tags span {
  padding: 4px 12px; border-radius: 0;
  background: rgba(255, 255, 255, 0.07); color: rgba(255, 255, 255, 0.8);
  font-size: 0.76rem; font-weight: 700; border: 1px solid rgba(255, 255, 255, 0.12);
}
.hero-actions { margin-top: 36px; }
.btn-block {
  min-height: 52px; padding: 14px 32px;
  border-radius: 0; font-weight: 800;
  letter-spacing: 0.03em;
}
.btn-block.primary {
  background: var(--red); border-color: var(--red); color: #fff;
}
.btn-block.primary:hover {
  background: var(--red-2); border-color: var(--red-2);
}
.btn-block.secondary {
  background: transparent; color: rgba(255, 255, 255, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.3);
}
.btn-block.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}
.hero-right {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 40px;
  background: rgba(255, 255, 255, 0.03);
  gap: 24px;
}
.mag-circle {
  position: relative;
  width: 240px; height: 240px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: radial-gradient(circle at 30% 30%, rgba(181, 31, 43, 0.2), transparent 60%);
}
.mag-circle-inner { text-align: center; }
.mag-circle-label {
  display: block; margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.68rem; font-weight: 900;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.mag-circle-title {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.88rem; font-weight: 700;
  line-height: 1.5;
}
.mag-circle-accent {
  position: absolute; top: -2px; right: -2px;
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--red);
}
.mag-circle-accent b {
  color: #fff; font-size: 1.1rem; font-weight: 900; line-height: 1;
}
.mag-circle-accent span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.52rem; font-weight: 700;
}
.mag-stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px; width: 100%;
}
.mag-stat {
  padding: 16px; text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.mag-stat b {
  display: block; color: #fff; font-size: 1.4rem; font-weight: 900;
}
.mag-stat span {
  display: block; margin-top: 2px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.72rem;
}

/* ---- Page Hero (inner pages) ---- */
.page-hero {
  background: var(--bg);
  border-bottom: 0;
  padding: 48px 0 0;
}
.page-hero-inner {
  position: relative; overflow: hidden;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto; padding: 42px 44px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 5px solid var(--red);
  background: var(--navy-deep);
  color: #fff;
}
.page-hero-inner::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Crect x='0' y='0' width='120' height='120' fill='none'/%3E%3Cline x1='0' y1='0' x2='120' y2='120' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3Cline x1='120' y1='0' x2='0' y2='120' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3Ccircle cx='0' cy='0' r='40' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='1'/%3E%3Ccircle cx='120' cy='120' r='40' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 120px 120px;
  pointer-events: none;
}
.page-hero-inner > * {
  position: relative; z-index: 1;
}
.page-hero-inner .tagline {
  color: var(--red);
}
.page-hero-inner .tagline::before {
  background: var(--red);
}
.page-hero-inner h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  color: #fff;
  margin-top: 10px;
}
.page-hero-inner p {
  margin: 14px 0 0; color: rgba(255, 255, 255, 0.68);
  font-size: 1.05rem; max-width: 760px;
}

/* ---- Sections ---- */
main { background: var(--bg); }
.section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto; padding: 66px 0;
}
.section + .section { border-top: 1px solid var(--line); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 28px; margin-bottom: 28px;
}
.section-head p { max-width: 710px; margin: 10px 0 0; color: var(--muted); }
.more-link {
  white-space: nowrap; color: var(--navy); font-weight: 800;
  font-size: 0.9rem; text-decoration: underline;
  text-underline-offset: 3px; flex-shrink: 0;
}

/* ---- Cards & Grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.grid.two   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.auto  { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.card {
  padding: 22px; border: 1px solid var(--line); border-top: 3px solid var(--navy);
  border-radius: 0;
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(24, 58, 90, 0.04);
  transition: border-top-color 0.15s;
}
.card:hover { border-top-color: var(--red); }
.card p { margin: 12px 0 0; color: #364152; }
.card h3 { font-size: 1.08rem; }

.theory-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.theory-tags span {
  display: inline-flex; align-items: center; min-height: 26px;
  padding: 3px 10px; border: 1px solid var(--line); border-radius: 0;
  background: var(--blue-soft); color: var(--navy-2);
  font-size: 0.76rem; font-weight: 800;
}

/* ---- Publications & News lists ---- */
.publication-list, .news-list {
  display: grid; gap: 12px; margin: 0; padding: 0; list-style: none;
}
.publication-list li, .news-list li {
  padding: 20px 22px;
  border: 1px solid var(--line); border-left: 5px solid var(--red);
  border-radius: 0; background: #fff;
  box-shadow: 0 4px 14px rgba(24, 58, 90, 0.03);
}
.publication-list b, .news-list b {
  display: block; color: var(--navy); font-size: 1rem;
}
.publication-list span, .news-list span {
  display: block; margin-top: 5px; color: var(--muted); font-size: 0.9rem;
}
.pub-meta { color: var(--muted); font-size: 0.88rem; margin-top: 6px; }
.pub-link {
  display: inline-block; margin-top: 8px;
  color: var(--red); font-size: 0.84rem; font-weight: 800;
  text-decoration: underline; text-underline-offset: 2px;
}
.publication-list.year-list {
  display: block;
  border-top: 1px solid var(--line);
}
.publication-list.year-list .publication-year-group {
  display: grid;
  grid-template-columns: minmax(96px, 150px) minmax(0, 1fr);
  gap: 42px;
  padding: 30px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.publication-list.year-list .publication-year-group.empty {
  min-height: auto;
}
.publication-list.year-list .pub-year {
  color: #A56A1B;
  font-size: 1.04rem;
  font-weight: 900;
  line-height: 1.25;
}
.publication-list.year-list .pub-year-items {
  display: grid;
  gap: 22px;
  min-width: 0;
}
.publication-list.year-list .pub-entry {
  min-width: 0;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(217, 226, 236, 0.72);
}
.publication-list.year-list .pub-entry:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.publication-list.year-list .pub-entry b {
  color: var(--ink);
  font-size: clamp(0.98rem, 1.25vw, 1.12rem);
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: normal;
}
.publication-list.year-list .pub-entry span {
  max-width: 720px;
  margin-top: 8px;
  color: #53627A;
  font-size: 0.92rem;
}
.publication-list.year-list .pub-entry .pub-meta {
  color: #53627A;
}
.publication-list.year-list .pub-entry .pub-meta:empty {
  display: none;
}
.publication-list.year-list .pub-link {
  margin-top: 10px;
}

/* ---- News badges ---- */
.news-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.news-date { color: var(--muted); font-size: 0.82rem; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 0;
  font-size: 0.72rem; font-weight: 800;
}
.badge-blue  { background: var(--blue-soft); color: var(--navy); }
.badge-red   { background: var(--red-soft);  color: var(--red); }
.badge-green { background: var(--green-soft); color: #166534; }
.badge-gray  { background: #F1F3F5; color: var(--muted); }

/* ---- People ---- */
.person-group { margin-bottom: 44px; }
.person-group:last-child { margin-bottom: 0; }
.person-group-label {
  display: block; font-size: 0.82rem; font-weight: 900; color: var(--red);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
}
.people-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
}
.people-strip.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.people-strip.five  { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.person {
  padding: 24px 18px; border: 1px solid var(--line); border-top: 3px solid var(--navy);
  border-radius: 0;
  background: #fff; text-align: center;
  transition: border-top-color 0.15s;
}
.person:hover { border-top-color: var(--red); }
.person.professor {
  border-top: 3px solid var(--navy);
}
.avatar {
  display: grid; width: 76px; height: 76px;
  margin: 0 auto 14px; place-items: center;
  border: 1px solid var(--line); border-radius: 0;
  background: var(--blue-soft); color: var(--navy);
  font-size: 1.55rem; font-weight: 900;
}
.avatar-photo {
  display: block; object-fit: cover;
  background: #fff;
}
.avatar-character {
  display: block; overflow: hidden;
}
.person.professor .avatar {
  width: 88px; height: 88px;
  background: var(--navy); color: #fff; font-size: 1.5rem;
}
.person.alumni {
  background: linear-gradient(180deg, #fff 0%, #F7FAFC 100%);
}
.person.placeholder {
  border-style: dashed;
}
.person strong { display: block; color: var(--navy); font-size: 1.04rem; }
.person .en-name {
  display: block; color: #364152; font-size: 0.88rem; margin-top: 2px;
}
.person .role {
  display: block; color: var(--muted); font-size: 0.84rem; margin-top: 4px;
}
.person .interest {
  display: block; color: var(--muted); font-size: 0.8rem;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
  line-height: 1.5;
}

/* ---- Join band (home page preview) ---- */
.join-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
  gap: 0; padding: 0; border-radius: 0;
  background: var(--navy); color: #fff;
}
.join-band h2 { color: #fff; }
.join-band p, .join-band .en { color: rgba(255, 255, 255, 0.78); }
.join-text { padding: 48px 44px; }
.join-text .tagline { color: var(--red); }
.join-text .tagline::before { background: var(--red); }
.join-actions {
  display: flex; flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}
.join-action {
  flex: 1; display: flex; align-items: center;
  padding: 18px 28px;
  border: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); border-radius: 0;
  background: transparent; color: rgba(255, 255, 255, 0.82); font-weight: 700;
  transition: background 0.15s, color 0.15s;
}
.join-action::after { content: " →"; margin-left: auto; color: var(--red); }
.join-action:last-child { border-bottom: 0; }
.join-action:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }

/* ---- Join page detail sections ---- */
.join-grid { display: grid; gap: 20px; }
.join-section {
  padding: 32px; border: 1px solid var(--line); border-top: 3px solid var(--navy);
  border-radius: 0;
  background: var(--surface);
}
.join-section h3 { margin-bottom: 12px; font-size: 1.2rem; }
.join-section p { margin: 10px 0 0; color: #364152; }
.join-section ul {
  margin: 14px 0 0; padding-left: 20px; color: #364152; line-height: 1.8;
}
.join-section .cta-button {
  display: inline-block; margin-top: 18px;
}

/* ---- Contact block ---- */
.contact-block {
  padding: 28px; border: 1px solid var(--line); border-top: 3px solid var(--navy);
  border-radius: 0;
  background: var(--surface);
}
.contact-block dl { margin: 0; }
.contact-block dt {
  font-size: 0.78rem; font-weight: 900; color: var(--red);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-top: 18px;
}
.contact-block dt:first-child { margin-top: 0; }
.contact-block dd {
  margin: 4px 0 0; color: var(--ink); font-size: 0.95rem; line-height: 1.65;
}

/* ---- Reservation page ---- */
.reservation-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.78fr);
  align-items: center; gap: 28px;
}
.reservation-copy {
  padding: 32px; border: 1px solid var(--line); border-top: 3px solid var(--navy);
  border-radius: 0;
  background: var(--surface);
}
.reservation-copy p {
  margin: 14px 0 0; color: #364152;
}
.reservation-rule {
  margin-top: 22px; padding: 18px 20px; border-radius: 0;
  border: 1px solid var(--line); border-left: 4px solid var(--red);
  background: var(--bg);
}
.reservation-rule strong {
  display: block; color: var(--navy); font-size: 0.92rem;
}
.reservation-rule p {
  margin-top: 6px; color: var(--ink); font-weight: 700;
}
.reservation-actions {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px;
}
.lab-visual {
  margin: 0; padding: 28px; border-radius: 0;
  border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow);
  border-top: 3px solid var(--navy);
}
.lab-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.lab-card-head span {
  color: var(--red); font-size: 0.78rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.lab-card-head strong {
  color: var(--navy); font-size: 1rem; text-align: right;
}
.lab-pictogram {
  position: relative; height: 260px; margin-top: 24px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 0;
  background: linear-gradient(180deg, #F8FBFD 0%, #EDF4F8 66%, #DDE8EF 66%, #DDE8EF 100%);
}
.lab-wall {
  position: absolute; inset: 20px 22px auto; height: 92px;
}
.lab-screen {
  position: absolute; left: 0; top: 10px; width: 116px; height: 68px;
  border: 5px solid var(--navy); border-radius: 0; background: #fff;
  box-shadow: inset 0 0 0 10px var(--blue-soft);
}
.lab-board {
  position: absolute; right: 0; top: 0; width: 126px; height: 86px;
  border: 4px solid var(--line); border-radius: 0; background: #fff;
}
.lab-board::before,
.lab-board::after {
  content: ""; position: absolute; left: 18px; right: 18px; height: 4px;
  border-radius: 0; background: var(--blue-soft);
}
.lab-board::before { top: 26px; }
.lab-board::after { top: 48px; }
.lab-desk {
  position: absolute; left: 34px; right: 34px; bottom: 64px;
  height: 76px; border-radius: 0;
  background: var(--navy); box-shadow: 0 14px 0 rgba(24,58,90,0.12);
}
.lab-desk::before,
.lab-desk::after {
  content: ""; position: absolute; bottom: -38px; width: 16px; height: 44px;
  border-radius: 0; background: var(--navy-2);
}
.lab-desk::before { left: 28px; }
.lab-desk::after { right: 28px; }
.lab-monitor {
  position: absolute; left: 38px; top: -46px; width: 74px; height: 48px;
  border: 5px solid var(--navy-2); border-radius: 0; background: #fff;
}
.lab-monitor::after {
  content: ""; position: absolute; left: 24px; bottom: -18px;
  width: 24px; height: 14px; border-radius: 0; background: var(--navy-2);
}
.lab-keyboard {
  position: absolute; left: 124px; top: 24px; width: 82px; height: 16px;
  border-radius: 0; background: rgba(255,255,255,0.35);
}
.lab-flask {
  position: absolute; right: 48px; top: -22px; width: 42px; height: 60px;
  border: 4px solid var(--red); border-top: none; border-radius: 0;
  background: linear-gradient(180deg, transparent 38%, var(--red-soft) 38%);
}
.lab-flask::before {
  content: ""; position: absolute; left: 10px; top: -28px;
  width: 14px; height: 30px; border: 4px solid var(--red); border-bottom: none;
  border-radius: 0; background: #fff;
}
.lab-seats span {
  position: absolute; bottom: 34px; width: 54px; height: 42px;
  border-radius: 0; background: var(--red);
}
.lab-seats span::after {
  content: ""; position: absolute; left: 22px; bottom: -28px;
  width: 10px; height: 34px; border-radius: 0; background: var(--red);
}
.lab-seats span:first-child { left: 58px; }
.lab-seats span:last-child { right: 58px; background: var(--navy-2); }
.lab-seats span:last-child::after { background: var(--navy-2); }
.lab-visual figcaption {
  margin-top: 18px; color: var(--muted); font-size: 0.86rem; line-height: 1.55;
}

/* ---- Footer ---- */
.site-footer { border-top: 3px solid var(--navy); background: #fff; }
.footer-inner {
  display: flex; align-items: flex-start; justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto; padding: 28px 0;
  gap: 24px; color: var(--muted); font-size: 0.88rem; line-height: 1.7;
}
.footer-inner strong { color: var(--navy); font-size: 0.96rem; }

/* ---- Nav Auth ---- */
.nav-auth {
  display: flex; align-items: center; justify-content: flex-end; justify-self: end; gap: 8px;
  min-width: 0;
}
.nav-auth-stack {
  display: grid; gap: 5px; justify-items: start;
  padding-left: 10px; border-left: 1px solid var(--line);
}
.nav-auth-row {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  font-size: 0.82rem; white-space: nowrap;
}
.nav-auth-row.secondary {
  justify-content: flex-start;
}
.nav-auth-row.secondary a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 3px 9px;
  border: 1px solid var(--line); border-radius: 0;
  background: var(--bg); color: var(--navy); font-weight: 800;
  text-decoration: none;
}
.nav-login-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 5px 14px;
  border: 1px solid var(--navy); border-radius: 0;
  color: var(--navy); font-weight: 800; font-size: 0.84rem;
  white-space: nowrap;
}
.nav-login-btn:hover { background: var(--blue-soft); }
.nav-user {
  display: flex; align-items: center; gap: 8px; font-size: 0.82rem;
  white-space: nowrap;
}
.nav-user-name { color: var(--navy); font-weight: 700; }
.nav-user a,
.nav-auth-row a {
  color: var(--navy); font-weight: 700;
  text-decoration: underline; text-underline-offset: 2px; font-size: 0.8rem;
}
.nav-user a:hover { color: var(--navy-2); }
.nav-logout,
.nav-notification,
.nav-notification-settings {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: none; cursor: pointer;
  padding: 4px 10px; border-radius: 0; font-size: 0.78rem;
  color: var(--muted); font-family: inherit;
}
.nav-logout:hover,
.nav-notification:hover,
.nav-notification-settings:hover { background: var(--bg); }
.nav-notification {
  color: var(--navy); font-weight: 800;
}
.nav-notification:disabled {
  opacity: 0.55; cursor: not-allowed;
}
.admin-header .nav-notification {
  color: #fff; border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.1);
}
.admin-header .nav-notification:hover { background: rgba(255,255,255,0.18); }
.nav-admin-link {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 0;
  background: var(--red-soft); color: var(--red) !important;
  font-size: 0.78rem !important; font-weight: 800;
}

.nav-auth-row:first-child {
  gap: 6px;
}
.nav-auth-row:first-child a {
  display: inline; min-height: 0; padding: 0;
  border: 0;
  background: transparent;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 800;
}
.nav-auth-row:first-child a:hover { color: var(--red); }
.nav-user-name {
  display: inline-flex; align-items: center; min-height: 28px;
  padding: 3px 8px 3px 7px;
  border-left: 3px solid var(--red);
  background: transparent;
  font-weight: 900;
}

/* ---- Edit overlays / badges ---- */
.edit-btn {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 10px; padding: 5px 12px;
  border: 1px solid var(--navy); border-radius: 4px;
  background: #fff; color: var(--navy); font-size: 0.78rem; font-weight: 800;
  cursor: pointer; font-family: inherit;
}
.edit-btn:hover { background: var(--blue-soft); }

.add-item-bar {
  margin-bottom: 16px; padding: 12px 16px;
  background: var(--blue-soft); border: 1px solid var(--line); border-radius: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.add-item-bar span { color: var(--navy); font-weight: 700; font-size: 0.9rem; }

/* ---- Login page ---- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
}
.auth-card {
  width: min(420px, calc(100% - 32px));
  background: #fff; border-radius: 12px; padding: 40px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.18);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo strong { display: block; color: var(--navy); font-size: 1.1rem; }
.auth-logo span { color: var(--muted); font-size: 0.82rem; }
.auth-card h2 { font-size: 1.3rem; margin-bottom: 24px; text-align: center; }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 0.84rem; font-weight: 700;
  color: var(--ink); margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 0.95rem; font-family: inherit; color: var(--ink);
  background: #fff;
}
.input-with-toggle { position: relative; }
.input-with-toggle input { padding-right: 64px; }
.input-toggle-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; color: var(--navy);
  font-size: 0.78rem; font-weight: 800; cursor: pointer; padding: 4px 6px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(24,58,90,0.1);
}
.form-group textarea { min-height: 90px; resize: vertical; }
.form-hint { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.auth-error {
  margin-bottom: 16px; padding: 10px 14px; border-radius: 6px;
  background: var(--red-soft); color: var(--red); font-size: 0.88rem;
  font-weight: 700; display: none;
}
.auth-error.show { display: block; }

/* ---- Dashboard / Admin shared ---- */
.page-wrap {
  width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 64px;
}
.page-wrap h2 { margin-bottom: 8px; }
.page-wrap > p { color: var(--muted); margin: 0 0 32px; }

.tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--line);
  margin-bottom: 32px; flex-wrap: wrap;
}
.tab-btn {
  padding: 10px 20px; border: none; background: none; cursor: pointer;
  font-size: 0.9rem; font-weight: 700; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  font-family: inherit; transition: color 0.15s;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
.data-table th {
  text-align: left; padding: 10px 14px;
  background: var(--bg); border-bottom: 2px solid var(--line);
  color: var(--navy); font-size: 0.8rem; font-weight: 900;
  text-transform: uppercase;
}
.data-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--bg); }
.role-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 0.72rem; font-weight: 800;
}
.role-admin { background: var(--red-soft); color: var(--red); }
.role-member { background: var(--blue-soft); color: var(--navy); }

.action-row {
  display: flex; gap: 8px; align-items: center;
}
.btn-sm {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 30px; padding: 4px 10px; border-radius: 0; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 0.78rem; font-weight: 700;
  font-family: inherit; color: var(--ink);
  line-height: 1.2; text-decoration: none;
}
.btn-sm:hover { background: var(--bg); }
.btn-sm:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-sm:disabled:hover { background: #fff; }
.btn-sm.danger { border-color: var(--red); color: var(--red); }
.btn-sm.danger:hover { background: var(--red-soft); }
.btn-sm.primary { border-color: var(--navy); background: var(--navy); color: #fff; }
.btn-sm.primary:hover { background: var(--navy-2); }

.panel-section {
  padding: 28px; border: 1px solid var(--line); border-top: 3px solid var(--navy);
  border-radius: 0;
  background: var(--surface); margin-bottom: 20px;
}
.panel-section h3 { margin-bottom: 18px; font-size: 1.05rem; }
.page-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 66px;
}
.dashboard-hero {
  position: relative; overflow: hidden;
  margin-bottom: 22px; padding: 42px 44px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 5px solid var(--red);
  background: var(--navy-deep);
  color: #fff;
}
.dashboard-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Crect x='0' y='0' width='120' height='120' fill='none'/%3E%3Cline x1='0' y1='0' x2='120' y2='120' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3Cline x1='120' y1='0' x2='0' y2='120' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3Ccircle cx='0' cy='0' r='40' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='1'/%3E%3Ccircle cx='120' cy='120' r='40' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 120px 120px;
  pointer-events: none;
}
.dashboard-hero > * {
  position: relative; z-index: 1;
}
.dashboard-hero .tagline {
  color: var(--red);
}
.dashboard-hero .tagline::before {
  background: var(--red);
}
.dashboard-hero h1 {
  margin: 10px 0 0;
  color: #fff;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
}
.dashboard-hero p {
  max-width: 760px; margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1.05rem;
}
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
  align-items: start;
  gap: 20px;
}
.dashboard-preview {
  position: sticky; top: 100px;
  padding: 28px; border: 1px solid var(--line); border-top: 3px solid var(--navy);
  border-radius: 0;
  background: #fff;
  box-shadow: 0 10px 24px rgba(24, 58, 90, 0.04);
}
.dashboard-preview h3 {
  margin-bottom: 18px; font-size: 1.05rem;
}
.dashboard-kicker {
  display: block; margin-bottom: 8px;
  color: var(--red); font-size: 0.76rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.dashboard-form {
  margin-bottom: 0;
}
.profile-preview-card {
  padding: 28px 22px; border: 1px solid var(--line); border-top: 3px solid var(--navy);
  border-radius: 0;
  background: #fff; text-align: center;
}
.profile-preview-card.professor {
  border-top: 3px solid var(--navy);
}
.profile-preview-card .avatar {
  width: 86px; height: 86px;
}
.profile-preview-card.professor .avatar {
  background: var(--navy); color: #fff;
}
.profile-preview-card strong {
  display: block; color: var(--navy); font-size: 1.08rem;
}
.profile-preview-card .en-name {
  display: block; color: #364152; font-size: 0.9rem; margin-top: 2px;
}
.profile-preview-card .role {
  display: block; color: var(--muted); font-size: 0.86rem; margin-top: 4px;
}
.profile-preview-card .interest {
  display: block; color: var(--muted); font-size: 0.82rem;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
  line-height: 1.55; white-space: pre-line; overflow-wrap: normal;
}
.profile-preview-card .preview-email {
  color: var(--navy); font-weight: 700; text-decoration: underline;
  text-underline-offset: 2px;
}
.profile-preview-card .is-empty {
  color: #98A2B3;
}
.dashboard-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
.dashboard-actions .save-btn {
  margin-top: 0;
}
.dashboard-actions .btn-sm {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 8px 14px; text-decoration: none;
}
.emoji-builder {
  padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--red);
  border-radius: 0;
  background: var(--bg);
}
.emoji-builder .form-group {
  margin-bottom: 12px;
}
.emoji-presets {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.emoji-presets button {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 0; background: #fff;
  cursor: pointer; font-size: 1.2rem;
}
.emoji-presets button:hover {
  border-color: var(--navy); background: var(--blue-soft);
}
.character-builder {
  margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--navy);
  border-radius: 0;
  background: #fff;
}
.character-builder .form-check {
  margin-top: 0; margin-bottom: 14px;
}
.character-controls {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.character-controls .form-group {
  margin-bottom: 0;
}
.save-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 8px 20px; border-radius: 0;
  border: none; background: var(--navy); color: #fff;
  font-weight: 800; font-size: 0.9rem; cursor: pointer; font-family: inherit;
  margin-top: 16px;
}
.save-btn:hover { background: var(--navy-2); }
.save-btn.success { background: #166534; }
.inline-form {
  padding: 20px; background: var(--bg); border-radius: 0; margin-top: 16px;
  border: 1px solid var(--line);
}
.inline-form h4 { margin: 0 0 16px; font-size: 0.95rem; color: var(--navy); }
.notif-settings-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.5);
}
.notif-settings-panel {
  width: min(420px, 100%);
  background: #fff; margin-top: 0;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}
.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.form-check {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
}
.form-check label { font-size: 0.88rem; color: var(--ink); cursor: pointer; }
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  padding: 12px 20px; border-radius: 0;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 0.9rem;
  box-shadow: var(--shadow); opacity: 0; transition: opacity 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* ---- LAB members page ---- */
.lab-page {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0 66px;
}
.lab-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 20px; padding: 42px 44px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 5px solid var(--red);
  background: var(--navy-deep);
  color: #fff;
}
.lab-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Crect x='0' y='0' width='120' height='120' fill='none'/%3E%3Cline x1='0' y1='0' x2='120' y2='120' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3Cline x1='120' y1='0' x2='0' y2='120' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3Ccircle cx='0' cy='0' r='40' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='1'/%3E%3Ccircle cx='120' cy='120' r='40' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 120px 120px; pointer-events: none;
}
.lab-hero > * {
  position: relative; z-index: 1;
}
.lab-hero .tagline {
  color: var(--red);
}
.lab-hero .tagline::before {
  background: var(--red);
}
.lab-hero h1 {
  color: #fff; font-size: clamp(2rem, 3.2vw, 3rem);
}
.lab-hero p {
  max-width: 760px; margin: 12px 0 0; color: rgba(255, 255, 255, 0.68);
}
.lab-quick-actions {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
  max-width: 520px;
}
.lab-quick-actions .btn-sm {
  min-height: 42px;
  border-color: rgba(255, 255, 255, 0.28);
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
}
.lab-quick-actions .btn-sm.primary {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}
.lab-quick-actions .btn-sm:hover {
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.lab-quick-actions .btn-sm.primary:hover {
  border-color: var(--red-2);
  background: var(--red-2);
}
.lab-page .btn-sm {
  border-radius: 0;
  font-weight: 800;
}
.lab-summary-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.lab-summary-card {
  min-height: 132px; padding: 18px;
  border: 1px solid var(--line); border-top: 3px solid var(--navy);
  border-radius: 0;
  background: #fff; box-shadow: 0 8px 20px rgba(24, 58, 90, 0.04);
  transition: border-top-color 0.15s;
}
.lab-summary-card:hover {
  border-top-color: var(--red);
}
.lab-summary-card span,
.lab-kicker {
  display: block; color: var(--red); font-size: 0.76rem;
  font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em;
}
.lab-summary-card strong {
  display: block; margin-top: 8px; color: var(--navy);
  font-size: 1.45rem; line-height: 1.1;
}
.lab-summary-card p {
  margin: 8px 0 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5;
}
.lab-dashboard-grid {
  display: grid; grid-template-columns: minmax(620px, 1.4fr) minmax(320px, 0.6fr);
  align-items: start; gap: 18px; margin-bottom: 18px;
}
.lab-bottom-grid {
  display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: start; gap: 18px;
}
.lab-page .lab-board {
  position: static; width: auto; height: auto;
  padding: 22px; border: 1px solid var(--line); border-top: 3px solid var(--navy);
  border-radius: 0;
  background: var(--surface); box-shadow: 0 10px 24px rgba(24, 58, 90, 0.04);
}
.lab-page .lab-board::before,
.lab-page .lab-board::after {
  content: none;
}
.lab-calendar-panel {
  min-height: 640px;
}
.lab-side-stack {
  display: grid; gap: 18px;
}
.lab-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.lab-panel-head.compact {
  align-items: center;
}
.lab-panel-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.lab-panel-sub {
  margin: 6px 0 0; color: var(--muted); font-size: 0.82rem;
}
.lab-panel-head h2 {
  margin-top: 4px; font-size: 1.18rem;
}
.calendar-tools {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.calendar-tools strong {
  min-width: 112px; color: var(--navy); font-size: 0.92rem; text-align: center;
}
.calendar-action-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 12px;
}
.event-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  color: var(--muted); font-size: 0.82rem; font-weight: 700;
}
.calendar-inline-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  flex-wrap: wrap;
}
.event-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-left: 4px;
}
.event-dot.class { background: #2563EB; }
.event-dot.meeting { background: var(--red); }
.event-dot.conference { background: #15803D; }
.lab-calendar {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: 0; overflow: hidden; background: #fff;
}
.calendar-weekday {
  min-height: 38px; display: grid; place-items: center;
  background: #F2F4F5; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  color: var(--navy); font-size: 0.78rem; font-weight: 900;
}
.calendar-weekday:nth-child(7) {
  border-right: none;
}
.calendar-cell {
  min-height: 102px; padding: 7px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: #fff;
}
.calendar-cell:nth-child(7n) {
  border-right: none;
}
.calendar-cell.is-empty {
  background: #F9FAFB;
}
.calendar-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--navy);
}
.calendar-cell.is-selected {
  background: #F8FBFD;
  box-shadow: inset 0 0 0 2px var(--red);
}
.calendar-date {
  display: inline-grid; place-items: center; width: 25px; height: 25px;
  border-radius: 0; color: var(--navy); font-weight: 900; font-size: 0.82rem;
}
.calendar-cell.is-today .calendar-date {
  background: var(--navy); color: #fff;
}
.calendar-events {
  display: grid; gap: 5px; margin-top: 6px;
}
.calendar-chip {
  display: block; width: 100%; min-height: 28px; padding: 4px 7px;
  border: 1px solid transparent; border-radius: 0;
  font-family: inherit; font-size: 0.74rem; font-weight: 800;
  text-align: left; cursor: pointer; overflow: hidden;
}
.calendar-chip span {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.calendar-chip.class {
  background: #EAF2FF; color: #1D4ED8; border-color: #BFDBFE;
}
.calendar-chip.meeting {
  background: var(--red-soft); color: var(--red); border-color: #F3C2C7;
}
.calendar-chip.conference {
  background: var(--green-soft); color: #166534; border-color: #BFE7CD;
}
.calendar-chip:hover {
  filter: brightness(0.98);
}
.calendar-chip:active {
  cursor: grabbing;
}
.calendar-day-detail {
  margin-top: 14px; padding: 14px;
  border: 1px solid var(--line); border-left: 5px solid var(--red);
  border-radius: 0; background: #fff;
}
.calendar-day-detail-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.calendar-day-detail-head strong { color: var(--navy); }
.calendar-day-detail-head span { color: var(--muted); font-size: 0.82rem; font-weight: 800; }
.calendar-day-list {
  display: grid; gap: 8px; margin-top: 10px;
}
.calendar-day-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; align-items: center;
  width: 100%; padding: 10px;
  border: 1px solid var(--line); border-radius: 0; background: var(--bg);
  font-family: inherit; text-align: left; cursor: pointer;
}
.calendar-day-item strong {
  color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.calendar-day-item small {
  grid-column: 2; color: var(--muted); font-size: 0.78rem; line-height: 1.4;
}
.lab-list {
  display: grid; gap: 10px;
}
.lab-list-card,
.minutes-card,
.meeting-block,
.progress-card {
  border: 1px solid var(--line); border-radius: 0; background: #fff;
}
.lab-list-card {
  width: 100%; padding: 15px; text-align: left; font-family: inherit; cursor: default;
  border-left: 4px solid transparent;
}
.lab-list-card.clickable {
  cursor: pointer;
}
.lab-list-card.clickable:hover {
  border-color: var(--line); border-left-color: var(--red); background: #F8FBFD;
}
.lab-list-card.resource-compact {
  min-height: 78px;
}
.lab-list-card span {
  display: block; color: var(--muted); font-size: 0.76rem; font-weight: 800;
}
.important-mark {
  display: inline-flex; align-items: center; min-height: 20px;
  padding: 1px 7px; border-radius: 0;
  background: var(--red-soft); color: var(--red);
  font-size: 0.7rem; font-weight: 900;
}
.lab-list-card strong {
  display: block; margin-top: 4px; color: var(--navy); line-height: 1.35;
}
.lab-list-card p {
  margin: 8px 0 0; color: #364152; font-size: 0.86rem; line-height: 1.55;
}
.lab-list-card a {
  color: var(--navy); text-decoration: underline; text-underline-offset: 2px;
}
.meeting-minutes-list {
  display: grid; gap: 12px;
}
.lab-retention-note {
  margin: -4px 0 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 0;
  background: var(--bg); color: var(--muted);
  font-size: 0.84rem; font-weight: 700;
}
.meeting-block {
  overflow: hidden;
}
.meeting-block-head {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  border-left: 0; border-right: 0; border-top: 0;
  font-family: inherit; text-align: left; cursor: pointer;
}
.meeting-block-head.plain {
  cursor: default;
}
.meeting-block-head.selected {
  background: #F8FBFD;
  box-shadow: inset 5px 0 0 var(--red);
}
.meeting-block-head strong {
  display: block; color: var(--navy);
}
.meeting-block-head p {
  margin: 3px 0 0; color: var(--muted); font-size: 0.84rem;
}
.meeting-attendees {
  color: #364152 !important;
}
.minutes-disclosure {
  background: #fff;
}
.minutes-disclosure summary {
  padding: 12px 16px; cursor: pointer;
  color: var(--navy); font-size: 0.86rem; font-weight: 900;
}
.minutes-disclosure summary:hover {
  background: var(--bg);
}
.minutes-items {
  display: grid; gap: 10px; padding: 12px 16px 16px;
}
.minutes-card {
  padding: 14px; background: var(--bg);
  border-left: 4px solid var(--navy);
}
.minutes-card strong {
  display: block; color: var(--navy);
}
.minutes-card span {
  display: block; color: var(--muted); font-size: 0.76rem; font-weight: 800;
}
.minutes-card p {
  margin: 7px 0 0; color: #364152; font-size: 0.88rem;
}
.minutes-pagination {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding-top: 4px;
}
.minutes-pagination span {
  color: var(--muted); font-size: 0.82rem; font-weight: 800;
}
.progress-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.progress-card {
  display: grid; grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px; padding: 14px;
  color: inherit; text-decoration: none;
  border-left: 4px solid transparent;
}
.progress-card.is-self {
  border-color: var(--line);
  border-left-color: var(--red);
}
.progress-card.is-self:hover,
.progress-card.is-admin-link:hover {
  background: #F8FBFD;
}
.progress-card.is-admin-link {
  border-color: var(--line);
  border-left-color: var(--navy);
  box-shadow: none;
}
.progress-card.is-admin-link .progress-avatar {
  background: #fff;
}
.progress-avatar {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 0; background: var(--blue-soft); color: var(--navy);
  font-weight: 900; border: 1px solid var(--line);
}
.progress-avatar img, .member-profile-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
.progress-card strong {
  display: block; color: var(--navy);
}
.progress-card span {
  display: block; color: var(--red); font-size: 0.8rem; font-weight: 900;
}
.progress-card p {
  margin: 6px 0 0; color: #364152; font-size: 0.84rem; line-height: 1.5;
}
.progress-body {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.progress-info {
  min-width: 0; flex: 1 1 auto;
}
.progress-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
}
.progress-body .progress-actions {
  flex-shrink: 0; margin-top: 0; padding-top: 0; border-top: none;
}
.progress-actions .btn-sm {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.lab-empty {
  margin: 0; padding: 14px; border: 1px dashed var(--line); border-radius: 0;
  color: var(--muted); font-size: 0.86rem; background: var(--bg);
}
.lab-empty.compact {
  padding: 10px 12px; font-size: 0.82rem;
}
.event-type-badge {
  display: inline-flex; align-items: center; min-height: 26px; padding: 3px 10px;
  border-radius: 0; font-size: 0.75rem; font-weight: 900; white-space: nowrap;
}
.event-type-badge.class { background: #EAF2FF; color: #1D4ED8; }
.event-type-badge.meeting { background: var(--red-soft); color: var(--red); }
.event-type-badge.conference { background: var(--green-soft); color: #166534; }
.lab-modal[hidden],
.lab-drawer-shade[hidden] {
  display: none;
}
.lab-modal {
  position: fixed; inset: 0; z-index: 210;
  display: grid; place-items: center; padding: 20px;
}
.lab-modal-backdrop,
.lab-drawer-shade {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.42);
}
.lab-modal-card {
  position: relative; z-index: 1; width: min(520px, 100%);
  padding: 28px; border-radius: 0; background: #fff;
  border: 1px solid var(--line); border-top: 4px solid var(--navy);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}
.lab-modal-card.wide {
  width: min(680px, 100%);
}
.lab-modal-card h2 {
  margin-top: 12px; font-size: 1.35rem;
}
.lab-close {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: 0; background: #fff;
  color: var(--muted); cursor: pointer; font-family: inherit; font-weight: 900;
}
.lab-modal-card .lab-close {
  position: absolute; top: 16px; right: 16px;
}
.event-detail-list {
  display: grid; gap: 12px; margin: 18px 0 0;
}
.event-detail-list div {
  display: grid; grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.event-detail-list dt {
  color: var(--navy); font-size: 0.78rem; font-weight: 900;
}
.event-detail-list dd {
  margin: 0; color: #364152; overflow-wrap: normal;
}
.event-detail-list a {
  color: var(--navy); text-decoration: underline; text-underline-offset: 2px;
}
.event-modal-actions {
  display: flex; justify-content: flex-end;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
}
.lab-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 230;
  width: min(460px, 100%); padding: 26px;
  background: #fff; border-left: 4px solid var(--navy);
  box-shadow: -18px 0 45px rgba(15, 23, 42, 0.16);
  transform: translateX(105%); transition: transform 0.2s ease;
  overflow-y: auto;
}
.lab-drawer.open {
  transform: translateX(0);
}
.lab-drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.lab-drawer-head h2 {
  margin-top: 4px; font-size: 1.28rem;
}
.member-check-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  padding: 12px; border: 1px solid var(--line); border-radius: 0; background: var(--bg);
}
.member-check-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 8px;
}
.member-check-actions label {
  margin-bottom: 0;
}
.member-check {
  display: flex; align-items: center; gap: 7px; color: var(--ink);
  font-size: 0.85rem; font-weight: 700;
}
.lab-self-note {
  margin-bottom: 16px; padding: 12px 14px;
  border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 0;
  background: var(--blue-soft); color: var(--navy);
  font-size: 0.9rem;
}
.modal-list {
  display: grid; gap: 8px; margin-top: 18px;
}
.modal-list-row {
  display: block; color: inherit; text-decoration: none;
  width: 100%; padding: 14px 16px;
  border: 1px solid var(--line); border-left: 4px solid transparent; border-radius: 0;
  background: #fff; text-align: left; font-family: inherit; cursor: pointer;
}
.modal-list-row:hover {
  border-color: var(--line); border-left-color: var(--red); background: var(--bg);
}
.modal-list-row span {
  display: block; color: var(--muted); font-size: 0.78rem; font-weight: 800;
}
.modal-list-row strong {
  display: block; margin-top: 4px; color: var(--navy);
}
.modal-list-row p {
  margin: 7px 0 0; color: #364152; font-size: 0.86rem;
}
.lab-page-list {
  display: grid; gap: 12px;
}
.lab-page-list-card {
  padding: 18px; border: 1px solid var(--line); border-left: 4px solid var(--navy);
  border-radius: 0; background: #fff;
}
.lab-page-list-card span {
  display: block; color: var(--muted); font-size: 0.8rem; font-weight: 800;
}
.lab-page-list-card strong {
  display: block; margin-top: 6px; color: var(--navy); font-size: 1.02rem;
}
.lab-page-list-card p {
  margin: 10px 0 0; color: #364152;
}
.drawer-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line);
}
.drawer-actions .save-btn {
  margin-top: 0;
}
.member-record-grid {
  display: grid; grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px; margin-bottom: 18px; align-items: start;
}
.member-profile-summary {
  min-height: 280px;
}
.member-profile-avatar {
  display: grid; place-items: center; width: 74px; height: 74px; margin: 16px 0;
  border-radius: 0; background: var(--blue-soft); color: var(--navy);
  border: 1px solid var(--line); font-size: 1.4rem; font-weight: 900;
}
.member-profile-summary strong {
  display: block; color: var(--navy); font-size: 1.18rem;
}
.member-profile-summary span {
  display: block; margin-top: 4px; color: var(--muted); font-size: 0.88rem;
}
.member-profile-summary p {
  margin: 12px 0 0; color: #364152;
}
.timeline-list,
.note-list {
  display: grid; gap: 10px;
}
.goal-form {
  margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.goal-form .save-btn {
  margin-top: 0;
}
.goal-form-actions {
  display: flex; justify-content: flex-end; gap: 8px; align-items: center;
}
.goal-view-toggle {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.goal-list {
  display: grid; gap: 10px;
}
.goal-table-wrap {
  width: 100%; overflow-x: auto; border: 1px solid var(--line);
  border-radius: 0; background: #fff;
}
.goal-table {
  width: 100%; border-collapse: collapse; min-width: 720px;
}
.goal-table th {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: var(--bg); color: var(--muted);
  font-size: 0.78rem; font-weight: 900; text-align: left;
}
.goal-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  color: #364152; font-size: 0.86rem; vertical-align: middle;
}
.goal-table .goal-status-cell {
  text-align: center;
}
.goal-table tr:last-child td {
  border-bottom: none;
}
.goal-table tr:hover td {
  background: #F8FBFD;
}
.goal-name {
  display: block; color: var(--navy); font-weight: 900;
}
.goal-table td > span {
  display: block; margin-top: 3px; color: var(--muted);
  font-size: 0.76rem; font-weight: 700;
}
.goal-card {
  padding: 15px; border: 1px solid var(--line); border-left: 4px solid var(--navy);
  border-radius: 0; background: #fff;
}
.goal-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.goal-card-head time {
  color: var(--muted); font-size: 0.78rem; font-weight: 800;
}
.goal-card strong {
  display: block; color: var(--navy);
}
.goal-card p {
  margin: 7px 0 0; color: #364152; line-height: 1.5;
}
.goal-card-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
}
.goal-row-actions {
  display: flex; justify-content: flex-end; gap: 6px; white-space: nowrap;
}
.goal-status,
.goal-calendar-chip {
  display: inline-flex; align-items: center;
  min-height: 24px; padding: 2px 8px; border-radius: 0;
  font-size: 0.72rem; font-weight: 900;
}
.goal-status.todo,
.goal-calendar-chip.todo {
  background: #F3F4F6; color: #374151;
}
.goal-status.doing,
.goal-calendar-chip.doing {
  background: #EAF2FF; color: #1D4ED8;
}
.goal-status.done,
.goal-calendar-chip.done {
  background: var(--green-soft); color: #166534;
}
.goal-status.hold,
.goal-calendar-chip.hold {
  background: var(--red-soft); color: var(--red);
}
.goal-status-select {
  min-height: 30px; padding: 3px 28px 3px 10px;
  border: 1px solid var(--line); border-radius: 0;
  font-family: inherit; font-size: 0.76rem; font-weight: 900;
  background: #fff; color: var(--navy);
}
.goal-status-select.todo {
  background-color: #F3F4F6; color: #374151;
}
.goal-status-select.doing {
  background-color: #EAF2FF; color: #1D4ED8;
}
.goal-status-select.done {
  background-color: var(--green-soft); color: #166534;
}
.goal-status-select.hold {
  background-color: var(--red-soft); color: var(--red);
}
/* ── Goal calendar — week-grid approach ── */
.goal-calendar-wrap { border: 1px solid var(--line); background: #fff; overflow: hidden; }
.goal-calendar-title { padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg); color: var(--navy); font-weight: 900; }
.calendar-weekday-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.goal-calendar-cell {
  min-height: 34px; padding: 5px 6px;
  border-right: 1px solid var(--line); border-top: 1px solid var(--line);
  background: #fff;
}
.calendar-weekday-row .calendar-weekday { border-bottom: none; }
.goal-calendar-cell.is-empty { background: #F9FAFB; }
.goal-lane-bg {
  height: 28px;
  background: #fff; /* no borders — invisible, just a spacer for chip positioning */
}
.goal-lane-bg.is-empty { background: #F9FAFB; }
.goal-calendar-chip {
  display: flex; align-items: center; gap: 0;
  padding: 0; border-radius: 2px; border: 1px solid transparent;
  margin: 2px 3px; cursor: pointer; font-family: inherit;
  font-size: 0.72rem; font-weight: 700; text-align: left;
  min-height: 22px; overflow: hidden; position: relative; z-index: 5;
}
.goal-calendar-chip strong {
  flex: 1; min-width: 0; padding: 2px 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit;
}
.goal-calendar-chip:hover { outline: 2px solid rgba(0,0,0,0.22); outline-offset: -1px; }
.goal-calendar-chip.todo  { border-color: #D1D5DB; }
.goal-calendar-chip.doing { border-color: #BFDBFE; }
.goal-calendar-chip.done  { border-color: #BFE7CD; }
.goal-calendar-chip.hold  { border-color: #F3C2C7; }
.goal-resize-handle {
  display: block; width: 7px; height: 100%; min-height: 18px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.55); cursor: ew-resize;
}
.goal-resize-handle:hover { background: rgba(255,255,255,0.92); }
.is-resizing-goal,
.is-resizing-goal * { cursor: ew-resize !important; user-select: none; }
.timeline-item,
.note-card {
  padding: 15px; border: 1px solid var(--line); border-left: 4px solid transparent;
  border-radius: 0; background: #fff;
}
.timeline-item { border-left-color: var(--navy); }
.note-card { border-left-color: var(--red); }
.timeline-item span,
.note-card span {
  color: var(--muted); font-size: 0.78rem; font-weight: 800;
}
.timeline-item strong {
  display: block; margin-top: 4px; color: var(--navy);
}
.timeline-item p,
.note-card p {
  margin: 7px 0 0; color: #364152;
}
.member-note-form {
  padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line);
}
.member-note-form .save-btn {
  margin-top: 0;
}
.member-note-actions,
.note-card-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
}
.note-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.note-check {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--navy); font-size: 0.78rem; font-weight: 900; white-space: nowrap;
}
.note-check input {
  width: 16px; height: 16px; accent-color: var(--navy);
}
.note-card.is-done {
  background: #F8FBFD;
}
.note-card.is-done p {
  color: var(--muted);
}
.note-card-actions {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 980px) {
  .nav-shell {
    display: flex; align-items: flex-start; flex-direction: column; padding: 12px 0;
  }
  .nav-links { justify-content: flex-start; flex-wrap: wrap; }
  .hero { min-height: auto; }
  .hero-inner {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .hero-content { min-height: auto; }
  .hero-left {
    padding: 56px max(20px, calc((100vw - 720px) / 2 + 16px));
    border-right: 0;
  }
  .hero-right { display: none; }
  .join-band { grid-template-columns: 1fr; min-height: auto; }
  .join-actions {
    min-height: 180px;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .reservation-layout { grid-template-columns: 1fr; }
  .hero-logo { width: min(100%, 360px); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two { grid-template-columns: 1fr; }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people-strip,
  .people-strip.three,
  .people-strip.five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .publication-list.year-list .publication-year-group {
    grid-template-columns: minmax(84px, 110px) minmax(0, 1fr);
    gap: 28px;
  }
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-preview { position: static; }
  .nav-auth {
    display: flex; justify-content: flex-start; justify-self: start;
    width: 100%;
  }
  .nav-auth-stack {
    align-items: flex-start; justify-items: start;
    width: 100%; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line);
  }
  .nav-auth-row {
    justify-content: flex-start; flex-wrap: wrap; white-space: normal;
  }
  .lab-hero { align-items: flex-start; flex-direction: column; }
  .lab-quick-actions { justify-content: flex-start; max-width: none; }
  .lab-dashboard-grid,
  .lab-bottom-grid,
  .member-record-grid {
    grid-template-columns: 1fr;
  }
  .lab-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lab-calendar-panel { min-height: auto; }
}

@media (max-width: 640px) {
  .site-header { position: sticky; }
  .nav-shell {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    align-items: center; gap: 10px; min-height: auto; padding: 10px 0;
  }
  .brand { min-width: 0; grid-column: 1; gap: 9px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-name strong { font-size: 0.82rem; }
  .brand-name span { font-size: 0.58rem; max-width: 230px; }
  .brand-logo { width: 48px; height: 48px; }
  .nav-links {
    grid-column: 1 / -1; width: 100%; display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .nav-shell.nav-open .nav-links { display: grid; }
  .nav-links a { min-width: 0; }
  .nav-auth { grid-column: 1 / -1; }
  .nav-shell:not(.nav-open) .nav-auth { display: none; }
  .nav-shell.nav-open .nav-auth { display: flex; }
  .nav-login-btn {
    width: 100%; min-height: 40px;
  }
  .nav-auth-row {
    width: 100%; gap: 6px;
  }
  .nav-auth-row a,
  .nav-auth-row.secondary a,
  .nav-notification,
  .nav-logout {
    flex: 1 1 auto; justify-content: center;
  }
  .hero-inner { padding: 0; }
  .hero-left { padding: 32px 20px 38px; }
  .mag-label { margin-bottom: 18px; }
  .mag-label-text { font-size: 0.68rem; letter-spacing: 0.12em; }
  .hero h1 { font-size: clamp(1.9rem, 9.2vw, 2.45rem); }
  .hero-rule { margin: 22px 0; }
  .hero .lead { font-size: 0.94rem; line-height: 1.78; }
  .hero-tags { margin-top: 24px; }
  .hero-actions { margin-top: 30px; }
  .hero-actions .button { width: 100%; }
  .hero-facts,
  .grid, .grid.two, .grid.three,
  .people-strip, .people-strip.three, .people-strip.five {
    grid-template-columns: 1fr;
  }
  .section { padding: 48px 0; }
  .section-head, .footer-inner {
    align-items: flex-start; flex-direction: column;
  }
  .publication-list.year-list .publication-year-group {
    grid-template-columns: 1fr;
    gap: 16px;
    min-height: auto;
    padding: 26px 0;
  }
  .publication-list.year-list .pub-entry b {
    font-size: 0.98rem;
  }
  .publication-list.year-list .pub-entry span {
    margin-top: 7px;
  }
  .join-band { grid-template-columns: 1fr; }
  .join-text { padding: 32px 24px; }
  .join-action { padding: 16px 24px; }
  .form-row { grid-template-columns: 1fr; }
  .page-wrap { padding: 36px 0 52px; }
  .dashboard-preview, .dashboard-form { padding: 22px; }
  .dashboard-actions {
    align-items: stretch; flex-direction: column;
  }
  .dashboard-actions .save-btn,
  .dashboard-actions .btn-sm {
    width: 100%;
  }
  .character-controls { grid-template-columns: 1fr; }
  .reservation-copy, .lab-visual { padding: 22px; }
  .reservation-actions .button { width: 100%; }
  .lab-page { padding: 34px 0 52px; }
  .progress-grid,
  .member-check-grid {
    grid-template-columns: 1fr;
  }
  .progress-body {
    flex-direction: column; align-items: stretch;
  }
  .progress-actions {
    width: 100%;
  }
  .progress-actions .btn-sm {
    flex: 1 1 auto; justify-content: center;
  }
  .lab-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .lab-summary-card {
    min-height: 104px; padding: 12px;
  }
  .lab-summary-card strong {
    margin-top: 5px; font-size: 1.15rem;
  }
  .lab-summary-card p {
    margin-top: 5px; font-size: 0.76rem; line-height: 1.35;
  }
  .lab-page .lab-board {
    padding: 18px;
  }
  .lab-panel-head,
  .lab-panel-head.compact {
    align-items: flex-start; flex-direction: column;
  }
  .calendar-tools {
    width: 100%; justify-content: space-between;
  }
  .calendar-action-row {
    align-items: flex-start; flex-direction: column;
  }
  .calendar-inline-actions {
    width: 100%; justify-content: flex-start;
  }
  .calendar-cell {
    min-height: 58px; padding: 5px;
  }
  .calendar-date {
    width: 22px; height: 22px; font-size: 0.76rem;
  }
  .calendar-events {
    display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px;
  }
  .calendar-chip {
    width: 8px; min-height: 8px; height: 8px; padding: 0; border-radius: 50%;
  }
  .calendar-chip span { display: none; }
  .calendar-day-detail { padding: 12px; }
  .calendar-day-item {
    grid-template-columns: 1fr; gap: 5px;
  }
  .calendar-day-item small { grid-column: 1; }
  .note-card-head {
    align-items: flex-start; flex-direction: column; gap: 6px;
  }
  .member-note-actions,
  .note-card-actions {
    align-items: stretch; flex-direction: column;
  }
  .member-note-actions .btn-sm,
  .member-note-actions .save-btn,
  .note-card-actions .btn-sm {
    width: 100%;
  }
  .event-detail-list div {
    grid-template-columns: 1fr; gap: 4px;
  }
  .drawer-actions {
    align-items: stretch; flex-direction: column;
  }
  .drawer-actions .btn-sm,
  .drawer-actions .save-btn {
    width: 100%;
  }
  .page-hero-inner h1 { font-size: clamp(1.5rem, 7vw, 1.9rem); }
  .lab-hero h1 { font-size: clamp(1.5rem, 7vw, 1.9rem); }
  .page-hero-inner p, .lab-hero p { font-size: 0.86rem; }
  .lab-hero { padding: 28px 20px; }
  .lab-quick-actions { flex-wrap: nowrap; gap: 6px; align-items: stretch; }
  .lab-quick-actions .btn-sm {
    flex: 1 1 0; min-width: 0; min-height: 40px;
    padding: 4px 4px; font-size: 0.66rem; line-height: 1.25;
    white-space: normal; text-align: center; word-break: keep-all;
  }
  .goal-view-toggle { width: 100%; }
  .goal-view-toggle .btn-sm { flex: 1 1 auto; justify-content: center; }
  .goal-table-wrap { overflow-x: visible; border: none; }
  .goal-table { min-width: 0; }
  .goal-table thead { display: none; }
  .goal-table, .goal-table tbody, .goal-table tr, .goal-table td { display: block; width: 100%; }
  .goal-table tr { border: 1px solid var(--line); margin-bottom: 10px; padding: 10px 12px; }
  .goal-table td { padding: 4px 0; border: none; }
  .goal-table td::before {
    display: block; margin-bottom: 2px; color: var(--muted);
    font-size: 0.7rem; font-weight: 800;
  }
  #member-goals .goal-table td:nth-of-type(1)::before { content: "목표"; }
  #member-goals .goal-table td:nth-of-type(2)::before { content: "상태"; }
  #member-goals .goal-table td:nth-of-type(3)::before { content: "기간"; }
  #member-goals .goal-table td:nth-of-type(4)::before { content: "메모"; }
  #project-goals .goal-table td:nth-of-type(1)::before { content: "담당자"; }
  #project-goals .goal-table td:nth-of-type(2)::before { content: "목표"; }
  #project-goals .goal-table td:nth-of-type(3)::before { content: "상태"; }
  #project-goals .goal-table td:nth-of-type(4)::before { content: "기간"; }
  #project-goals .goal-table td:nth-of-type(5)::before { content: "메모"; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; gap: 4px;
    width: 34px; height: 34px; padding: 0; align-items: center; justify-content: center;
    border: 1px solid var(--navy); background: #fff;
    grid-column: 2; justify-self: end;
  }
  .nav-toggle-bar { display: block; width: 18px; height: 2px; background: var(--navy); }
}

/* Team Project */
.note-target { display:block; margin-bottom:6px; color:var(--navy); font-size:0.76rem; font-weight:900; }
.project-member-chip { display:inline-flex; align-items:center; gap:4px; background:var(--blue-soft); color:var(--navy); border-radius:20px; padding:3px 10px; font-size:0.82rem; font-weight:700; }

/* Goal source badge (team project goal in individual page) */
.goal-source-badge { display:inline-flex; align-items:center; background:var(--navy); color:#fff; font-size:0.64rem; font-weight:900; padding:1px 7px; border-radius:10px; margin-left:5px; white-space:nowrap; vertical-align:middle; }
.goal-calendar-chip.is-team-goal { border-left:3px solid var(--red); background:rgba(181,31,43,0.08); }
.goal-team-label { font-size:0.64rem; opacity:0.8; display:block; margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Note reply system */
.note-replies { margin-top:10px; padding-top:10px; border-top:1px solid var(--line); }
.note-reply-list { display:flex; flex-direction:column; gap:4px; margin-bottom:6px; }
.note-reply-card { background:var(--bg); border-radius:var(--radius); padding:8px 12px; font-size:0.85rem; }
.note-reply-meta { color:var(--muted); font-size:0.75rem; margin-bottom:3px; display:block; }
.note-reply-actions { display:flex; gap:6px; margin-top:4px; }
.note-reply-form-wrap { display:flex; gap:6px; align-items:flex-end; margin-top:6px; }
.note-reply-form-wrap textarea { flex:1; min-height:44px; font-size:0.84rem; padding:6px 10px; border:1px solid var(--line); border-radius:var(--radius); font-family:inherit; resize:vertical; }
.note-reply-toggle { background:none; border:none; color:var(--navy-2); font-size:0.78rem; font-weight:700; cursor:pointer; padding:2px 0; display:block; margin-top:4px; }
.note-reply-toggle:hover { text-decoration:underline; }

/* ── Sticky note card grid ── */
.note-sticky-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 9px;
  padding: 2px 0 6px;
}
.note-sticky-grid .minutes-pagination {
  grid-column: 1 / -1;
}
.note-sticky {
  min-height: 148px; height: 148px;
  background: #FEFCE8; border: 1px solid #F7E87A;
  padding: 10px 10px 8px; display: flex; flex-direction: column;
  cursor: pointer; overflow: hidden;
  box-shadow: 1px 2px 5px rgba(0,0,0,0.07);
  transition: transform 0.1s, box-shadow 0.1s;
}
.note-sticky:hover { transform: translateY(-2px); box-shadow: 2px 5px 12px rgba(0,0,0,0.12); }
.note-sticky.type-feedback { background: #EFF6FF; border-color: #93C5FD; }
.note-sticky.is-done { opacity: 0.52; }
.note-sticky.is-selected { outline: 2px solid var(--navy); outline-offset: 1px; }
.note-sticky-type {
  font-size: 0.6rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted); margin-bottom: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
}
.note-sticky-body {
  flex: 1; font-size: 0.78rem; line-height: 1.42; color: var(--ink);
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  word-break: keep-all;
}
.note-sticky-foot {
  margin-top: 6px; padding-top: 5px; border-top: 1px solid rgba(0,0,0,0.1);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.62rem; color: var(--muted); flex-shrink: 0; gap: 4px;
}
.note-sticky-reply-badge { font-weight: 800; }
.note-detail-panel {
  border: 2px solid var(--navy); background: #fff;
  padding: 16px 18px; margin-top: 4px;
}
.note-detail-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.note-detail-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; display: block; }
.note-detail-text { font-size: 0.88rem; line-height: 1.6; color: var(--ink); white-space: pre-wrap; word-break: keep-all; overflow-wrap: break-word; }
.note-detail-subrow { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); margin-bottom: 8px; flex-wrap: wrap; gap: 6px; }
.note-detail-actions { display: flex; gap: 6px; align-items: center; }
.note-detail-close { background: none; border: none; font-size: 0.8rem; font-weight: 900; color: var(--muted); cursor: pointer; padding: 2px 4px; }
.note-detail-close:hover { color: var(--navy); }
/* goal-linked note color overrides */
.note-sticky.is-global { background: #F0FDF4; border-color: #86EFAC; }
.goal-notes-panel { margin-top: 12px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); }
.goal-notes-panel-head { font-size: 0.78rem; font-weight: 900; color: var(--navy); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.goal-notes-panel-close { background: none; border: none; font-size: 0.72rem; font-weight: 900; color: var(--muted); cursor: pointer; margin-left: auto; }
.project-status-chip { font-size:0.72rem; font-weight:900; padding:2px 7px; border-radius:2px; display:inline-block; }
.project-status-chip.active { color: var(--red); background: var(--red-soft); }
.project-status-chip.completed { color: var(--muted); background: #f0f0f0; }
.project-status-chip.ready { color: #166534; background: var(--green-soft); }
.project-status-chip.paused { color: var(--muted); background: #f0f0f0; }

/* ── Calendar lane-based rendering ── */
.goal-lane-spacer {
  height: 26px; flex-shrink: 0;
}
.goal-lane-cont {
  height: 26px; flex-shrink: 0; width: 100%;
  background: transparent; /* invisible — overflow chip provides the visual */
}

/* ── 3-col member record grid ── */
.member-record-grid-3 {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);
  gap: 18px; margin-bottom: 18px; align-items: start;
}

/* ── Meeting mini card grid ── */
.meeting-mini-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px;
}
.meeting-mini-card {
  padding: 10px 12px; border: 1px solid var(--line); background: #fff;
  display: flex; flex-direction: column; gap: 3px; cursor: default;
}
.meeting-mini-card strong {
  font-size: 0.82rem; color: var(--navy); font-weight: 900;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.meeting-mini-card span {
  font-size: 0.7rem; color: var(--muted); font-weight: 700;
}
.meeting-mini-card .meeting-mini-minutes {
  font-size: 0.68rem; color: var(--ink); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.75;
}
.meeting-mini-card.is-selected { outline: 2px solid var(--navy); outline-offset: -1px; }
.meeting-mini-detail {
  grid-column: 1 / -1;
  padding: 12px 14px; background: #fff;
  border: 1px solid var(--navy); border-top: 2px solid var(--navy);
  margin-top: 2px;
}
.meeting-mini-detail-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.meeting-mini-detail strong { font-size: 0.84rem; color: var(--navy); }
.meeting-mini-close { background: none; border: none; font-size: 0.76rem; font-weight: 900; color: var(--muted); cursor: pointer; }
.minutes-detail-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.minutes-detail-item:last-child { border-bottom: none; }
.minutes-detail-item strong { display: block; font-size: 0.82rem; color: var(--navy); margin-bottom: 3px; }
.minutes-detail-item p { font-size: 0.8rem; color: var(--ink); line-height: 1.5; margin: 0; white-space: pre-wrap; }

/* responsive adjustments */
@media (max-width: 980px) {
  .member-record-grid-3 { grid-template-columns: 1fr; }
  .note-sticky-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
