:root {
  --page: #f5f1e9;
  --paper: #fff;
  --ink: #3e3a37;
  --muted: #8a8580;
  --coral: #ed7d78;
  --coral-dark: #d9625e;
  --coral-pale: #fff0ee;
  --teal: #469b9d;
  --teal-pale: #e9f5f3;
  --navy: #354f64;
  --line: #e4ded6;
  --shadow: 0 2px 10px rgba(75, 61, 48, .07);
  --sans: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body.is-locked { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.shell { width: min(1040px, calc(100% - 32px)); margin-inline: auto; }

.demo-bar { min-height: 28px; padding: 6px 16px; display: flex; justify-content: center; gap: 12px; background: var(--navy); color: #fff; font-size: 10px; }
.demo-bar span { opacity: .65; }

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.brand-area { min-height: 126px; display: grid; place-items: center; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); }
.brand > span:last-child { display: grid; gap: 4px; }
.brand b { color: var(--coral-dark); font-size: clamp(22px, 3vw, 31px); line-height: 1; letter-spacing: .015em; }
.brand small { color: var(--muted); font-size: 10px; }
.brand-copy-ja { margin-top: 4px; letter-spacing: .045em; }
.brand-copy-en { color: #aaa39c !important; font-size: 8px !important; letter-spacing: .025em; }
.brand-mark { width: 42px; height: 40px; position: relative; flex: 0 0 auto; }
.brand-mark i { position: absolute; width: 22px; height: 22px; border-radius: 50%; }
.brand-mark i:nth-child(1) { left: 0; top: 10px; background: var(--coral); }
.brand-mark i:nth-child(2) { right: 0; top: 0; background: #9fd2c9; }
.brand-mark i:nth-child(3) { right: 2px; bottom: 0; background: #efc876; }
.header-tools { border-top: 1px solid var(--line); background: #fffdfa; }
.header-tools__inner { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.header-tools p { margin: 0; color: #6f6963; font-size: 12px; }
.site-search { width: 260px; height: 34px; display: flex; align-items: center; position: relative; }
.site-search > span { position: absolute; width: 1px; height: 1px; clip: rect(0 0 0 0); overflow: hidden; }
.site-search input { width: 100%; height: 34px; padding: 0 34px 0 12px; border: 1px solid #d7d0c7; border-radius: 3px; background: #fff; outline: 0; font-size: 11px; }
.site-search input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(237,125,120,.1); }
.site-search i { position: absolute; right: 10px; color: var(--muted); font-size: 18px; font-style: normal; pointer-events: none; }

.page-shell { padding-block: 28px 55px; display: grid; grid-template-columns: minmax(0, 710px) 290px; gap: 24px; align-items: start; }
.board, .side-panel { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.board-tabs { display: grid; grid-template-columns: 1fr 1fr; }
.board-tab { min-height: 58px; border: 0; border-bottom: 4px solid transparent; background: #dcefed; color: #397f80; font-size: 15px; font-weight: 700; cursor: pointer; }
.board-tab + .board-tab { border-left: 1px solid rgba(255,255,255,.75); }
.board-tab span { margin-right: 7px; }
.board-tab.is-active { border-bottom-color: var(--coral-dark); background: var(--coral); color: #fff; }
.list-date { min-height: 50px; padding: 0 15px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.list-date strong { font-size: 12px; }
.list-date button { border: 0; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.list-date button:first-child { text-align: left; }
.list-date button:last-child { text-align: right; }
.active-filter { min-height: 42px; padding: 7px 14px; display: flex; align-items: center; justify-content: space-between; gap: 15px; background: var(--coral-pale); border-bottom: 1px solid #f3d7d4; color: var(--coral-dark); font-size: 11px; font-weight: 700; }
.active-filter button { border: 0; background: transparent; color: var(--muted); font-size: 9px; cursor: pointer; }

.topic-list { background: #fff; }
.topic-row { min-height: 92px; padding: 14px 15px 13px; display: grid; grid-template-columns: 38px 66px minmax(0, 1fr); gap: 12px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.topic-row.no-image { grid-template-columns: 38px minmax(0, 1fr); }
.topic-row:hover, .topic-row:focus-visible { background: #fffaf8; outline: 0; }
.rank { width: 28px; height: 28px; margin-top: 16px; display: grid; place-items: center; border-radius: 50%; background: #eeeae5; color: #877f77; font-size: 11px; font-weight: 800; }
.rank.top-1 { background: #e8bb5d; color: #fff; }
.rank.top-2 { background: #aeb9c0; color: #fff; }
.rank.top-3 { background: #c99369; color: #fff; }
.rank.new-mark { height: 21px; margin-top: 19px; border-radius: 3px; background: var(--teal-pale); color: var(--teal); font-size: 8px; letter-spacing: .04em; }
.topic-thumb { width: 66px; height: 66px; display: grid; place-items: center; border-radius: 3px; border: 1px solid #ddd6cd; background: #eee9e1; color: var(--muted); font-size: 15px; font-weight: 700; }
.topic-thumb.topic-image { display: block; object-fit: cover; }
.thumb-0 { background: linear-gradient(145deg,#f4d39a,#c98756); }
.thumb-1 { background: linear-gradient(145deg,#9bd0c6,#3d7b80); }
.thumb-2 { background: linear-gradient(145deg,#f2b7b1,#be6d75); }
.thumb-3 { background: linear-gradient(145deg,#bcc9db,#647c9b); }
.topic-content { min-width: 0; }
.topic-meta { min-height: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.reply-count { color: var(--coral-dark); font-weight: 800; }
.category-label { padding: 2px 5px; border-radius: 2px; background: var(--teal-pale); color: #3f8182; font-weight: 700; }
.solved-label { color: #3c8b70; font-weight: 700; }
.topic-mode-label { color: var(--coral-dark); font-weight: 700; }
.topic-content h3 { margin: 5px 0 0; color: #3d5a6e; font-size: 14px; line-height: 1.55; font-weight: 700; }
.topic-content h3:hover { color: var(--coral-dark); }
.topic-content p { margin: 5px 0 0; overflow: hidden; color: #77716a; font-size: 10px; line-height: 1.55; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state strong { font-size: 16px; }
.empty-state p { color: var(--muted); font-size: 11px; }
.load-more { width: 100%; min-height: 48px; border: 0; background: #fbfaf8; color: #6f6963; font-size: 11px; font-weight: 700; cursor: pointer; }
.load-more:hover { background: var(--coral-pale); color: var(--coral-dark); }

.sidebar { display: grid; gap: 17px; }
.post-button { width: 100%; min-height: 58px; border: 0; border-radius: 3px; background: var(--coral); color: #fff; box-shadow: 0 3px 0 var(--coral-dark); font-size: 15px; font-weight: 800; cursor: pointer; }
.post-button:hover { background: var(--coral-dark); }
.post-button span { margin-right: 7px; font-size: 21px; vertical-align: -1px; }
.side-panel h2 { margin: 0; padding: 13px 14px 11px; border-top: 3px solid var(--coral); border-bottom: 1px solid var(--line); color: #5a5652; font-size: 13px; }
.popular-list { list-style: none; margin: 0; padding: 0 13px; }
.popular-item { padding: 11px 0; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; border-bottom: 1px dotted #ddd5cc; cursor: pointer; }
.popular-item:last-child { border-bottom: 0; }
.popular-item > span { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: #eeeae5; color: #7b756e; font-size: 9px; font-weight: 800; }
.popular-item:nth-child(1) > span { background: #e8bb5d; color: #fff; }
.popular-item:nth-child(2) > span { background: #aeb9c0; color: #fff; }
.popular-item:nth-child(3) > span { background: #c99369; color: #fff; }
.popular-item strong { display: block; color: #496276; font-size: 10px; line-height: 1.5; font-weight: 700; }
.popular-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.discussion-list { padding: 4px 13px; }
.discussion-link { width: 100%; padding: 9px 0; display: block; border: 0; border-bottom: 1px dotted #ddd5cc; background: transparent; color: #496276; text-align: left; font-size: 10px; line-height: 1.5; cursor: pointer; }
.discussion-link:last-child { border-bottom: 0; }
.discussion-link span { color: var(--coral-dark); font-size: 8px; }
.category-list { display: grid; grid-template-columns: 1fr 1fr; padding: 7px 10px 10px; }
.category-link { min-height: 34px; padding: 7px 6px; display: flex; align-items: center; justify-content: space-between; gap: 6px; border: 0; border-bottom: 1px dotted #e0d9d1; background: transparent; color: #5f5a55; text-align: left; font-size: 9px; cursor: pointer; }
.category-link:hover, .category-link.is-active { color: var(--coral-dark); background: var(--coral-pale); }
.category-link span:last-child { min-width: 18px; color: #aaa29a; text-align: right; font-size: 8px; }

.site-footer { padding: 32px 0; border-top: 1px solid var(--line); background: #fffdfa; color: var(--muted); }
.site-footer .shell { display: grid; gap: 18px; text-align: center; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 19px; font-size: 9px; }
.site-footer small { font-size: 9px; }

dialog { padding: 0; border: 0; border-radius: 5px; color: var(--ink); background: var(--page); box-shadow: 0 20px 70px rgba(48, 41, 35, .35); }
dialog::backdrop { background: rgba(43, 48, 52, .65); }
.dialog-close { position: absolute; z-index: 4; top: 12px; right: 13px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: #777; font-size: 21px; cursor: pointer; }
.detail-dialog { width: min(720px, calc(100% - 28px)); max-height: 92vh; overflow: auto; }
.detail-head { padding: 38px 38px 25px; background: #fff; border-bottom: 1px solid var(--line); }
.detail-head.with-image { display: grid; grid-template-columns: 125px 1fr; gap: 22px; }
.detail-photo { width: 125px; height: 118px; border-radius: 4px; object-fit: cover; background: #eee9e1; }
.detail-placeholder { display: grid; place-items: center; border: 1px solid #ddd6cd; color: rgba(255,255,255,.9); font-size: 14px; font-weight: 700; }
.detail-head h2 { margin: 10px 0 12px; color: #3d5a6e; font-size: 21px; line-height: 1.55; }
.detail-head p { margin: 0; color: #625d58; font-size: 12px; line-height: 1.85; }
.detail-info { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 13px; color: var(--muted); font-size: 9px; }
.detail-body { padding: 24px 38px 38px; }
.detail-actions { margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.detail-actions button { min-height: 36px; padding: 0 12px; border: 1px solid #d8d1c8; border-radius: 3px; background: #fff; color: #645f59; font-size: 9px; font-weight: 700; cursor: pointer; }
.detail-actions button:first-child { border-color: #f0c7c4; background: var(--coral-pale); color: var(--coral-dark); }
.comment-form { display: none; grid-template-columns: 1fr auto; margin-bottom: 17px; }
.comment-form.is-visible { display: grid; }
.comment-form textarea { min-width: 0; min-height: 74px; padding: 10px; border: 1px solid #d8d1c8; outline: 0; resize: vertical; font: inherit; line-height: 1.6; }
.comment-form button { border: 0; padding: 0 16px; background: var(--teal); color: #fff; font-size: 10px; font-weight: 700; }
.answer-box { min-height: 104px; padding: 19px; position: relative; overflow: hidden; border: 1px solid #cfe2dc; border-radius: 3px; background: var(--teal-pale); }
.answer-box h3 { margin: 0 0 7px; color: #367472; font-size: 15px; }
.answer-box p { margin: 0; color: #5b706a; font-size: 10px; line-height: 1.75; }
.answer-box.is-hidden::before { content: ""; position: absolute; z-index: 1; inset: 0; background: rgba(233,245,243,.8); backdrop-filter: blur(6px); }
.reveal-button { display: none; position: absolute; z-index: 2; inset: 0; border: 0; background: transparent; cursor: pointer; }
.answer-box.is-hidden .reveal-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.reveal-button strong { color: #367472; font-size: 11px; }
.reveal-button small { color: var(--muted); font-size: 8px; }
.comments { margin-top: 22px; }
.comments h3 { margin: 0; padding-bottom: 10px; border-bottom: 2px solid var(--coral); font-size: 13px; }
.comment { padding: 12px 3px; border-bottom: 1px solid var(--line); color: #645f59; font-size: 10px; line-height: 1.65; }
.comment strong { display: block; margin-bottom: 3px; color: var(--teal); font-size: 9px; }

.submit-dialog { width: min(680px, calc(100% - 28px)); max-height: 92vh; overflow: auto; background: #fff; }
.submit-header { padding: 27px 34px 20px; border-bottom: 1px solid var(--line); }
.submit-header h2 { margin: 0; color: #425c70; font-size: 21px; }
.submit-header p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.submit-form { padding: 25px 34px 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field > span { color: #5d5853; font-size: 10px; font-weight: 700; }
.field > span b { color: var(--coral-dark); }
.field > span i { color: var(--muted); font-size: 8px; font-style: normal; font-weight: 400; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #d8d1c8; border-radius: 3px; background: #fff; outline: 0; color: var(--ink); }
.field input, .field select { height: 43px; padding: 0 11px; }
.field textarea { min-height: 120px; padding: 11px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(237,125,120,.1); }
.field small { align-self: end; color: var(--muted); font-size: 8px; }
.field--category { padding: 14px; border: 2px solid #f0c0bd; border-radius: 4px; background: var(--coral-pale); }
.field--category select { border-color: #e8aaa5; font-weight: 700; }
.upload-zone { min-height: 73px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; position: relative; border: 1px dashed #cfc7be; border-radius: 3px; background: #faf9f7; cursor: pointer; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #eee9e3; color: var(--coral-dark); font-size: 20px; }
.upload-zone > span:nth-of-type(2) { display: grid; gap: 3px; font-size: 10px; }
.upload-zone small { color: var(--muted); font-size: 8px; }
.upload-zone img { width: 57px; height: 55px; margin-left: auto; object-fit: cover; border-radius: 3px; }
.moderation-note { padding: 12px 14px; border: 1px solid #eadfd4; border-radius: 3px; background: #faf7f2; }
.moderation-note strong { display: block; margin-bottom: 5px; color: #625c56; font-size: 10px; }
.moderation-note p { margin: 3px 0; color: var(--muted); font-size: 8px; line-height: 1.65; }
.submit-button { min-height: 48px; border: 0; border-radius: 3px; background: var(--coral); color: #fff; font-size: 12px; font-weight: 800; cursor: pointer; }
.submit-button:hover { background: var(--coral-dark); }
.submit-button:disabled { opacity: .62; cursor: wait; }
.form-error { margin: -2px 0 0; padding: 10px 12px; border: 1px solid #efb8b4; border-radius: 3px; background: #fff0ee; color: #ad4641; font-size: 10px; line-height: 1.6; }
.posting-note { margin: -7px 0 0; color: var(--muted); text-align: center; font-size: 8px; line-height: 1.6; }
.success-state { min-height: 420px; padding: 50px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.success-state > span { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-pale); color: var(--teal); font-size: 24px; }
.success-state h2 { margin: 17px 0 5px; color: #425c70; }
.success-state p { margin: 0 0 20px; color: var(--muted); font-size: 10px; }
.success-state .submit-button { padding-inline: 25px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 20px; padding: 10px 17px; border-radius: 30px; background: var(--navy); color: #fff; box-shadow: 0 8px 25px rgba(0,0,0,.2); opacity: 0; transform: translate(-50%, 55px); transition: .2s; pointer-events: none; font-size: 10px; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  .page-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { grid-template-columns: 1fr 1fr; }
  .post-button, .categories-panel { grid-column: 1 / -1; }
}

@media (max-width: 580px) {
  .shell { width: min(100% - 20px, 1040px); }
  .demo-bar { gap: 7px; font-size: 8px; }
  .brand-area { min-height: 108px; }
  .brand-mark { width: 34px; height: 33px; }
  .brand-mark i { width: 18px; height: 18px; }
  .brand b { font-size: 20px; }
  .brand small { font-size: 8px; }
  .brand-copy-en { max-width: 275px; font-size: 7px !important; }
  .header-tools__inner { min-height: 54px; }
  .header-tools p { display: none; }
  .site-search { width: 100%; }
  .page-shell { width: 100%; padding-top: 14px; gap: 14px; }
  .board { border-inline: 0; }
  .board-tab { min-height: 52px; font-size: 12px; }
  .topic-row { min-height: 82px; padding: 12px 10px; grid-template-columns: 30px 55px minmax(0, 1fr); gap: 8px; }
  .topic-row.no-image { grid-template-columns: 30px minmax(0, 1fr); }
  .rank { width: 25px; height: 25px; }
  .topic-thumb { width: 55px; height: 55px; }
  .topic-content h3 { font-size: 12px; }
  .topic-content p { display: none; }
  .topic-meta { gap: 5px; font-size: 8px; }
  .sidebar { padding-inline: 10px; grid-template-columns: 1fr; }
  .post-button, .categories-panel { grid-column: auto; }
  .category-list { grid-template-columns: 1fr 1fr; }
  .detail-head, .detail-body { padding-inline: 20px; }
  .detail-head.with-image { grid-template-columns: 85px 1fr; gap: 14px; }
  .detail-photo { width: 85px; height: 84px; }
  .detail-head h2 { font-size: 17px; }
  .comment-form { grid-template-columns: 1fr; }
  .comment-form button { min-height: 42px; }
  .submit-form { padding-inline: 18px; grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
  .submit-header { padding-inline: 18px; }
}
