/* ============================================================
   ConfigCraft Suite — Community & Support
   Apple-inspired design system
   ============================================================ */

:root {
  /* surfaces */
  --bg:        #f5f5f7;
  --bg-soft:   #fbfbfd;
  --surface:   #ffffff;
  --surface-2: #f5f5f7;

  /* ink */
  --ink:    #1d1d1f;
  --ink-2:  #515154;
  --ink-3:  #86868b;
  --ink-4:  #aeaeb2;

  /* lines */
  --line:    rgba(0,0,0,0.08);
  --line-2:  rgba(0,0,0,0.12);

  /* brand / accent (tweakable — soft/ink derive from base) */
  --accent:        var(--dx-global-primary, #0071e3);
  --accent-ink:    color-mix(in srgb, var(--accent), #000 26%);
  --accent-soft:   color-mix(in srgb, var(--accent) 11%, #fff);
  --accent-2:      var(--dx-global-primary, #0071e3);
  --accent-2-soft: color-mix(in srgb, var(--accent-2) 10%, #fff);

  /* status */
  --ok:      #1f8a5b;
  --ok-soft: #e4f3ec;
  --warn:    #9a6b06;
  --warn-soft:#f6efdd;
  --danger:  #c50f40;
  --danger-soft:#fcebf0;

  /* shape (tweakable) */
  --radius:   20px;
  --radius-sm:12px;
  --radius-xs:9px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 0 rgba(0,0,0,.02);
  --shadow:    0 1px 3px rgba(0,0,0,.05), 0 18px 40px -22px rgba(0,0,0,.20);
  --shadow-lg: 0 1px 3px rgba(0,0,0,.05), 0 40px 80px -30px rgba(0,0,0,.28);

  /* density (tweakable) */
  --pad: 22px;
  --gap: 18px;

  --font-display: var(--dx-global-title-font, -apple-system, BlinkMacSystemFont, system-ui, sans-serif);
  --font-ui: var(--dx-global-description-font, -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', system-ui, sans-serif);
}

[data-density="compact"] { --pad: 15px; --gap: 12px; }
[data-radius="sharp"]    { --radius: 8px; --radius-sm: 6px; --radius-xs: 5px; }

* { box-sizing: border-box; }

body.dx-community-support-screen {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app a { color: inherit; text-decoration: none; }
.app button { font-family: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* ---------- typography ---------- */
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; }
.eyebrow {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.muted { color: var(--ink-3); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-ui);
}

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  height: 56px;
  background: rgba(251,251,253,0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto; height: 100%;
  padding: 0 24px;
  display: flex; align-items: center; gap: 26px;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand .mark { width: 26px; height: 26px; display: block; }
.brand .word { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand .word small {
  display: block; font-size: 9px; font-weight: 600; letter-spacing: 0.34em;
  color: var(--accent); margin-top: -3px;
}
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.nav-links a {
  font-size: 13.5px; color: var(--ink-2); padding: 7px 12px; border-radius: var(--radius-pill);
  transition: background .15s;
}
.nav-links a:hover { background: rgba(0,0,0,0.045); color: var(--ink); }
.nav-links a.active { color: var(--accent); font-weight: 600; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nav-icon {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  color: var(--ink-2); cursor: pointer; transition: background .15s;
}
.nav-icon:hover { background: rgba(0,0,0,0.05); }

/* ---------- context sub-bar ---------- */
.subbar {
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.subbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  height: 52px; display: flex; align-items: center; gap: 8px;
}
.subbar .ctx { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-right: 8px; }
.seg {
  display: inline-flex; background: rgba(0,0,0,0.05); border-radius: var(--radius-pill); padding: 3px;
}
.seg button {
  border: none; background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  padding: 6px 15px; border-radius: var(--radius-pill); transition: all .15s;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }

/* ---------- page layout ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 34px 24px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-title { font-family: var(--font-display); font-weight: 700; font-size: 34px; letter-spacing: -0.03em; line-height: 1.05; }
.page-sub { color: var(--ink-3); font-size: 15px; margin-top: 8px; }

.layout { display: grid; grid-template-columns: 1fr 312px; gap: 28px; align-items: start; }
.layout.narrow { grid-template-columns: 1fr 320px; }
@media (max-width: 1000px){ .layout { grid-template-columns: 1fr; } }

/* ============================================================
   PRIMITIVES
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: none; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 600; font-family: var(--font-ui);
  padding: 10px 18px; transition: transform .12s, box-shadow .15s, background .15s, opacity .15s;
}
.btn:active { transform: scale(0.975); }
.btn:disabled { opacity: .62; cursor: wait; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { background: rgba(0,0,0,0.05); color: var(--ink); }
.btn-ghost:hover { background: rgba(0,0,0,0.08); }
.btn-outline { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); }
.btn-outline:hover { border-color: var(--ink-3); }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: var(--radius-xs);
  padding: 4px 9px; cursor: pointer; transition: filter .15s;
  white-space: nowrap;
}
.chip:hover { filter: brightness(0.97); }
.chip.plain { background: rgba(0,0,0,0.05); color: var(--ink-2); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 3px 9px 3px 8px;
  border-radius: var(--radius-pill); white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-ok     { color: var(--ok);     background: var(--ok-soft); }
.badge-warn   { color: var(--warn);   background: var(--warn-soft); }
.badge-danger { color: var(--danger); background: var(--danger-soft); }
.badge-info   { color: var(--accent-ink); background: var(--accent-soft); }
.badge-neutral{ color: var(--ink-2);  background: rgba(0,0,0,0.06); }

.avatar {
  border-radius: 50%; display: grid; place-items: center;
  font-weight: 600; color: #fff; flex: none; font-family: var(--font-ui);
  background: var(--accent); overflow: hidden; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.025);
}
.card-pad { padding: var(--pad); }

.side-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.025);
  padding: 18px 20px; margin-bottom: 20px;
}
.side-card h4 {
  margin: 0 0 14px; font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
}

.searchbar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-pill); padding: 0 16px; height: 42px;
  transition: border-color .15s, box-shadow .15s;
}
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.searchbar input { border: none; outline: none; background: transparent; flex: 1; font-size: 14px; color: var(--ink); }
.searchbar svg { color: var(--ink-3); flex: none; }

.tabs { display: flex; gap: 4px; }
.tabs button {
  border: none; background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  padding: 9px 14px; border-radius: var(--radius-sm); transition: all .15s;
}
.tabs button:hover { background: rgba(0,0,0,0.04); color: var(--ink); }
.tabs button.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

.divider { height: 1px; background: var(--line); border: none; margin: 0; }

.cs-notice {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.55;
}

.cs-notice-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.cs-notice-info {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* stat pills */
.statrow { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 24px; }
.stat {
  background: var(--surface); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.025);
}
.stat .n { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -0.02em; }
.stat .l { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.stat .n .unit { font-size: 14px; color: var(--ink-3); margin-left: 4px; font-weight: 500; }

/* ============================================================
   FORUM
   ============================================================ */
.q-list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.025); overflow: hidden; }
.q-list-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--pad); border-bottom: 1px solid var(--line);
}
.q-list-head .count { font-family: var(--font-display); font-weight: 700; font-size: 17px; }

.q-row {
  display: grid; grid-template-columns: 96px 1fr; gap: 18px;
  padding: var(--pad); border-bottom: 1px solid var(--line); cursor: pointer;
  transition: background .14s;
}
.q-row:last-child { border-bottom: none; }
.q-row:hover { background: var(--surface-2); }
.q-stats { display: flex; flex-direction: column; gap: 7px; align-items: flex-end; padding-top: 2px; }
.q-stat { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.q-stat .v { font-weight: 700; font-family: var(--font-display); font-size: 15px; min-width: 26px; text-align: right; }
.q-stat.answered { color: var(--ok); }
.q-stat.accepted .box {
  display: inline-grid; place-items: center; width: 22px; height: 22px;
  border-radius: 6px; background: var(--ok); color: #fff;
}
.q-stat .box { width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 6px; border: 1px solid var(--line-2); color: var(--ink-2); font-weight: 700; font-size: 12px; }
.q-stat .lbl { color: var(--ink-3); font-weight: 500; }

.q-main .q-title { font-size: 17px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; line-height: 1.3; }
.q-row:hover .q-title { color: var(--accent-ink); }
.q-excerpt { font-size: 13.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.q-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; gap: 12px; flex-wrap: wrap; }
.q-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.q-author { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.q-author b { color: var(--accent-ink); font-weight: 600; }

/* question detail */
.qd-head { margin-bottom: 18px; }
.qd-title { font-family: var(--font-display); font-weight: 700; font-size: 27px; letter-spacing: -0.025em; line-height: 1.2; }
.qd-meta { display: flex; gap: 18px; margin-top: 12px; font-size: 13px; color: var(--ink-3); }
.qd-meta b { color: var(--ink-2); font-weight: 600; }

.post { display: grid; grid-template-columns: 52px 1fr; gap: 18px; padding: var(--pad) 0; }
.votes { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vbtn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-2); cursor: pointer; display: grid; place-items: center;
  transition: all .14s;
}
.vbtn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.vbtn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.vcount { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.vstar { color: var(--ink-4); cursor: pointer; }
.vstar.on { color: #e0a300; }

.post-body { font-size: 15px; line-height: 1.7; color: var(--ink); }
.post-body p { margin: 0 0 14px; }
.post-body code, .inline-code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px;
}
.codeblock {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; line-height: 1.6;
  background: #1d1d1f; color: #f5f5f7; border-radius: var(--radius-sm); padding: 16px 18px;
  margin: 14px 0; overflow-x: auto; white-space: pre;
}
.codeblock .c-key { color: #8e96ff; }
.codeblock .c-str { color: #7ee2a8; }
.codeblock .c-com { color: #86868b; }

.post-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; gap: 16px; flex-wrap: wrap; }
.post-actions { display: flex; gap: 14px; font-size: 13px; color: var(--ink-3); }
.post-actions span { cursor: pointer; }
.post-actions span:hover { color: var(--accent); }
.author-card {
  background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 12px;
  display: flex; align-items: center; gap: 10px; min-width: 210px;
}
.author-card .meta { font-size: 12px; color: var(--ink-3); }
.author-card .meta b { display: block; color: var(--accent-ink); font-size: 13.5px; font-weight: 600; margin-bottom: 1px; }
.author-card.staff { background: var(--surface-2); }
.author-card.staff .meta b { color: var(--ink); }

.comments { margin: 6px 0 0 70px; border-top: 1px solid var(--line); }
.comment { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.comment .cv { color: var(--ink-4); font-weight: 600; min-width: 18px; }
.comment a { color: var(--accent-ink); font-weight: 600; }
.comment .ct { color: var(--ink-4); }

.answers-head { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 6px; }
.answers-head h3 { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; margin: 0; }
.accepted-flag { display: inline-flex; align-items: center; gap: 7px; color: var(--ok); font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.post.accepted { background: linear-gradient(0deg, var(--ok-soft), transparent 60%); border-radius: var(--radius); padding-left: 16px; padding-right: 16px; }

.answer-editor textarea, .form-field textarea, .form-field input, .form-field select {
  width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); padding: 13px 15px; font-size: 14.5px; font-family: var(--font-ui); color: var(--ink);
  resize: vertical; outline: none; transition: border-color .15s, box-shadow .15s;
}
.answer-editor textarea:focus, .form-field textarea:focus, .form-field input:focus, .form-field select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}

/* tag list sidebar */
.taggrid { display: flex; flex-wrap: wrap; gap: 8px; }
.tagstat { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.tagstat:last-child { border-bottom: none; }
.tagstat .n { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.userline { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.userline .meta { font-size: 13px; }
.userline .meta b { display: block; font-weight: 600; }
.userline .meta span { color: var(--ink-3); font-size: 12px; }
.userline .rep { margin-left: auto; font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--accent-ink); }

/* ============================================================
   TICKETING
   ============================================================ */
.t-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.t-toolbar .searchbar { flex: 1; max-width: 360px; }

.t-table { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.025); overflow: hidden; }
.t-head, .t-row { display: grid; align-items: center; gap: 16px; padding: 14px var(--pad); }
.t-row { border-top: 1px solid var(--line); cursor: pointer; transition: background .14s; }
.t-row:hover { background: var(--surface-2); }
.t-head { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-4); }

/* customer my-tickets columns */
.cols-mine { grid-template-columns: 64px 1fr 130px 110px 150px; }
/* agent queue columns */
.cols-agent { grid-template-columns: 64px 1fr 120px 110px 130px 150px; }

.t-id { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--ink-3); }
.t-subject { font-weight: 600; font-size: 14.5px; color: var(--ink); letter-spacing: -0.01em; }
.t-row:hover .t-subject { color: var(--accent-ink); }
.t-sub-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; display: flex; gap: 8px; align-items: center; }
.t-cell-muted { font-size: 13px; color: var(--ink-3); }
.t-assignee { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); }

.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.prio .bar { width: 4px; height: 13px; border-radius: 2px; }
.prio.urgent { color: var(--danger); } .prio.urgent .bar { background: var(--danger); }
.prio.high   { color: #b5520a; } .prio.high .bar { background: #d9730d; }
.prio.normal { color: var(--ink-2); } .prio.normal .bar { background: var(--ink-4); }
.prio.low    { color: var(--ink-3); } .prio.low .bar { background: var(--line-2); }

/* ticket detail */
.td-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
@media (max-width: 1000px){ .td-layout { grid-template-columns: 1fr; } }
.td-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.td-title { font-family: var(--font-display); font-weight: 700; font-size: 25px; letter-spacing: -0.025em; line-height: 1.2; }
.td-id { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; font-weight: 600; }

.thread { display: flex; flex-direction: column; gap: 18px; }
.msg { display: grid; grid-template-columns: 44px 1fr; gap: 14px; }
.msg-bubble { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.025); padding: 16px 18px; }
.msg-bubble .who { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.msg-bubble .who b { font-size: 14px; font-weight: 600; }
.msg-bubble .who .time { margin-left: auto; font-size: 12px; color: var(--ink-4); }
.msg-bubble .body { font-size: 14.5px; line-height: 1.65; color: var(--ink); }
.msg.agent .msg-bubble { background: var(--accent-soft); border-color: transparent; }
.msg.agent .avatar { background: var(--accent); }
.msg.note .msg-bubble { background: var(--warn-soft); border-color: transparent; }
.role-tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--accent); color: #fff; }
.role-tag.note { background: var(--warn); }

.reply-box { margin-top: 8px; }
.reply-box .reply-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.reply-box .reply-tabs button { border: none; background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: var(--radius-pill); color: var(--ink-3); }
.reply-box .reply-tabs button.on { background: var(--ink); color: #fff; }
.reply-box .reply-tabs button.on.note { background: var(--warn); }
.reply-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }

/* properties sidebar */
.props .prop { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.props .prop:last-child { border-bottom: none; }
.props .prop .k { color: var(--ink-3); }
.props .prop .v { font-weight: 600; display: flex; align-items: center; gap: 8px; }

.timeline { position: relative; padding-left: 8px; }
.tl-item { display: grid; grid-template-columns: 16px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.tl-item:not(:last-child)::before { content:''; position: absolute; left: 7px; top: 16px; bottom: -2px; width: 2px; background: var(--line); }
.tl-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); margin-top: 2px; z-index: 1; }
.tl-dot.muted { border-color: var(--ink-4); }
.tl-body { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.tl-body b { font-weight: 600; }
.tl-body .t { display: block; color: var(--ink-4); font-size: 11.5px; margin-top: 2px; }

/* forms */
.form-grid { display: grid; gap: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--ink-2); }
.form-field .hint { font-size: 12px; color: var(--ink-4); margin-top: 6px; }
.dropzone {
  border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); padding: 26px; text-align: center;
  color: var(--ink-3); font-size: 13px; background: var(--bg-soft); cursor: pointer; transition: border-color .15s;
}
.dropzone:hover { border-color: var(--accent); color: var(--accent); }

.seg-pick { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.seg-pick .opt {
  border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--radius-pill);
  padding: 9px 16px; font-size: 13.5px; font-weight: 500; cursor: pointer; color: var(--ink-2); transition: all .15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.seg-pick .opt.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

/* empty placeholder image */
.ph {
  background-image: repeating-linear-gradient(45deg, rgba(0,0,0,0.035) 0 10px, transparent 10px 20px);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  display: grid; place-items: center; color: var(--ink-4);
  font-family: ui-monospace, monospace; font-size: 12px;
}

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--ink-4); }

.fade-in { animation: fadeIn .4s cubic-bezier(.2,.7,.2,1) both; }
@keyframes fadeIn { from { transform: translateY(8px); } to { transform: none; } }

/* ConfigCraft storefront alignment */
.community-hero {
  position: relative;
  overflow: hidden;
  align-items: center;
  padding: clamp(28px, 5vw, 54px);
  margin-bottom: 30px;
  border: 1px solid rgba(0, 113, 227, .12);
  border-radius: 30px;
  background:
    radial-gradient(circle at 86% 14%, rgba(0, 113, 227, .16), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(245, 249, 255, .94));
  box-shadow: 0 24px 70px -48px rgba(0, 79, 158, .58);
}
.community-hero::after {
  content: '';
  position: absolute;
  right: -42px;
  bottom: -82px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(0, 113, 227, .12);
  pointer-events: none;
}
.community-hero > * { position: relative; z-index: 1; }
.community-hero .page-title {
  max-width: 720px;
  font-size: clamp(36px, 5vw, 58px);
  letter-spacing: -.045em;
}
.community-hero .page-sub {
  max-width: 700px;
  color: var(--ink-2);
  font-size: clamp(15px, 1.7vw, 18px);
  line-height: 1.55;
}
.community-hero .btn { flex: none; }
.forum-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 18px;
}
.forum-tools .searchbar {
  height: 54px;
  border-color: rgba(0, 0, 0, .1);
  border-radius: 16px;
  box-shadow: 0 12px 34px -28px rgba(0, 0, 0, .35);
}
.forum-tools .searchbar input { min-width: 0; font-size: 15px; }
.topic-filter {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 54px;
  padding: 0 40px 0 16px;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 34px -28px rgba(0, 0, 0, .35);
}
.topic-filter::after {
  content: '';
  position: absolute;
  right: 17px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--ink-2);
  border-bottom: 1.5px solid var(--ink-2);
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}
.filter-label {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.topic-select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent;
  color: var(--ink);
  font: 600 14px/1 var(--font-ui);
  cursor: pointer;
}
.topic-filter:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.q-list,
.side-card {
  border-color: rgba(0, 0, 0, .06);
  box-shadow: 0 20px 54px -42px rgba(0, 0, 0, .42);
}
.q-row:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: -3px;
}
.tagstat-button {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font: 500 13.5px/1.35 var(--font-ui);
  text-align: left;
  cursor: pointer;
}
.tagstat-button:hover,
.tagstat-button.on {
  color: var(--accent-ink);
  background: var(--accent-soft);
  margin-inline: -10px;
  width: calc(100% + 20px);
  padding-inline: 10px;
  border-radius: 10px;
}
.tagstat-button.on { font-weight: 700; }

@media (max-width: 1000px) {
  .layout > aside {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .layout > aside .side-card { margin-bottom: 0; }
}

@media (max-width: 720px) {
  .page { padding: 22px 16px 64px; }
  .community-hero { align-items: flex-start; flex-direction: column; padding: 28px 22px; border-radius: 24px; }
  .community-hero .btn { width: 100%; justify-content: center; }
  .forum-tools { grid-template-columns: 1fr; }
  .topic-filter { width: 100%; }
  .q-list-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .tabs { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .tabs button { flex: none; }
  .q-row { grid-template-columns: 1fr; gap: 14px; }
  .q-stats { flex-direction: row; align-items: center; justify-content: flex-start; order: 2; }
  .q-stat .v { min-width: auto; }
  .q-main { order: 1; }
  .q-foot { align-items: flex-start; flex-direction: column; }
  .layout > aside { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .post { grid-template-columns: 42px 1fr; gap: 12px; }
  .comments { margin-left: 54px; }
}
.legal-notice {
  margin: 4px 0 0;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.55;
}
.legal-notice a {
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
