/* =========================================================
   Dashboard
========================================================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.dashboard-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.04);
}

.dashboard-card h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.dashboard-card p {
    margin: 0 0 18px;
    color: #666;
    line-height: 1.7;
}


/* =========================================================
   Projects list
========================================================= */

.project-list {
    display: grid;
    gap: 18px;
}

.project-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.05);
    padding: 22px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
}

.project-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.project-card-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.4;
}

.project-card-description {
    margin: 0 0 18px;
    color: #4b5563;
    line-height: 1.8;
}

.project-card-description.is-muted {
    color: #9ca3af;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.project-meta-item {
    min-width: 120px;
    background: #f9fafb;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    padding: 10px 12px;
}

.project-meta-label {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 4px;
}

.project-meta-item strong {
    display: block;
    color: #111827;
    font-size: 14px;
    font-weight: 700;
}

.project-card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 140px;
}

.project-card-actions .btn,
.project-card-actions .btn-secondary {
    width: 100%;
}


/* =========================================================
   Project edit / info
========================================================= */

.project-info-box {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #eef0f3;
    border-radius: 14px;
}

.project-info-box span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 5px;
}

.project-info-box strong {
    display: block;
    color: #111827;
    font-size: 13px;
    word-break: break-all;
}


/* =========================================================
   Project show / maker menu
========================================================= */

.project-summary-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.05);
    padding: 24px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

.project-summary-description {
    margin: 0;
    color: #374151;
    line-height: 1.9;
}

.project-summary-description.is-muted {
    color: #9ca3af;
}

.project-summary-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.project-summary-meta div {
    background: #f9fafb;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    padding: 10px 12px;
}

.project-summary-meta span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 4px;
}

.project-summary-meta strong {
    display: block;
    color: #111827;
    font-size: 14px;
}

.maker-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 16px;
}

.maker-menu-card {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.04);
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.maker-menu-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(0,0,0,0.08);
    border-color: #c7d2fe;
}

.maker-menu-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.maker-menu-card p {
    margin: 0 0 12px;
    color: #6b7280;
    line-height: 1.7;
    font-size: 14px;
}

.maker-menu-card strong {
    color: #4f46e5;
    font-size: 14px;
}

.maker-menu-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}


/* =========================================================
   Characters list
========================================================= */

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.character-card {
    position: relative;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.05);
    overflow: hidden;
}

.character-color-bar {
    height: 8px;
    width: 100%;
}

.character-card-body {
    padding: 20px;
}

.character-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.character-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    border: 3px solid #333;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.character-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-icon span {
    font-size: 24px;
    font-weight: 800;
    color: #374151;
}

.character-title-wrap {
    min-width: 0;
}

.character-name {
    margin: 0 0 4px;
    font-size: 20px;
    line-height: 1.4;
}

.character-role {
    margin: 0;
    color: #4b5563;
    font-size: 14px;
}

.character-role.is-muted,
.character-profile.is-muted {
    color: #9ca3af;
}

.character-profile {
    min-height: 56px;
    margin: 0 0 18px;
    color: #4b5563;
    line-height: 1.8;
    font-size: 14px;
}

.character-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.character-meta div {
    background: #f9fafb;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    padding: 10px 12px;
}

.character-meta span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 4px;
}

.character-meta strong {
    display: block;
    color: #111827;
    font-size: 14px;
    word-break: break-all;
}

.character-actions {
    display: flex;
    gap: 10px;
}

.character-actions .btn {
    width: 100%;
}


/* =========================================================
   Character create / edit
========================================================= */

.color-input-row {
    display: grid;
    grid-template-columns: 1fr 54px;
    gap: 10px;
    align-items: center;
}

.color-code-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.color-picker {
    width: 54px;
    height: 46px;
    padding: 4px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.character-preview-box {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 22px;
    padding: 16px;
    border: 1px solid #eef0f3;
    border-radius: 16px;
    background: #f9fafb;
}

.character-preview-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    border: 3px solid #4f46e5;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.character-preview-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-preview-icon span {
    font-size: 24px;
    font-weight: 800;
    color: #374151;
}

.character-preview-box strong {
    display: block;
    margin-bottom: 4px;
    font-size: 18px;
}

.character-preview-box p {
    margin: 0;
    color: #6b7280;
}

.character-edit-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #eef0f3;
    border-radius: 16px;
    margin-bottom: 22px;
}

.character-edit-icon {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    border: 4px solid #4f46e5;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.character-edit-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-edit-icon span {
    font-size: 30px;
    font-weight: 800;
    color: #374151;
}

.character-edit-preview strong {
    display: block;
    font-size: 20px;
    margin-bottom: 4px;
}

.character-edit-preview p {
    margin: 0 0 4px;
    color: #6b7280;
}

.character-edit-preview small {
    color: #9ca3af;
}

.form-help {
    margin: 8px 0 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #374151;
    font-size: 14px;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
}

.form-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 24px 0;
}


/* =========================================================
   Delete screens
========================================================= */

.delete-warning {
    padding: 18px;
    border-radius: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    margin-bottom: 22px;
}

.delete-warning h2 {
    margin: 0 0 8px;
    color: #991b1b;
    font-size: 20px;
}

.delete-warning p {
    margin: 0;
    color: #7f1d1d;
    line-height: 1.8;
}

.related-box {
    margin: 20px 0;
    padding: 16px;
    border-radius: 16px;
    background: #f9fafb;
    border: 1px solid #eef0f3;
}

.related-box h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.related-box ul {
    margin: 0;
    padding-left: 20px;
    line-height: 1.9;
    color: #374151;
}

.delete-preview-box {
    margin: 20px 0;
    padding: 18px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.delete-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.delete-preview-head h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.delete-preview-head p {
    margin: 0;
    color: #6b7280;
}

.delete-preview-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.delete-preview-meta div {
    background: #f9fafb;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    padding: 10px 12px;
}

.delete-preview-meta span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 4px;
}

.delete-preview-meta strong {
    display: block;
    color: #111827;
    font-size: 14px;
    word-break: break-word;
}

.delete-preview-body {
    background: #f9fafb;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    padding: 14px;
    color: #374151;
    line-height: 1.8;
}

.delete-preview-body.is-muted {
    color: #9ca3af;
}


/* =========================================================
   Handouts
========================================================= */

.handout-list {
    display: grid;
    gap: 18px;
}

.handout-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.05);
    padding: 22px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
}

.handout-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.handout-title {
    margin: 0 0 6px;
    font-size: 22px;
    line-height: 1.4;
}

.handout-submeta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.handout-submeta span {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 700;
}

.handout-excerpt {
    margin: 0 0 18px;
    color: #4b5563;
    line-height: 1.8;
}

.handout-excerpt.is-muted {
    color: #9ca3af;
}

.handout-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.handout-meta-grid div {
    background: #f9fafb;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    padding: 10px 12px;
}

.handout-meta-grid span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 4px;
}

.handout-meta-grid strong {
    display: block;
    color: #111827;
    font-size: 14px;
    word-break: break-word;
}

.handout-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 130px;
}

.handout-actions .btn {
    width: 100%;
}

.handout-body-textarea {
    min-height: 280px;
}

.target-mode-box {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #eef0f3;
    border-radius: 14px;
    background: #f9fafb;
}

.radio-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #374151;
    font-size: 14px;
}

.radio-row input {
    width: 18px;
    height: 18px;
}

.character-target-box {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #eef0f3;
    border-radius: 16px;
    background: #fff;
}

.character-target-box h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.target-character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.target-character-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 5px solid #4f46e5;
    background: #f9fafb;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
}

.target-character-item input {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.target-character-item strong {
    display: block;
    font-size: 14px;
}

.target-character-item small {
    display: block;
    color: #6b7280;
    margin-top: 2px;
}

.target-gm-row {
    margin-top: 14px;
}


/* =========================================================
   Reading scenes
========================================================= */

.reading-scene-list {
    display: grid;
    gap: 18px;
}

.reading-scene-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.05);
    padding: 22px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
}

.reading-scene-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.reading-scene-title {
    margin: 0 0 6px;
    font-size: 22px;
    line-height: 1.4;
}

.reading-scene-submeta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reading-scene-submeta span {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 700;
}

.reading-scene-description {
    margin: 0 0 18px;
    color: #4b5563;
    line-height: 1.8;
}

.reading-scene-description.is-muted {
    color: #9ca3af;
}

.reading-scene-meta-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 10px;
}

