/* ダッシュボード用。Unfold のビルド済みCSSに無いクラスを当てにせず、
   レイアウトと装飾はここで完結させる。ダークは html.dark で切り替わる。 */

:root {
    --hd-accent: oklch(73.5% 0.165 65);
    --hd-accent-dim: oklch(55.5% 0.130 55);
    --hd-muted: oklch(55.1% 0.024 75);
    --hd-line: oklch(92.8% 0.008 75);
    --hd-warn: oklch(62% 0.19 30);
}

.dark {
    --hd-muted: oklch(70.2% 0.020 75);
    --hd-line: oklch(27.7% 0.015 75);
}

.hd-dash {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.hd-cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .hd-cols {
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    }
}

.hd-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

/* --- 見出しと道具（今朝の獲物） -------------------------------------- */

.hd-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.hd-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
}

.hd-page-sub {
    font-size: 0.8125rem;
    color: var(--hd-muted);
    margin: 0.25rem 0 0;
}

.hd-page-tools {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.hd-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
    height: 2.375rem;
    min-width: 16rem;
    border-radius: 8px;
    border: 1px solid var(--hd-line);
    background: var(--color-base-900, #181614);
    color: var(--hd-muted);
}

.hd-search .material-symbols-outlined {
    font-size: 1.125rem;
}

.hd-search input {
    flex: 1 1 auto;
    background: transparent;
    border: 0;
    outline: none;
    font-size: 0.8125rem;
    color: inherit;
    min-width: 0;
}

.hd-search input::placeholder {
    color: var(--hd-muted);
    opacity: 0.8;
}

.hd-btn.is-go {
    height: 2.375rem;
    padding: 0 1rem;
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: var(--color-base-900, #181614);
}

.hd-btn.is-go:hover {
    background: var(--hd-accent);
    border-color: var(--hd-accent);
    color: #2a1a06;
}

/* --- 実行中パネル（Let's go baby!! の後。static/js/run-status.js） ---- */

.hd-run {
    margin: 0 0 1.25rem;
    padding: 0.875rem 1.125rem;
    border-radius: 12px;
    border: 1px solid color-mix(in oklch, var(--hd-accent) 45%, transparent);
    background: color-mix(in oklch, var(--hd-accent) 8%, transparent);
}

.hd-run.is-ok {
    border-color: color-mix(in oklch, oklch(72% 0.17 150) 50%, transparent);
    background: color-mix(in oklch, oklch(72% 0.17 150) 8%, transparent);
}

.hd-run.is-ng {
    border-color: color-mix(in oklch, oklch(62% 0.2 25) 50%, transparent);
    background: color-mix(in oklch, oklch(62% 0.2 25) 8%, transparent);
}

.hd-run-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.hd-run-log {
    color: var(--hd-accent);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}

.hd-run-bar {
    height: 6px;
    margin: 0.625rem 0 0.5rem;
    border-radius: 999px;
    background: color-mix(in oklch, var(--hd-line) 70%, transparent);
    overflow: hidden;
}

.hd-run-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--hd-accent);
    transition: width 0.4s ease;
}

.hd-run.is-ok .hd-run-fill {
    background: oklch(72% 0.17 150);
}

.hd-run-stages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0;
    font-size: 0.75rem;
    color: var(--hd-muted);
}

.hd-run-stages .is-done {
    color: var(--hd-accent);
}

.hd-run-stages .is-now {
    color: var(--color-font-important-dark, #fff);
    font-weight: 600;
}

.hd-run-stages .is-now::after {
    content: '…';
}

.hd-run-note {
    margin: 0.375rem 0 0;
    font-size: 0.8125rem;
    color: var(--hd-muted);
}

/* --- KPI ------------------------------------------------------------- */

a.hd-kpi {
    display: block;
    position: relative;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s;
}

a.hd-kpi:hover {
    border-color: color-mix(in oklch, var(--hd-accent) 60%, var(--hd-line));
}

.hd-kpi.is-alert::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--hd-accent), transparent);
}

.hd-kpi-code {
    color: var(--hd-accent);
}

