* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f7f8fc;
    color: #1f2937;
    line-height: 1.6;
}

main {
    display: block;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    display: block;
}

/* ===== Header ===== */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.site-header-inner,
.page-container,
.site-footer-inner {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

.site-header-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-logo a {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.site-nav a {
    font-size: 14px;
    color: #374151;
}

/* ===== Main ===== */
.page-container {
    flex: 1;
    padding-top: 32px;
    padding-bottom: 48px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.3;
    color: #111827;
}

.page-description {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.breadcrumb {
    margin-bottom: 16px;
    font-size: 14px;
    color: #6b7280;
}

.page-actions {
    margin-bottom: 20px;
}

.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.empty-box p {
    margin: 0;
}

/* ===== Buttons ===== */
.btn-primary,
.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s ease;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
    border: 1px solid #2563eb;
    text-decoration: none;
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    text-decoration: none;
}

.btn-link {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    text-decoration: none;
}

.btn-link:hover {
    background: #dbeafe;
    text-decoration: none;
}

/* ===== Guild list ===== */
.guild-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.guild-list > li {
    list-style: none;
    margin: 0 0 16px 0;
    padding-left: 0;
}

.guild-card {
    list-style: none;
}

.guild-card-head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.guild-icon {
    width: 64px;
    height: 64px;
    border-radius: 9999px;
    object-fit: cover;
    background: #e5e7eb;
    flex-shrink: 0;
}

.guild-icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #374151;
    font-size: 22px;
}

.guild-meta {
    min-width: 0;
}

.guild-name {
    margin: 0 0 4px;
    font-size: 20px;
    color: #111827;
}

.guild-id {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    word-break: break-all;
}

.guild-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

/* ===== Board list ===== */
.board-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.board-list li {
    margin-bottom: 16px;
}

.board-title {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 1.4;
}

.board-title a {
    color: #111827;
}

.board-description {
    margin: 0 0 12px;
    white-space: pre-wrap;
    color: #4b5563;
}

.board-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #6b7280;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 4px 10px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 12px;
    font-weight: 700;
}

/* ===== Form ===== */
.form-card {
    max-width: 720px;
}

.form-group + .form-group {
    margin-top: 18px;
}

.form-group label {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #374151;
}

.form-group input,
.form-group textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    background: #ffffff;
    color: #111827;
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.form-actions {
    margin-top: 20px;
}

/* ===== Detail ===== */
.board-detail-description {
    margin-top: 12px;
    margin-bottom: 14px;
    white-space: pre-wrap;
    color: #374151;
}

.message-section {
    margin-top: 28px;
}

.message-section h2 {
    margin: 0 0 16px;
    font-size: 24px;
    color: #111827;
}

.message-list {
    display: grid;
    gap: 16px;
}

.message-card {
    padding: 16px;
}

.message-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.message-avatar {
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    object-fit: cover;
    background: #e5e7eb;
    flex-shrink: 0;
}

.message-avatar-placeholder {
    display: block;
}

.message-author-meta {
    min-width: 0;
}

