/* ============================================================
   CSS Reset & Design Tokens
   デジタル庁デザインシステム準拠（design_system.md）
   ============================================================ */
:root {
    /* --- カラー --- */
    --bg-color: #F8FAFC;
    --surface-color: #FFFFFF;

    /* キーカラー（コントラスト比確保: 白背景で AA 準拠） */
    --primary-color: #1D4ED8;   /* 白背景での比: 5.7:1 以上 */
    --primary-hover: #1E40AF;
    --primary-light: #EFF6FF;   /* 薄い背景 */

    /* セカンダリー */
    --secondary-color: #0F172A;
    --secondary-hover: #1E293B;

    /* ニュートラル */
    --text-main: #0F172A;       /* 白背景での比: 16:1 */
    --text-muted: #475569;      /* 白背景での比: 4.9:1 AA 準拠 */
    --border-color: #CBD5E1;

    /* 機能カラー */
    --color-success: #059669;
    --color-error:   #DC2626;
    --color-warning: #D97706;
    --color-info:    #0284C7;

    /* --- 影 --- */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.10), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.10), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* --- スペーシング（8px スケール） --- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 40px;
    --space-8: 48px;

    /* --- 角丸 --- */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* --- タイポグラフィ --- */
    --font-base: 'Noto Sans JP', 'Inter', sans-serif;
    --font-mono: 'Noto Sans Mono', monospace;
    --font-size-base: 16px;
    --font-size-sm:   14px;   /* 補助情報の最小値 */
    --font-size-xs:   14px;   /* 14px 未満は使用しない */
    --line-height-base: 1.75; /* 本文: 1.5倍以上 */
    --line-height-ui:   1.5;

    /* カンバン固有 */
    --kanban-bg: #F1F5F9;
    --card-bg: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* Noto Sans JP を優先（design_system.md §3） */
    font-family: var(--font-base);
    font-size: var(--font-size-base);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: var(--line-height-base);
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 196px;
    flex-shrink: 0;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    transition: none;
    overflow-x: hidden;
}