.hd-kpi-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--hd-muted);
    margin: 0 0 0.5rem;
}

.hd-kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    margin: 0;
}

.hd-kpi-value a {
    color: inherit;
    text-decoration: none;
}

.hd-kpi-value a:hover {
    color: var(--hd-accent);
}

.hd-kpi-sub {
    font-size: 0.75rem;
    color: var(--hd-muted);
    margin: 0.5rem 0 0;
}

.hd-kpi-sub.is-alert {
    color: var(--hd-warn);
    font-weight: 600;
}

.hd-accent-top::before {
    content: '';
    position: absolute;
    inset: -1.5rem -1.5rem auto;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--hd-accent), transparent);
    opacity: 0.75;
}

/* --- 案件のフィード（今朝の新着・締切が近い） ------------------------- */

.hd-card-sub {
    font-size: 0.75rem;
    color: var(--hd-muted);
    margin: -0.5rem 0 1rem;
}

.hd-feed {
    display: flex;
    flex-direction: column;
}

.hd-feed-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--hd-line);
}

.hd-feed-row:first-child {
    border-top: 0;
    padding-top: 0.25rem;
}

.hd-feed-main {
    flex: 1 1 auto;
    min-width: 0;
}

.hd-feed-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hd-feed-title a {
    color: inherit;
    text-decoration: none;
}

.hd-feed-title a:hover {
    color: var(--hd-accent);
}

.hd-feed-sub {
    font-size: 0.6875rem;
    color: var(--hd-muted);
    margin: 0.125rem 0 0;
}

.hd-feed-fit,
.hd-feed-pill,
.hd-feed-date {
    flex: 0 0 auto;
}

.hd-feed-right {
    flex: 0 0 auto;
    text-align: right;
    font-size: 0.8125rem;
}

.hd-feed-right small {
    display: block;
    font-size: 0.625rem;
    color: var(--hd-muted);
}

.hd-feed-budget {
    flex: 0 0 5.5rem;
    text-align: right;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
    color: var(--hd-muted);
}

.hd-feed.is-compact .hd-feed-row {
    gap: 0.75rem;
}

.hd-feed.is-compact .hd-feed-date {
    min-width: 3.5rem;
}

.hd-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.875rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--hd-line);
    font-size: 0.75rem;
}

.hd-card-foot a {
    color: var(--hd-accent);
    text-decoration: none;
    font-weight: 600;
}

.hd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0.25rem 0 0.25rem;
}

.hd-tag {
    font-size: 0.6875rem;
    padding: 0.2rem 0.625rem;
    border-radius: 999px;
    border: 1px solid var(--hd-line);
    color: var(--hd-muted);
}

/* --- 傾向プロファイル（templates/hound/profile.html） ------------------ */

.hd-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem;
    border-radius: 12px;
    border: 1px solid var(--hd-line);
    background: var(--color-base-900, #181614);
}

.hd-tab {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    color: var(--hd-muted);
    text-decoration: none;
    min-width: 8rem;
}

.hd-tab:hover {
    color: inherit;
}

.hd-tab.is-active {
    background: color-mix(in oklch, var(--hd-accent) 18%, transparent);
    color: var(--hd-accent);
}

.hd-tab-title {
    font-size: 0.8125rem;
    font-weight: 600;
}

.hd-tab-sub {
    font-size: 0.6875rem;
    opacity: 0.85;
}

.hd-tabs-note {
    margin: 0 0.5rem 0 auto;
    font-size: 0.6875rem;
    color: var(--hd-muted);
}

.hd-grid-5 {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.hd-tend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.hd-tend li {
    position: relative;
    padding-left: 1.125rem;
}

.hd-tend li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--hd-accent);
}

.hd-tend li.is-avoid::before {
    background: var(--hd-muted);
}

.hd-tend-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
}

.hd-tend-detail {
    font-size: 0.75rem;
    color: var(--hd-muted);
    line-height: 1.7;
    margin: 0.125rem 0 0;
}

.hd-gap {
    padding: 0.75rem 0;
    border-top: 1px solid var(--hd-line);
}