.message-author-name {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.message-author-type {
    font-size: 12px;
    color: #6b7280;
}

.message-body {
    margin-top: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    color: #374151;
}

/* ===== Footer ===== */
.site-footer {
    margin-top: auto;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.site-footer-inner {
    padding-top: 18px;
    padding-bottom: 18px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}

/* ===== Hero ===== */
.hero {
    padding-top: 12px;
}

.hero-card {
    text-align: center;
    padding: 32px 24px;
}

.hero-label {
    margin: 0 0 10px;
    color: #2563eb;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.hero-card h1 {
    margin: 0 0 14px;
    font-size: 36px;
    line-height: 1.2;
    color: #111827;
}

.hero-description {
    max-width: 720px;
    margin: 0 auto;
    color: #4b5563;
    font-size: 16px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.hero-note {
    margin-top: 14px;
    font-size: 13px;
    color: #6b7280;
}

.feature-section {
    margin-top: 28px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.feature-card h2 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #111827;
}

.feature-card p {
    margin: 0;
    color: #4b5563;
}

@media (max-width: 800px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .hero-card h1 {
        font-size: 30px;
    }
}

@media (max-width: 640px) {
    .site-header-inner {
        min-height: auto;
        padding-top: 12px;
        padding-bottom: 12px;
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .guild-card-head,
    .message-head {
        align-items: flex-start;
    }

    .guild-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary,
    .btn-link {
        width: 100%;
    }
}

.board-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.board-main {
    flex: 1;
    min-width: 0;
}

.board-status-wrap {
    flex-shrink: 0;
}

.board-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    font-size: 13px;
    color: #6b7280;
}

.board-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.board-share-box {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
}

.board-share-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

.board-share-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.board-share-input {
    flex: 1;
    min-width: 240px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: #ffffff;
    color: #111827;
}

.board-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.copy-btn {
    cursor: pointer;
}

@media (max-width: 640px) {
    .board-card-top {
        flex-direction: column;
    }

    .board-share-row {
        flex-direction: column;
    }

    .board-share-input {
        width: 100%;
    }

    .board-actions {
        flex-direction: column;
    }
}

.write-section {
    margin-top: 20px;
}

.write-card {
    max-width: 760px;
    margin: 0 auto;
}

.write-user-box {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e5e7eb;
}

.write-user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 9999px;
    object-fit: cover;
    background: #e5e7eb;
    flex-shrink: 0;
}

.write-user-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #374151;
}

.write-user-meta {
    min-width: 0;
}

.write-user-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.write-user-name {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.write-user-subname {
    font-size: 14px;
    color: #6b7280;
    margin-top: 2px;
    word-break: break-all;
}

.write-form textarea {
    width: 100%;
    min-height: 160px;
}

.char-count-wrap {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

.char-count {
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}

.char-count.is-warning {
    color: #d97706;
}

.char-count.is-limit {
    color: #dc2626;
}

.form-alert {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
}

.form-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.form-alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.already-posted-box {
    margin-top: 8px;
}

.already-posted-box h2 {
    margin: 0 0 12px;
    font-size: 20px;
    color: #111827;
}

.posted-message-card {
    background: #f9fafb;
}

.posted-message-body {
    white-space: pre-wrap;
    word-break: break-word;
    color: #374151;
    font-size: 15px;
}

.posted-message-meta {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
}

.already-posted-note {
    margin-top: 12px;
    font-size: 14px;
    color: #6b7280;
}

@media (max-width: 640px) {
    .write-user-box {
        align-items: flex-start;
    }

    .write-user-name {
        font-size: 18px;
    }

    .write-card {
        padding: 16px;
    }

    .posted-message-meta {
        flex-direction: column;
        gap: 6px;
    }
}

.modal-open {
    overflow: hidden;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}

.modal-card {
    width: 100%;
    max-width: 640px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #111827;
}

.modal-close-btn {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
}

.modal-body {
    padding: 20px;
}

.modal-description {
    margin: 0 0 16px;
    color: #4b5563;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

@media (max-width: 640px) {
    .modal-card {
        max-width: 100%;
    }

    .modal-actions {
        flex-direction: column;
    }
}

.message-meta {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
}

.message-author-type {
    font-size: 12px;
    color: #6b7280;
}

.copy-btn {
    cursor: pointer;
}

select.board-share-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #ffffff;
}

.layout-role-box {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
}

.layout-role-label {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px;
}

.layout-role-value {
    font-size: 14px;
    color: #111827;
}

.layout-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.layout-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.layout-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.layout-size-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.layout-size-label {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

.layout-size-select {
    min-width: 220px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    color: #111827;
}

.board-size-note {
    font-size: 13px;
    color: #4b5563;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 8px 12px;
    white-space: nowrap;
}

.save-status {
    font-size: 13px;
    color: #6b7280;
}

.save-status.is-dirty {
    color: #d97706;
    font-weight: 700;
}

.layout-board-wrap {
    overflow: auto;
    padding-bottom: 8px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #eef3f9;
}

.layout-board {
    --board-grid-color: rgba(100, 116, 139, 0.10);
    --board-grid-size: 24px;
    position: relative;
    width: 1400px;
    height: 900px;
    margin: 0 auto;
    background-color: #f8fafc;
    background-image:
        linear-gradient(to right, var(--board-grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--board-grid-color) 1px, transparent 1px);
    background-size: var(--board-grid-size) var(--board-grid-size);
    box-shadow: inset 0 0 0 1px #cbd5e1;
}

.layout-board.is-size-free {
    width: 1400px;
    height: 900px;
}

.layout-board.is-size-a4-portrait {
    width: 21cm;
    height: 29.7cm;
}

.layout-board.is-size-a4-landscape {
    width: 29.7cm;
    height: 21cm;
}

.layout-board.is-size-shikishi {
    width: 24.2cm;
    height: 27.3cm;
}

.layout-board.is-size-shikishi-mini {
    width: 13.6cm;
    height: 12.1cm;
}

.layout-card {
    position: absolute;
    min-width: 140px;
    max-width: 320px;
    width: auto !important;
    min-height: 0 !important;
    height: auto !important;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    user-select: none;
    display: block;
    resize: none !important;
}

.layout-card-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px 6px;
    background: #ffffff;
}

.layout-card-body {
    padding: 6px 10px 6px 10px;
    background: #ffffff;
    white-space: pre-wrap;
    word-break: break-word;
    color: #374151;
    font-size: 13px;
    line-height: 1.3;
    overflow: visible;
}

.layout-resize-handle {
    display: none !important;
}
.layout-board.is-exporting .layout-card {
    display: block !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.layout-board.is-exporting .layout-card-body {
    flex: none !important;
    padding-top: 6px !important;
    padding-right: 10px !important;
    padding-bottom: 6px !important;
    padding-left: 10px !important;
    overflow: visible !important;
}

.layout-card.is-dragging {
    opacity: 0.94;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
}

.layout-card-head {
    background: #ffffff;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px 6px;
    flex-shrink: 0;
}

.layout-card-handle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 14px;
    background: #dfe7f2;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
    cursor: grab;
    border-bottom: 1px solid #d7e0ec;
    touch-action: none;
}

.layout-card.is-dragging .layout-card-handle {
    cursor: grabbing;
}

.layout-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    object-fit: cover;
    flex: 0 0 40px;
    display: block;
    background: #e5e7eb;
}

.layout-card-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #c7d2fe;
    color: #1e3a8a;
    font-size: 15px;
    font-weight: 700;
}

.layout-card-author {
    min-width: 0;
    flex: 1;
    padding-top: 2px;
}

.layout-card-name {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    word-break: break-word;
}

.layout-card-username {
    display: none;
}

.layout-card-body {
    padding: 6px 10px 2px 10px;
    background: #ffffff;
    white-space: pre-wrap;
    word-break: break-word;
    color: #374151;
    font-size: 13px;
    line-height: 1.25;
    flex: 1;
    overflow: hidden;
}

.layout-board.is-exporting {
    background-image: none !important;
    box-shadow: none !important;
}

.layout-board.is-exporting .layout-card-handle {
    display: none !important;
}

.layout-board.is-exporting::after {
    display: none;
}

.layout-board.is-exporting .layout-card-head {
    padding-top: 12px;
}

.btn-secondary {
    appearance: none;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #111827;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #f8fafc;
}

@media (max-width: 900px) {
    .layout-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .layout-toolbar-right {
        align-items: stretch;
    }

    .layout-size-control {
        align-items: stretch;
    }

    .layout-size-select {
        width: 100%;
        min-width: 0;
    }

    .layout-board-wrap {
        padding-bottom: 0;
    }
}

@media print {
    .breadcrumb,
    .layout-toolbar,
    .page-description,
    .board-meta,
    .layout-role-box {
        display: none !important;
    }

    .layout-board-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .layout-board {
        box-shadow: none;
        margin: 0;
        background-color: #fff;
    }

    .layout-card {
        box-shadow: none;
    }
}

.layout-upload-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.layout-upload-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.layout-board.is-exporting {
    background-image: none !important;
}

.layout-board.is-exporting .layout-card-handle,
.layout-board.is-exporting .layout-asset-handle,
.layout-board.is-exporting .layout-asset-toolbar,
.layout-board.is-exporting .layout-resize-handle {
    display: none !important;
}

.layout-board.is-exporting .layout-card {
    border-color: #dbe3ee;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.layout-board.is-exporting .layout-asset {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.layout-board.is-exporting .layout-card-head {
    padding-top: 12px;
}

.layout-asset {
    position: absolute;
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.layout-asset-background {
    overflow: hidden;
    border-radius: 14px;
}

.layout-asset-toolbar {
    position: absolute;
    top: -34px;
    left: 0;
    display: flex;
    gap: 6px;
    z-index: 3;
}

.layout-mini-btn {
    appearance: none;
    border: 1px solid #cbd5e1;
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.layout-mini-btn:hover {
    background: #fff;
}

.layout-asset-handle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.92);
    color: #4338ca;
    font-size: 12px;
    font-weight: 700;
    cursor: grab;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    width: max-content;
    margin-bottom: 8px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    touch-action: none;
}

.layout-asset.is-dragging .layout-asset-handle {
    cursor: grabbing;
}

.layout-asset-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    background: transparent;
}