.reading-scene-meta-grid div {
    background: #f9fafb;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    padding: 10px 12px;
}

.reading-scene-meta-grid span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 4px;
}

.reading-scene-meta-grid strong {
    display: block;
    color: #111827;
    font-size: 14px;
    word-break: break-all;
}

.reading-scene-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 140px;
}

.reading-scene-actions .btn {
    width: 100%;
}

.scene-preview-box {
    margin-top: 20px;
    padding: 18px;
    border-radius: 16px;
    background: #f9fafb;
    border: 1px solid #eef0f3;
}

.scene-preview-box h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.scene-preview-box ol {
    margin: 0;
    padding-left: 22px;
    color: #374151;
    line-height: 1.9;
}


/* =========================================================
   Reading lines management
========================================================= */

.reading-scene-summary {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 22px;
}

.reading-scene-summary div {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.04);
}

.reading-scene-summary span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 4px;
}

.reading-scene-summary strong {
    display: block;
    color: #111827;
    font-size: 15px;
    word-break: break-word;
}

.reading-line-form-card {
    margin-bottom: 28px;
}

.form-section-title {
    margin: 0 0 18px;
    font-size: 22px;
}

.reading-line-textarea {
    min-height: 130px;
}

.reading-line-list {
    display: grid;
    gap: 14px;
}

.reading-line-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.05);
    padding: 18px;
    display: grid;
    grid-template-columns: 54px 1fr auto;
    gap: 16px;
    align-items: flex-start;
}

.reading-line-order {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #eef2ff;
    color: #3730a3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.reading-speaker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.reading-speaker-info {
    min-width: 0;
}

.reading-speaker-info h3 {
    margin: 0 0 6px;
    font-size: 18px;
    line-height: 1.4;
}

.reading-line-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 3px solid #4f46e5;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.reading-line-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.reading-line-icon span {
    font-size: 18px;
    font-weight: 800;
    color: #374151;
}

.reading-line-submeta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reading-line-submeta span {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f9fafb;
    color: #374151;
    border: 1px solid #eef0f3;
    font-size: 12px;
    font-weight: 700;
}

.reading-line-body {
    margin: 0;
    color: #374151;
    line-height: 1.9;
    white-space: normal;
}

.reading-line-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 90px;
}

.reading-line-actions form {
    margin: 0;
}

.reading-line-actions .btn {
    width: 100%;
}


/* =========================================================
   Reading preview
========================================================= */

.preview-control-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.05);
    padding: 18px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
}

.preview-control-form .form-group {
    margin-bottom: 0;
}

.preview-current-viewer {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f9fafb;
    border: 1px solid #eef0f3;
    border-radius: 14px;
    padding: 10px 14px;
    min-width: 260px;
}

.preview-current-viewer span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 4px;
}

.preview-current-viewer strong {
    display: block;
    color: #111827;
    font-size: 14px;
}

.preview-current-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid #4f46e5;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.preview-current-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-current-icon span {
    margin: 0;
    color: #374151;
    font-weight: 800;
    font-size: 16px;
}

.reading-preview-paper {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    box-shadow: 0 14px 36px rgba(0,0,0,0.06);
    padding: 34px;
    max-width: 920px;
    margin: 0 auto;
}

.reading-preview-title {
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 20px;
    margin-bottom: 28px;
}

.reading-preview-title span {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.reading-preview-title h2 {
    margin: 0 0 8px;
    font-size: 28px;
}

.reading-preview-title p {
    margin: 0;
    color: #6b7280;
    line-height: 1.8;
}

.reading-preview-lines {
    display: grid;
    gap: 20px;
}

.preview-line-row {
    display: flex;
    width: 100%;
}

.preview-line-left {
    justify-content: flex-start;
}

.preview-line-right {
    justify-content: flex-end;
}

.preview-line-center {
    justify-content: center;
}

.preview-line-bubble {
    max-width: 72%;
    min-width: 240px;
}

.preview-line-center .preview-line-bubble {
    max-width: 78%;
    text-align: center;
}

.preview-speaker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.preview-line-right .preview-speaker {
    justify-content: flex-end;
}

.preview-line-center .preview-speaker {
    justify-content: center;
}

.preview-speaker-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid #4f46e5;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.preview-speaker-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-speaker-icon span {
    color: #374151;
    font-weight: 800;
    font-size: 16px;
}

.preview-speaker-name strong {
    font-size: 15px;
    color: #111827;
}

.preview-speaker-name.is-right {
    text-align: right;
}

.preview-line-body {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 16px 18px;
    color: #111827;
    line-height: 1.9;
    font-size: 16px;
}

.preview-line-left .preview-line-body {
    border-top-left-radius: 6px;
}

.preview-line-right .preview-line-body {
    border-top-right-radius: 6px;
    background: #eef2ff;
    border-color: #c7d2fe;
}

.preview-line-center .preview-line-body {
    background: #fff7ed;
    border-color: #fed7aa;
}


/* =========================================================
   Responsive
========================================================= */

@media (max-width: 980px) {
    .handout-card,
    .reading-scene-card {
        grid-template-columns: 1fr;
    }

    .handout-actions,
    .reading-scene-actions {
        flex-direction: row;
    }

    .handout-actions .btn,
    .reading-scene-actions .btn {
        width: auto;
    }

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

    .reading-scene-meta-grid {
        grid-template-columns: 1fr;
    }

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

    .reading-line-card {
        grid-template-columns: 46px 1fr;
    }

    .reading-line-actions {
        grid-column: 1 / -1;
        flex-direction: row;
    }

    .reading-line-actions .btn {
        width: auto;
    }
}

@media (max-width: 900px) {
    .project-card {
        grid-template-columns: 1fr;
    }

    .project-card-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .project-card-actions .btn,
    .project-card-actions .btn-secondary {
        width: auto;
    }

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

@media (max-width: 820px) {
    .project-summary-card {
        grid-template-columns: 1fr;
    }

    .project-summary-meta {
        grid-template-columns: 1fr;
    }

    .preview-control-card {
        grid-template-columns: 1fr;
    }

    .preview-current-viewer {
        min-width: 0;
    }

    .reading-preview-paper {
        padding: 22px;
    }

    .preview-line-bubble {
        max-width: 92%;
        min-width: 0;
    }
}

@media (max-width: 720px) {
    .project-info-box {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .handout-meta-grid,
    .delete-preview-meta,
    .reading-scene-summary {
        grid-template-columns: 1fr;
    }

    .reading-line-card {
        grid-template-columns: 1fr;
    }

    .reading-line-order,
    .reading-line-icon {
        margin-bottom: 4px;
    }
}

@media (max-width: 560px) {
    .preview-line-bubble {
        max-width: 100%;
        width: 100%;
    }

    .preview-line-right,
    .preview-line-left,
    .preview-line-center {
        justify-content: stretch;
    }
}


@page {
    size: A4;
    margin: 0;
}

@media print {
    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .page-header,
    .preview-control-card,
    .page-actions,
    .site-header,
    .sidebar,
    .breadcrumb,
    .flash-message,
    .site-footer,
    footer {
        display: none !important;
    }

    .main-content,
    .page-content {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }

    .reading-preview-paper {
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 6mm 14mm 10mm 14mm !important;
        width: 100% !important;
        background: #fff !important;
    }

    .reading-preview-title {
        margin-top: 0 !important;
        padding-top: 0 !important;
        page-break-after: avoid;
    }

    .reading-preview-title h2 {
        margin-top: 0 !important;
    }

    .preview-line-row,
    .preview-line-bubble {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .preview-line-body {
        color: #111 !important;
    }

    a {
        color: inherit !important;
        text-decoration: none !important;
    }
}



/* =========================================================
   PDF / ZIP 出力
========================================================= */

.export-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.export-summary-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.export-summary-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 8px;
}

.export-summary-card strong {
    font-size: 30px;
    line-height: 1;
    color: #111827;
}

.export-summary-card small {
    margin-left: 4px;
    color: #64748b;
}

.export-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.export-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.export-card.is-ready {
    grid-column: 1 / -1;
    border-color: #c7d2fe;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.export-card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.export-card h2 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #111827;
}

.export-card p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
}

.export-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.export-badge-ready {
    background: #eef2ff;
    color: #4338ca;
}

.export-scene-list {
    display: grid;
    gap: 12px;
}

.export-scene-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.export-scene-item strong {
    display: block;
    color: #111827;
    font-size: 15px;
    margin-bottom: 4px;
}

.export-scene-item p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.export-scene-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-sm {
    padding: 7px 10px;
    font-size: 13px;
    border-radius: 10px;
}

.btn-disabled,
.btn-disabled:hover {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    border-color: #e5e7eb !important;
    cursor: not-allowed;
}

.empty-state.compact {
    padding: 24px;
    text-align: center;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
}

.empty-state.compact h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.empty-state.compact p {
    margin: 0 0 16px;
}

@media (max-width: 900px) {
    .export-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .export-grid {
        grid-template-columns: 1fr;
    }

    .export-card.is-ready {
        grid-column: auto;
    }

    .export-scene-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .export-scene-actions {
        width: 100%;
    }

    .export-scene-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .export-summary-grid {
        grid-template-columns: 1fr;
    }

    .export-card-header {
        flex-direction: column;
    }
}



/* =========================================================
   GMシナリオ管理
========================================================= */

.gm-guide-card {
    background: linear-gradient(135deg, #312e81, #4f46e5);
    color: #fff;
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.2);
}

.gm-guide-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.gm-guide-card p {
    margin: 0;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.88);
}

