:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  --bg: #f5f5fa;
  --panel: #fff;
  --card: #fff;
  --line: #e1dfea;
  --ink: #231c35;
  --muted: #625b72;
  --accent: #6744bc;
  --accent-soft: #f0eafe;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button, input, select, textarea { border-radius: 9px; }
:is(button, input, select, textarea, a, .board):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.topbar {
  min-height: 66px; padding: 10px max(24px, 4vw); background: var(--panel);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
}
.account { display: flex; gap: 12px; align-items: center; }
.brand { min-width: 0; }
.brand img { display: block; width: clamp(140px, 45vw, 224px); max-width: 100%; height: auto; }
.account { color: var(--muted); font-size: .88rem; }
.account-info { display: grid; gap: 2px; line-height: 1.15; }
.account-info strong { color: var(--ink); max-width: 22ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-info > span { font-size: .75rem; }
.avatar {
  display: inline-grid; place-items: center; width: 33px; height: 33px; flex: 0 0 33px; border-radius: 50%;
  background: var(--accent-soft); color: #523191; font-size: .73rem; font-weight: 750;
}
main { max-width: 1760px; margin: auto; padding: 27px max(24px, 4vw); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.045em; line-height: 1.05; }
h2 { font-size: 1.55rem; letter-spacing: -.025em; overflow-wrap: anywhere; }
h3 { font-size: 1rem; }
.muted, .hint { color: var(--muted); }
.page-heading {
  display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-bottom: 15px; padding: 26px 30px; border-radius: 16px; color: white;
  background: radial-gradient(ellipse at 93% 16%, #6746a1 0, transparent 54%), linear-gradient(120deg, #2d1b45, #49336d);
}
.page-heading p, .login > p { margin-top: 9px; }
.page-heading p { color: #f1e9ff; font-size: .94rem; }
.primary, .secondary {
  padding: 9px 13px; border: 1px solid transparent; font-weight: 650; white-space: nowrap;
  transition: background .16s, border-color .16s, box-shadow .16s;
}
.primary { color: #fff; background: var(--accent); }
.primary:hover { background: #5332a7; }
.page-heading .primary { background: white; color: #402365; }
.page-heading .primary:hover { background: #f0eafe; }
.secondary { color: var(--ink); border-color: var(--line); background: var(--panel); }
.secondary:hover { background: var(--accent-soft); border-color: #cfc0ed; }
.metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  margin-bottom: 26px;
}
.metric {
  --metric: #6843b9; --metric-soft: #eee8fa;
  position: relative; display: grid; gap: 5px; padding: 12px 15px 13px; text-align: left;
  color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .16s, background .16s, transform .16s;
}
.metric[data-filter="open"] { --metric: #27568c; --metric-soft: #eaf3ff; }
.metric[data-filter="verify"] { --metric: #865019; --metric-soft: #fff4e4; }
.metric[data-filter="closed"] { --metric: #257355; --metric-soft: #e6f5ed; }
.metric::after {
  content: ""; position: absolute; right: 15px; top: 16px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--metric); box-shadow: 0 0 0 4px var(--metric-soft);
}
.metric span { padding-right: 17px; font-size: .81rem; font-weight: 650; }
.metric strong { color: var(--metric); font-size: 1.55rem; font-variant-numeric: tabular-nums; line-height: 1.05; }
.metric:hover { transform: translateY(-2px); border-color: var(--metric); }
.metric[aria-pressed="true"] { border-color: var(--metric); background: var(--metric-soft); }
.metric[aria-pressed="true"]::after { box-shadow: 0 0 0 4px #fff; }
.reports-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.reports-heading h2 { font-size: 1.35rem; }
#result-count { font-size: .82rem; margin-top: 4px; }
.view-options { display: flex; gap: 3px; padding: 3px; background: #eae7f2; border-radius: 10px; }
.view-options button {
  padding: 6px 10px; color: #4f4562; border: 1px solid transparent; background: transparent;
  font-size: .82rem; font-weight: 650; white-space: nowrap;
}
.view-options button[aria-pressed="true"] { background: #fff; border-color: #ddd6ea; color: #4f2d8c; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; }
.toolbar :is(select, button) { font-size: .82rem; }
.toolbar select { max-width: 210px; }
.toolbar #refresh { margin-left: auto; }
input, select, textarea {
  background: var(--panel); border: 1px solid var(--line); color: var(--ink); padding: 9px 11px; min-width: 0;
}
input::placeholder, textarea::placeholder { color: #6d647c; }
.search-field { position: relative; width: min(280px, 100%); display: block; font-size: .82rem; }
.search-field > span { position: absolute; left: 11px; top: 50%; transform: translateY(-53%); color: #58427b; font-size: 1.15rem; }
.search-field input { height: 100%; padding-left: 33px; }
textarea { resize: vertical; }
.board {
  display: grid; grid-template-columns: repeat(5, minmax(204px, 1fr)); gap: 11px;
  overflow-x: auto; padding: 3px 3px 14px; scrollbar-color: #b6a8cd transparent;
}
.column {
  --status: #6f6880;
  min-height: 345px; border: 1px solid #e3dfee; background: #efedf5;
  border-radius: 13px; padding: 9px; transition: border-color .16s, background .16s, box-shadow .16s;
}
.column[data-state="todo"], .status-tag[data-state="todo"] { --status: #345e9b; }
.column[data-state="doing"], .status-tag[data-state="doing"] { --status: #7449b8; }
.column[data-state="verify"], .status-tag[data-state="verify"] { --status: #926020; }
.column[data-state="closed"], .status-tag[data-state="closed"] { --status: #287256; }
.is-dragging .column { border-style: dashed; }
.column.drop { border-color: var(--accent); background: #eae0ff; box-shadow: inset 0 0 0 1px var(--accent); }
.column-head { display: flex; align-items: center; gap: 7px; padding: 2px 2px 9px; min-height: 40px; }
.column-head h3 { font-size: .85rem; letter-spacing: 0; }
.dot { background: var(--status); width: 8px; height: 8px; border-radius: 100%; flex: 0 0 8px; }
.count { margin-left: auto; color: var(--muted); font-size: .75rem; font-weight: 650; background: #e4dfed; border-radius: 20px; padding: 2px 7px; }
.column-add { padding: 0 4px 2px; border: 1px solid transparent; background: transparent; color: #523588; font-size: 1rem; }
.column-add:hover { border-color: #d6c8ed; background: #fff; }
.cards { display: grid; gap: 9px; }
.empty { border: 1px dashed #d2c9df; border-radius: 8px; padding: 15px 8px; color: var(--muted); text-align: center; font-size: .82rem; }
.card {
  display: grid; min-width: 0; text-align: left; color: var(--ink); padding: 0; overflow: hidden;
  border: 1px solid var(--line); background: var(--card); width: 100%; overflow-wrap: anywhere;
  box-shadow: 0 1px 3px #2513450b; transition: border-color .16s, box-shadow .16s, transform .16s, opacity .16s;
}
.card:hover { border-color: #ac96d5; box-shadow: 0 4px 12px #311b4c16; transform: translateY(-1px); }
.card[draggable="true"] { cursor: grab; }
.card.dragging { opacity: .43; cursor: grabbing; }
.card.in-motion { position: relative; z-index: 2; }
.card-cover { display: block; overflow: hidden; background: #ded6ea; }
.card img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.card-content { display: grid; gap: 6px; min-width: 0; padding: 10px; }
.card-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-id { color: #665c76; font-size: .72rem; font-weight: 650; }
.card-title { font-weight: 700; font-size: .91rem; line-height: 1.3; }
.card-environment { font-size: .75rem; color: var(--muted); }
.card-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 5px 8px; color: var(--muted); font-size: .72rem; margin-top: 4px; }
.card-person, .card-activity { display: inline-flex; gap: 5px; align-items: center; }
.card-person .avatar { width: 22px; height: 22px; flex-basis: 22px; font-size: .59rem; }
.card-activity { gap: 8px; }
.comment-count { display: inline-flex; align-items: center; gap: 3px; }
.comment-count::before { content: ""; display: inline-block; width: 9px; height: 7px; border: 1px solid currentColor; border-radius: 3px 3px 3px 0; }
.priority, .status-tag { width: max-content; font-size: .69rem; font-weight: 700; border-radius: 20px; padding: 3px 7px; }
.priority { color: #514478; background: #eee9f9; }
.priority[data-level="high"] { color: #824913; background: #fff0da; }
.priority[data-level="critical"] { color: #9e2445; background: #fce6eb; }
.priority[data-level="low"] { color: #24684e; background: #e4f4ed; }
.status-tag { --status: #6f6880; color: var(--status); background: #f1eff6; }
.report-list { display: grid; gap: 7px; }
.report-list .card { display: flex; align-items: center; }
.report-list .card-cover { width: 94px; flex: 0 0 94px; border-radius: 6px; margin-left: 9px; }
.report-list .card-content { width: 100%; }
.report-list .card-meta { margin-top: 0; justify-content: flex-start; gap: 12px; }
.login {
  max-width: 430px; margin: 6vh auto; border: 1px solid var(--line); background: var(--panel);
  padding: 27px; border-radius: 14px; box-shadow: 0 12px 30px #311b4c0d; animation: enter .22s ease-out;
}
form { display: grid; gap: 15px; }
.login form { margin-top: 24px; }
.alternate-auth { width: 100%; margin-top: 12px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .87rem; }
label :is(input, select, textarea) { font-weight: 400; width: 100%; }
.hint { font-size: .78rem; font-weight: 400; }
.error { color: #a42749; font-size: .88rem; }
#notice {
  position: fixed; z-index: 3; bottom: 18px; right: 18px; max-width: min(390px, calc(100% - 36px));
  padding: 11px 15px; border-radius: 9px; background: #38235c; color: #fff;
  box-shadow: 0 6px 20px #24134138; font-size: .86rem; animation: enter .2s ease-out;
}
dialog {
  width: min(680px, calc(100% - 28px)); max-height: calc(100% - 34px); padding: 24px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink);
  box-shadow: 0 18px 65px #28183f55;
}
dialog[open] { animation: enter .21s cubic-bezier(.2,.75,.25,1); }
dialog::backdrop { background: #281a40a0; }
@keyframes enter {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.dialog-heading .close { padding: 1px 9px 4px; font-size: 1.4rem; line-height: 1.2; }
#detail-meta { font-size: .82rem; margin-bottom: 7px; }
.form-row, .workflow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; }
.workflow { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.workflow .actions, .workflow .error { grid-column: 1 / -1; }
.actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.report-info { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.gallery { display: flex; flex-wrap: wrap; gap: 9px; margin: 15px 0; }
.gallery a { width: min(155px, 45%); color: var(--accent); font-size: .8rem; overflow-wrap: anywhere; }
.gallery img { display: block; width: 100%; height: 92px; object-fit: cover; border-radius: 6px; margin-bottom: 4px; }
.discussion, .workflow { margin-top: 21px; padding-top: 17px; border-top: 1px solid var(--line); }
.discussion h3 { margin-bottom: 12px; }
.comment { border-bottom: 1px solid var(--line); padding: 10px 0; }
.comment header { display: flex; flex-wrap: wrap; gap: 7px 12px; align-items: baseline; font-size: .86rem; margin-bottom: 5px; }
#comment-form { margin-top: 15px; }
@media (max-width: 580px) {
  main { padding: 17px 14px; }
  .topbar { gap: 12px; padding: 0 15px; }
  .account { gap: 6px; }
  .account-info strong { max-width: 11ch; }
  .account > .avatar { display: none; }
  .page-heading { padding: 20px; }
  .page-heading p { font-size: .84rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 19px; }
  .metric { padding: 10px; }
  .toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-field { width: 100%; grid-column: 1 / -1; }
  .toolbar #refresh { margin-left: 0; }
  .toolbar select { max-width: none; width: 100%; }
  .board { grid-template-columns: repeat(5, minmax(235px, 72vw)); scroll-snap-type: x proximity; }
  .column { scroll-snap-align: start; min-height: 260px; }
  .form-row, .workflow { grid-template-columns: 1fr; }
  dialog { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