/* リサイズ禁止 */
.layout-resize-handle {
    display: none !important;
}

.layout-card.is-resizing,
.layout-asset.is-resizing {
    opacity: 0.96;
}

.layout-board.is-exporting .layout-card {
    display: block !important;
    min-height: 0 !important;
}

.layout-board.is-exporting .layout-card-body {
    flex: none !important;
    padding-bottom: 2px !important;
    overflow: visible !important;
}

.layout-card.is-resizing {
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
}


/* 共通ボタン */
button {
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* メインボタン */
.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

/* サブ */
.btn-secondary {
    background: #f3f4f6;
    color: #111827;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* 危険（削除） */
.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

/* 小さいボタン（最背面とか） */
.layout-mini-btn {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #e5e7eb;
}

.layout-mini-btn:hover {
    background: #d1d5db;
}


.layout-card {
    position: absolute;
    width: auto !important;
    min-width: 140px;
    max-width: 320px;
    min-height: 0 !important;
    height: auto !important;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    user-select: none;
    display: block;
    resize: none !important;
}

.layout-card-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px 6px;
    background: #ffffff;
}

.layout-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    object-fit: cover;
    flex: 0 0 40px;
    display: block;
    background: #e5e7eb;
}

.layout-card-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #c7d2fe;
    color: #1e3a8a;
    font-size: 15px;
    font-weight: 700;
}