/* Batch B: Application context and two-step application creation */
.detail-entity-label {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.application-context-bar {
    margin-bottom: 20px;
    padding: 16px 18px;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #2563eb;
    background: #f8fafc;
}

.application-context-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.application-context-heading h3 {
    margin: 2px 0 0;
    font-size: 1rem;
}

.application-context-heading code {
    max-width: 45%;
    overflow: hidden;
    color: #475569;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.application-context-grid {
    display: flex;
    margin: 0;
    gap: 12px;
}

.application-context-grid > div {
    min-width: 0;
    flex: 1 1 0;
}

.application-context-grid dt {
    margin-bottom: 3px;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
}

.application-context-grid dd {
    margin: 0;
    overflow: hidden;
    color: #0f172a;
    font-size: 0.875rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.other-applications {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.other-applications > span {
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
}

.other-applications > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.other-application-link {
    padding: 6px 9px;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    background: #eff6ff;
    color: #1d4ed8;
    cursor: pointer;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
}

.other-application-link small {
    margin-left: 5px;
    color: #475569;
}

.modal-lead,
.application-create-step > p {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.6;
}

.modal-lead {
    margin: -4px 0 16px;
}

.application-create-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.application-create-steps li {
    padding: 10px 12px;
    border-bottom: 3px solid #cbd5e1;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 700;
}

.application-create-steps li.active {
    border-bottom-color: #2563eb;
    color: #1d4ed8;
}

.application-create-steps li span {
    display: inline-grid;
    width: 24px;
    height: 24px;
    margin-right: 6px;
    border-radius: 50%;
    background: #e2e8f0;
    place-items: center;
}

.application-create-steps li.active span {
    background: #2563eb;
    color: white;
}

.application-create-form,
.application-create-step {
    display: grid;
    gap: 14px;
}

.application-create-step[hidden] {
    display: none;
}

.application-create-step h3 {
    margin: 0;
    font-size: 1rem;
}

.application-create-step > p {
    margin: -8px 0 2px;
}

.form-grid-2,
.qualification-grid {
    display: grid;
    gap: 12px;
}

.form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qualification-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.qualification-grid label {
    font-size: 0.875rem;
    font-weight: 500;
}

.manual-duplicate-result {
    padding: 12px;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    background: #fffbeb;
}

.manual-duplicate-result > p {
    margin: 5px 0 10px;
    color: #78350f;
    font-size: 0.8125rem;
}

.duplicate-person-options {
    display: grid;
    gap: 7px;
}

.duplicate-person-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid #fcd34d;
    border-radius: 5px;
    background: white;
    color: #0f172a;
    cursor: pointer;
    text-align: left;
}

.duplicate-person-option small {
    color: #64748b;
}

.duplicate-person-option.is-new {
    border-color: #cbd5e1;
}

.application-create-summary {
    display: grid;
    gap: 3px;
    padding: 12px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
}

.application-create-summary span {
    color: #475569;
    font-size: 0.8125rem;
}

.modal-step-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-step-actions.split {
    justify-content: space-between;
}

.card-job-title {
    max-width: 100%;
    overflow: hidden;
    color: #334155;
    font-size: 0.8125rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-assignee {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.card-assignee b {
    display: inline-grid;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.6875rem;
    place-items: center;
}

@media (max-width: 767px) {
    .application-context-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .other-applications,
    .modal-step-actions.split {
        flex-direction: column;
    }

    .application-context-heading code {
        max-width: 52%;
    }

    .form-grid-2,
    .qualification-grid {
        grid-template-columns: 1fr;
    }

    .modal-step-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

.sidebar:hover, .sidebar.pinned {
    width: 196px;
    box-shadow: var(--shadow-sm);
}

.sidebar-header {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.sidebar-header h2 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.sidebar-header h2 span {
    opacity: 0;
    transition: opacity 0.2s;
}

.sidebar:hover .sidebar-header h2 span, .sidebar.pinned .sidebar-header h2 span {
    opacity: 1;
}

.sidebar-nav {
    flex: 1;
    padding: 14px 10px;
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 9px 10px;
    color: var(--text-muted);
    text-decoration: none !important;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sidebar-nav a i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav a span, .sidebar-footer a span {
    opacity: 1;
    transition: none;
}

.sidebar-nav a:hover {
    background-color: #F1F5F9;
    color: var(--primary-color);
}

.sidebar-nav li.active a {
    background-color: #E8F0FE;
    color: #1746B3;
    box-shadow: none;
    font-weight: 700;
}

.sidebar-nav li.active a i {
    color: var(--primary-color);
}

.sidebar-nav a:focus {
    outline: none;
}

.sidebar-nav a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.22);
}

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--border-color);
    white-space: nowrap;
}

.sidebar-footer a {
    color: var(--text-muted);
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 9px 10px;
    transition: color 0.2s ease;
}

.sidebar-footer a i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer a:hover {
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-header {
    height: 58px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px 0 0;
    box-shadow: var(--shadow-sm);
    z-index: 20; /* サイドバー(10)の上に表示するため */
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 196px;
    padding-left: 12px;
}

.app-brand h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.08rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

#btn-toggle-sidebar {
    display: none;
}

.header-page-title {
    display: flex;
    align-items: center;
    padding-left: 18px;
    border-left: 1px solid var(--border-color);
}

.header-title h1 {
    font-size: 1.04rem;
    font-weight: 800;
    white-space: nowrap;
}

.header-search {
    flex: 1;
    max-width: 520px;
    min-width: 220px;
    margin-left: 18px;
    position: relative;
    display: flex;
    align-items: center;
}

.header-search i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.header-search input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #F8FAFC;
    padding: 8px 12px 8px 36px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-main);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-settings-btn {
    min-height: 38px;
    padding: 7px 12px;
    font-size: 0.9rem;
}

.user-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

/* ============================================================
   ボタン（design_system.md §5 - 優先度別3種）
   disabled は原則使用しない → エラーメッセージで案内
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-family: var(--font-base);
    font-size: var(--font-size-base);
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    line-height: var(--line-height-ui);
    text-decoration: none; /* ボタンにリンク下線不要 */
}

/* プライマリーボタン：最重要アクション */
.btn-primary {
    background-color: var(--primary-color);
    color: #FFFFFF;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* セカンダリーボタン：補助アクション */
.btn-secondary {
    background-color: var(--surface-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-secondary:hover {
    background-color: var(--primary-light);
}

/* ターシャリーボタン：低優先アクション */
.btn-outline,
.btn-tertiary {
    background-color: transparent;
    color: var(--text-muted);
    border-color: var(--border-color);
}
.btn-outline:hover,
.btn-tertiary:hover {
    background-color: var(--bg-color);
    color: var(--text-main);
    border-color: var(--text-muted);
}

/* 例外的な入力など、主導線ではない操作 */
.btn-quiet {
    background-color: #F1F5F9;
    color: #475569;
    border-color: transparent;
    font-weight: 600;
    box-shadow: none;
}

.btn-quiet:hover {
    background-color: #E2E8F0;
    color: #0F172A;
    border-color: transparent;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 16px; /* 32pxから16pxに削減（情報密度とUX向上） */
    overflow-y: auto;
    background-color: var(--bg-color);
}

.view-section {
    display: none;
    height: 100%;
}

.view-section.active {
    display: block;
}

#view-kanban.active {
    display: flex !important;
    flex-direction: column;
    height: 100%;
}

.kanban-board {
    display: flex;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-x: hidden; /* 横スクロールを完全に排除 */
    overflow-y: hidden; /* 縦スクロールを完全に排除 */
    padding-bottom: 8px;
}

@media (min-width: 768px) {
    #view-kanban.active {
        height: 100%;
        min-height: 0;
    }

    .kanban-board {
        flex: 1 1 auto;
        min-height: 360px;
    }
}

#view-today {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

.kanban-today-summary {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.kanban-entry-strip {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.summary-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.summary-heading h2 {
    margin: 0;
    font-size: 0.98rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-heading p {
    margin: 3px 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 8px;
}

.today-header-actions,
.kanban-board-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.today-header-actions .btn,
.kanban-board-actions .btn {
    min-height: 38px;
}

.today-action-table-head {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) minmax(220px, 1.4fr) 100px minmax(150px, auto);
    gap: 12px;
    padding: 14px 12px 7px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.today-action-queue {
    display: grid;
    gap: 6px;
    border-top: 1px solid #E2E8F0;
    padding-top: 8px;
}

.today-action-row {
    width: 100%;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    border-radius: 8px;
    padding: 11px 12px;
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) minmax(220px, 1.4fr) 100px minmax(150px, auto);
    gap: 12px;
    align-items: center;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
}

.today-action-row:hover {
    border-color: var(--primary-color);
    background: #F8FAFC;
}

.today-action-name {
    font-weight: 800;
    font-size: 0.96rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.today-action-sub,
.today-action-reason {
    color: var(--text-muted);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.today-action-elapsed {
    color: var(--text-main);
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
}

.today-action-command {
    min-height: 32px;
    border-radius: 6px;
    background: #EFF6FF;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 10px;
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
}

.today-action-row:hover .today-action-command {
    background: var(--primary-color);
    color: #FFFFFF;
}

.today-action-command-warning {
    background: #FEF3C7;
    color: #92400E;
}

.today-action-command-video {
    background: #EDE9FE;
    color: #6D28D9;
}

.today-action-command-success {
    background: #D1FAE5;
    color: #047857;
}

.today-action-command-danger {
    background: #FEE2E2;
    color: #B91C1C;
}

.today-action-command-muted {
    background: #E2E8F0;
    color: #334155;
}

.today-action-status {
    display: inline-flex;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 8px;
    background: #EFF6FF;
    color: #1D4ED8;
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.today-action-empty {
    color: var(--text-muted);
    font-size: 0.84rem;
    background: #F8FAFC;
    border: 1px dashed #CBD5E1;
    border-radius: 8px;
    padding: 10px;
}

.summary-card {
    border: 1px solid #dbe3e8;
    background: #f8fafc;
    border-radius: 8px;
    min-height: 58px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: var(--text-main);
    text-align: left;
}

.summary-card:hover,
.summary-card.active {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.summary-card-danger {
    background: #FEF2F2;
    border-color: #FECACA;
}

.summary-card-danger .summary-label,
.summary-card-danger strong {
    color: #B91C1C;
}

.summary-card-warning {
    background: #FFF7ED;
    border-color: #FED7AA;
}

.summary-card-warning .summary-label,
.summary-card-warning strong {
    color: #C2410C;
}

.summary-card-documents {
    background: #FFFBEB;
    border-color: #FDE68A;
}

.summary-card-documents .summary-label,
.summary-card-documents strong {
    color: #A16207;
}

.summary-card-video {
    background: #F5F3FF;
    border-color: #DDD6FE;
}

.summary-card-video .summary-label,
.summary-card-video strong {
    color: #6D28D9;
}

.summary-card-portal {
    background: #EFF6FF;
    border-color: #BFDBFE;
}

.summary-card-portal .summary-label,
.summary-card-portal strong {
    color: #1D4ED8;
}

.summary-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
}

.summary-card strong {
    font-size: 1.35rem;
    line-height: 1;
    color: var(--text-main);
}

.kanban-board-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.kanban-board-toolbar .kanban-filter-tabs {
    margin: 0;
}

.kanban-summary-filter-chip {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #BFDBFE;
    background: #EFF6FF;
    color: #1E40AF;
    border-radius: 6px;
    padding: 5px 6px 5px 10px;
    font-size: 0.78rem;
}

.kanban-summary-filter-chip[hidden] {
    display: none;
}

.kanban-summary-filter-chip button {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #1E40AF;
    cursor: pointer;
}

.kanban-summary-filter-chip button:hover {
    background: #DBEAFE;
}

/* 表示カラム数が多い場合の折り返しモード（JSから動的に付与） */
.kanban-board.wrap-mode {
    flex-wrap: wrap;
    align-content: flex-start;
}

.kanban-column {
    background-color: #f8fafc;
    border-radius: 8px;
    flex: 1 1 0;       /* 等分割フィット。min-widthなしで画面幅に完全追従 */
    min-width: 0;      /* 制約を撤廃し、どんなカラム数でも画面内に収める */
    display: flex;
    flex-direction: column;
    max-height: 100%;
    border: 1px solid #e2e8f0;
    overflow: hidden;  /* カラム内コンテンツのはみ出し防止 */
}

.kanban-column[data-status="未対応"] {
    border-top: 3px solid #D97706;
}

.kanban-column[data-status="応募受付"] {
    border-top: 3px solid #0284C7;
}

.kanban-column[data-status="書類確認"] {
    border-top: 3px solid #D97706;
}

.kanban-column[data-status="カジュアル面談"],
.kanban-column[data-status="面接・見学調整"] {
    border-top: 3px solid #0891B2;
}

.kanban-column[data-status="面接予定"],
.kanban-column[data-status="結果連絡待ち"] {
    border-top: 3px solid #7C3AED;
}

.kanban-column[data-status="内定"] {
    border-top: 3px solid #059669;
}

.kanban-column[data-status="終了"] {
    border-top: 3px solid #64748B;
}

@media (min-width: 1101px) {
    .kanban-board.adaptive-column-widths .kanban-column.is-empty {
        flex: 0.68 1 0;
    }

    .kanban-board.adaptive-column-widths .kanban-column.has-cards {
        flex: 1.3 1 0;
    }
}

.kanban-column-header {
    padding: 8px 10px; /* さらにコンパクトにして縦幅を節約 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.kanban-column-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    text-transform: none; /* 大文字固定を解除して読みやすく */
    letter-spacing: 0.02em;
    margin: 0;
}

.count {
    background-color: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 10px;
}

.kanban-cards {
    padding: 6px; /* 余白を縮小して情報密度を向上 */
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px; /* カード同士の間隔を6pxに詰めて縦スクロール量を抑制 */
    min-height: 150px;
}

/* Kanban column hover state during drag */
.kanban-cards.drag-over {
    background-color: #cbd5e1;
    border-radius: 6px;
}

/* Kanban Card */
.kanban-card {
    background-color: #ffffff;
    border-radius: 6px;
    padding: 8px 10px; /* パディングを縮小し、縦のスクロール量を大幅に抑制 */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* より自然で柔らかい影 */
    border: 1px solid #e2e8f0;
    cursor: grab;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;       /* ウィンドウ幅（カラム幅）の伸縮に完全に連動させる */
    min-width: 0;      /* コンテンツの最小幅に引きずられず縮むようにする */
    container-type: inline-size; /* Container Query でカード幅に応じたレイアウト切替 */
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kanban-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border-color: var(--primary-color, #3b82f6); /* ホバー時の境界線をわかりやすく強調 */
    transform: translateY(-1px); /* 微妙な浮き上がりアニメーション */
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card.dragging {
    opacity: 0.5;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-source-row {
    color: #64748b;
    font-size: 12px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-action-row,
.card-badge-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    min-width: 0;
}

.kanban-mini-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border-radius: 999px;
    padding: 3px 7px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
}

.kanban-mini-badge-primary {
    color: #1d4ed8;
    background: #dbeafe;
}

.kanban-mini-badge-video {
    color: #6d28d9;
    background: #ede9fe;
}

.kanban-mini-badge-warning {
    color: #92400e;
    background: #fef3c7;
}

.kanban-mini-badge-success {
    color: #047857;
    background: #d1fae5;
}

.kanban-mini-badge-danger {
    color: #b91c1c;
    background: #fee2e2;
}

.kanban-mini-badge-muted {
    color: #475569;
    background: #e2e8f0;
}

.human-insight-block {
    border: 1px solid #d8e3ea;
    border-left: 4px solid #7c3aed;
    border-radius: 8px;
    padding: 16px 18px;
    background: #fbfaff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.human-insight-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.human-insight-header h4 {
    margin: 0 0 4px;
    font-size: 0.95rem;
    color: var(--text-main);
}

.human-insight-header p,
.human-insight-note {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.human-insight-status {
    border-radius: 999px;
    padding: 4px 8px;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
}

.human-insight-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.human-insight-actions .btn {
    justify-content: center;
    min-width: 0;
    font-size: 0.82rem;
    padding: 9px 10px;
}

.video-review-header {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.video-review-header h2 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    color: var(--text-main);
}

.video-review-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.video-review-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.video-review-filters .tab-btn {
    border: 1px solid var(--border-color);
    background: #f8fafc;
    border-radius: 999px;
    padding: 7px 11px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
}

.video-review-filters .tab-btn.active {
    color: var(--primary-color);
    background: #eff6ff;
    border-color: var(--primary-color);
}

.video-review-state {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 7px;
    margin-top: 5px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
}

.video-review-state.viewed {
    background: #dbeafe;
    color: #1d4ed8;
}

.video-review-state.shared {
    background: #d1fae5;
    color: #047857;
}

@container (max-width: 150px) {
    .card-source-row {
        display: none;
    }

    .card-action-row,
    .card-badge-row {
        gap: 3px;
    }

    .kanban-mini-badge {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* カード内レイアウト用追加スタイル */
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center; /* 頭文字や日付のベースラインを合わせる */
    gap: 6px;
    width: 100%;
    min-width: 0;        /* 縮小時の折りたたみ/省略を可能にする */
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1; /* タイトル領域を最大化 */
}

/* Container Query: カード幅が狭い場合はヘッダーを縦積みに切替 */
@container (max-width: 179px) {
    .card-header-row {
        flex-direction: row;
        align-items: flex-start;
        gap: 6px;
    }
    .card-title {
        width: 100%;
    }
    .card-date-normal {
        width: auto;
    }
    .card-second-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .card-meta-right {
        width: 100%;
        justify-content: space-between;
    }
}

.card-badge {
    display: inline-block;
    padding: 1px 5px; /* さらに細くして主張を控えめに */
    border-radius: 4px;
    background-color: #eff6ff;
    color: #2563eb;
    font-size: 10px; /* 10pxにしてコンパクト化 */
    font-weight: 500; /* 太すぎないように調整 */
    margin-top: 0;
    width: fit-content;
    white-space: nowrap;
}

.card-date {
    font-size: 10.5px; /* 読みやすさを維持するギリギリのサイズに縮小 */
    color: #64748b;
    flex-shrink: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 3px;
}

.card-job {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px; /* 余白を詰める */
    display: flex;
    align-items: center;
    gap: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px; /* 余白を詰める */
    gap: 6px;
    width: 100%;
    min-width: 0;        /* 縮小時の折りたたみ/省略を可能にする */
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 1.5px;
    font-size: 11px; /* 11pxに統一 */
    color: #f59e0b;
    flex-shrink: 0;
}

/* 通常時および共通スタイル */
.card-second-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.all-mode-info-icon {
    display: inline-flex; /* 通常時も表示 */
    color: #2563eb;
    font-size: 13px;
    cursor: help;
    flex-shrink: 0;
    margin-left: 0;
    padding: 2px;
}

.card-meta-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.card-badge-normal {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 4px;
    background-color: #eff6ff;
    color: #2563eb;
    font-size: 10px;
    font-weight: 500;
    margin-top: 0;
    width: fit-content;
    white-space: nowrap;
}

.card-date-normal {
    font-size: 11.5px;
    color: #64748b;
    flex-shrink: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 3px;
}

.card-footer-row-normal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.card-rating-normal {
    display: flex;
    align-items: center;
    gap: 1.5px;
    font-size: 11px;
    color: #f59e0b;
    flex-shrink: 0;
}

.card-rating-normal .score {
    font-weight: 600;
    color: #334155;
    margin-left: 2px;
}

.card-rating-normal .rating-stars {
    display: flex;
    gap: 1px;
}

/* カンバンカード: 次の操作を主役にした情報階層 */
.kanban-card {
    padding: 0;
    gap: 0;
    overflow: hidden;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.kanban-card.is-overdue {
    border-left-color: #DC2626;
}

.kanban-card:focus-visible {
    outline: none;
    border-color: #93C5FD;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.18);
}

.kanban-card.is-overdue:focus-visible {
    border-left-color: #DC2626;
}

.kanban-card .card-header-row {
    padding: 10px 10px 7px;
    align-items: flex-start;
    cursor: grab;
}

.card-drag-handle {
    width: 10px;
    padding-top: 2px;
    color: #94A3B8;
    display: inline-flex;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 12px;
}

.card-identity {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.kanban-card .card-title {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
}

.kanban-card .card-date-normal {
    font-size: 12px;
    line-height: 1.35;
}

.card-info-button {
    width: 28px;
    height: 28px;
    margin: -3px -3px 0 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #64748B;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    cursor: help;
}

.card-info-button:hover,
.card-info-button:focus-visible {
    background: #F1F5F9;
    color: #1D4ED8;
    outline: none;
}

.card-context-row {
    padding: 0 10px 9px;
    display: grid;
    gap: 3px;
    color: #475569;
    font-size: 12.5px;
    line-height: 1.4;
}

.card-context-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-context-row i {
    width: 15px;
    color: #64748B;
    text-align: center;
}

.card-alert-row {
    margin: 0 10px 8px;
    padding: 6px 8px;
    border-radius: 4px;
    background: #FEF2F2;
    color: #B91C1C;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

.card-support-row {
    min-height: 28px;
    padding: 0 10px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.card-blocker-summary {
    min-width: 0;
    color: #475569;
    font-size: 12px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-blocker-summary span {
    color: #92400E;
    font-weight: 800;
    margin-right: 5px;
}

.kanban-card .card-rating-normal {
    font-size: 11.5px;
}

.card-primary-action {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 0;
    border-top: 1px solid #DBEAFE;
    border-radius: 0;
    background: #EFF6FF;
    color: #1D4ED8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-family: var(--font-base);
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.card-primary-action span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-primary-action:hover,
.card-primary-action:focus-visible {
    background: #DBEAFE;
    color: #1E40AF;
    outline: none;
}

@container (max-width: 135px) {
    .card-context-row span:last-child,
    .card-support-row {
        display: none;
    }

    .card-alert-row {
        margin-top: 1px;
    }
}

.compact-info-icon {
    display: none; /* 通常時は非表示 */
    color: #2563eb;
    font-size: 13px;
    cursor: help;
    flex-shrink: 0;
    padding: 2px;
}

/* コンパクトモード (すべて表示、または選考中の折り返し発生時) のカード極小化スタイル */
.compact-mode .kanban-card {
    padding: 0 !important;
}

/* 通常用メタデータ部を非表示にし、名前とℹ️アイコンのみの1行表示にする */
.compact-mode .kanban-card .card-date-normal,
.compact-mode .kanban-card .card-second-row,
.compact-mode .kanban-card .card-footer-row-normal,
.compact-mode .kanban-card .card-context-row,
.compact-mode .kanban-card .card-alert-row,
.compact-mode .kanban-card .card-support-row {
    display: none !important;
}

.compact-mode .kanban-card .card-header-row {
    display: flex !important;
    flex-direction: row !important; /* コンテナ幅に関わらず常に横並び1行表示を保証 */
    justify-content: space-between !important;
    align-items: center !important;
    gap: 4px !important;
    width: 100% !important;
}

.compact-mode .kanban-card .card-title {
    flex: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.compact-mode .kanban-card .compact-info-icon {
    display: inline-flex !important; /* ℹ️アイコンを出現させる */
    align-items: center !important;
}



/* 「他〇人」リンクのスタイリング */
.kanban-overflow-link {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f5f9;
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 4px;
    transition: all 0.15s;
    width: 100%;
    border: 1px dashed #cbd5e1;
    box-sizing: border-box;
}

.kanban-overflow-link:hover {
    background-color: #e2e8f0;
    color: #1d4ed8;
    border-color: #94a3b8;
}

/* JS動的ツールチップのスタイリング */
.custom-js-tooltip {
    background-color: #0f172a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    pointer-events: none;
    z-index: 9999;
    animation: tooltipFadeIn 0.12s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5); /* Glassmorphism effect base */
    backdrop-filter: blur(4px);
    align-items: center; /* コンテンツ中央配置 */
    justify-content: center;
    overflow: hidden; /* 外側の余分なスクロールを完全に排除 */
    padding: 20px;
    box-sizing: border-box;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--surface-color);
    padding: 32px;
    border-radius: 12px;
    width: 480px;
    max-width: 95%;
    max-height: calc(100vh - 80px); /* 画面の上下に十分なマージンを確保 */
    overflow-y: auto;                /* コンテンツが多い場合のみ内側で縦スクロール */
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideIn 0.3s ease-out;
    box-sizing: border-box;          /* パディングによる高さのズレを防ぐ */
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-main);
}

.modal-content h2 {
    margin-bottom: 24px;
    font-size: 1.25rem;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: var(--font-size-base);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.form-group input,
.form-group select,
.form-group textarea {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-base);
    font-size: var(--font-size-base);
    color: var(--text-main);
    transition: border-color 0.2s;
    background-color: var(--surface-color);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.25);
}

#form-add-candidate button {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
}


/* === New Views Styles === */

/* Schedule View */
.schedule-container {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.timeline-marker {
    position: absolute;
    left: -20px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 4px solid var(--surface-color);
    transition: background-color 0.2s, box-shadow 0.2s;
}

.timeline-marker.status-first-interview {
    background-color: var(--color-warning);
    box-shadow: 0 0 0 2px var(--color-warning);
}
.timeline-marker.status-final-interview {
    background-color: var(--color-error);
    box-shadow: 0 0 0 2px var(--color-error);
}
.timeline-marker.status-offer {
    background-color: var(--color-success);
    box-shadow: 0 0 0 2px var(--color-success);
}
.timeline-marker.status-other {
    background-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-content {
    background-color: var(--surface-color);
    padding: 16px;
    border-radius: 8px;
    flex: 1;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s;
}

.timeline-content:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.timeline-time {
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.timeline-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 6px;
}

/* タイムライン用候補者情報メタ・バッジ */
.timeline-candidate-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.timeline-candidate-meta .candidate-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 4px;
}

.timeline-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: var(--font-size-sm);
    font-weight: 700;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.timeline-badge.badge-job {
    background-color: var(--bg-color);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.timeline-badge.badge-status.status-first-interview {
    background-color: #FFF7ED;
    color: var(--color-warning);
    border: 1px solid #FFEDD5;
}

.timeline-badge.badge-status.status-final-interview {
    background-color: #FEF2F2;
    color: var(--color-error);
    border: 1px solid #FEE2E2;
}

.timeline-badge.badge-status.status-offer {
    background-color: #ECFDF5;
    color: var(--color-success);
    border: 1px solid #D1FAE5;
}

.timeline-badge.badge-status.status-other {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border: 1px solid #DBEAFE;
}

/* Messages View */
.messages-container {
    display: flex;
    height: calc(100vh - 148px); /* 親パディング削減分(32px)を考慮 */
    background-color: var(--surface-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.messages-sidebar {
    width: 300px;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    background-color: var(--bg-color);
}

.contact-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-item:hover, .contact-item.active {
    background-color: #DBEAFE;
}

.contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.contact-info {
    flex: 1;
    overflow: hidden;
}

.contact-name {
    font-weight: 700;
    font-size: var(--font-size-base);
}

.contact-preview {
    /* 最小14px（design_system.md §3） */
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messages-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.messages-history {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-placeholder {
    margin: auto;
    color: var(--text-muted);
}

.msg-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px; /* ギャップの代わりに要素ごとの余白 */
    max-width: 80%; /* Google Chat風、少し広めに */
}

.msg-received {
    align-self: flex-start;
}

.msg-sent {
    align-self: flex-end;
    align-items: flex-end;
}

.msg-header {
    display: flex;
    gap: 8px;
    align-items: baseline;
    margin-bottom: 4px;
    padding: 0 4px;
}

.msg-name {
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text-main);
}

.msg-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.msg-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-main);
    word-break: break-word;
}

.msg-received .msg-bubble {
    background-color: #F8F9FA; /* Google Chat風の薄いグレー */
}

.msg-sent .msg-bubble {
    background-color: #E8EAF6; /* 薄い青紫 */
}

.messages-input {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    background-color: var(--surface-color);
}

.messages-input input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
}

.messages-input input:focus {
    border-color: var(--primary-color);
}

/* Documents View */
.documents-container {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.doc-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.doc-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.modal-close-button,
.icon-button {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
}

.modal-close-button {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

.modal-close-button:hover,
.icon-button:hover {
    color: var(--text-main);
    background: #F1F5F9;
}

.modal-close-button:focus-visible,
.icon-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}

.candidate-video-region {
    min-height: 52px;
}

.candidate-video-region .video-player-container {
    min-height: 380px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
}

.candidate-video-inline-state {
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #F8FAFC;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.candidate-video-inline-state strong {
    color: var(--text-main);
}

.candidate-video-inline-state .link-button {
    margin-left: auto;
}

.candidate-video-inline-error {
    border-color: #FED7AA;
    background: #FFF7ED;
    color: #9A3412;
}

.link-button {
    border: 0;
    background: transparent;
    padding: 6px;
    color: var(--primary-color);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.mobile-more-menu {
    display: none;
}

.compact-mode .kanban-card .card-primary-action {
    min-height: 32px;
    padding: 6px 8px;
    font-size: 11.5px;
}

.email-import-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) {
    .email-import-layout {
        grid-template-columns: 1fr;
    }
}

.mobile-kanban-panel,
.mobile-bottom-nav,
.mobile-detail-action-bar {
    display: none;
}

.mobile-empty-state {
    min-height: 160px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 24px;
}

.mobile-empty-state i {
    font-size: 1.6rem;
    color: var(--color-success);
}

.mobile-card-status-control {
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
    margin-top: 4px;
}

.mobile-card-status-control label,
.mobile-status-filter {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.mobile-card-status-control select,
.mobile-status-filter select {
    min-height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-main);
    font: inherit;
    font-weight: 700;
    padding: 8px 34px 8px 10px;
}

.mobile-view-switch {
    display: none;
}

.mobile-view-switch button {
    min-height: 40px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

.mobile-view-switch button.active {
    color: var(--primary-color);
    background: var(--primary-light);
    border-color: #bfdbfe;
}

.mobile-section-toggle {
    display: none;
}

.doc-icon {
    height: 120px;
    background-color: #EFF6FF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary-color);
}

.doc-info {
    padding: 16px;
    background-color: var(--surface-color);
}

.doc-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.doc-actions {
    display: flex;
    gap: 8px;
}

.doc-actions button {
    flex: 1;
    padding: 6px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.doc-actions button:hover {
    background-color: var(--bg-color);
}



/* ============================================================
   スケジュールビュー ヘッダー
   ============================================================ */
/* ============================================================
   選考スケジュール（Google カレンダー風 2カラム & インラインヘッダー）
   ============================================================ */

/* 1行インラインヘッダー */
.schedule-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--surface-color);
    height: 52px;
}

.header-left-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 「今日」ボタン */
.btn-today-btn {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-main);
    transition: background-color 0.1s;
}
.btn-today-btn:hover {
    background-color: var(--bg-color);
}

/* 矢印ナビゲーション */
.nav-arrows {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-nav-arrow {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
    transition: background-color 0.1s;
}
.btn-nav-arrow:hover {
    background-color: var(--bg-color);
    color: var(--text-main);
}

/* 月タイトル */
.calendar-month-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-main);
}

.header-right-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ビュー切り替えトグル */
.view-toggle {
    display: flex;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.toggle-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    font-family: var(--font-base);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.toggle-btn + .toggle-btn {
    border-left: 1px solid var(--border-color);
}

.toggle-btn.active {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 700;
}


/* 2カラムワークスペースレイアウト */
.schedule-workspace-layout {
    display: flex;
    height: calc(100vh - 156px); /* ヘッダー高さを考慮し全画面フィット（親パディング32pxを減算） */
    overflow: hidden;
    background-color: var(--bg-color);
}

/* 左サイドバー */
.schedule-sidebar {
    width: 240px;
    min-width: 240px;
    border-right: none; /* 境界線を廃止 */
    background-color: var(--surface-color);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
}

/* 右メインコンテンツ */
.schedule-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}


/* 「＋作成」ボタン (Googleカレンダー風) */
.btn-create-event {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 20px 8px 16px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-main);
    box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    cursor: pointer;
    transition: box-shadow 0.1s, background-color 0.1s;
    width: fit-content;
}

.btn-create-event:hover {
    background-color: var(--bg-color);
    box-shadow: 0 2px 3px 0 rgba(60,64,67,0.3), 0 6px 10px 4px rgba(60,64,67,0.15);
}

.btn-create-event i {
    font-size: 16px;
    color: var(--primary-color);
}


/* ミニカレンダー */
.mini-calendar-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mini-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.mini-month-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.mini-nav-arrows {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-mini-arrow {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 11px;
    transition: background-color 0.1s;
}
.btn-mini-arrow:hover {
    background-color: var(--bg-color);
    color: var(--text-main);
}

/* ミニカレンダーグリッド */
.mini-calendar-grid {
    display: flex;
    flex-direction: column;
}

.mini-calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}

.mini-calendar-header-day {
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 4px 0;
}

.mini-calendar-header-day.cal-sun { color: var(--color-error); }
.mini-calendar-header-day.cal-sat { color: var(--color-info); }

.mini-calendar-body {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    row-gap: 2px;
}

.mini-calendar-day {
    text-align: center;
    padding: 4px 0;
    cursor: pointer;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 12px;
    transition: background-color 0.1s;
}

.mini-calendar-day:hover {
    background-color: var(--bg-color);
}

.mini-calendar-day.other-month {
    color: var(--border-color);
}

.mini-calendar-day.today {
    background-color: var(--primary-color);
    color: white !important;
    font-weight: 700;
}

/* ミニカレンダー日付色 */
.mini-calendar-day.cal-sun-day:not(.today) { color: var(--color-error); }
.mini-calendar-day.cal-sat-day:not(.today) { color: var(--color-info); }


#schedule-calendar-view {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* メインカレンダー 5週間100%フィット化 */
.calendar-grid {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-left: 1px solid #F1F5F9;
    border-top: 1px solid #F1F5F9;
    border-right: none;
    border-bottom: none;
    background: var(--surface-color);
}

.calendar-header {
    display: none; /* 曜日ヘッダー行を廃止 */
}

.calendar-header-day {
    display: none;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: repeat(5, 1fr); /* 常に5行（5週間） */
    height: 100%;
    flex: 1;
}

.calendar-day {
    border-right: 1px solid #F1F5F9; /* 極薄に変更 */
    border-bottom: 1px solid #F1F5F9; /* 極薄に変更 */
    border-left: none;
    border-top: none;
    margin: 0;
    padding: 6px;
    background: var(--surface-color);
    position: relative;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.calendar-day.empty-day {
    background: var(--bg-color);
    cursor: default;
    border-color: transparent;
}

/* 他月の予定は半透明 */
.calendar-day.other-month {
    background-color: #F8FAFC;
}
.calendar-day.other-month .calendar-date {
    color: var(--border-color);
}
.calendar-day.other-month .calendar-event {
    opacity: 0.5;
}

.calendar-day:not(.empty-day):hover {
    /* セルのホバーあしらいは無し */
}

/* 土日セル */
.calendar-day.cal-sun-day { background: #FEF2F2; }
.calendar-day.cal-sat-day { background: #F0F9FF; }

/* 今日 */
.calendar-day.today {
    background: #EFF6FF;
    border: 2px solid var(--primary-color);
    box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.15);
    z-index: 1;
}

/* ハイライト（追加直後） */
.calendar-day.highlighted {
    background: #FEF9C3;
    animation: highlightFade 2s ease forwards;
}

@keyframes highlightFade {
    0%   { background: #FEF08A; }
    100% { background: var(--surface-color); }
}

/* 日付の表示用スタイル */
.calendar-date-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: var(--space-2);
    flex-shrink: 0; /* 潰れ防止 */
}

.calendar-day-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1;
    margin-bottom: 4px;
}
.calendar-day-name.cal-sun { color: var(--color-error); }
.calendar-day-name.cal-sat { color: var(--color-info); }

.calendar-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-main);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.15s, color 0.15s;
}

.calendar-day:not(.today) .calendar-date:hover {
    background-color: #E0F2FE;
    cursor: pointer;
}

/* 今日の日付丸バッジ */
.calendar-day.today .calendar-date {
    background-color: var(--primary-color);
    color: #FFFFFF;
    font-weight: 700;
}

/* 土日の日付色 */
.calendar-day.cal-sun-day .calendar-date { color: var(--color-error); }
.calendar-day.cal-sat-day .calendar-date { color: var(--color-info); }
.calendar-day.today.cal-sun-day .calendar-date { color: #FFFFFF; }
.calendar-day.today.cal-sat-day .calendar-date { color: #FFFFFF; }

/* 他〇件表示スタイル */
.calendar-event-more {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 3px 6px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background-color 0.1s;
    text-align: left;
    margin-top: 2px;
}
.calendar-event-more:hover {
    background-color: var(--bg-color);
    color: var(--text-main);
}

/* 他〇件 ポップオーバー */
.events-popover {
    position: fixed;
    z-index: 1020;
    background: #F1F5F9; /* 薄いグレーに変更 */
    border: none; /* borderは無し */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 280px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: popoverIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.events-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #E2E8F0;
}
.events-popover-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}
.events-popover-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1;
}
.events-popover-close:hover {
    color: var(--text-main);
}
.events-popover-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* カレンダーイベント（ボタン） */
.calendar-event {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    background: var(--primary-light);
    border: none;
    border-left: 3px solid var(--primary-color);
    padding: 3px var(--space-2);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-1);
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
    position: relative;
    overflow: hidden;
    font-family: var(--font-base);
}

.calendar-event:hover {
    background: #DBEAFE;
}

.calendar-event-time {
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
    flex-shrink: 0;
    font-size: var(--font-size-sm);
}

.calendar-event-title {
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip; /* ...を使わず単純にあふれる部分を隠す */
    font-size: var(--font-size-sm);
}

/* カレンダーイベントのステータス色分け */
.calendar-event.status-first-interview {
    background-color: #FFF7ED;
    border-left-color: var(--color-warning, #F59E0B);
}
.calendar-event.status-first-interview .calendar-event-time {
    color: var(--color-warning, #F59E0B);
}
.calendar-event.status-first-interview:hover {
    background-color: #FFEDD5;
}

.calendar-event.status-final-interview {
    background-color: #FEF2F2;
    border-left-color: var(--color-error, #EF4444);
}
.calendar-event.status-final-interview .calendar-event-time {
    color: var(--color-error, #EF4444);
}
.calendar-event.status-final-interview:hover {
    background-color: #FEE2E2;
}

.calendar-event.status-offer {
    background-color: #F0FDF4;
    border-left-color: var(--color-success, #10B981);
}
.calendar-event.status-offer .calendar-event-time {
    color: var(--color-success, #10B981);
}
.calendar-event.status-offer:hover {
    background-color: #DCFCE7;
}

.calendar-event.status-other {
    background-color: var(--primary-light);
    border-left-color: var(--primary-color);
}
.calendar-event.status-other .calendar-event-time {
    color: var(--primary-color);
}
.calendar-event.status-other:hover {
    background-color: #DBEAFE;
}

.calendar-event-more {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    padding: 2px var(--space-2);
    cursor: default;
}

/* ============================================================
   カレンダーイベント詳細 ポップオーバー
   ============================================================ */
.cal-popover {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1010;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 320px;
    max-width: 480px;
    animation: popoverIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cal-popover-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    animation: backdropFadeIn 0.2s ease-out;
}

@keyframes popoverIn {
    from { opacity: 0; transform: translate(-50%, -45%) scale(0.96); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes backdropFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.cal-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-base);
    background: var(--primary-light);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.cal-popover-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.cal-popover-close:hover { color: var(--text-main); }

.cal-popover-body {
    padding: var(--space-3) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--text-main);
}

.cal-popover-body i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
    margin-right: 4px;
}




/* Toast Notification System */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}
.toast {
    background: white;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 16px 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.toast.show {
    transform: translateX(0);
    opacity: 1;
}
.toast-icon {
    font-size: 1.25rem;
}
.toast-success { border-left-color: #10B981; }
.toast-success .toast-icon { color: #10B981; }
.toast-error { border-left-color: #EF4444; }
.toast-error .toast-icon { color: #EF4444; }
.toast-info { border-left-color: #3B82F6; }
.toast-info .toast-icon { color: #3B82F6; }
.toast-content {
    flex: 1;
}
.toast-title {
    font-weight: 700;
    font-size: var(--font-size-base);
    color: var(--text-main);
    margin-bottom: 2px;
}
.toast-message {
    /* 最小14px（design_system.md §3） */
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ============================================================
   コンテンツリンク（design_system.md §5）
   色だけでなく下線で必ずリンクを識別可能にする
   ============================================================ */
a:not([class]) {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}
a:not([class]):hover {
    color: var(--primary-hover);
}
a:not([class])[target="_blank"]::after {
    /* 外部リンクアイコン（design_system.md §5） */
    content: ' \f08e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.75em;
    margin-left: 4px;
    vertical-align: super;
}

/* 成功・エラー表示（色だけで伝えない、アイコン併用） */
.status-success {
    color: var(--color-success);
}
.status-error {
    color: var(--color-error);
}
.status-warning {
    color: var(--color-warning);
}

/* ============================================================
   クイックアクション ドロップダウン & スプリットボタン
   ============================================================ */
.quick-action-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background-color: var(--surface-color);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    z-index: 50;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: 10px 16px;
    font-size: var(--font-size-sm);
    color: var(--text-main);
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s;
    font-family: var(--font-base);
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

/* Kanban Filter Tabs */
.kanban-filter-tabs {
    display: flex;
    gap: 8px;
    background-color: var(--kanban-bg, #F1F5F9);
    padding: 6px;
    border-radius: var(--radius-md, 8px);
    width: fit-content;
    margin-bottom: 20px;
    border: 1px solid var(--border-color, #E2E8F0);
}

.kanban-filter-tabs .tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted, #64748B);
    font-weight: 700;
    font-size: 15px;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    transition: all 0.2s ease;
}

    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--text-main);
}

.cal-popover-body i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
    margin-right: 4px;
}




/* Toast Notification System */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}
.toast {
    background: white;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 16px 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.toast.show {
    transform: translateX(0);
    opacity: 1;
}
.toast-icon {
    font-size: 1.25rem;
}
.toast-success { border-left-color: #10B981; }
.toast-success .toast-icon { color: #10B981; }
.toast-error { border-left-color: #EF4444; }
.toast-error .toast-icon { color: #EF4444; }
.toast-info { border-left-color: #3B82F6; }
.toast-info .toast-icon { color: #3B82F6; }
.toast-content {
    flex: 1;
}
.toast-title {
    font-weight: 700;
    font-size: var(--font-size-base);
    color: var(--text-main);
    margin-bottom: 2px;
}
.toast-message {
    /* 最小14px（design_system.md §3） */
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ============================================================
   コンテンツリンク（design_system.md §5）
   色だけでなく下線で必ずリンクを識別可能にする
   ============================================================ */
a:not([class]) {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}
a:not([class]):hover {
    color: var(--primary-hover);
}
a:not([class])[target="_blank"]::after {
    /* 外部リンクアイコン（design_system.md §5） */
    content: ' \f08e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.75em;
    margin-left: 4px;
    vertical-align: super;
}

/* 成功・エラー表示（色だけで伝えない、アイコン併用） */
.status-success {
    color: var(--color-success);
}
.status-error {
    color: var(--color-error);
}
.status-warning {
    color: var(--color-warning);
}

/* ============================================================
   クイックアクション ドロップダウン & スプリットボタン
   ============================================================ */
.quick-action-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background-color: var(--surface-color);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    z-index: 50;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: 10px 16px;
    font-size: var(--font-size-sm);
    color: var(--text-main);
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s;
    font-family: var(--font-base);
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

/* Kanban Filter Tabs */
.kanban-filter-tabs {
    display: flex;
    gap: 8px;
    background-color: var(--kanban-bg, #F1F5F9);
    padding: 6px;
    border-radius: var(--radius-md, 8px);
    width: fit-content;
    margin-bottom: 20px;
    border: 1px solid var(--border-color, #E2E8F0);
}

.kanban-filter-tabs .tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted, #64748B);
    font-weight: 700;
    font-size: 15px;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.kanban-filter-tabs .tab-btn:hover {
    color: var(--text-main, #0F172A);
    background-color: rgba(255, 255, 255, 0.5);
}

.kanban-filter-tabs .tab-btn.active {
    color: var(--primary-color, #1D4ED8);
    background-color: #FFFFFF;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.1));
}

/* ============================================================
   詳細画面ワークスペース タブコンポーネント
   ============================================================ */
.workspace-tab-btn {
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.workspace-tab-btn:hover {
    color: var(--text-main) !important;
    background-color: #F1F5F9 !important;
}
.workspace-tab-btn.active {
    color: var(--primary-color) !important;
    border-bottom-color: var(--primary-color) !important;
    background-color: #FFFFFF !important;
}

/* ============================================================
   Job Management & AI Flyer Styles
   ============================================================ */
.job-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.job-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px 0;
}
.job-card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.job-card-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .top-header {
        height: 64px;
        padding-right: 16px;
    }

    .header-actions {
        gap: 10px;
    }

    .header-search {
        max-width: 320px;
        min-width: 180px;
    }

    .header-plan-info {
        display: none !important;
    }

    .content-area {
        padding: 12px;
    }

    .summary-cards {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }

    .today-action-row {
        grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.2fr) 76px minmax(120px, auto);
    }

    .kanban-board {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x proximity;
    }

    .kanban-column {
        flex: 0 0 220px !important;
        min-width: 220px !important;
        scroll-snap-align: start;
    }

    .workspace-container,
    .videos-container {
        gap: 14px !important;
    }

    .video-player-container {
        max-height: 42vh;
    }
}

@media (min-width: 1024px) and (max-width: 1100px) {
    .kanban-board {
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }

    .kanban-column {
        flex: 0 0 180px !important;
        min-width: 180px !important;
    }
}

@media (max-width: 767px) {
    html,
    body {
        min-width: 0;
        overflow-x: hidden;
    }

    .app-container {
        height: 100dvh !important;
        min-height: 100dvh;
        overflow: hidden;
    }

    .main-body {
        min-width: 0;
    }

    .sidebar {
        display: none !important;
    }

    .main-content {
        width: 100%;
        min-width: 0;
    }

    .top-header {
        height: 56px;
        padding: 0 12px !important;
        gap: 8px;
    }

    .header-left {
        min-width: 0 !important;
        gap: 8px !important;
    }

    .header-search {
        display: none;
    }

    #btn-toggle-sidebar {
        display: none !important;
    }

    .header-left h2 {
        font-size: 1rem !important;
    }

    .header-title h1 {
        max-width: 38vw;
        font-size: 0.95rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-plan-info,
    .header-settings-btn,
    .notification-bell-container {
        display: none !important;
    }

    .header-actions {
        gap: 8px;
    }

    .user-profile img {
        width: 32px;
        height: 32px;
    }

    .content-area {
        padding: 10px 10px calc(82px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .view-section {
        height: auto;
        min-height: 100%;
    }

    #view-kanban.active {
        display: block !important;
        height: auto;
    }

    .kanban-filter-tabs {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 4px;
        margin-bottom: 10px;
        scrollbar-width: none;
    }

    .kanban-filter-tabs::-webkit-scrollbar {
        display: none;
    }

    .kanban-filter-tabs .tab-btn {
        min-height: 42px;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .kanban-today-summary {
        padding: 12px;
        margin-bottom: 10px;
    }

    .summary-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .summary-heading h2 {
        font-size: 0.98rem;
    }

    .summary-heading p {
        font-size: 0.8rem;
    }

    .summary-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .today-action-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .today-action-table-head {
        display: none;
    }

    .today-header-actions {
        width: 100%;
    }

    .today-header-actions .btn {
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
    }

    .kanban-board-toolbar {
        align-items: stretch;
    }

    .kanban-board-actions {
        width: 100%;
    }

    .kanban-board-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .today-action-status,
    .today-action-row .kanban-mini-badge {
        width: fit-content;
    }

    .summary-card {
        min-height: 64px;
        padding: 10px;
    }

    .summary-label {
        font-size: 0.74rem;
        line-height: 1.35;
    }

    .summary-card strong {
        font-size: 1.45rem;
    }

    .kanban-board {
        display: none !important;
    }

    body.mobile-kanban-board-mode #view-kanban.active .kanban-board {
        display: flex !important;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 12px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    body.mobile-kanban-board-mode #view-kanban.active .kanban-column {
        flex: 0 0 min(82vw, 320px) !important;
        min-width: min(82vw, 320px) !important;
        max-height: none;
        scroll-snap-align: start;
    }

    body.mobile-kanban-board-mode #view-kanban.active .mobile-candidate-list {
        display: none;
    }

    .mobile-kanban-panel {
        display: block;
        background: #ffffff;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 12px;
        box-shadow: var(--shadow-sm);
    }

    .mobile-kanban-panel-header {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 12px;
    }

    .mobile-view-switch {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-radius: 8px;
        overflow: hidden;
    }

    .mobile-view-switch button + button {
        margin-left: -1px;
    }

    .mobile-kanban-panel-header h2 {
        margin: 0 0 4px;
        font-size: 1rem;
    }

    .mobile-kanban-panel-header p {
        margin: 0;
        color: var(--text-muted);
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .mobile-candidate-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-list-card {
        cursor: pointer;
        padding: 12px;
        border-radius: 8px;
        gap: 7px;
    }

    .mobile-list-card:hover {
        transform: none;
    }

    .mobile-list-card:active {
        cursor: pointer;
    }

    .mobile-list-card .card-header-row,
    .mobile-list-card .card-second-row {
        gap: 8px;
    }

    .mobile-list-card .card-title {
        font-size: 1rem;
    }

    .mobile-list-card .kanban-mini-badge {
        font-size: 0.72rem;
        padding: 4px 8px;
        white-space: normal;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 90;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.08);
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
        backdrop-filter: blur(12px);
    }

    .mobile-bottom-nav a,
    .mobile-bottom-nav button {
        min-height: 52px;
        border: none;
        border-radius: 8px;
        background: transparent;
        color: var(--text-muted);
        font: inherit;
        font-size: 0.72rem;
        font-weight: 800;
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        cursor: pointer;
    }

    .mobile-bottom-nav i {
        font-size: 1.05rem;
    }

    .mobile-bottom-nav a.active,
    .mobile-bottom-nav button.active {
        color: var(--primary-color);
        background: var(--primary-light);
    }

    .mobile-more-menu:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 130;
        display: flex;
        align-items: flex-end;
    }

    .mobile-more-backdrop {
        position: absolute;
        inset: 0;
        width: 100%;
        border: 0;
        background: rgba(15, 23, 42, 0.46);
        cursor: pointer;
    }

    .mobile-more-sheet {
        position: relative;
        width: 100%;
        max-height: min(72vh, 560px);
        overflow-y: auto;
        background: #FFFFFF;
        border-radius: 8px 8px 0 0;
        padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.18);
    }

    .mobile-more-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
    }

    .mobile-more-header h2 {
        margin: 0;
        font-size: 1rem;
    }

    .mobile-more-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .mobile-more-grid button {
        min-height: 78px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: #FFFFFF;
        color: var(--text-main);
        font: inherit;
        font-size: 0.82rem;
        font-weight: 700;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        cursor: pointer;
    }

    .mobile-more-grid button i {
        color: var(--primary-color);
        font-size: 1.1rem;
    }

    .mobile-more-grid button:focus-visible {
        outline: 3px solid rgba(37, 99, 235, 0.35);
        outline-offset: 1px;
    }

    body.mobile-detail-mode .mobile-bottom-nav {
        display: none;
    }

    #view-candidate-detail.active {
        padding-bottom: 76px;
    }

    #view-candidate-detail:not(.active) .mobile-detail-action-bar {
        display: none !important;
    }

    .mobile-detail-action-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 95;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        background: rgba(255, 255, 255, 0.97);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.08);
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
        backdrop-filter: blur(12px);
    }

    .mobile-detail-action-bar a,
    .mobile-detail-action-bar button {
        min-height: 50px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: #ffffff;
        color: var(--text-main);
        font: inherit;
        font-size: 0.72rem;
        font-weight: 800;
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        cursor: pointer;
    }

    .mobile-detail-action-bar a:first-child,
    .mobile-detail-action-bar button:last-child {
        color: var(--primary-color);
        background: var(--primary-light);
        border-color: #bfdbfe;
    }

    .mobile-detail-action-bar a[aria-disabled="true"],
    .mobile-detail-action-bar .disabled {
        color: #94a3b8;
        background: #f8fafc;
    }

    .workspace-header {
        position: sticky;
        top: 0;
        z-index: 5;
        background: var(--bg-color);
        padding: 4px 0 10px;
        margin-bottom: 12px !important;
    }

    .workspace-header h2 {
        flex: 1 1 100%;
        font-size: 1.1rem;
    }

    .workspace-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        height: auto !important;
    }

    .workspace-left,
    .workspace-right {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding-right: 0 !important;
    }

    .video-player-container {
        min-height: 220px !important;
        height: auto !important;
        max-height: 56vh;
        aspect-ratio: 16 / 9;
    }

    .candidate-info-card {
        padding: 16px !important;
    }

    .mobile-collapsible-section {
        position: relative;
    }

    .mobile-section-toggle {
        width: 100%;
        min-height: 44px;
        border: 0;
        border-bottom: 1px solid var(--border-color);
        background: #ffffff;
        color: var(--text-main);
        font: inherit;
        font-weight: 800;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 0 0 12px;
        margin-bottom: 14px;
        cursor: pointer;
    }

    .mobile-section-toggle i {
        color: var(--text-muted);
        transition: transform 0.2s ease;
    }

    .mobile-collapsible-section.is-collapsed .mobile-section-toggle {
        border-bottom: 0;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .mobile-collapsible-section.is-collapsed .mobile-section-toggle i {
        transform: rotate(-90deg);
    }

    .mobile-collapsible-section.is-collapsed > :not(.mobile-section-toggle) {
        display: none !important;
    }

    .candidate-info-card > div {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .candidate-info-card > div > div {
        grid-column: auto !important;
    }

    .human-insight-header {
        flex-direction: column;
    }

    .human-insight-actions,
    .quick-action-group {
        grid-template-columns: 1fr !important;
        display: grid !important;
        gap: 8px !important;
    }

    .workspace-tabs {
        overflow-x: auto;
    }

    .workspace-tab-btn {
        min-width: 120px;
        flex: 0 0 auto !important;
        font-size: 0.82rem !important;
        padding: 12px 10px !important;
    }

    .videos-container {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        gap: 12px !important;
    }

    .videos-list {
        width: 100% !important;
        max-height: none !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0 !important;
        padding-bottom: 10px;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        display: flex;
        gap: 8px;
        scroll-snap-type: x proximity;
    }

    .videos-list .contact-item {
        flex: 0 0 82%;
        max-width: 320px;
        scroll-snap-align: start;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: #ffffff;
        padding: 10px;
    }

    .videos-list .contact-item.active {
        border-color: var(--primary-color);
        background: var(--primary-light);
    }

    .video-evaluation-main {
        min-width: 0;
    }

    .video-evaluation-main .evaluation-form {
        margin-top: 12px !important;
        padding: 14px !important;
        overflow: visible !important;
    }

    .video-evaluation-main .evaluation-form > div:first-child {
        align-items: stretch !important;
    }

    #btn-video-generate-share-url {
        width: 100%;
        justify-content: center;
    }

    .video-review-header {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 10px;
    }

    .video-review-filters {
        position: sticky;
        top: 0;
        z-index: 6;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 3px;
        background: #ffffff;
    }

    .video-review-filters .tab-btn {
        min-height: 40px;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .email-import-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #form-add-candidate > div[style*="grid"],
    #form-import-applicant-email > div[style*="grid"],
    #form-email-import-page > div[style*="grid"],
    #form-job > div[style*="grid"],
    #form-add-schedule > div[style*="grid"],
    .settings-tab-content > div[style*="grid"] {
        grid-template-columns: 1fr !important;
    }

    #modal-add-candidate .modal-content,
    #modal-import-applicant-email .modal-content,
    #modal-company-settings .modal-content {
        min-height: min(92dvh, 720px);
    }

    .modal {
        align-items: flex-end;
        justify-content: center;
        padding: 0;
    }

    .modal-content {
        width: 100% !important;
        max-width: none !important;
        max-height: 92dvh;
        border-radius: 16px 16px 0 0;
        padding: 22px 18px calc(22px + env(safe-area-inset-bottom, 0px));
    }

    .form-group input,
    .form-group select,
    .form-group textarea,
    input,
    select,
    textarea {
        min-height: 44px;
        font-size: 16px;
    }

    .btn {
        min-height: 44px;
    }
}

@media print {
    body * {
        visibility: hidden !important;
    }
    
    #modal-flyer-maker,
    #modal-flyer-maker .modal-content,
    #modal-flyer-maker .modal-content > div,
    #modal-flyer-maker .modal-content > div > div:nth-child(2),
    #flyer-preview-container, 
    #flyer-preview-container * {
        visibility: visible !important;
    }

    #modal-flyer-maker {
        position: absolute;
        left: 0;
        top: 0;
        background: transparent;
    }
    
    .modal-content {
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
    }
    
    #flyer-preview-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* Hide unnecessary UI elements */
    .close-modal-flyer,
    #modal-flyer-maker h2,
    #modal-flyer-maker .modal-content > div > div:first-child,
    #btn-print-flyer,
    #modal-flyer-maker .modal-content > div > div:nth-child(2) > div:first-child {
        display: none !important;
    }
}
