/* Campus Board – styles
   Colors: ink #14162B · sub #5B6075 · line #E4E6EF · ground #F6F7FB · primary #3B3FD8 */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --ink: #14162B;
  --sub: #5B6075;
  --line: #E4E6EF;
  --line-soft: #EEF0F5;
  --ground: #F6F7FB;
  --primary: #3B3FD8;
  --primary-dark: #2A2DB0;
  --primary-soft: #ECEDFD;
  --warm: #C2410C;
  --warm-soft: #FFF1E6;
  --green: #166534;
  --green-soft: #DCFCE7;
  --red: #991B1B;
  --red-soft: #FEE2E2;
  --tabbar-h: 72px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #E9EBF2;
  line-height: 1.4;
}
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
img { display: block; max-width: 100%; }
button { font-family: inherit; }
h1, h2, h3, p { margin: 0; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px;
}
.skip-link:focus { top: 8px; }

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ground);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  position: relative;
}
#view:focus { outline: none; }

.noscroll { scrollbar-width: none; }
.noscroll::-webkit-scrollbar { display: none; }

/* ---------- Banner & toast ---------- */
.banner {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; font-size: 12px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary-dark);
}
.banner.warn { background: #FEF3C7; color: #92400E; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(20px);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
  padding: 12px 18px; border-radius: 14px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 40; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; z-index: 30;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #fff; border-top: 1px solid var(--line);
  padding: 6px 8px calc(10px + env(safe-area-inset-bottom)) 8px;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 52px; text-decoration: none; color: var(--sub);
  font-size: 11px; font-weight: 600;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--primary); font-weight: 700; }
.tab-plus {
  width: 44px; height: 28px; border-radius: 14px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Headers ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo {
  width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -0.2px; }

.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 16px 6px 20px;
}
.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.6px; line-height: 1.15; }
.page-head .sub { font-size: 13px; color: var(--sub); margin-top: 2px; }

.icon-btn {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 22px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; text-decoration: none;
}
.icon-btn:hover { color: var(--ink); background: var(--ground); }

.pill-btn {
  height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer;
}