.hd-gap:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.hd-gap-title {
    font-size: 0.8125rem;
    font-weight: 500;
    margin: 0 0 0.25rem;
}

.hd-gap-title a {
    color: inherit;
    text-decoration: none;
}

.hd-gap-title a:hover {
    color: var(--hd-accent);
}

.hd-gap-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    margin: 0;
}

.hd-gap-who {
    font-size: 0.6875rem;
    color: var(--hd-muted);
}

.hd-gap-note {
    font-size: 0.75rem;
    color: var(--hd-accent);
    margin: 0.25rem 0 0;
}

.hd-example {
    padding: 0.75rem 0.875rem;
    border-radius: 8px;
    background: var(--color-base-950, #0f0e0c);
    border: 1px solid var(--hd-line);
    margin-bottom: 0.625rem;
}

.hd-example:last-child {
    margin-bottom: 0;
}

.hd-example-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.375rem;
}

.hd-example-title {
    font-size: 0.8125rem;
    font-weight: 500;
    margin: 0;
}

.hd-example-title a {
    color: inherit;
    text-decoration: none;
}

.hd-example-title a:hover {
    color: var(--hd-accent);
}

.hd-example-note {
    font-size: 0.6875rem;
    color: var(--hd-muted);
    margin: 0.25rem 0 0;
}

.hd-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- 状態チェック ----------------------------------------------------- */

.hd-progress {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.hd-progress-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.hd-progress-total {
    font-size: 0.875rem;
    color: var(--hd-muted);
}

.hd-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--hd-line);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.hd-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--hd-accent-dim), var(--hd-accent));
    transition: width 0.4s ease;
}

.hd-check {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--hd-line);
}

.hd-check:first-of-type {
    border-top: 0;
}

.hd-check-mark {
    flex: 0 0 auto;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 1.5px solid var(--hd-line);
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    line-height: 1;
    margin-top: 0.1rem;
}

.hd-check.is-done .hd-check-mark {
    background: var(--hd-accent);
    border-color: var(--hd-accent);
    color: #2a1a06;
    font-weight: 700;
}

.hd-check-body {
    min-width: 0;
}

.hd-check-label {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

.hd-check.is-done .hd-check-label {
    color: var(--hd-muted);
}

.hd-check-note {
    font-size: 0.75rem;
    color: var(--hd-muted);
    margin: 0.125rem 0 0;
}

/* --- テーブル --------------------------------------------------------- */

.hd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.hd-table th {
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hd-muted);
    padding: 0 0.75rem 0.625rem 0;
}

.hd-table td {
    padding: 0.625rem 0.75rem 0.625rem 0;
    border-top: 1px solid var(--hd-line);
    vertical-align: top;
}

.hd-table a {
    color: inherit;
}

.hd-table a:hover {
    color: var(--hd-accent);
}

.hd-nowrap {
    white-space: nowrap;
}

.hd-muted {
    color: var(--hd-muted);
    font-size: 0.75rem;
}

.hd-empty {
    font-size: 0.8125rem;
    color: var(--hd-muted);
    padding: 0.5rem 0;
    margin: 0;
}

.hd-note {
    font-size: 0.75rem;
    color: var(--hd-muted);
    line-height: 1.7;
    margin: 0;
}

.hd-note code {
    font-size: 0.6875rem;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    background: var(--hd-line);
}

.hd-steps {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.8125rem;
    line-height: 1.9;
}

/* --- ☆（狙いたい度・AI 適合度）。部品は static/js/cases.js ------------- */

.hd-stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    white-space: nowrap;
    line-height: 1;
}

.hd-star {
    font-size: 0.9375rem;
    color: var(--hd-line);
    background: none;
    border: 0;
    padding: 0 1px;
    line-height: 1;
    cursor: default;
}

.hd-star.is-on {
    color: var(--hd-accent);
}

.hd-stars.is-input .hd-star {
    cursor: pointer;
    transition: color 0.1s, transform 0.1s;
}

.hd-stars.is-input .hd-star.is-hover {
    color: color-mix(in oklch, var(--hd-accent) 70%, var(--hd-line));
    transform: scale(1.15);
}

