/* 投稿考察パネルは全幅。左 1/3 が投稿プレビュー、右が考察 */
#post-consideration-side-panel-sheet.comments-side-panel-sheet {
    width: 100%;
}

.post-consideration-side-panel-header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.post-consideration-preview-toggle {
    display: none;
}

.post-consideration-side-panel-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.post-consideration-side-panel-main {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.post-consideration-preview {
    flex: 0 0 33.333%;
    width: 33.333%;
    max-width: 33.333%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background-color: var(--bg-color);
}

.post-consideration-preview__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-shrink: 0;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.post-consideration-preview__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
}

.post-consideration-preview__main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.post-consideration-preview__media.caption-modal-media {
    position: relative;
    flex: 3 1 0;
    width: 100%;
    min-width: 0;
    min-height: 10rem;
    align-self: stretch;
}

.post-consideration-preview__main.is-caption-only .post-consideration-preview__media {
    display: none;
}

.post-consideration-preview__main.is-media-only .post-consideration-preview__caption {
    display: none;
}

.post-consideration-preview__main.is-media-only .post-consideration-preview__media {
    flex: 1 1 auto;
}

.post-consideration-preview__caption {
    flex: 2 1 0;
    min-height: 0;
    margin: 0;
    padding: 0.75rem 1rem 1rem;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 0.9rem;
    color: var(--text-color);
    border-top: 1px solid var(--border-color);
}

.post-consideration-preview__caption.is-empty {
    color: var(--text-light);
}

.post-consideration-preview__caption[hidden] {
    display: none !important;
}

.post-consideration-panel-tabs {
    display: none;
    flex-shrink: 0;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.post-consideration-panel-tab {
    flex: 1;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    background: var(--bg-light);
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
}

.post-consideration-panel-tab.is-active,
.post-consideration-panel-tab[aria-selected='true'] {
    background: var(--bg-color);
    border-bottom-color: var(--bg-color);
    color: var(--primary-color);
    font-weight: 600;
}

.post-consideration-panel-tab:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.post-consideration-panel-layout {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.post-consideration-panel-layout.has-chat {
    flex-direction: row;
}

.post-consideration-panel-layout__report {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 0.75rem 1rem 1.25rem;
}

.post-consideration-panel-layout.has-chat .post-consideration-panel-layout__report {
    flex: 1 1 58%;
}

.post-consideration-panel-layout.has-chat .post-consideration-panel-layout__chat {
    flex: 1 1 42%;
}

.post-consideration-panel-layout__chat {
    flex: 1 1 50%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    background: var(--bg-light);
}

.post-consideration-chat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
}

.post-consideration-chat-session-select {
    flex: 1;
    min-width: 0;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    background: var(--bg-color);
}

.post-consideration-chat-new-btn {
    flex-shrink: 0;
}

.post-consideration-chat-stale-banner {
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--error-color);
    background: #ffebee;
    border-bottom: 1px solid var(--border-color);
}

.post-consideration-chat-timeline {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.post-consideration-chat-message {
    max-width: 92%;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    line-height: 1.5;
}

.post-consideration-chat-message--user {
    align-self: flex-end;
    background: #f0f5ff;
    border-color: rgba(71, 120, 223, 0.45);
}

.post-consideration-chat-message--assistant {
    align-self: flex-start;
    background: var(--bg-color);
}

.post-consideration-chat-message__meta {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    color: var(--text-light);
}

.post-consideration-chat-message__text {
    margin: 0;
    word-break: break-word;
}

.post-consideration-chat-message__citations {
    margin: 0.35rem 0 0;
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--text-light);
}

.post-consideration-chat-message--user .post-consideration-chat-message__text {
    white-space: pre-wrap;
}

.post-consideration-chat-message--assistant .post-consideration-chat-message__text {
    white-space: normal;
}

.post-consideration-chat-message__markdown.post-consideration-markdown {
    font-size: 0.85rem;
    line-height: 1.55;
}

.post-consideration-chat-status {
    margin: 0;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.post-consideration-chat-ai-notice {
    margin: 0;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-light);
    flex-shrink: 0;
}

.post-consideration-chat-input-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
    padding: 0.65rem 0.75rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
}

.post-consideration-chat-input {
    width: 100%;
    min-height: 4.5rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font: inherit;
    line-height: 1.5;
    resize: vertical;
}

.post-consideration-chat-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.post-consideration-chat-send-btn {
    align-self: flex-end;
}