.detail-bar {
  display: grid; grid-template-columns: 60px 1fr 60px; align-items: center;
  padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.detail-bar .title { text-align: center; font-size: 16px; font-weight: 800; }
.detail-bar .icon-btn { border: 0; background: transparent; }
.detail-bar .icon-btn:last-child { justify-self: end; }

/* ---------- Sections ---------- */
.stack { display: flex; flex-direction: column; gap: 22px; padding-bottom: 8px; }
.section { padding: 0 16px; display: flex; flex-direction: column; gap: 6px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head h2 { font-size: 18px; font-weight: 800; }
.section-head .count { font-size: 13px; color: var(--sub); font-weight: 500; margin-left: 8px; }
.see-all {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px;
  font-size: 14px; font-weight: 700; text-decoration: none;
}
.list { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Featured slider ---------- */
.slider {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-padding-left: 16px; padding: 2px 16px;
}
.slide {
  flex: 0 0 min(330px, 86%); height: 196px; scroll-snap-align: start;
  border-radius: 22px; background: var(--slide, var(--primary-dark)); color: #fff;
  text-decoration: none; display: flex; gap: 14px; padding: 18px; overflow: hidden;
}
.slide:hover { color: #fff; }
.slider.single .slide { flex-basis: 100%; }
.slide-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.slide-type {
  align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  background: rgba(255, 255, 255, .2); padding: 3px 9px; border-radius: 999px;
}
.slide-title {
  font-size: 19px; font-weight: 800; line-height: 1.25; letter-spacing: -0.2px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.slide-meta {
  font-size: 13px; line-height: 1.4; color: rgba(255, 255, 255, .88);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.slide-cta { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.slide-pic {
  flex: 0 0 92px; border-radius: 14px; background: rgba(255, 255, 255, .14); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.slide-pic img { width: 100%; height: 100%; object-fit: cover; }
.dots { display: flex; justify-content: center; gap: 6px; padding-top: 10px; }
.dot { width: 6px; height: 6px; border-radius: 3px; background: #C9CCDA; transition: width .2s, background .2s; }
.dot.active { width: 20px; background: var(--primary); }

/* ---------- Category colors ---------- */
.tint { background: var(--bg, #EEF0F5); color: var(--fg, #4A4F63); }
.cat { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--fg, #4A4F63); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.badge.now { color: var(--green); background: var(--green-soft); }
.badge.now::before { content: ""; width: 6px; height: 6px; border-radius: 3px; background: #16A34A; }
.badge.soon, .badge.pinned, .badge.important { color: var(--warm); background: var(--warm-soft); }
.badge.ended { color: #4A4F63; background: var(--line-soft); }
.badge.type { color: var(--fg); background: var(--bg); text-transform: uppercase; letter-spacing: .6px; padding: 4px 10px; }

/* ---------- Program card ---------- */
.card {
  display: flex; gap: 12px; padding: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; text-decoration: none; color: var(--ink);
}
.card:hover { color: var(--ink); border-color: #CDD0DD; }
.thumb {
  flex: 0 0 76px; height: 76px; border-radius: 14px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.thumb.sm { flex-basis: 60px; height: 60px; border-radius: 12px; }
.thumb, .slide-pic { position: relative; }
.thumb img, .slide-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.meta {
  display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); min-width: 0;
}
.meta svg { flex: 0 0 auto; }
.meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Notice rows ---------- */
.group { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.row {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px;
  text-decoration: none; color: var(--ink);
}
.row + .row { border-top: 1px solid var(--line-soft); }
.row:hover { color: var(--ink); background: #FAFBFD; }
.tile {
  flex: 0 0 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.row-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-size: 14px; font-weight: 700; line-height: 1.35; }
.row-meta { font-size: 12px; color: var(--sub); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chev { flex: 0 0 auto; color: var(--sub); }

.notice-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: #fff;
  border: 1px solid var(--line); border-radius: 18px; text-decoration: none; color: var(--ink);
}
.notice-card.pinned { border-color: #F5C9A8; }
.notice-card:hover { color: var(--ink); }
.notice-card .tile { flex-basis: 44px; height: 44px; }
.notice-card .row-title { font-size: 15px; }
.file-tag { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: #4A4F63; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 20px; }
.chip {
  flex: 0 0 auto; height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Calendar ---------- */
.cal {
  margin: 0 16px; background: #fff; border: 1px solid var(--line); border-radius: 20px;
  padding: 8px 10px 12px;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head .icon-btn { border: 0; background: transparent; }
.cal-month { font-size: 16px; font-weight: 800; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.cal-week { font-size: 12px; font-weight: 700; color: var(--sub); padding: 4px 0; }
.cal-grid { row-gap: 4px; justify-items: center; }
.day {
  width: 44px; height: 44px; border-radius: 22px; border: 1.5px solid transparent; background: transparent;
  color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.day .dotmark { width: 5px; height: 5px; border-radius: 3px; background: transparent; }
.day.has .dotmark { background: var(--primary); }
.day.past { color: var(--sub); }
.day.past.has .dotmark { background: #A3A8BA; }
.day.out { color: #A3A8BA; font-weight: 500; }
.day.today { border-color: var(--primary); font-weight: 800; }
.day[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 800; }
.day[aria-pressed="true"] .dotmark { background: #fff; }

.tl {
  display: flex; gap: 14px; align-items: center; padding: 12px 10px 12px 14px; background: #fff;
  border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink);
}
.tl:hover { color: var(--ink); }
.tl-time { flex: 0 0 66px; display: flex; flex-direction: column; gap: 2px; }
.tl-time b { font-size: 13px; font-weight: 800; }
.tl-time span { font-size: 12px; color: var(--sub); }
.tl-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tl-top { display: flex; align-items: center; gap: 6px; }
.swatch { width: 8px; height: 8px; border-radius: 4px; background: var(--fg); }
.tl-title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.tl-sub { font-size: 12px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Detail pages ---------- */
.hero {
  position: relative; height: 290px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; overflow: hidden;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .hero-label { font-size: 14px; font-weight: 700; }
.float-btn {
  position: absolute; top: 14px; width: 44px; height: 44px; border-radius: 22px; border: 0;
  background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(20, 22, 43, .12); cursor: pointer; padding: 0; z-index: 2;
}
.hero-full {
  position: absolute; right: 14px; bottom: 34px; z-index: 2; display: inline-flex; align-items: center;
  min-height: 36px; padding: 0 14px; border-radius: 18px; background: rgba(20, 22, 43, .72); color: #fff;
  font-size: 12px; font-weight: 700; text-decoration: none;
}
.hero-full:hover { color: #fff; background: rgba(20, 22, 43, .85); }
.float-btn.left { left: 14px; }
.float-btn.right { right: 14px; }
.sheet {
  position: relative; margin-top: -22px; background: #fff; border-radius: 24px 24px 0 0;
  padding: 22px 20px 24px; display: flex; flex-direction: column; gap: 18px; min-height: 200px;
}
.sheet.flat { margin-top: 0; border-radius: 0; }
.badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.detail-title { font-size: 25px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; }
.facts { display: flex; flex-direction: column; gap: 14px; }
.fact { display: flex; gap: 14px; align-items: center; }
.fact-ic {
  flex: 0 0 44px; height: 44px; border-radius: 12px; background: var(--ground); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.fact-label { font-size: 12px; font-weight: 600; color: var(--sub); }
.fact-value { font-size: 15px; font-weight: 700; }
.divider { height: 1px; background: var(--line); }
.prose { display: flex; flex-direction: column; gap: 8px; }
.prose h2 { font-size: 17px; font-weight: 800; }
.prose p { font-size: 15px; line-height: 1.6; color: #2D3045; overflow-wrap: anywhere; }
.approved-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--sub); }
.approved-line svg { color: var(--green); }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.actions .btn { font-size: 14px; padding: 0 14px; white-space: nowrap; }

.btn {
  height: 52px; border-radius: 26px; padding: 0 20px; font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  text-decoration: none; border: 1px solid transparent;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); color: #fff; }
.btn.secondary { background: #fff; color: var(--ink); border-color: #D5D8E3; }
.btn.secondary:hover { color: var(--ink); background: var(--ground); }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.keybox { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--ground); border-radius: 16px; }
.keyrow { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.keyrow span:first-child { color: var(--sub); }
.keyrow span:last-child { font-weight: 700; text-align: right; }

.issuer { display: flex; align-items: center; gap: 10px; }
.issuer .tile { border-radius: 20px; }
.issuer b { font-size: 14px; display: block; }
.issuer span { font-size: 12px; color: var(--sub); }

.attachment {
  display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 12px;
  border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink);
}
.attachment:hover { color: var(--ink); background: #FAFBFD; }
.file-ic {
  flex: 0 0 44px; height: 52px; border-radius: 8px; background: var(--red-soft); color: var(--red);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; letter-spacing: .5px;
}
.attachment .name { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment .go {
  flex: 0 0 44px; height: 44px; border-radius: 22px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Post page ---------- */
.info {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
  background: var(--primary-soft); color: var(--primary-dark); font-size: 13px; line-height: 1.5; font-weight: 500;
}
.info svg { flex: 0 0 auto; margin-top: 1px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.step-n {
  flex: 0 0 28px; height: 28px; border-radius: 14px; background: var(--primary-soft); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800;
}
.panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { font-size: 17px; font-weight: 800; }

/* ---------- Search ---------- */
.search-box { padding: 8px 16px 12px; }
.search-box input {
  width: 100%; height: 50px; padding: 0 16px; border: 1px solid #D5D8E3; border-radius: 14px;
  background: #fff; font-family: inherit; font-size: 16px; color: var(--ink);
}

/* ---------- Empty, skeleton, footer ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 28px 20px; background: #fff; border: 1px dashed #C9CCDA; border-radius: 18px;
  color: var(--sub); font-size: 14px;
}
.empty b { color: var(--ink); font-size: 15px; }
.sk { background: linear-gradient(90deg, #ECEEF4 25%, #F5F6FA 37%, #ECEEF4 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: 18px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.footer-note { text-align: center; font-size: 12px; color: var(--sub); padding: 8px 24px 0; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .sk { animation: none; }
  .toast, .dot { transition: none; }
}

@media (min-width: 600px) {
  .app { box-shadow: 0 0 0 1px var(--line); }
}