.gm-section-list {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.gm-section-card {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.gm-section-main {
    flex: 1;
    min-width: 0;
}

.gm-section-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.gm-section-type {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 12px;
    font-weight: 700;
}

.gm-section-order {
    color: #94a3b8;
    font-size: 12px;
}

.gm-section-card h2 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 18px;
}

.gm-section-excerpt {
    margin: 0;
    color: #64748b;
    line-height: 1.7;
    font-size: 14px;
}

.gm-section-excerpt.is-muted {
    color: #9ca3af;
}

.gm-section-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-draft {
    background: #f1f5f9;
    color: #475569;
}

.status-ready {
    background: #dcfce7;
    color: #15803d;
}

.status-archived {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background: #fecaca;
    color: #991b1b;
}

@media (max-width: 760px) {
    .gm-section-card {
        flex-direction: column;
    }

    .gm-section-actions {
        width: 100%;
    }

    .gm-section-actions .btn {
        flex: 1;
        justify-content: center;
    }
}



/* =========================================================
   GMシナリオ フォーム
========================================================= */

.gm-form-card {
    max-width: 980px;
}

.gm-body-textarea {
    min-height: 420px;
    line-height: 1.8;
    font-size: 15px;
    resize: vertical;
}

.required {
    display: inline-flex;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 11px;
    font-weight: 700;
}

.alert {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}


/* =========================================================
   GMシナリオプレビュー
========================================================= */

.gm-preview-paper {
    max-width: 920px;
    margin: 0 auto 40px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.gm-preview-cover {
    padding-bottom: 32px;
    margin-bottom: 32px;
    border-bottom: 1px solid #e5e7eb;
}

.gm-preview-cover-label {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 14px;
}

.gm-preview-cover h1 {
    margin: 0 0 14px;
    color: #111827;
    font-size: 32px;
    line-height: 1.3;
}

.gm-preview-cover p {
    margin: 0;
    color: #475569;
    line-height: 1.9;
}

.gm-preview-cover p.is-muted {
    color: #94a3b8;
}

.gm-preview-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.gm-preview-meta div {
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.gm-preview-meta span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 4px;
}

.gm-preview-meta strong {
    color: #111827;
    font-size: 16px;
}

.gm-preview-toc {
    padding: 22px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    margin-bottom: 30px;
}

.gm-preview-toc h2 {
    margin: 0 0 12px;
    font-size: 18px;
    color: #111827;
}

.gm-preview-toc ol {
    margin: 0;
    padding-left: 22px;
}

.gm-preview-toc li {
    margin: 8px 0;
    color: #334155;
    line-height: 1.6;
}

.gm-preview-toc li span {
    display: inline-flex;
    margin-right: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 12px;
    font-weight: 700;
}

.gm-preview-sections {
    display: grid;
    gap: 28px;
}

.gm-preview-section {
    padding-bottom: 28px;
    border-bottom: 1px solid #e5e7eb;
}

.gm-preview-section:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.gm-preview-section-head {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.gm-preview-section-head span,
.gm-preview-section-head small {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.gm-preview-section-head span {
    background: #eef2ff;
    color: #4338ca;
}

.gm-preview-section-head small {
    background: #f1f5f9;
    color: #64748b;
}

.gm-preview-section h2 {
    margin: 0 0 14px;
    color: #111827;
    font-size: 22px;
    line-height: 1.4;
}

.gm-preview-body {
    color: #1f2937;
    font-size: 15px;
    line-height: 2;
    white-space: normal;
}

.gm-preview-empty {
    color: #94a3b8;
    margin: 0;
}

@media print {
    @page {
        size: A4;
        margin: 0;
    }

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .page-header,
    .page-actions,
    .site-header,
    .sidebar,
    .breadcrumb,
    .flash-message,
    .site-footer,
    footer {
        display: none !important;
    }

    .main-content,
    .page-content,
    main,
    .layout-main,
    .app-main {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        width: 100% !important;
        background: #fff !important;
    }

    .gm-preview-paper {
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        background: #fff !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 4mm 10mm 10mm 10mm !important;
        box-shadow: none !important;
    }

    .gm-preview-cover {
        margin-top: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 18px !important;
        margin-bottom: 18px !important;
        border-bottom: 1px solid #e5e7eb !important;
        page-break-after: avoid;
        break-after: avoid;
    }

    .gm-preview-cover-label {
        margin-top: 0 !important;
        margin-bottom: 8px !important;
    }

    .gm-preview-cover h1 {
        margin-top: 0 !important;
    }

    .gm-preview-meta {
        margin-top: 14px !important;
    }

    .gm-preview-toc {
        margin-top: 0 !important;
        margin-bottom: 18px !important;
        background: #fff !important;
        border: 1px solid #e5e7eb !important;
    }

    .gm-preview-meta div {
        background: #fff !important;
        border: 1px solid #e5e7eb !important;
    }

    .gm-preview-cover-label,
    .gm-preview-toc li span,
    .gm-preview-section-head span {
        background: #eef2ff !important;
        color: #4338ca !important;
    }

    .gm-preview-section-head small {
        background: #f1f5f9 !important;
        color: #64748b !important;
    }

    .gm-preview-section,
    .gm-preview-toc {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    a {
        color: inherit !important;
        text-decoration: none !important;
    }
}



/* =========================================================
   削除確認
========================================================= */

.delete-confirm-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    max-width: 900px;
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 10px 28px rgba(153, 27, 27, 0.08);
}

.delete-confirm-icon {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #fef2f2;
    font-size: 26px;
}

.delete-confirm-body {
    flex: 1;
    min-width: 0;
}

.delete-confirm-body h2 {
    margin: 0 0 8px;
    color: #991b1b;
    font-size: 22px;
}

.delete-confirm-body p {
    margin: 0 0 18px;
    color: #64748b;
    line-height: 1.8;
}

.delete-target-box {
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.delete-target-box dl {
    margin: 0;
}

.delete-target-box dl div {
    display: grid;
    grid-template-columns: 140px 1fr;
    border-bottom: 1px solid #e5e7eb;
}

.delete-target-box dl div:last-child {
    border-bottom: none;
}

.delete-target-box dt,
.delete-target-box dd {
    padding: 12px 14px;
    margin: 0;
    font-size: 14px;
}

.delete-target-box dt {
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
}

.delete-target-box dd {
    color: #111827;
}

.delete-target-preview {
    padding: 14px;
    border-top: 1px solid #e5e7eb;
    color: #475569;
    line-height: 1.8;
    font-size: 14px;
    background: #f8fafc;
}

@media (max-width: 700px) {
    .delete-confirm-card {
        flex-direction: column;
    }

    .delete-target-box dl div {
        grid-template-columns: 1fr;
    }

    .delete-target-box dt {
        border-bottom: 1px solid #e5e7eb;
    }
}



/* =========================================================
   進行・フェーズ管理
========================================================= */

.schedule-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.schedule-summary-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.schedule-summary-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 8px;
}

.schedule-summary-card strong {
    font-size: 30px;
    line-height: 1;
    color: #111827;
}

.schedule-summary-card small {
    margin-left: 4px;
    color: #64748b;
}

.schedule-guide-card {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #fff;
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 30px rgba(20, 184, 166, 0.18);
}

.schedule-guide-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.schedule-guide-card p {
    margin: 0;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

.phase-list {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.phase-card {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.phase-card-main {
    flex: 1;
    min-width: 0;
}

.phase-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.phase-type {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: #ccfbf1;
    color: #0f766e;
    font-size: 12px;
    font-weight: 700;
}

.phase-public {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.phase-public-on {
    background: #dcfce7;
    color: #15803d;
}

.phase-public-off {
    background: #f1f5f9;
    color: #64748b;
}

.phase-order {
    color: #94a3b8;
    font-size: 12px;
}

.phase-card h2 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 18px;
}

.phase-description {
    margin: 0;
    color: #64748b;
    line-height: 1.7;
    font-size: 14px;
}

.phase-description.is-muted,
.phase-extra-info .is-muted {
    color: #9ca3af;
}

.phase-extra-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.phase-extra-info span {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
}

.phase-card-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.status-review {
    background: #fef3c7;
    color: #92400e;
}

@media (max-width: 900px) {
    .schedule-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .phase-card {
        flex-direction: column;
    }

    .phase-card-actions {
        width: 100%;
    }

    .phase-card-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .schedule-summary-grid {
        grid-template-columns: 1fr;
    }

    .phase-card-actions {
        flex-direction: column;
    }

    .phase-card-actions .btn {
        width: 100%;
    }
}




/* =========================================================
   進行・フェーズ フォーム
========================================================= */

.schedule-form-card {
    max-width: 980px;
}

.schedule-textarea {
    min-height: 140px;
    line-height: 1.8;
    resize: vertical;
}

.schedule-gm-note {
    min-height: 220px;
}

.form-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #334155;
    font-weight: 700;
}

.form-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: #0f766e;
}





/* =========================================================
   進行項目管理
========================================================= */

.phase-detail-card {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.phase-detail-main {
    flex: 1;
    min-width: 0;
}

.phase-detail-main h2 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #111827;
}

.phase-detail-main p {
    margin: 0;
    color: #64748b;
    line-height: 1.8;
}

.phase-detail-main p.is-muted {
    color: #9ca3af;
}

.phase-detail-stats {
    flex: 0 0 280px;
    display: grid;
    gap: 10px;
}

.phase-detail-stats div {
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
}

.phase-detail-stats span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 4px;
}

.phase-detail-stats strong {
    color: #111827;
    font-size: 18px;
}

.schedule-item-list {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.schedule-item-card {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 18px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.schedule-item-time {
    display: grid;
    place-items: center;
    min-height: 72px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.schedule-item-time span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.schedule-item-time strong {
    display: block;
    color: #111827;
    font-size: 20px;
    line-height: 1.2;
}

.schedule-item-main {
    min-width: 0;
}

.schedule-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.schedule-item-type {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.schedule-item-type-default {
    background: #f1f5f9;
    color: #475569;
}

.schedule-item-type-read {
    background: #eef2ff;
    color: #4338ca;
}

.schedule-item-type-announce {
    background: #dbeafe;
    color: #1d4ed8;
}

.schedule-item-type-card {
    background: #fef3c7;
    color: #92400e;
}

.schedule-item-type-handout {
    background: #fae8ff;
    color: #a21caf;
}

.schedule-item-type-investigation {
    background: #ccfbf1;
    color: #0f766e;
}

.schedule-item-type-discussion {
    background: #dcfce7;
    color: #15803d;
}

.schedule-item-type-vote {
    background: #fee2e2;
    color: #b91c1c;
}

.schedule-item-type-ending {
    background: #ede9fe;
    color: #6d28d9;
}

.schedule-item-type-system {
    background: #e5e7eb;
    color: #374151;
}

.schedule-item-card h2 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 18px;
}

.schedule-item-description {
    margin: 0;
    color: #64748b;
    line-height: 1.7;
    font-size: 14px;
}

.schedule-item-description.is-muted {
    color: #9ca3af;
}

.schedule-item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

@media (max-width: 920px) {
    .phase-detail-card {
        flex-direction: column;
    }

    .phase-detail-stats {
        flex: none;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .schedule-item-card {
        grid-template-columns: 1fr;
    }

    .schedule-item-time {
        display: flex;
        justify-content: space-between;
        min-height: auto;
        padding: 12px 14px;
    }

    .schedule-item-actions {
        width: 100%;
    }

    .schedule-item-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .phase-detail-stats {
        grid-template-columns: 1fr;
    }

    .schedule-item-actions {
        flex-direction: column;
    }

    .schedule-item-actions .btn {
        width: 100%;
    }
}




/* =========================================================
   進行表プレビュー
========================================================= */

.schedule-preview-paper {
    max-width: 940px;
    margin: 0 auto 40px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.schedule-preview-cover {
    padding-bottom: 32px;
    margin-bottom: 32px;
    border-bottom: 1px solid #e5e7eb;
}

.schedule-preview-cover-label {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: #ccfbf1;
    color: #0f766e;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 14px;
}

.schedule-preview-cover h1 {
    margin: 0 0 14px;
    color: #111827;
    font-size: 32px;
    line-height: 1.3;
}

.schedule-preview-cover p {
    margin: 0;
    color: #475569;
    line-height: 1.9;
}

.schedule-preview-cover p.is-muted {
    color: #94a3b8;
}

.schedule-preview-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.schedule-preview-meta div {
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.schedule-preview-meta span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 4px;
}

.schedule-preview-meta strong {
    color: #111827;
    font-size: 16px;
}

.schedule-preview-toc {
    padding: 22px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    margin-bottom: 30px;
}

.schedule-preview-toc h2 {
    margin: 0 0 12px;
    font-size: 18px;
    color: #111827;
}

.schedule-preview-toc ol {
    margin: 0;
    padding-left: 22px;
}

.schedule-preview-toc li {
    margin: 8px 0;
    color: #334155;
    line-height: 1.6;
}

.schedule-preview-toc li span {
    display: inline-flex;
    margin-right: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ccfbf1;
    color: #0f766e;
    font-size: 12px;
    font-weight: 700;
}

.schedule-preview-toc li small {
    margin-left: 8px;
    color: #64748b;
}

.schedule-preview-phases {
    display: grid;
    gap: 32px;
}

.schedule-preview-phase {
    padding-bottom: 30px;
    border-bottom: 1px solid #e5e7eb;
}

.schedule-preview-phase:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.schedule-preview-phase-head {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.schedule-preview-phase-head span,
.schedule-preview-phase-head small {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.schedule-preview-phase-head span {
    background: #ccfbf1;
    color: #0f766e;
}

.schedule-preview-phase-head small {
    background: #f1f5f9;
    color: #64748b;
}

.schedule-preview-phase h2 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 24px;
    line-height: 1.4;
}

.schedule-preview-phase-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.schedule-preview-phase-meta span {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
}

.schedule-preview-text {
    color: #1f2937;
    font-size: 15px;
    line-height: 1.9;
    margin: 10px 0 0;
}

.schedule-preview-note {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    line-height: 1.8;
}

.schedule-preview-note strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
}

.schedule-preview-note.is-player {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.schedule-preview-note.is-gm {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.schedule-preview-items {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.schedule-preview-item {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
}

.schedule-preview-item-time {
    display: grid;
    place-items: center;
    min-height: 72px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.schedule-preview-item-time span {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.schedule-preview-item-time strong {
    color: #111827;
    font-size: 18px;
}

.schedule-preview-item-main {
    min-width: 0;
}

.schedule-preview-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.schedule-preview-item h3 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 18px;
}

.schedule-preview-empty {
    color: #94a3b8;
    margin: 0;
}

@media print {
    @page {
        size: A4;
        margin: 0;
    }

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .page-header,
    .page-actions,
    .site-header,
    .sidebar,
    .breadcrumb,
    .flash-message,
    .site-footer,
    footer {
        display: none !important;
    }

    .main-content,
    .page-content,
    main,
    .layout-main,
    .app-main {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        width: 100% !important;
        background: #fff !important;
    }

    .schedule-preview-paper {
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        background: #fff !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 4mm 10mm 10mm 10mm !important;
        box-shadow: none !important;
    }

    .schedule-preview-cover {
        margin-top: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 18px !important;
        margin-bottom: 18px !important;
        border-bottom: 1px solid #e5e7eb !important;
        page-break-after: avoid;
        break-after: avoid;
    }

    .schedule-preview-cover-label {
        margin-top: 0 !important;
        margin-bottom: 8px !important;
    }

    .schedule-preview-cover h1 {
        margin-top: 0 !important;
    }

    .schedule-preview-phase,
    .schedule-preview-item,
    .schedule-preview-toc,
    .schedule-preview-note {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .schedule-preview-meta div,
    .schedule-preview-toc,
    .schedule-preview-item-time,
    .schedule-preview-phase-meta span {
        background: #fff !important;
        border: 1px solid #e5e7eb !important;
    }

    a {
        color: inherit !important;
        text-decoration: none !important;
    }
}

@media (max-width: 760px) {
    .schedule-preview-paper {
        padding: 24px;
    }

    .schedule-preview-cover h1 {
        font-size: 26px;
    }

    .schedule-preview-meta {
        grid-template-columns: 1fr;
    }

    .schedule-preview-item {
        grid-template-columns: 1fr;
    }

    .schedule-preview-item-time {
        display: flex;
        justify-content: space-between;
        min-height: auto;
        padding: 12px 14px;
    }
}



/* =========================================================
   カード管理
========================================================= */

.cards-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.cards-summary-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.cards-summary-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 8px;
}

.cards-summary-card strong {
    font-size: 30px;
    line-height: 1;
    color: #111827;
}

.cards-summary-card small {
    margin-left: 4px;
    color: #64748b;
}

.cards-guide-card {
    background: linear-gradient(135deg, #4338ca, #7c3aed);
    color: #fff;
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.18);
}

.cards-guide-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.cards-guide-card p {
    margin: 0;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

.card-list {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.card-item {
    display: grid;
    grid-template-columns: 74px 1fr auto;
    gap: 18px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.card-item-preview {
    display: flex;
    justify-content: center;
}

.card-mini {
    width: 58px;
    height: 76px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    border: 2px solid #c7d2fe;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 800;
    font-size: 22px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.card-mini.card-state-down {
    background: repeating-linear-gradient(
        45deg,
        #eef2ff,
        #eef2ff 8px,
        #e0e7ff 8px,
        #e0e7ff 16px
    );
}

.card-mini.card-state-up {
    background: #fff;
}

.card-mini.card-state-hidden {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #64748b;
}

.card-item-main {
    min-width: 0;
}

.card-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.card-state,
.card-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.card-state-down {
    background: #eef2ff;
    color: #4338ca;
}

.card-state-up {
    background: #dcfce7;
    color: #15803d;
}

.card-state-hidden {
    background: #f1f5f9;
    color: #64748b;
}

.card-meta-pill {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e5e7eb;
}

.card-item h2 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 18px;
}

.card-description {
    margin: 0;
    color: #64748b;
    line-height: 1.7;
    font-size: 14px;
}

.card-description.is-muted,
.card-face-summary .is-muted {
    color: #9ca3af;
}

.card-face-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.card-face-summary span {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
}

.card-item-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

@media (max-width: 980px) {
    .cards-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .card-item {
        grid-template-columns: 1fr;
    }

    .card-item-preview {
        justify-content: flex-start;
    }

    .card-item-actions {
        width: 100%;
    }

    .card-item-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .cards-summary-grid {
        grid-template-columns: 1fr;
    }

    .card-item-actions {
        flex-direction: column;
    }

    .card-item-actions .btn {
        width: 100%;
    }
}




/* =========================================================
   カード フォーム
========================================================= */

.card-form-card {
    max-width: 980px;
}

.card-textarea {
    min-height: 160px;
    line-height: 1.8;
    resize: vertical;
}

.card-gm-note {
    min-height: 220px;
}

.form-help {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}


/* =========================================================
   カード面管理
========================================================= */

.card-face-card-summary {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 18px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.card-face-summary-preview {
    display: flex;
    justify-content: center;
}

.card-face-summary-main {
    min-width: 0;
}

.card-face-summary-main h2 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 22px;
}

.card-face-summary-text {
    margin: 6px 0 0;
    color: #64748b;
    line-height: 1.7;
    font-size: 14px;
}

.card-face-section {
    margin-bottom: 30px;
}

.card-face-list {
    display: grid;
    gap: 14px;
}

.card-face-item {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 18px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.card-face-preview {
    width: 110px;
}

.card-face-preview img {
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
}

.card-face-placeholder {
    width: 100%;
    height: 140px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
}

.card-face-main {
    min-width: 0;
}

.card-face-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.card-face-side,
.card-face-default {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.card-face-side.is-front {
    background: #eef2ff;
    color: #4338ca;
}

.card-face-side.is-back {
    background: #fef3c7;
    color: #92400e;
}

.card-face-default {
    background: #dcfce7;
    color: #15803d;
}

.card-face-main h3 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 18px;
}

.card-face-board,
.card-face-asset {
    margin-top: 6px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}

.card-face-text {
    margin: 10px 0 0;
    color: #475569;
    line-height: 1.7;
    font-size: 14px;
}

.card-face-text.is-muted {
    color: #9ca3af;
}

.card-face-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.empty-state.compact {
    padding: 24px;
    text-align: center;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
}

.empty-state.compact h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.empty-state.compact p {
    margin: 0 0 16px;
    color: #64748b;
}

@media (max-width: 920px) {
    .card-face-item {
        grid-template-columns: 1fr;
    }

    .card-face-preview {
        width: 100%;
        max-width: 240px;
    }

    .card-face-actions {
        width: 100%;
    }

    .card-face-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .card-face-card-summary {
        grid-template-columns: 1fr;
    }

    .card-face-summary-preview {
        justify-content: flex-start;
    }

    .card-face-actions {
        flex-direction: column;
    }

    .card-face-actions .btn {
        width: 100%;
    }
}









/* カード一覧の表示補正 */
.card-list {
    display: grid !important;
    gap: 14px !important;
    margin-bottom: 24px !important;
}

.card-list .card-item {
    display: grid !important;
    grid-template-columns: 74px 1fr auto !important;
    gap: 18px !important;
    align-items: flex-start !important;
    min-height: 120px !important;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 18px !important;
    padding: 20px !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05) !important;
    overflow: visible !important;
}

.card-list .card-item-preview,
.card-list .card-item-main,
.card-list .card-item-actions {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.card-list .card-item-main {
    display: block !important;
    min-width: 0 !important;
}

.card-list .card-item-actions {
    flex: 0 0 auto !important;
    gap: 8px !important;
    align-items: center !important;
}

.card-list .card-item h2 {
    display: block !important;
    margin: 0 0 8px !important;
    color: #111827 !important;
    font-size: 18px !important;
}

.card-list .card-description,
.card-list .card-face-summary,
.card-list .card-item-meta {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.card-list .card-description {
    display: block !important;
    color: #64748b !important;
}


.delete-target-image {
    padding: 14px;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

.delete-target-image img {
    display: block;
    max-width: 260px;
    max-height: 220px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
}










/* =========================================================
   カード面プレビュー
========================================================= */

.card-preview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: flex-start;
}

.card-preview-stage {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 32px;
    background:
        linear-gradient(45deg, #f8fafc 25%, transparent 25%),
        linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f8fafc 75%),
        linear-gradient(-45deg, transparent 75%, #f8fafc 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
}

.card-render-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 2px solid #c7d2fe;
    border-radius: 22px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    color: #111827;
}

.card-render-card.is-back {
    border-color: #fcd34d;
}

.card-render-card.is-front {
    border-color: #c7d2fe;
}

.card-render-card > .card-render-image:first-child {
    margin-top: 18px;
}

.card-render-card > .card-render-body:first-child {
    padding-top: 34px;
}

.card-render-image {
    margin: 18px 18px 0;
    border-radius: 16px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.card-render-image img {
    display: block;
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.card-render-body {
    flex: 1;
    padding: 18px;
}

.card-render-body h2 {
    margin: 0 0 14px;
    color: #111827;
    font-size: 22px;
    line-height: 1.4;
}

.card-render-text {
    color: #334155;
    font-size: 15px;
    line-height: 1.9;
    white-space: normal;
}

.card-render-empty {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.8;
}

.card-preview-info {
    display: grid;
    gap: 16px;
}

.card-preview-info-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.card-preview-info-card h2 {
    margin: 0 0 14px;
    color: #111827;
    font-size: 18px;
}

.card-preview-info-card dl {
    margin: 0;
}

.card-preview-info-card dl div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
}

.card-preview-info-card dl div:last-child {
    border-bottom: none;
}

.card-preview-info-card dt {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.card-preview-info-card dd {
    margin: 0;
    color: #111827;
    font-size: 13px;
}

.card-preview-info-card p {
    margin: 0 0 14px;
    color: #475569;
    line-height: 1.8;
    font-size: 14px;
}

.card-preview-info-card p:last-child {
    margin-bottom: 0;
}

@media print {
    @page {
        size: A4;
        margin: 0;
    }

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .page-header,
    .page-actions,
    .site-header,
    .sidebar,
    .breadcrumb,
    .flash-message,
    .site-footer,
    footer,
    .card-preview-info {
        display: none !important;
    }

    .main-content,
    .page-content,
    main,
    .layout-main,
    .app-main {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        width: 100% !important;
        background: #fff !important;
    }

    .card-preview-layout {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .card-preview-stage {
        display: flex !important;
        justify-content: center !important;
        align-items: flex-start !important;
        padding: 8mm !important;
        background: #fff !important;
        border: none !important;
        border-radius: 0 !important;
    }

    .card-render-card {
        box-shadow: none !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    a {
        color: inherit !important;
        text-decoration: none !important;
    }
}

@media (max-width: 920px) {
    .card-preview-layout {
        grid-template-columns: 1fr;
    }

    .card-preview-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .card-preview-stage {
        padding: 18px;
        overflow-x: auto;
        justify-content: flex-start;
    }
}
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .page-header,
    .page-actions,
    .site-header,
    .sidebar,
    .breadcrumb,
    .flash-message,
    .site-footer,
    footer,
    .card-preview-info {
        display: none !important;
    }

    .main-content,
    .page-content,
    main,
    .layout-main,
    .app-main {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        width: 100% !important;
        background: #fff !important;
    }

    .card-preview-layout {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .card-preview-stage {
        display: flex !important;
        justify-content: center !important;
        align-items: flex-start !important;
        padding: 8mm !important;
        background: #fff !important;
        border: none !important;
        border-radius: 0 !important;
    }

    .card-render-card {
        box-shadow: none !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    a {
        color: inherit !important;
        text-decoration: none !important;
    }
}

@media (max-width: 920px) {
    .card-preview-layout {
        grid-template-columns: 1fr;
    }

    .card-preview-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .card-preview-stage {
        padding: 18px;
        overflow-x: auto;
        justify-content: flex-start;
    }
}



/* =========================================================
   素材アップロード
========================================================= */

.asset-upload-card {
    max-width: 820px;
}

.asset-upload-guide {
    margin: 20px 0;
    padding: 18px 20px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.asset-upload-guide h2 {
    margin: 0 0 10px;
    color: #111827;
    font-size: 18px;
}

.asset-upload-guide ul {
    margin: 0;
    padding-left: 20px;
    color: #475569;
    line-height: 1.8;
}

.asset-upload-guide li {
    margin: 4px 0;
}



/* =========================================================
   素材管理
========================================================= */

.assets-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.assets-summary-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.assets-summary-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 8px;
}

.assets-summary-card strong {
    font-size: 30px;
    line-height: 1;
    color: #111827;
}

.assets-summary-card small {
    margin-left: 4px;
    color: #64748b;
}

.assets-guide-card {
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: #fff;
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.18);
}

.assets-guide-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.assets-guide-card p {
    margin: 0;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

.asset-list {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.asset-item {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 18px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.asset-thumb {
    width: 110px;
    height: 90px;
    border-radius: 14px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    display: grid;
    place-items: center;
}

.asset-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asset-file-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 48px;
    border-radius: 10px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 13px;
    font-weight: 800;
}

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

.asset-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.asset-type,
.asset-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.asset-type-icon {
    background: #fef3c7;
    color: #92400e;
}

.asset-type-background {
    background: #dbeafe;
    color: #1d4ed8;
}

.asset-type-card-front {
    background: #eef2ff;
    color: #4338ca;
}

.asset-type-card-back {
    background: #fae8ff;
    color: #a21caf;
}

.asset-type-image {
    background: #dcfce7;
    color: #15803d;
}

.asset-type-pdf {
    background: #fee2e2;
    color: #b91c1c;
}

.asset-type-other {
    background: #f1f5f9;
    color: #64748b;
}

.asset-meta-pill {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e5e7eb;
}

.asset-item h2 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 18px;
    line-height: 1.4;
}

.asset-path {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    word-break: break-all;
}

.asset-created {
    margin-top: 8px;
    color: #94a3b8;
    font-size: 12px;
}

.asset-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

@media (max-width: 920px) {
    .assets-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .asset-item {
        grid-template-columns: 1fr;
    }

    .asset-actions {
        width: 100%;
    }

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

@media (max-width: 560px) {
    .assets-summary-grid {
        grid-template-columns: 1fr;
    }

    .asset-actions {
        flex-direction: column;
    }

    .asset-actions .btn {
        width: 100%;
    }
}


.card-face-display-title {
    margin-top: 6px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
}

.card-face-display-title.is-muted {
    color: #94a3b8;
    font-weight: 600;
}


.card-render-card.is-image-only {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.card-render-card.is-image-only .card-render-image {
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.card-render-card.is-image-only .card-render-image img {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    border-radius: 0 !important;
}


/* =========================================================
   カード面プレビュー：画像だけの面
========================================================= */

.card-preview-stage.is-image-only {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
}

.card-render-image-only {
    display: block;
    line-height: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;

    /* 追加 */
    overflow: hidden;
    border-radius: 22px;
}

.card-render-image-only img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 22px;
    box-shadow: none;
}



/* =========================================================
   バージョン管理
========================================================= */

.version-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.version-summary-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.version-summary-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 8px;
}

.version-summary-card strong {
    font-size: 26px;
    line-height: 1;
    color: #111827;
}

.version-summary-card small {
    margin-left: 4px;
    color: #64748b;
}

.versions-guide-card {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #fff;
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 30px rgba(20, 184, 166, 0.18);
}

.versions-guide-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.versions-guide-card p {
    margin: 0;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.92);
}

.version-list {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.version-item {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 18px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.version-badge {
    width: 92px;
    min-height: 92px;
    border-radius: 18px;
    background: #ecfeff;
    border: 1px solid #a5f3fc;
    color: #0f766e;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 12px;
}

.version-badge span {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #0f766e;
}

.version-badge strong {
    display: block;
    font-size: 20px;
    line-height: 1.2;
}

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

.version-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.version-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.version-meta-pill.is-muted {
    color: #94a3b8;
}

.version-item h2 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 18px;
    line-height: 1.4;
}

.version-description {
    margin: 0;
    color: #64748b;
    line-height: 1.7;
    font-size: 14px;
}

.version-description.is-muted {
    color: #9ca3af;
}

.version-change-log {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.version-change-log strong {
    display: block;
    color: #334155;
    font-size: 13px;
    margin-bottom: 6px;
}

.version-change-log p {
    margin: 0;
    color: #475569;
    line-height: 1.7;
    font-size: 14px;
}

.version-created {
    margin-top: 10px;
    color: #94a3b8;
    font-size: 12px;
}

.version-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

@media (max-width: 980px) {
    .version-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .version-item {
        grid-template-columns: 1fr;
    }

    .version-actions {
        width: 100%;
    }

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

@media (max-width: 560px) {
    .version-summary-grid {
        grid-template-columns: 1fr;
    }

    .version-actions {
        flex-direction: column;
    }

    .version-actions .btn {
        width: 100%;
    }
}


/* =========================================================
   バージョン作成
========================================================= */

.version-form-card {
    max-width: 980px;
}

.version-create-summary {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.version-create-current,
.version-create-suggestions {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.version-create-current span,
.version-create-suggestions > span {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 10px;
}

.version-create-current strong {
    display: block;
    color: #111827;
    font-size: 30px;
}

.version-create-suggestions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.version-create-suggestions > span {
    width: 100%;
}

.version-textarea {
    min-height: 140px;
    line-height: 1.8;
    resize: vertical;
}

.version-change-textarea {
    min-height: 220px;
}

.version-option-box {
    margin: 16px 0;
    padding: 16px 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
}

.version-recent-box {
    margin: 20px 0;
    padding: 18px 20px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.version-recent-box h2 {
    margin: 0 0 12px;
    font-size: 18px;
    color: #111827;
}

.version-recent-box ul {
    margin: 0;
    padding-left: 20px;
    color: #475569;
    line-height: 1.9;
}

.version-recent-box li span {
    margin-left: 8px;
    color: #64748b;
    font-size: 12px;
}

@media (max-width: 760px) {
    .version-create-summary {
        grid-template-columns: 1fr;
    }
}



/* =========================================================
   バージョン詳細
========================================================= */

.version-detail-hero {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 20px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.version-detail-badge {
    min-height: 130px;
    border-radius: 20px;
    background: #ecfeff;
    border: 1px solid #a5f3fc;
    color: #0f766e;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 16px;
}

.version-detail-badge span {
    display: block;
    font-size: 13px;
    font-weight: 800;
}

.version-detail-badge strong {
    display: block;
    font-size: 28px;
    line-height: 1.2;
}

.version-detail-main h2 {
    margin: 0 0 10px;
    color: #111827;
    font-size: 24px;
}

.version-detail-description {
    margin: 0;
    color: #475569;
    line-height: 1.8;
    font-size: 15px;
}

.version-detail-description.is-muted {
    color: #9ca3af;
}

.version-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 20px;
    margin-bottom: 24px;
}

.version-detail-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.section-title-row.compact {
    margin-bottom: 16px;
}

.section-title-row.compact h2 {
    font-size: 20px;
}

.version-change-log-full {
    padding: 18px 20px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    color: #334155;
    line-height: 1.9;
    font-size: 15px;
}

.snapshot-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.snapshot-summary div {
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.snapshot-summary span {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 6px;
}

.snapshot-summary strong {
    color: #111827;
    font-size: 18px;
}

.snapshot-table-list {
    display: grid;
    gap: 8px;
}

.snapshot-table-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.snapshot-table-list span {
    color: #64748b;
    font-size: 13px;
}

.snapshot-table-list strong {
    color: #111827;
    font-size: 13px;
}

.version-file-list {
    display: grid;
    gap: 12px;
}

.version-file-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #f8fafc;
}

.version-file-type {
    display: grid;
    place-items: center;
    min-height: 58px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 800;
}

.file-type-pdf {
    background: #fee2e2;
    color: #b91c1c;
}

.file-type-zip {
    background: #fef3c7;
    color: #92400e;
}

.file-type-json {
    background: #dbeafe;
    color: #1d4ed8;
}

.file-type-png {
    background: #dcfce7;
    color: #15803d;
}

.file-type-other {
    background: #f1f5f9;
    color: #64748b;
}

.version-file-main {
    min-width: 0;
}

.version-file-main h3 {
    margin: 0 0 6px;
    color: #111827;
    font-size: 16px;
}

.version-file-main p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    word-break: break-all;
}

.version-file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 12px;
}

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

@media (max-width: 980px) {
    .version-detail-grid {
        grid-template-columns: 1fr;
    }

    .version-detail-hero {
        grid-template-columns: 1fr;
    }

    .version-detail-badge {
        min-height: auto;
    }

    .version-file-item {
        grid-template-columns: 1fr;
    }

    .version-file-actions .btn {
        width: 100%;
        justify-content: center;
    }
}



/* =========================================================
   バージョン編集
========================================================= */

.version-edit-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.version-edit-summary div {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.version-edit-summary span {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 8px;
}

.version-edit-summary strong {
    color: #111827;
    font-size: 24px;
    line-height: 1.2;
}

.version-edit-note {
    margin: 20px 0;
    padding: 18px 20px;
    border-radius: 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.version-edit-note h2 {
    margin: 0 0 8px;
    color: #92400e;
    font-size: 18px;
}

.version-edit-note p {
    margin: 0;
    color: #92400e;
    line-height: 1.8;
    font-size: 14px;
}

@media (max-width: 760px) {
    .version-edit-summary {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   盤面管理
========================================================= */

.boards-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.boards-summary-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.boards-summary-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 8px;
}

.boards-summary-card strong {
    color: #111827;
    font-size: 30px;
    line-height: 1;
}

.boards-summary-card small {
    margin-left: 4px;
    color: #64748b;
}

.boards-guide-card {
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    color: #fff;
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.18);
}

.boards-guide-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.boards-guide-card p {
    margin: 0;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.92);
}

.board-list {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.board-item {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.board-thumb {
    width: 150px;
    height: 96px;
    border-radius: 14px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    display: grid;
    place-items: center;
}

.board-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.board-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background:
        linear-gradient(45deg, #f8fafc 25%, transparent 25%),
        linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f8fafc 75%),
        linear-gradient(-45deg, transparent 75%, #f8fafc 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

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

.board-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.board-default-badge,
.board-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.board-default-badge {
    background: #dcfce7;
    color: #15803d;
}

.board-meta-pill {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e5e7eb;
}

.board-meta-pill.is-muted {
    color: #94a3b8;
}

.board-item h2 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 18px;
    line-height: 1.4;
}

.board-info-line {
    margin-top: 6px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.7;
}

.board-count-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.board-count-row span {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.board-created {
    margin-top: 10px;
    color: #94a3b8;
    font-size: 12px;
}

.board-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

@media (max-width: 1080px) {
    .board-item {
        grid-template-columns: 1fr;
    }

    .board-actions {
        width: 100%;
    }

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

@media (max-width: 760px) {
    .boards-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .board-actions {
        flex-direction: column;
    }

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

@media (max-width: 520px) {
    .boards-summary-grid {
        grid-template-columns: 1fr;
    }

    .board-thumb {
        width: 100%;
        height: 160px;
    }
}


/* =========================================================
   盤面作成
========================================================= */

.board-form-card {
    max-width: 980px;
}

.boards-create-guide-card {
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    color: #fff;
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.18);
}

.boards-create-guide-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.boards-create-guide-card p {
    margin: 0;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.92);
}

.board-bg-preview-card {
    margin: 20px 0;
    padding: 18px 20px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.board-bg-preview-card h2 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 18px;
}

.board-bg-preview-empty {
    display: grid;
    place-items: center;
    min-height: 180px;
    border-radius: 14px;
    background:
        linear-gradient(45deg, #eef2ff 25%, transparent 25%),
        linear-gradient(-45deg, #eef2ff 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #eef2ff 75%),
        linear-gradient(-45deg, transparent 75%, #eef2ff 75%);
    background-size: 22px 22px;
    background-position: 0 0, 0 11px, 11px -11px, -11px 0;
    color: #64748b;
    font-weight: 700;
    border: 1px dashed #cbd5e1;
}

.board-bg-preview-image {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.board-bg-preview-image img {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    background: #fff;
}

.board-bg-preview-meta {
    padding: 10px 12px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}



/* =========================================================
   盤面エディタ
========================================================= */

.board-editor-page-header {
    margin-bottom: 12px;
}

.board-editor-status {
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 13px;
    font-weight: 700;
}

.board-editor-status.is-dirty {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.board-editor-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 300px;
    gap: 16px;
    align-items: flex-start;
}

.board-editor-sidebar,
.board-editor-layer-panel {
    display: grid;
    gap: 16px;
}

.board-editor-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.board-editor-panel h2 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 17px;
}

.board-editor-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.board-tab {
    flex: 1;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #475569;
    border-radius: 999px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.board-tab.is-active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.board-tab-panel {
    display: none;
    gap: 8px;
}

.board-tab-panel.is-active {
    display: grid;
}

.board-palette-item {
    width: 100%;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 14px;
    padding: 10px;
    cursor: pointer;
    text-align: left;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
}

.board-palette-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.board-palette-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 900;
}

.board-palette-item.with-thumb {
    grid-template-columns: 46px minmax(0, 1fr);
}

.board-palette-item.with-thumb img {
    width: 46px;
    height: 38px;
    object-fit: cover;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.board-palette-item small {
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}

.board-empty-text {
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.7;
}

.board-selected-box {
    min-height: 120px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    color: #475569;
    font-size: 13px;
    line-height: 1.8;
}

.board-editor-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.board-editor-main {
    min-width: 0;
}

.board-canvas-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.board-canvas-toolbar strong {
    color: #111827;
    font-size: 15px;
}

.board-canvas-toolbar span {
    margin-left: 8px;
    color: #64748b;
    font-size: 13px;
}

.board-zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

#zoomLabel {
    min-width: 52px;
    text-align: center;
    color: #334155;
    font-weight: 800;
    font-size: 13px;
}

.board-canvas-scroll {
    overflow: auto;
    max-height: calc(100vh - 250px);
    background:
        linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
        linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
}

.canvas-container {
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.board-layer-list {
    display: grid;
    gap: 8px;
}

.board-layer-row {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
}

.board-layer-row.is-active {
    border-color: #2563eb;
    background: #eff6ff;
}

.board-layer-name {
    border: none;
    background: transparent;
    padding: 0;
    color: #111827;
    text-align: left;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.board-layer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.board-layer-actions button {
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #475569;
    border-radius: 999px;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.board-layer-actions button:hover {
    background: #e0f2fe;
    color: #075985;
}

@media (max-width: 1180px) {
    .board-editor-shell {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .board-editor-layer-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .board-editor-shell {
        grid-template-columns: 1fr;
    }

    .board-canvas-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .board-editor-buttons {
        grid-template-columns: 1fr;
    }
}




/* =========================================================
   Boards edit / create form
========================================================= */

.form-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    margin-bottom: 8px;
    color: #111827;
    font-weight: 700;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 11px 12px;
    background: #fff;
    color: #111827;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #334155;
    font-weight: 700;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: #4f46e5;
}

.board-background-preview {
    margin-top: 22px;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    background: #f8fafc;
    padding: 18px;
}

.board-background-preview-inner {
    min-height: 180px;
    border-radius: 14px;
    background:
        linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
        linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
    background-size: 22px 22px;
    background-position: 0 0, 0 11px, 11px -11px, -11px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 700;
}

.board-background-preview img {
    display: none;
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    background: #fff;
}

.board-background-preview.has-image .board-background-preview-inner {
    background: #111827;
    padding: 14px;
}

.board-background-preview.has-image .board-background-preview-inner span {
    display: none;
}

.board-background-preview.has-image img {
    display: block;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}


/* =========================================================
   Boards responsive
========================================================= */

@media (max-width: 760px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

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

    .board-background-preview-inner {
        min-height: 140px;
    }
}

/* =========================================================
   Boards delete
========================================================= */

.delete-board-thumb {
    padding: 14px;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

.delete-board-thumb img {
    display: block;
    max-width: 100%;
    max-height: 260px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}



/* =========================================================
   Boards preview
========================================================= */

.board-preview-summary-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.board-preview-summary-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.board-preview-summary-card span,
.board-preview-meta-card span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 6px;
}

.board-preview-summary-card strong {
    display: inline-block;
    color: #111827;
    font-size: 20px;
    line-height: 1.3;
    word-break: break-word;
}

.board-preview-summary-card small {
    margin-left: 4px;
    color: #64748b;
}

.board-preview-meta-card {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 0.7fr 0.7fr;
    gap: 12px;
    margin-bottom: 24px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px;
}

.board-preview-meta-card div {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    padding: 10px 12px;
}

.board-preview-meta-card strong {
    color: #111827;
    font-size: 14px;
    word-break: break-word;
}

.board-preview-wrap {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
    margin-bottom: 24px;
}

.board-preview-scroll {
    overflow: auto;
    max-width: 100%;
    border-radius: 16px;
    background: #111827;
    padding: 18px;
}

.board-preview-canvas {
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    background:
        linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
        linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
    box-shadow: 0 12px 28px rgba(0,0,0,0.28);
    transform-origin: top left;
}

.board-preview-background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    user-select: none;
    pointer-events: none;
}

.board-preview-item {
    position: absolute;
    box-sizing: border-box;
    transform-origin: center center;
}

.board-preview-card,
.board-preview-text,
.board-preview-memo,
.board-preview-missing,
.board-preview-unknown {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.board-preview-card {
    background: #fff;
    border: 2px solid #111827;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.board-preview-card-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.board-preview-card-head span,
.board-preview-card-head small {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.board-preview-card-head span {
    background: #eef2ff;
    color: #4338ca;
}

.board-preview-card-head small {
    background: #f1f5f9;
    color: #64748b;
}

.board-preview-card strong {
    display: block;
    color: #111827;
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 6px;
}

.board-preview-card p {
    margin: 0;
    color: #475569;
    font-size: 12px;
    line-height: 1.6;
}

.board-preview-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255,255,255,0.88);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.board-preview-text {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.92);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    color: #111827;
    font-size: 16px;
    line-height: 1.7;
    text-align: center;
    white-space: normal;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.board-preview-memo {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 12px;
    color: #92400e;
    font-size: 14px;
    line-height: 1.7;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.board-preview-memo-label {
    display: inline-flex;
    margin-bottom: 6px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 800;
}

.board-preview-missing,
.board-preview-unknown {
    display: grid;
    place-items: center;
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 12px;
    padding: 10px;
    font-size: 13px;
    font-weight: 700;
}

.board-preview-layer-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    margin-bottom: 24px;
}

.board-preview-layer-card h2 {
    margin: 0 0 14px;
    color: #111827;
    font-size: 18px;
}

.board-preview-layer-list {
    display: grid;
    gap: 10px;
}

.board-preview-layer-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    border: 1px solid #eef0f3;
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 14px;
}

.board-preview-layer-item strong {
    display: block;
    color: #111827;
    font-size: 14px;
    margin-bottom: 4px;
}

.board-preview-layer-item span {
    display: block;
    color: #64748b;
    font-size: 12px;
}

.board-preview-layer-item small {
    color: #475569;
    font-size: 13px;
    text-align: right;
}

@media (max-width: 980px) {
    .board-preview-summary-grid,
    .board-preview-meta-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .board-preview-layer-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .board-preview-layer-item small {
        text-align: left;
    }
}

@media (max-width: 560px) {
    .board-preview-summary-grid,
    .board-preview-meta-card {
        grid-template-columns: 1fr;
    }

    .board-preview-scroll {
        padding: 10px;
    }
}

@media print {
    .board-preview-page-header,
    .board-preview-summary-grid,
    .board-preview-meta-card,
    .board-preview-layer-card,
    .page-header,
    .page-actions,
    .site-header,
    .sidebar,
    .breadcrumb,
    .flash-message,
    .site-footer,
    footer {
        display: none !important;
    }

    .main-content,
    .page-content,
    main,
    .layout-main,
    .app-main {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        width: 100% !important;
        background: #fff !important;
    }

    .board-preview-wrap {
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .board-preview-scroll {
        overflow: visible !important;
        padding: 0 !important;
        background: #fff !important;
        border-radius: 0 !important;
    }

    .board-preview-canvas {
        margin: 0 auto !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }
}



/* =========================================================
   Boards editor full width
========================================================= */

/* editorページだけ横幅制限を外す */
.board-editor-page {
    width: 100%;
    max-width: none !important;
}

/* 共通レイアウトの中央寄せ制限を外す */
.board-editor-page,
.board-editor-page .page-content,
.board-editor-page .page-container,
.board-editor-page .container,
.board-editor-page .content-container,
.board-editor-page .main-content {
    max-width: none !important;
    width: 100% !important;
}

/* 左右余白を少なめにする */
.board-editor-page {
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

/* ヘッダーも全幅で使う */
.board-editor-page .page-header {
    width: 100%;
    max-width: none;
}

/* エディタ全体の3カラム */
.board-editor-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr) 260px;
    gap: 16px;
    align-items: start;
    width: 100%;
    max-width: none;
}

/* 中央カラムは縮められるように */
.board-editor-main {
    min-width: 0;
}

/* キャンバスエリア */
.board-editor-stage-card,
.board-editor-canvas-card,
.board-editor-center-panel {
    width: 100%;
    min-width: 0;
}

/* スクロールで盤面全体を見せる */
.board-editor-stage-scroll,
.board-editor-canvas-wrap,
.board-editor-canvas-scroll {
    width: 100%;
    overflow: auto;
}

/* 盤面上の余白を少しだけ */
.board-editor-stage-toolbar,
.board-editor-main-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* 左右パネル */
.board-editor-sidebar-left,
.board-editor-sidebar-right {
    min-width: 0;
}

/* 大きい画面では少し広め */
@media (min-width: 1600px) {
    .board-editor-layout {
        grid-template-columns: 280px minmax(0, 1fr) 280px;
    }

    .board-editor-page {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* タブレット */
@media (max-width: 1200px) {
    .board-editor-layout {
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .board-editor-sidebar-right {
        grid-column: 1 / -1;
    }
}

/* スマホ */
@media (max-width: 860px) {
    .board-editor-layout {
        grid-template-columns: 1fr;
    }

    .board-editor-page {
        padding-left: 12px;
        padding-right: 12px;
    }

    .board-editor-sidebar-left,
    .board-editor-sidebar-right,
    .board-editor-main {
        grid-column: auto;
    }
}