@media (max-width: 768px) {
    .post-consideration-preview-toggle {
        display: inline-flex;
    }

    .post-consideration-side-panel-body {
        position: relative;
        flex-direction: column;
    }

    #post-consideration-side-panel .post-consideration-preview {
        display: none;
    }

    #post-consideration-side-panel.is-preview-open .post-consideration-preview {
        display: flex;
        position: absolute;
        inset: 0;
        z-index: 3;
        width: auto;
        max-width: none;
        flex: none;
        border-right: none;
    }

    .post-consideration-panel-tabs {
        display: flex;
    }

    .post-consideration-panel-layout.has-chat {
        flex-direction: column;
    }

    .post-consideration-panel-layout__chat {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }

    .post-consideration-panel-layout.has-chat[data-mobile-tab='report']
        .post-consideration-panel-layout__chat {
        display: none;
    }

    .post-consideration-panel-layout.has-chat[data-mobile-tab='chat']
        .post-consideration-panel-layout__report {
        display: none;
    }

    #post-consideration-side-panel-sheet.comments-side-panel-sheet {
        width: 100%;
    }
}

.post-consideration-section {
    margin-bottom: 1.25rem;
}

.post-consideration-section-title {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
}

.post-consideration-section-body {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--text-color);
}

.post-consideration-fallback-note {
    margin: 0 0 0.5rem;
}

.post-consideration-fallback-text {
    margin: 0;
    padding: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow-x: auto;
}

.post-consideration-markdown {
    white-space: normal;
    overflow-wrap: break-word;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-color);
}

.post-consideration-markdown > :first-child {
    margin-top: 0;
}

.post-consideration-markdown > :last-child {
    margin-bottom: 0;
}

.post-consideration-markdown h2 {
    margin: 0.75rem 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
}

.post-consideration-markdown h3 {
    margin: 0.65rem 0 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
}

.post-consideration-markdown h4,
.post-consideration-markdown h5,
.post-consideration-markdown h6 {
    margin: 0.5rem 0 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-color);
}

.post-consideration-markdown p {
    margin: 0 0 0.5rem;
}

.post-consideration-markdown ul,
.post-consideration-markdown ol {
    margin: 0 0 0.5rem;
    padding-left: 1.25rem;
}

.post-consideration-markdown li {
    margin: 0.2rem 0;
}

.post-consideration-markdown ul ul,
.post-consideration-markdown ul ol,
.post-consideration-markdown ol ul,
.post-consideration-markdown ol ol {
    margin-top: 0.35rem;
    margin-bottom: 0;
}

.post-consideration-markdown strong {
    font-weight: 700;
    color: var(--text-color);
}

.post-consideration-markdown blockquote {
    margin: 0.5rem 0;
    padding-left: 0.75rem;
    border-left: 3px solid var(--border-color);
    color: var(--text-light);
}

.post-consideration-markdown code {
    font-size: 0.88em;
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
}

.post-consideration-markdown pre {
    margin: 0.5rem 0;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-consideration-markdown pre code {
    padding: 0;
    border: none;
    background: transparent;
}

.post-consideration-markdown table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 0.75rem;
    font-size: inherit;
    display: block;
    overflow-x: auto;
}