.hd-stars.is-busy {
    opacity: 0.5;
}

.hd-stars.is-estimated .hd-star.is-on {
    color: color-mix(in oklch, var(--hd-accent) 55%, var(--hd-line));
}

.hd-stars-label {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    color: var(--hd-accent);
    font-weight: 600;
}

.hd-stars-none {
    font-size: 0.75rem;
    color: var(--hd-muted);
}

/* --- ピル（区分・状態）。色は Figma の Badge: BPO 琥珀 / Web 緑 / システム 青 / 対象外 灰 --- */

.hd-pill {
    display: inline-block;
    padding: 0.1875rem 0.625rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    background: var(--hd-line);
    color: var(--hd-muted);
}

.hd-pill.is-amber {
    background: color-mix(in oklch, var(--hd-accent) 22%, transparent);
    color: var(--hd-accent);
}

.hd-pill.is-green {
    background: oklch(75% 0.15 155 / 0.2);
    color: oklch(80% 0.15 155);
}

.hd-pill.is-blue {
    background: oklch(72% 0.14 245 / 0.2);
    color: oklch(80% 0.12 245);
}

.hd-pill.is-red {
    background: oklch(65% 0.19 25 / 0.2);
    color: oklch(78% 0.15 25);
}

.hd-pill.is-gray {
    background: color-mix(in oklch, var(--hd-muted) 22%, transparent);
    color: var(--hd-muted);
}

/* --- 一覧（案件）。unfold の changelist の上に置く見出しと列の調整 ----- */

.hd-list-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1.25rem;
}

.hd-list-title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
}

.hd-list-sub {
    font-size: 0.8125rem;
    color: var(--hd-muted);
    margin: 0.25rem 0 0;
}

.hd-list-tools {
    display: flex;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.hd-deadline {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hd-deadline.is-soon {
    color: var(--hd-accent);
    font-weight: 600;
}

.hd-deadline.is-past {
    opacity: 0.45;
}

.hd-deadline small {
    display: block;
    font-size: 0.6875rem;
    color: var(--hd-muted);
    font-weight: 400;
}

.hd-cell-title {
    display: block;
    font-weight: 500;
    line-height: 1.4;
    max-width: 34rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hd-cell-title a {
    color: inherit;
}

.hd-cell-title a:hover {
    color: var(--hd-accent);
}

.hd-cell-sub {
    display: block;
    font-size: 0.6875rem;
    color: var(--hd-muted);
    margin-top: 0.125rem;
}

/* 横並びフィルタを Figma 02 のチップの幅に（unfold は min-w 260px）。
   セレクト（select2）の幅は選択肢の一番長い文字に合わせて cases.js が付ける。
   ここは JS が動く前・動かないときの最低幅だけ */
.change-list form[oninput] .form-field {
    min-width: 0 !important;
}

.change-list form[oninput] .form-field .select2 {
    min-width: 6rem;
}

/* 一覧の行を Figma 02 の密度に */
.change-list #result_list td {
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
    font-size: 0.8125rem;
}

.change-list #result_list th {
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hd-muted);
}

/* --- 詳細（案件）。templates/admin/hound/case/change_form.html ---------- */

.hd-card {
    background: var(--color-base-900, #181614);
    border: 1px solid var(--hd-line);
    border-radius: 12px;
    padding: 1.25rem 1.375rem;
}

.hd-card-title {
    font-size: 0.875rem;
    font-weight: 700;
    margin: 0 0 0.875rem;
}

.hd-detail-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.8125rem;
    margin-bottom: 1.25rem;
}

.hd-detail-nav a {
    color: var(--hd-muted);
    text-decoration: none;
}

.hd-detail-nav a:hover {
    color: var(--hd-accent);
}

.hd-detail-pager {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.hd-detail-pager .is-off {
    opacity: 0.35;
}

.hd-detail-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    font-size: 0.75rem;
    margin-bottom: 0.625rem;
}

.hd-detail-title {
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin: 0 0 0.375rem;
}

