:root {
  --blue: #263f70;
  --green: #7dff00;
  --ink: #172b52;
  --muted: #6d7991;
  --line: #d6dce7;
  --page: #edf3fa;
  --surface: #f8f9fb;
  --card: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.45 Arial, Helvetica, sans-serif; }
.shell { padding: 32px 20px; }
.app { max-width: 1180px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); }
.header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 32px; background: var(--blue); color: #fff; }
.header h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); line-height: 1; letter-spacing: -.03em; }
.header p { margin: 14px 0 0; color: var(--green); font-weight: 700; font-size: 1.08rem; }
.combain { flex: 0 0 auto; border: 1px solid rgba(255,255,255,.8); padding: 15px 20px; color: #fff; text-decoration: none; font-weight: 700; }
.content { padding: 32px; }
.notice { margin-bottom: 18px; padding: 14px 16px; border-left: 5px solid var(--green); background: #fff; }
.notice-error { border-left-color: #d83333; }
.intro { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(250px,.5fr); gap: 22px; padding: 28px; background: var(--card); border: 1px solid var(--line); }
.intro-single { grid-template-columns: 1fr; }
.kicker { color: #4d9900; font-size: .84rem; font-weight: 800; text-transform: uppercase; }
.intro h2 { max-width: 700px; margin: 8px 0 12px; font-size: clamp(2rem,4vw,2.75rem); line-height: 1.08; }
.lead { max-width: 740px; margin: 0; color: var(--muted); font-size: 1.08rem; }
.intro-copy { max-width: 820px; color: var(--muted); font-size: 1.08rem; }
.intro-copy p { margin: 0 0 10px; }
.promotion-channels { color: var(--blue); font-weight: 800; }
.intro-offer { max-width: 820px; margin: 22px 0 0; color: var(--ink); font-size: 1.15rem; font-weight: 800; }
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 24px 0 0; padding: 0; list-style: none; font-size: .92rem; }
.steps li:not(.arrow) { display: flex; align-items: center; gap: 7px; }
.steps b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--green); }
.arrow { color: var(--muted); }
.access { display: flex; flex-direction: column; justify-content: space-between; gap: 22px; padding: 22px; background: #f5f7f2; border-left: 5px solid var(--green); }
.access span,.access small { display: block; color: var(--muted); }
.access strong { display: block; margin: 6px 0 3px; font-size: 1.4rem; }
.access form { display: grid; gap: 9px; }
.access label { font-size: .82rem; font-weight: 700; }
.access input { width: 100%; min-height: 46px; border: 1px solid var(--line); padding: 10px 12px; font: inherit; }
.access button,.action-primary { border: 1px solid #66d600; background: var(--green); color: var(--blue); font-weight: 800; }
.access button { min-height: 48px; padding: 10px 14px; cursor: pointer; }
.section-title { margin: 30px 0 14px; font-size: 1.45rem; }
.projects { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.project { padding: 24px; background: var(--card); border: 1px solid var(--line); }
.project-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.project-icon { display: grid; place-items: center; width: 52px; height: 52px; border: 4px solid #7887a1; border-radius: 50%; background: var(--blue); color: var(--green); font-weight: 800; }
.demo { color: var(--muted); font-size: .85rem; }
.project h3 { margin: 18px 0 8px; font-size: 1.55rem; }
.project > p { min-height: 72px; margin: 0; color: var(--muted); }
.actions { display: grid; gap: 10px; margin-top: 20px; }
.action { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; border: 1px solid var(--line); background: #f4f5f7; color: var(--ink); padding: 10px 14px; text-align: center; text-decoration: none; font-size: .88rem; font-weight: 800; }
.action-primary { background: var(--green); }
.is-disabled { opacity: .55; cursor: not-allowed; }
.hosting-help { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding: 20px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.hosting-help strong { color: var(--ink); }
.hosting-help a,.guide-pending { color: var(--ink); font-weight: 800; }
.topline { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.topline h1 { margin: 6px 0 10px; font-size: clamp(2rem, 5vw, 3rem); line-height: 1; }
.codes-logout { color: var(--ink); font-weight: 800; }
.code-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 28px 0; }
.code-summary article { padding: 24px; border: 1px solid var(--line); background: white; }
.code-summary span,.code-summary small { display: block; color: var(--muted); font-weight: 700; }
.code-summary strong { display: block; margin: 8px 0 2px; color: var(--blue); font-size: 2.8rem; line-height: 1; }
.code-section { margin-top: 28px; padding: 24px; border: 1px solid var(--line); background: white; }
.code-section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.code-section-title h2 { margin: 0 0 4px; }
.code-section-title p { margin: 0; color: var(--muted); }
.code-section-title > span { padding: 7px 10px; background: #edf5e5; color: #3f7900; font-size: .8rem; font-weight: 800; white-space: nowrap; }
.codes-table-wrap { overflow-x: auto; }
.codes { width: 100%; border-collapse: collapse; }
.codes th,.codes td { padding: 12px 10px; border-bottom: 1px solid #e3e7ee; text-align: left; vertical-align: middle; }
.codes th { color: var(--muted); font-size: .78rem; text-transform: uppercase; }
.codes code { color: var(--blue); font-weight: 800; white-space: nowrap; }
.issue { display: flex; gap: 8px; min-width: 380px; }
.issue input { width: 100%; min-height: 44px; border: 1px solid var(--line); padding: 9px 11px; font: inherit; }
.issue select { min-height: 44px; border: 1px solid var(--line); background: white; padding: 8px 28px 8px 10px; font: inherit; font-weight: 700; }
.issue .action { width: auto; min-height: 44px; }
.muted { color: var(--muted); font-size: .86rem; }
.code-status { display: inline-block; padding: 5px 8px; background: #eef1f6; font-size: .78rem; font-weight: 800; }
.code-status-available { background: #eaf8dd; color: #3f7900; }
.code-status-issued { background: #fff2cc; color: #765900; }
.code-status-activated { background: #e5eeff; color: #244f9a; }
.code-status-used { background: #ececec; color: #606060; }
.code-status-active { background: #eaf8dd; color: #3f7900; }
.code-status-pending { background: #fff2cc; color: #765900; }
.code-status-expired { background: #ffe5e5; color: #9b2929; }
.owner-nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: -32px -32px 32px; padding: 18px 32px; background: var(--blue); color: white; }
.owner-nav div { display: flex; align-items: center; gap: 8px; }
.owner-nav a { padding: 9px 12px; color: white; text-decoration: none; font-weight: 800; }
.owner-nav a.active { background: var(--green); color: var(--blue); }
.journal-total { min-width: 150px; padding: 18px; border: 1px solid var(--line); background: white; text-align: center; }
.journal-total strong,.journal-total span { display: block; }
.journal-total strong { font-size: 2.3rem; line-height: 1; }
.journal-total span { margin-top: 4px; color: var(--muted); }
.journal-wrap { margin-top: 28px; border: 1px solid var(--line); background: white; }
.journal td:first-child strong,.journal td:first-child small { display: block; }
.journal td:first-child small { margin-top: 3px; color: var(--muted); }
.journal a { color: var(--blue); font-weight: 800; }
.empty-journal { margin-top: 28px; padding: 46px; border: 1px solid var(--line); background: white; text-align: center; }
.empty-journal h2 { margin-top: 0; }
.empty-journal .action { max-width: 280px; margin: 22px auto 0; }
.channel-entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.channel-entry-single { grid-template-columns: minmax(0, 1fr); }
.channel-entry { padding: 26px; border: 1px solid var(--line); border-top: 6px solid var(--green); background: white; }
.channel-entry-private { border-top-color: var(--blue); }
.channel-entry-label { color: #4d9900; font-size: .78rem; font-weight: 800; letter-spacing: .04em; }
.channel-entry h3 { margin: 10px 0 8px; font-size: 1.65rem; }
.channel-entry p { min-height: 70px; color: var(--muted); }
.channel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 34px; background: var(--blue); color: white; }
.channel-header .kicker { display: block; margin-top: 22px; color: var(--green); }
.channel-header h1 { margin: 6px 0 8px; font-size: clamp(2.1rem, 6vw, 3.6rem); line-height: 1; }
.channel-header p { margin: 0; color: #dce6f8; }
.back-link { color: white; font-weight: 800; text-decoration: none; }
.back-link.dark { display: inline-block; margin-bottom: 32px; color: var(--blue); }
.participant { min-width: 170px; padding: 15px; border: 1px solid rgba(255,255,255,.35); }
.participant strong,.participant span,.participant a { display: block; }
.participant span { margin: 3px 0 10px; color: var(--green); font-size: .82rem; }
.participant a { color: white; font-size: .82rem; }
.channel-feed,.discussion-page { max-width: 820px; margin: 0 auto; padding: 30px; }
.channel-post { margin-bottom: 22px; padding: 28px; border: 1px solid var(--line); background: white; }
.post-meta { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.channel-post h2 { margin: 12px 0; font-size: clamp(1.55rem, 4vw, 2.25rem); line-height: 1.15; }
.post-body { white-space: pre-wrap; }
.post-image { display: block; width: 100%; max-height: 560px; margin-top: 20px; object-fit: contain; background: #eef1f6; }
.post-media,.post-link { display: block; margin-top: 16px; color: var(--blue); font-weight: 800; }
.post-button { max-width: 420px; margin-top: 20px; }
.discussion-link { display: flex; justify-content: space-between; gap: 18px; margin: 24px -28px -28px; padding: 17px 28px; border-top: 1px solid var(--line); color: var(--blue); text-decoration: none; font-weight: 800; }
.discussion-link small { color: var(--muted); }
.empty-channel { padding: 42px; border: 1px dashed #aeb8ca; background: white; text-align: center; }
.empty-channel h2 { margin-top: 0; }
.channel-access { max-width: 660px; margin: 0 auto; padding: 60px 34px; }
.channel-access h1 { margin: 8px 0 12px; font-size: clamp(2.2rem, 6vw, 3.5rem); line-height: 1; }
.channel-access form { display: grid; gap: 10px; margin-top: 28px; }
.channel-access label,.editor-form label,.comment-form label { font-size: .85rem; font-weight: 800; }
.channel-access input,.editor-form input,.editor-form select,.editor-form textarea,.comment-form textarea { width: 100%; min-height: 48px; border: 1px solid var(--line); background: white; padding: 11px 13px; color: var(--ink); font: inherit; }
.comment-list { display: grid; gap: 12px; }
.comment { padding: 18px; border: 1px solid var(--line); background: white; }
.comment-reply { margin-left: 42px; border-left: 5px solid var(--green); }
.comment header { display: flex; justify-content: space-between; gap: 15px; }
.comment time { color: var(--muted); font-size: .78rem; }
.comment p { margin: 10px 0; white-space: pre-wrap; }
.reply-button { border: 0; background: none; color: var(--blue); padding: 0; font-weight: 800; cursor: pointer; }
.comment-form { display: grid; gap: 9px; margin-top: 22px; padding: 22px; border: 1px solid var(--line); background: white; }
.reply-state { padding: 8px 10px; background: #edf5e5; color: #3f7900; font-size: .82rem; font-weight: 800; }
.compact-action { width: auto; min-width: 220px; }
.admin-post-list { display: grid; gap: 12px; margin-top: 28px; }
.admin-post-list > article,.comment-admin-list > article { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px; border: 1px solid var(--line); background: white; }
.admin-post-list h2 { margin: 8px 0 4px; }
.admin-post-list p { margin: 0 0 8px; color: var(--muted); }
.channel-pill { display: inline-block; padding: 5px 8px; background: #eaf8dd; color: #3f7900; font-size: .75rem; font-weight: 800; }
.muted-pill { background: #eef1f6; color: var(--muted); }
.admin-row-actions { display: flex; flex-wrap: wrap; gap: 7px; min-width: 180px; }
.admin-row-actions .action { min-height: 40px; }
.danger-action { border-color: #e9b7b7; color: #9b2929; cursor: pointer; }
.moderation { margin-top: 34px; padding: 24px; border: 1px solid var(--line); background: white; }
.comment-admin-list { display: grid; gap: 10px; }
.comment-admin-list article { background: var(--surface); }
.comment-admin-list small { display: block; color: var(--muted); }
.comment-admin-list p { margin-bottom: 0; }
.editor-form { display: grid; gap: 16px; margin-top: 28px; padding: 26px; border: 1px solid var(--line); background: white; }
.editor-form label { display: grid; gap: 6px; }
.editor-form textarea { resize: vertical; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.check-row { display: flex; flex-wrap: wrap; gap: 22px; }
.check-row label { display: flex; align-items: center; gap: 8px; }
.check-row input { width: auto; min-height: 0; }
.admin-create { margin-bottom: 28px; }
.term-choice { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin: 28px 0 18px; padding: 0; border: 0; }
.term-choice legend { margin-bottom: 10px; font-weight: 800; }
.term-choice label { display: grid; gap: 2px; padding: 14px; border: 1px solid var(--line); background: white; cursor: pointer; }
.term-choice input { width: auto; min-height: 0; }
.term-choice span { color: var(--muted); }
.unread-badge { display: inline-block; padding: 7px 10px; vertical-align: middle; background: var(--green); color: var(--blue); font-size: .78rem; }

@media (max-width: 760px) {
  .shell { padding: 0; }
  .header,.content { padding: 20px; }
  .header { align-items: flex-start; flex-direction: column; }
  .intro,.projects,.code-summary,.channel-entry-grid,.editor-grid,.term-choice { grid-template-columns: 1fr; }
  .intro { padding: 22px 20px; }
  .intro h2 { font-size: clamp(1.9rem, 10vw, 2.5rem); }
  .topline,.code-section-title { align-items: flex-start; flex-direction: column; }
  .owner-nav { align-items: flex-start; flex-direction: column; margin: -20px -20px 24px; padding: 18px 20px; }
  .owner-nav div { width: 100%; overflow-x: auto; }
  .project > p { min-height: 0; }
  .hosting-help { align-items: flex-start; flex-direction: column; }
  .channel-header,.admin-post-list > article,.comment-admin-list > article { align-items: flex-start; flex-direction: column; }
  .channel-header { padding: 24px 20px; }
  .participant { width: 100%; }
  .channel-feed,.discussion-page { padding: 18px; }
  .channel-post { padding: 20px; }
  .discussion-link { margin: 22px -20px -20px; padding: 15px 20px; }
  .post-meta,.comment header { align-items: flex-start; flex-direction: column; gap: 5px; }
  .comment-reply { margin-left: 20px; }
  .compact-action,.admin-row-actions { width: 100%; }
}
