:root {
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color: #252419;
  background: #f9f8f3;
  --paper: #f9f8f3;
  --white: #fffefa;
  --line: #e5e1d6;
  --muted: #676357;
  --orange: #ba3a24;
  --green: #24523e;
  --peach: #fae8d9;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, a, select, .picker { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:active:not(:disabled), .picker:active { transform: translateY(1px); }
:focus-visible { outline: 3px solid #9b442a; outline-offset: 3px; }
a { color: inherit; text-underline-offset: 4px; }
img { display: block; width: 100%; }
h1, h2, p { margin: 0; }
.skip { position: fixed; top: .6rem; left: .6rem; padding: .7rem; background: white; transform: translateY(-150%); z-index: 2; }
.skip:focus { transform: none; }
.frame { width: min(1140px, calc(100% - 52px)); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top-actions { display: flex; gap: 6px; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 7px; font-size: clamp(1.06rem, 2.7vw, 1.38rem); text-decoration: none; font-weight: 850; letter-spacing: -.07em; }
.brand b { color: var(--orange); }
.mark { display: inline-block; width: 29px; height: 24px; border: 2px solid currentColor; border-radius: 6px; margin-inline-end: 3px; transform: rotate(-9deg); background: linear-gradient(90deg, #ba3a24 0 36%, transparent 36% 47%, #f4b74d 47% 100%) center / 78% 68% no-repeat; }
.plain, .primary { min-height: 44px; padding: .58rem .95rem; border: 1px solid transparent; border-radius: 9px; font-weight: 750; }
.plain { background: transparent; border-color: var(--line); color: var(--green); }
.primary { color: #fff; background: var(--green); border-color: var(--green); }
.hero { display: grid; grid-template-columns: 45% 55%; background: var(--peach); margin-top: 24px; border: 1px solid #ecd9c9; border-radius: 22px; overflow: hidden; }
.hero-copy { padding: clamp(22px, 5.3vw, 66px); align-self: center; }
.hero h1 { font-size: clamp(2.55rem, 6vw, 5.05rem); font-weight: 900; letter-spacing: -.09em; line-height: 1.04; }
.hero h1 em { color: var(--orange); font-style: normal; }
.hero p { color: #514231; font-size: clamp(1rem, 2vw, 1.2rem); line-height: 1.6; margin: 17px 0 21px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.hero-actions .plain { border-color: #cdb6a1; }
.hero img { height: 100%; min-height: 300px; object-fit: cover; }
.boards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 300px); gap: 25px; margin: 32px 0 50px; align-items: start; }
.board { min-width: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); gap: clamp(14px, 4vw, 28px); }
.tabs button { padding: 9px 2px 11px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); min-height: 44px; font-weight: 750; }
.tabs button[aria-pressed="true"] { color: var(--green); border-bottom-color: var(--green); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0; }
.filters label { color: var(--muted); font-size: .875rem; display: flex; align-items: center; gap: 6px; }
select, input[type="search"] { font-size: 1rem; min-height: 44px; color: inherit; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .65rem; }
select { max-width: 240px; }
.fine { color: var(--muted); font-size: .875rem; line-height: 1.6; }
.status { color: var(--muted); background: var(--white); border: 1px dashed #cfcabb; border-radius: 13px; text-align: center; padding: 2.45rem .9rem; }
.today { padding: 17px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.today-heading { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.today h2, .dialog-title h2 { font-size: 1.22rem; letter-spacing: -.035em; }
#today-date { color: var(--orange); font-size: .84rem; font-weight: 750; }
.today ol { padding: 0; margin: .6rem 0; list-style: none; }
.today li { display: grid; grid-template-columns: 22px minmax(0, 1fr) max-content; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); min-height: 47px; }
.today li a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.today #more-ranks { width: 100%; margin-top: .75rem; }
.posts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.photo-card { border-radius: 13px; border: 1px solid var(--line); background: var(--white); overflow: hidden; min-width: 0; }
.photo-card img { height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--peach); }
.card-body { padding: .72rem .86rem; }
.card-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.card-heading a { font-weight: 800; overflow-wrap: anywhere; }
.rank-number { color: var(--orange); font-weight: 900; font-variant-numeric: tabular-nums; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: .5rem; }
.like, .small { min-height: 42px; border: 1px solid var(--line); border-radius: 8px; color: var(--orange); background: var(--white); padding: 5px 9px; }
.like[aria-pressed="true"] { background: #f8e3dd; border-color: #cf7868; }
.small { color: var(--green); }
.school-rank { grid-column: 1 / -1; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 11px; background: var(--white); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.notice { position: fixed; z-index: 1; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(580px, 94%); background: #e9f2e9; color: #143b29; padding: 12px; border: 1px solid #c6d7c5; border-radius: 8px; box-shadow: 0 3px 14px #2524191f; }
.bottom { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 16px 0 calc(18px + env(safe-area-inset-bottom, 0px)); font-size: .875rem; color: var(--muted); }
.bottom div { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--white); color: inherit; width: min(530px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 20px; overscroll-behavior: contain; overflow: auto; }
dialog::backdrop { background: #19171185; }
.dialog-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.close { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: none; font-size: 1.4rem; }
dialog form > label, dialog form > p { display: block; margin-block: 8px; }
dialog input[type="search"], dialog form > .primary { width: 100%; }
.join-outside { width: 100%; margin-top: 8px; }
#school-matches { max-height: 34dvh; overflow: auto; overscroll-behavior: contain; margin-bottom: 12px; }
.school-option { display: block; width: 100%; min-height: 44px; text-align: left; background: var(--white); border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; margin: 4px 0; }
.school-option[aria-pressed="true"] { border-color: var(--green); background: #e9f2e9; }
.school-option small { display: block; color: var(--muted); }
#photo-preview { max-height: 36dvh; object-fit: contain; background: var(--paper); border-radius: 10px; }
.pickers { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.picker { display: flex; flex-direction: column; flex: 1 1 150px; padding: .55rem; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; gap: 7px; line-height: 1.4; }
.picker input { width: 100%; }
.confirm { display: flex !important; align-items: flex-start; gap: 8px; min-height: 44px; }
.confirm input { margin-top: 4px; accent-color: var(--green); }
#school-photos { display: grid; gap: 12px; margin-top: 10px; }
.rep-label { color: var(--orange); font-weight: 800; }
.favorite-entry { grid-column: 1 / -1; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.favorite-entry .photo-card { margin-top: 9px; max-width: 330px; }
.official-menu { margin-block: 12px; background: #f0f4eb; padding: 10px 12px; border-radius: 9px; }
.official-menu h3 { margin: 0 0 5px; font-size: .98rem; }
.official-menu h3 a { font-size: .82rem; margin-left: 9px; font-weight: 600; color: var(--green); }
.official-menu ul { margin: .3rem 0 0; padding-left: 1.2rem; columns: 2; font-size: .93rem; }
.official-menu li { break-inside: avoid; padding-block: 2px; }
.login-confirm, .login-privacy { display: block; margin-block: 12px; }
.login-confirm input { accent-color: var(--green); }
.legal { max-width: 760px; margin: 24px auto; background: var(--white); border: 1px solid var(--line); padding: clamp(15px, 4vw, 38px); border-radius: 16px; line-height: 1.7; }
.legal h2 { margin-top: 18px; font-size: 1.15rem; }
#favorite-school { margin-top: 8px; }
@media (hover: hover) and (pointer: fine) {
  .plain:hover, .school-option:hover { background: #efeee7; }
  .primary:hover:not(:disabled) { background: #173c2d; }
}
@media (max-width: 760px) {
  .frame { width: min(100% - 26px, 1140px); }
  .boards { grid-template-columns: minmax(0, 1fr); gap: 21px; margin-top: 22px; }
  .today { grid-row: 1; }
  .hero img { min-height: 240px; }
}
@media (max-width: 500px) {
  .top-inner { min-height: 60px; }
  .top-inner .plain { padding-inline: .5rem; font-size: .9rem; overflow-wrap: anywhere; }
  .hero { grid-template-columns: 1fr; margin-top: 13px; border-radius: 16px; }
  .hero-copy { padding: 20px 18px; }
  .hero h1 { font-size: 2.55rem; }
  .hero p { margin: 10px 0 12px; }
  .hero img { min-height: 0; height: 176px; }
  .posts { grid-template-columns: 1fr; }
  .filters select { max-width: 182px; }
}