.hd-detail-meta {
    font-size: 0.8125rem;
    color: var(--hd-muted);
    margin: 0 0 1.5rem;
}

.hd-detail-meta a {
    color: inherit;
}

.hd-detail-cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
}

@media (min-width: 1100px) {
    .hd-detail-cols {
        grid-template-columns: minmax(0, 1fr) 340px;
    }
}

.hd-detail-main,
.hd-detail-side {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.hd-lead {
    font-size: 0.875rem;
    line-height: 1.8;
    margin: 0 0 1rem;
}

.hd-kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem 1rem;
    margin: 0 0 1rem;
}

.hd-kv-grid dt,
.hd-kv dt,
.hd-kv-rows dt,
.hd-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--hd-muted);
    margin-bottom: 0.25rem;
}

.hd-kv-grid dd,
.hd-kv dd {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.hd-kv-grid dd.is-accent {
    color: var(--hd-accent);
    font-weight: 600;
}

.hd-kv {
    margin: 0 0 0.875rem;
}

.hd-kv-rows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
}

.hd-kv-rows > div {
    display: grid;
    grid-template-columns: 5rem 1fr;
    gap: 0.5rem;
    align-items: baseline;
    font-size: 0.8125rem;
}

.hd-kv-rows dt {
    margin: 0;
}

.hd-kv-rows dd {
    margin: 0;
}

.hd-reason {
    font-size: 0.75rem;
    color: var(--hd-muted);
    line-height: 1.7;
    margin: 0;
}

.hd-bullets {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.875rem;
    line-height: 1.9;
}

.hd-bullets li::marker {
    color: var(--hd-accent);
}

.hd-att {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-top: 1px solid var(--hd-line);
}

.hd-att:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.hd-att-body {
    flex: 1 1 auto;
    min-width: 0;
}

.hd-att-name {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hd-att-name a {
    color: inherit;
    text-decoration: none;
}

.hd-att-name a:hover {
    color: var(--hd-accent);
}

.hd-att-sub {
    font-size: 0.6875rem;
    color: var(--hd-muted);
    margin: 0.125rem 0 0;
}

.hd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.4rem 0.875rem;
    border-radius: 8px;
    border: 1px solid var(--hd-line);
    font-size: 0.75rem;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
}

.hd-btn:hover {
    border-color: var(--hd-accent);
    color: var(--hd-accent);
}

.hd-btn.is-ghost {
    border-color: transparent;
    color: var(--hd-muted);
}

.hd-btn.is-off {
    opacity: 0.35;
    cursor: not-allowed;
}

.hd-btn.is-primary {
    background: var(--hd-accent);
    border-color: var(--hd-accent);
    color: #2a1a06;
    padding: 0.5rem 1.25rem;
}

.hd-btn.is-primary:hover {
    background: color-mix(in oklch, var(--hd-accent) 85%, white);
    color: #2a1a06;
}

.hd-desc {
    font-size: 0.8125rem;
    line-height: 1.8;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    background: var(--color-base-950, #0f0e0c);
    border: 1px solid var(--hd-line);
    white-space: pre-wrap;
    word-break: break-word;
}

.hd-desc.is-collapsed {
    max-height: 16rem;
    overflow: hidden;
    position: relative;
}

.hd-desc.is-collapsed::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4rem;
    background: linear-gradient(transparent, var(--color-base-950, #0f0e0c));
}

.hd-link-button {
    margin-top: 0.625rem;
    font-size: 0.75rem;
    color: var(--hd-accent);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

/* 判断 */

.hd-judge .hd-field {
    margin-bottom: 1rem;
}

.hd-hint {
    font-size: 0.6875rem;
    color: var(--hd-muted);
    margin: 0.375rem 0 0.5rem;
}

.hd-input {
    width: 100%;
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--hd-line);
    background: var(--color-base-950, #0f0e0c);
    color: inherit;
}

.hd-input::placeholder {
    color: var(--hd-muted);
    opacity: 0.7;
}

.hd-input:focus {
    outline: none;
    border-color: var(--hd-accent);
}

/* セグメント（radio を隠してボタンに）。unfold の RadioSelect は <div><label><input>…</label></div> */
.hd-segment > div,
.hd-segment > ul {
    display: inline-flex;
    flex-direction: row !important; /* unfold の RadioSelect は flex-col */
    flex-wrap: wrap;
    gap: 2px;
    padding: 2px;
    border-radius: 8px;
    background: var(--color-base-950, #0f0e0c);
    border: 1px solid var(--hd-line);
    margin: 0;
}

.hd-segment label {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hd-muted);
    cursor: pointer;
    white-space: nowrap;
}

.hd-segment label:hover {
    color: inherit;
}

.hd-segment label:has(input:checked) {
    background: color-mix(in oklch, var(--hd-accent) 22%, transparent);
    color: var(--hd-accent);
}

.hd-segment input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.hd-judge-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--hd-line);
    font-size: 0.6875rem;
}

/* 履歴 */

.hd-timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 1rem;
    border-left: 1px solid var(--hd-line);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hd-timeline li {
    position: relative;
    font-size: 0.75rem;
    line-height: 1.5;
}

.hd-timeline li::before {
    content: '';
    position: absolute;
    left: calc(-1rem - 4.5px);
    top: 0.35rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hd-line);
}