.post-consideration-markdown thead th {
    padding: 0.4rem 0.5rem;
    font-weight: 700;
    text-align: left;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.post-consideration-markdown tbody td {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    vertical-align: top;
}

.post-consideration-markdown thead th:not(:first-child),
.post-consideration-markdown tbody td:not(:first-child) {
    text-align: right;
}

.post-consideration-markdown tbody td:first-child {
    font-weight: 600;
    text-align: left;
}

.post-consideration-process {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.post-consideration-process-toggle {
    display: inline-block;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-consideration-process-toggle:hover {
    opacity: 0.85;
}

.post-consideration-process-toggle:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.post-consideration-process-panel {
    margin-top: 0.75rem;
}

.post-consideration-process-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.post-consideration-process-tab {
    margin: 0;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    font-size: 0.8rem;
    color: var(--text-color);
    cursor: pointer;
}

.post-consideration-process-tab:hover {
    background-color: var(--bg-light);
}

.post-consideration-process-tab.is-active,
.post-consideration-process-tab[aria-selected='true'] {
    background-color: rgba(71, 120, 223, 0.12);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.post-consideration-process-tab:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.post-consideration-process-status {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.post-consideration-process-body {
    min-height: 2rem;
}

.comments-side-panel {
    position: fixed;
    inset: 0;
    z-index: 210;
    pointer-events: none;
    visibility: hidden;
}

.comments-side-panel.is-open {
    pointer-events: auto;
    visibility: visible;
}

.comments-side-panel-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.comments-side-panel.is-open .comments-side-panel-backdrop {
    pointer-events: auto;
    cursor: default;
}

.comments-side-panel-sheet {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100vw);
    max-width: 100%;
    background-color: #ffffff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.2s ease-out;
}

.comments-side-panel.is-open .comments-side-panel-sheet {
    transform: translateX(0);
}

.comments-side-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.comments-side-panel-title-block {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    min-width: 0;
}

.comments-side-panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.comments-side-panel-count {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-light);
    white-space: nowrap;
}

.comments-side-panel-close {
    border: none;
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-color);
}

.comments-side-panel-status {
    margin: 0;
    padding: 0.5rem 1rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.comments-side-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1rem 1rem;
}

.comments-side-panel-empty {
    margin: 1rem 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.comments-side-panel-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.comments-side-panel-item:last-child {
    border-bottom: none;
}

.comments-side-panel-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.comments-side-panel-user-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.comments-side-panel-username {
    color: #4778df;
    font-weight: 600;
    font-size: 0.875rem;
    word-break: break-all;
}

.comments-side-panel-time {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: pre;
    line-height: 1.4;
}

.comments-side-panel-text {
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.comments-side-panel-meta {
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-light);
    margin-top: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.caption-modal {
    position: fixed;
    inset: 0;
    display: none;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.caption-modal.is-open {
    display: flex;
}

.caption-modal-content {
    display: flex;
    flex-direction: column;
    width: min(1120px, 100%);
    max-height: 80vh;
    overflow: hidden;
    background-color: var(--bg-color);
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
}

.caption-modal-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.caption-modal-close {
    border: none;
    background-color: transparent;
    color: var(--text-color);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.caption-modal-main {
    display: flex;
    align-items: stretch;
    height: calc(80vh - 3.25rem);
    min-height: 10rem;
    overflow: hidden;
}

.caption-modal-media {
    position: relative;
    flex-shrink: 0;
    width: min(52vw, 440px);
    min-width: 200px;
    align-self: stretch;
    min-height: 0;
    overflow: hidden;
    background-color: var(--bg-light);
}

.caption-modal-media[hidden] {
    display: none !important;
}

.caption-modal-media-link {
    position: absolute;
    inset: 0;
    display: block;
    line-height: 0;
}

.caption-modal-media-link .caption-modal-media-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.caption-modal-media > .caption-modal-media-img {
    position: absolute;
    inset: 0;
    display: block;
}

.caption-modal-media-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.caption-modal-media-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.caption-modal-media-visual {
    position: relative;
    flex: 1;
    min-height: 0;
}

.caption-modal-media-visual > .caption-modal-media-link {
    position: absolute;
    inset: 0;
    display: block;
    line-height: 0;
}

.caption-modal-media-visual > .caption-modal-media-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.caption-modal-reels-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}

.caption-modal-reels-play-btn {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background-color: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    line-height: 0;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.caption-modal-reels-play-btn:hover:not(:disabled) {
    background-color: rgba(0, 0, 0, 0.7);
}

.caption-modal-reels-play-btn:focus-visible {
    outline: 2px solid var(--accent-color, #2563eb);
    outline-offset: 2px;
}

.caption-modal-reels-play-btn:disabled {
    cursor: wait;
    opacity: 0.8;
}

.caption-modal-reels-play-icon {
    margin-left: 0.2rem;
}

.caption-modal-reels-aux {
    flex-shrink: 0;
    max-width: 100%;
    padding: 0.5rem 0.75rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-color);
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-light);
}

.caption-modal-reels-aux:empty {
    display: none;
}

.caption-modal-reels-aux[hidden] {
    display: none !important;
}

.caption-modal-reels-loading {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.caption-modal-reels-loading-spinner {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    box-sizing: border-box;
    border: 2px solid var(--border-color);
    border-top-color: var(--text-color);
    border-radius: 50%;
    animation: caption-modal-reels-spin 0.7s linear infinite;
}

.caption-modal-reels-loading-text {
    margin: 0;
    flex: 1;
    min-width: 0;
    color: var(--text-muted, var(--text-color));
    font-size: 0.875rem;
    line-height: 1.45;
}

@keyframes caption-modal-reels-spin {
    to {
        transform: rotate(360deg);
    }
}

.caption-modal-reels-video {
    display: block;
    width: 100%;
    max-height: 40vh;
    background: #000;
    border-radius: 6px;
}

.caption-modal-body {
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 1rem;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.6;
}

.posts-export-modal-content {
    width: min(420px, 100%);
    max-width: 100%;
}

.posts-export-modal-body {
    padding: 0 1rem 1rem;
}

.posts-export-modal-hint {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
}

.posts-export-month-field {
    margin: 0 0 1rem;
}

.posts-export-month-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.posts-export-format-fieldset {
    margin: 0 0 1rem;
    padding: 0;
    border: none;
}

.posts-export-format-legend {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    padding: 0;
}

.posts-export-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-color);
    cursor: pointer;
}

.posts-export-radio-label input {
    accent-color: var(--primary-color);
}

.posts-export-error-message {
    margin: 0 0 1rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: var(--error-color);
    background-color: #ffebee;
    border-radius: 8px;
}

.posts-export-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

