@font-face {
  font-family: "Feed Heading";
  src: url("../fonts/ahnchangho-feed-title.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Explora";
  src: url("../fonts/explora-latin-400-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "Inter", "Noto Sans KR", system-ui, sans-serif;
  color: #171717;
  background: #f7f7f7;
  --surface: #fff;
  --app-width: 520px;
  --nav-height: 58px;
  --border: #e9e9e9;
  --muted: #676767;
  --accent: #0064d1;
  --accent-light: #f0f5fa;
  --heart: #ed164f;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wordmark { font-family: "Instrument Serif", Georgia, serif; font-size: 33px; font-weight: 600; letter-spacing: -.07em; line-height: 1; }
.auth-link { margin: 22px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.auth-link a { color: var(--accent); font-weight: 700; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.feed-list { display: grid; gap: 20px; }
.feed-list:empty[aria-busy="true"], #profile:empty[aria-busy="true"] { border-radius: 16px; min-height: 104px; background: var(--accent-light); }
.post-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 66px; }
.identity { display: inline-flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.identity:hover strong, .comment-link:hover, .stats a:hover { text-decoration: underline; }
.avatar { display: inline-grid; position: relative; place-items: center; width: 39px; height: 39px; flex: none; border-radius: 50%; overflow: hidden; color: #555; background: #efefef; font-weight: 750; }
.avatar img { position: absolute; width: 100%; height: 100%; inset: 0; object-fit: cover; }
.post-media { position: relative; background: #eeeaf0; }
.photo-open { display: block; width: 100%; border: 0; padding: 0; background: transparent; }
.photo-open img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-step { position: absolute; top: 50%; transform: translateY(-50%); border: 0; border-radius: 50%; width: 35px; height: 35px; font-size: 26px; color: white; background: #201829b0; }
.previous { left: 12px; }
.next { right: 12px; }
.photo-index { position: absolute; top: 12px; right: 12px; color: white; background: #201829b0; border-radius: 16px; padding: 4px 10px; font-size: 12px; pointer-events: none; }
.post-body { padding: 9px 16px 17px; font-size: 14px; }
.post-actions { display: flex; align-items: center; gap: 6px; margin: 0 0 7px -6px; }
.icon-button { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; padding: 4px; background: transparent; border: 0; border-radius: 9px; color: inherit; }
.icon-button:hover { background: var(--accent-light); }
.like-button[aria-pressed="true"] { color: var(--heart); }
.like-button[aria-pressed="true"] .icon { fill: currentColor; }
.like-count { font-weight: 750; margin: 0; }
.caption { margin: 7px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.caption a { font-weight: 750; }
.comment-count { color: var(--muted); display: inline-block; margin-top: 5px; }
button.primary, button.secondary, a.secondary { display: inline-flex; justify-content: center; align-items: center; min-height: 40px; padding: 9px 15px; border-radius: 9px; font-weight: 700; font-size: 14px; border: 1px solid transparent; }
.primary { color: white; background: var(--accent); }
.primary:hover { background: #0055b5; }
button.secondary, a.secondary { color: #171717; background: #f2f2f2; border-color: #f2f2f2; }
#load-more, .comments > .secondary { margin-top: 15px; }
.text-button { min-height: 34px; border: 0; background: transparent; color: var(--accent); font-weight: 750; white-space: nowrap; }
.empty { color: var(--muted); margin: 0; padding: 22px 17px; font-size: 14px; }
.status { position: fixed; z-index: 10; max-width: min(90vw, 460px); right: 24px; bottom: 24px; padding: 12px 16px; margin: 0; background: #eee7f8; color: #362252; border: 1px solid #dbc9ef; border-radius: 9px; box-shadow: 0 10px 30px #23143715; }
.status.error { background: #fff0f1; border-color: #edcad2; color: #820c36; }
.comments { padding: 16px; }
#post + .comments { margin-top: 16px; }
.comments h2 { margin: 0 0 8px; font-size: 17px; }
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; justify-content: space-between; align-items: start; gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
#people .list-row { align-items: center; padding-inline: 9px; }
#people .list-row span:not(.avatar), .comment-body time { font-size: 13px; color: var(--muted); }
.comment-body { min-width: 0; }
.comment-body p { margin: 4px 0 3px 49px; white-space: pre-wrap; }
.comment-body time { margin-left: 49px; }
.comment-form { display: flex; gap: 8px; margin-top: 15px; }
.comment-form input { min-width: 0; }
.profile-avatar { width: 86px; height: 86px; font-size: 28px; object-fit: cover; }
.profile-info { min-width: 0; overflow-wrap: anywhere; }
.bio { white-space: pre-wrap; }
.tile { display: grid; place-items: center; min-width: 0; aspect-ratio: 1; overflow: hidden; text-align: center; background: var(--accent-light); border-radius: 7px; overflow-wrap: anywhere; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; text-align: center; border-bottom: 1px solid var(--border); }
.tabs a { padding: 13px; }
.tabs a[aria-current] { color: var(--accent); font-weight: 750; border-bottom: 2px solid var(--accent); }
form:not(.comment-form) { display: grid; gap: 14px; }
form label { display: grid; gap: 6px; font-size: 14px; font-weight: 650; }
input, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fafafa; color: inherit; }
textarea { resize: vertical; }
.form-card { padding: 21px; }
fieldset { margin: 0; border: 0; padding: 0; min-width: 0; }
fieldset > button { width: 100%; }
.settings > * { display: block; width: 100%; text-align: left; padding: 16px; border: 0; background: transparent; color: inherit; font-size: 15px; }
.settings > * + * { border-top: 1px solid var(--border); color: #a12046; }
.settings > *:hover { background: #f8f5fa; }
.previews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.preview { min-width: 0; }
.preview img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border-radius: 8px; }
.preview-actions { display: flex; justify-content: space-between; }
.preview-actions .icon-button { min-width: 28px; min-height: 34px; }
#caption-count { justify-self: end; font-size: 13px; color: var(--muted); }
/* The same centered app column is used on mobile and desktop. */
.layout {
  width: min(100%, var(--app-width));
  min-height: 100dvh;
  margin-inline: auto;
  background: var(--surface);
  border-inline: 1px solid var(--border);
}
.main { min-width: 0; padding-bottom: 24px; }
.has-tabs .main { padding-bottom: calc(var(--nav-height) + 24px + env(safe-area-inset-bottom)); }
.bottom-nav {
  position: fixed;
  z-index: 5;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  width: min(100%, var(--app-width));
  min-height: var(--nav-height);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-items: center;
  align-items: center;
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
  background: var(--surface);
  border: 1px solid var(--border);
}
.bottom-nav .icon-button { min-width: 56px; min-height: 46px; }
.bottom-nav .icon { width: 26px; height: 26px; }
.bottom-nav [aria-current="page"] > .icon { fill: currentColor; }
.bottom-nav .avatar { width: 27px; height: 27px; font-size: 12px; }
.bottom-nav [aria-current="page"] .avatar { outline: 2px solid currentColor; outline-offset: 2px; }
.page-header {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 57px;
  display: grid;
  grid-template-columns: minmax(70px, 1fr) minmax(0, 2.6fr) minmax(70px, 1fr);
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.page-header > :first-child { justify-self: start; }
.page-header h1 { grid-column: 2; margin: 0; text-align: center; font-size: 17px; font-weight: 750; overflow-wrap: anywhere; }
.page-header .header-end { grid-column: 3; justify-self: end; padding-inline: 5px; }
.feed-header h1.wordmark {
  font-family: "Feed Heading", "Explora", Georgia, serif;
  font-size: clamp(20px, 8vw, 30px);
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
}
body[data-screen="login"] .layout, body[data-screen="signup"] .layout { display: grid; align-content: center; }
.auth { width: min(100% - 48px, 350px); margin-inline: auto; padding: 24px 0; }
.auth-card { border: 0; border-radius: 0; }
.auth-card .wordmark { margin: 0 0 34px; text-align: center; font-size: 48px; font-style: italic; }
.auth-heading { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; margin-bottom: 22px; }
.auth-heading h1 { font-size: 19px; margin: 0; text-align: center; }
.feed-list { gap: 0; }
.post-card { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.post-header { padding: 10px 15px; gap: 9px; min-height: 58px; }
.post-header .identity { font-size: 14px; }
.post-header .avatar { width: 35px; height: 35px; }
.follow-button {
  margin-left: auto;
  min-height: 31px;
  padding-inline: 11px;
  border-radius: 7px;
  background: #f2f2f2;
  color: #171717;
  font-size: 12px;
}
.follow-button[aria-pressed="false"] { color: #fff; background: var(--accent); }
.post-options { position: relative; margin-left: auto; flex: none; }
.post-options summary { cursor: pointer; list-style: none; }
.post-options summary .icon { fill: currentColor; stroke: none; }
.post-options summary::-webkit-details-marker { display: none; }
.post-options-panel {
  position: absolute;
  z-index: 2;
  top: calc(100% + 3px);
  right: 0;
  width: 120px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 4px 16px #0002;
}
.delete-post {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b71c34;
  text-align: left;
  font-weight: 700;
}
.delete-post:hover { background: #fff1f3; }
.post-time { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.post-body { padding-inline: 15px; }
.profile {
  display: grid;
  grid-template-columns: 85px minmax(0, 1fr);
  align-items: center;
  gap: 13px 19px;
  padding: 20px 15px 17px;
  border: 0;
  border-radius: 0;
}
.profile h2 { margin: 0; font-size: 15px; }
.profile-info { min-width: 0; }
.profile-avatar { width: 82px; height: 82px; }
.profile .bio, .profile-actions { grid-column: 1 / -1; }
.profile .bio { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
}
.stats > * { display: grid; min-height: 35px; gap: 1px; color: inherit; }
.stats strong { font-size: 17px; }
.profile-actions { display: flex; }
.profile-actions > * { flex: 1; }
.profile-grid-heading {
  display: grid;
  place-items: center;
  min-height: 43px;
  border-block: 1px solid var(--border);
}
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin-top: 3px; }
.tile { border-radius: 0; }
#load-more { display: flex; margin: 14px auto; }
.tabs { position: sticky; top: 57px; z-index: 3; background: var(--surface); }
.tabs a[aria-current] { color: inherit; border-color: currentColor; }
#people { padding: 0 15px; }
#people .list-row { justify-content: flex-start; gap: 15px; padding: 10px 0; }
.comments { border: 0; border-radius: 0; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.comment-body time { margin: 0; }
.comment-form { align-items: center; }
#comment-avatar { line-height: 0; flex: none; }
.comment-form input { border-radius: 22px; }
.comment-form .send-button { min-width: 34px; min-height: 34px; color: #fff; background: var(--accent); border-radius: 50%; }
.comment-form .send-button .icon { width: 19px; height: 19px; }
body[data-screen="comments"] .comments { padding-bottom: calc(81px + env(safe-area-inset-bottom)); }
body[data-screen="comments"] .comment-form {
  position: fixed;
  z-index: 5;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  width: min(100%, var(--app-width));
  padding: 11px 13px calc(11px + env(safe-area-inset-bottom));
  border: 1px solid var(--border);
  background: var(--surface);
}
.settings { border: 0; border-radius: 0; }
.settings > * { border-bottom: 1px solid var(--border); }
.settings > a { display: flex; justify-content: space-between; }
.settings > * + * { border-top: 0; }
.form-card { border: 0; border-radius: 0; padding: 17px 15px; }
.edit-photo { justify-items: center; padding-bottom: 10px; color: var(--accent); cursor: pointer; }
.edit-photo:focus-within, .upload-picker:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.upload-media { min-width: 0; display: flex; align-items: flex-start; gap: 9px; padding-bottom: 13px; border-bottom: 1px solid var(--border); }
#upload-form .upload-picker {
  display: grid;
  place-items: center;
  flex: 0 0 70px;
  aspect-ratio: 1;
  border-radius: 9px;
  border: 1px dashed #999;
  cursor: pointer;
}
.previews { min-width: 0; display: flex; overflow-x: auto; }
.preview { flex: 0 0 85px; }
.caption-field textarea { border: 0; padding: 10px 1px; background: transparent; }
.has-tabs .status, body[data-screen="comments"] .status { bottom: calc(70px + env(safe-area-inset-bottom)); }
@media (max-width: 520px) {
  .layout, .bottom-nav { border-inline: 0; }
  .status { right: 12px; }
}

.user-search { padding: 12px 15px; }
.user-search .search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  background: #f2f2f2;
  border-radius: 12px;
  color: var(--muted);
}
.search-field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-field .icon { width: 19px; height: 19px; }
.search-field input {
  min-width: 0;
  padding: 11px 0;
  border: 0;
  background: transparent;
  color: #171717;
  font-size: 16px;
}
.search-field input:focus-visible { outline: 0; }
#search-status { padding-inline: 0; }
#search-results { margin-top: 12px; }
.search-row .identity {
  display: flex;
  gap: 12px;
  padding: 9px 7px;
  border-radius: 9px;
  font-size: 14px;
}
.search-row .identity:hover { background: #f7f7f7; }
.search-account { display: grid; gap: 3px; min-width: 0; }
.search-name { color: var(--muted); font-size: 13px; }
.bottom-nav a[href="/search"][aria-current="page"] > .icon { fill: none; stroke-width: 2.7; }