.hd-timeline li.is-amber::before {
    background: var(--hd-accent);
}

.hd-timeline p {
    margin: 0;
}

.hd-timeline time {
    color: var(--hd-muted);
    font-size: 0.6875rem;
}

/* --- ロゴ区画（unfold の site_branding.html を上書き） ----------------- */

.hd-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.hd-logo-mark {
    flex: 0 0 auto;
}

.hd-logo-chev {
    fill: currentColor;
}

.hd-logo-dia {
    fill: var(--hd-accent);
}

/* ワードマークは Montserrat（Figma Logo/nav・Logo/stacked）。読み込みは UNFOLD['STYLES'] */
.hd-logo-word,
.hd-login-funa2,
.hd-login-hound {
    font-family: 'Montserrat', 'Inter', sans-serif;
}

.hd-logo-word {
    display: inline-flex;
    align-items: baseline;
    gap: 0.375rem;
    white-space: nowrap;
}

.hd-logo-funa2 {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--hd-muted);
}

/* Figma Logo/nav: Montserrat Bold 19px, letter-spacing 6% */
.hd-logo-hound {
    font-size: 1.1875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

/* --- ログイン画面（templates/admin/login.html） ------------------------- */

/* 黒ベース。Figma の bg/canvas（base-950）に合わせ、右下に funa2 マークのウォーターマーク */
.login #page {
    background: var(--color-base-950, #0f0e0c);
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(180deg, color-mix(in oklch, var(--hd-accent) 9%, transparent), transparent 46%);
}

.login #page::before {
    content: '';
    position: fixed;
    right: -160px;
    bottom: -150px;
    width: 1000px;
    height: 865px;
    pointer-events: none;
    opacity: 0.045;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 74 64' fill='%23ffffff'><path d='M45.9424 0.209595L38.5632 7.58879L58.5832 27.6088L38.5632 47.6288L45.9424 55.008L73.3408 27.6088L45.9424 0.209595Z'/><path d='M27.3992 0L0 27.3992L27.3992 54.8L34.7784 47.4208L14.7584 27.3992L34.7784 7.3784L27.3992 0Z'/><path fill='%23e9a83f' d='M27.398 20.026L20.0192 27.4048L27.398 34.7836L34.7768 27.4048L27.398 20.026Z'/><path fill='%23e9a83f' d='M54.5437 48.7109L47.1648 56.0896L54.5435 63.4685L61.9224 56.0899L54.5437 48.7109Z'/></svg>") no-repeat center / contain;
}

/* unfold は中身を w-96 の箱（最初の子）に置く。カードの見た目はその箱に付ける。
   2番目の子は unauthenticated_header.html（テーマ切替。ダーク固定なので空）なので当てない */
.login #page > div > div:first-child {
    position: relative;
    padding: 2.75rem 2.5rem 2.25rem;
    border-radius: 16px;
    background: var(--color-base-900, #181614);
    border: 1px solid var(--hd-line);
    box-shadow: 0 24px 60px -10px oklch(0% 0 0 / 0.55);
}