.layout-card-author {
    min-width: 0;
    flex: 1;
    padding-top: 2px;
}

.layout-card-name {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    word-break: break-word;
}

.layout-card-body {
    padding: 6px 10px 6px 10px;
    background: #ffffff;
    white-space: pre-wrap;
    word-break: break-word;
    color: #374151;
    font-size: 13px;
    line-height: 1.3;
    overflow: visible;
}

.layout-card.is-dragging {
    opacity: 0.94;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
}

.layout-card-handle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 14px;
    background: #dfe7f2;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
    cursor: grab;
    border-bottom: 1px solid #d7e0ec;
    touch-action: none;
}

.layout-card.is-dragging .layout-card-handle {
    cursor: grabbing;
}

.layout-resize-handle {
    display: none !important;
}

.layout-board.is-exporting .layout-card {
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: hidden !important;
}

.layout-board.is-exporting .layout-card-body {
    flex: none !important;
    padding-top: 6px !important;
    padding-right: 10px !important;
    padding-bottom: 6px !important;
    padding-left: 10px !important;
    overflow: visible !important;
}






.layout-editor {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}

.layout-sidebar {
    padding: 16px;
    position: sticky;
    top: 16px;
    border-radius: 16px;
}

.layout-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.layout-sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.layout-sidebar-count {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
}

.layout-sidebar-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.layout-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 700px;
    overflow-y: auto;
    padding-right: 4px;
}

.message-filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.message-filter-item:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.message-filter-checkbox {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    cursor: pointer;
}

.message-filter-name {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    min-width: 0;
    word-break: break-word;
}

.btn-small {
    padding: 8px 12px;
    font-size: 13px;
}

.layout-board-wrap {
    overflow: auto;
    padding-bottom: 8px;
}

.layout-card {
    position: absolute;
    width: auto !important;
    min-width: 140px;
    max-width: 320px;
    min-height: 0 !important;
    height: auto !important;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    user-select: none;
    display: block;
    resize: none !important;
}

.layout-card.is-hidden-by-filter {
    display: none !important;
}

.layout-card-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px 6px;
    background: #ffffff;
}

.layout-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    object-fit: cover;
    flex: 0 0 40px;
    display: block;
    background: #e5e7eb;
}

.layout-card-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #c7d2fe;
    color: #1e3a8a;
    font-size: 15px;
    font-weight: 700;
}

.layout-card-author {
    min-width: 0;
    flex: 1;
    padding-top: 2px;
}

.layout-card-name {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    word-break: break-word;
}

.layout-card-body {
    padding: 6px 10px 6px 10px;
    background: #ffffff;
    white-space: pre-wrap;
    word-break: break-word;
    color: #374151;
    font-size: 13px;
    line-height: 1.3;
    overflow: visible;
}

.layout-card.is-dragging {
    opacity: 0.94;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
}

.layout-card-handle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 14px;
    background: #dfe7f2;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
    cursor: grab;
    border-bottom: 1px solid #d7e0ec;
    touch-action: none;
}

.layout-card.is-dragging .layout-card-handle {
    cursor: grabbing;
}

.layout-resize-handle {
    display: none !important;
}

.layout-board.is-exporting .layout-card {
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: hidden !important;
}

.layout-board.is-exporting .layout-card-body {
    flex: none !important;
    padding-top: 6px !important;
    padding-right: 10px !important;
    padding-bottom: 6px !important;
    padding-left: 10px !important;
    overflow: visible !important;
}

@media (max-width: 1100px) {
    .layout-editor {
        grid-template-columns: 1fr;
    }

    .layout-sidebar {
        position: static;
    }

    .layout-sidebar-list {
        max-height: 260px;
    }
}