.hd-login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    margin-bottom: 2.25rem;
}

/* 詳細の重複バナー（同じ公告が別行になったものを寄せた印。services/dedupe.py） */
.hd-dup-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1rem;
    padding: 0.625rem 0.875rem;
    border-radius: 10px;
    border: 1px solid color-mix(in oklch, var(--hd-accent) 45%, transparent);
    background: color-mix(in oklch, var(--hd-accent) 10%, transparent);
    font-size: 0.8125rem;
    line-height: 1.6;
}

.hd-dup-banner.is-primary {
    border-color: var(--hd-line);
    background: var(--color-base-900, #181614);
    color: var(--hd-muted);
}

.hd-dup-banner a {
    color: var(--hd-accent);
    font-weight: 600;
}

/* ログアウト画面（templates/registration/logged_out.html）。文言は 1 行だけ */
.hd-logout-message {
    margin: 0;
    text-align: center;
    font-size: 0.9375rem;
    color: var(--hd-muted);
}

.hd-login-brand .hd-logo-mark {
    width: 74px;
    height: 64px;
    margin-bottom: 0.875rem;
}

.hd-login-funa2 {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--hd-muted);
}

/* Figma Logo/stacked: Montserrat Bold 24px, letter-spacing 10%, 琥珀 */
.hd-login-hound {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.2;
    color: var(--hd-accent);
}

/* 入力欄。ラベル無し、User / Password はプレースホルダで、フォーカスで消える */
.hd-login-field {
    margin-bottom: 0.75rem;
}

.hd-login-form input::placeholder {
    color: var(--hd-muted);
    opacity: 0.85;
    letter-spacing: 0.02em;
}

.hd-login-form input:focus::placeholder {
    color: transparent;
}

.hd-login-footer {
    position: fixed;
    left: 40px;
    right: 40px;
    bottom: 28px;
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--hd-muted);
    pointer-events: none;
}

.hd-login-footer-right {
    font-family: ui-monospace, 'JetBrains Mono', 'Roboto Mono', monospace;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

/* --- ヘルプドロワー（ロゴ横の ? ボタン。中身は static/js/help.js） ---- */

.hd-help-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-left: auto;
    border-radius: 999px;
    border: 1px solid var(--hd-line);
    color: var(--hd-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
    background: transparent;
}

.hd-help-button:hover,
.hd-help-button[aria-expanded="true"] {
    border-color: color-mix(in oklch, var(--hd-accent) 60%, transparent);
    background: color-mix(in oklch, var(--hd-accent) 14%, transparent);
    color: var(--hd-accent);
}

/* 開閉は help.js が #hound-help に is-open を付け外しする。右からスライド＋背景フェード */
.hd-help-overlay {
    position: fixed;
    inset: 0;
    background: oklch(0% 0 0 / 0.45);
    z-index: 70;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.hd-help-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(480px, 92vw);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid var(--hd-line);
    box-shadow: -12px 0 40px oklch(0% 0 0 / 0.35);
    z-index: 71;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#hound-help.is-open .hd-help-overlay {
    opacity: 1;
}

#hound-help.is-open .hd-help-drawer {
    transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
    .hd-help-overlay,
    .hd-help-drawer {
        transition: none;
    }
}

.dark .hd-help-drawer {
    background: oklch(16% 0.012 75);
}

.hd-help-head {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1rem 0.875rem 1.375rem;
    border-bottom: 1px solid var(--hd-line);
}

.hd-help-head h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    flex: 1 1 auto;
}

.hd-help-head a,
.hd-help-head button {
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
    border-radius: 8px;
    border: 1px solid var(--hd-line);
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
}

.hd-help-head a:hover,
.hd-help-head button:hover {
    border-color: var(--hd-accent);
    color: var(--hd-accent);
}

.hd-help-body {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
}

.hd-help-body iframe {
    flex: 1 1 auto;
    width: 100%;
    border: 0;
    background: transparent;
}
