.contact-book-section {
    margin-top: 20px;
    text-align: left;
}

.contact-book-heading {
    font-size: 15px;
    margin: 0 0 10px;
    color: #333;
}

.contact-book-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.contact-book-item {
    border-bottom: 1px solid #e8edf3;
}

.contact-book-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 0;
}

.contact-book-link {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    padding: 10px 0;
}

.contact-book-avatar {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.contact-book-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.contact-book-name {
    font-weight: 700;
    font-size: 15px;
    color: #1a4f9c;
}

.contact-book-trade {
    font-size: 12px;
    color: #666;
}

.contact-book-preview {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-book-empty {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin: 8px 0 0;
}

.contact-book-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.contact-actions-root {
    margin-top: 14px;
}

.contact-actions-root .seeker-contact-panel-flash {
    margin-bottom: 10px;
}

.contact-card-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.contact-actions-root .contact-card-actions {
    margin-top: 0;
}

.seeker-contact-panel {
    margin-top: 18px;
    padding: 14px;
    background: #f7f9fc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.seeker-contact-panel-lead {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    line-height: 1.5;
}

.seeker-contact-panel-poster {
    margin: -4px 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #1a4f9c;
    line-height: 1.5;
}

.seeker-contact-panel-flash {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #eef4ff;
    color: #1a4f9c;
    font-size: 13px;
    line-height: 1.5;
}

.seeker-contact-panel-flash-error {
    background: #fde8e8;
    color: #b42318;
}

.seeker-contact-panel-methods {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.seeker-contact-panel-methods .seeker-contact-gate {
    flex: 1 1 100%;
    margin: 0;
}

.seeker-contact-panel-methods .seeker-contact-link {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f7f9fc;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.contact-card-form {
    margin: 0;
}

.contact-card-btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    line-height: 1.4;
}

.contact-card-btn-add {
    background: #1a4f9c;
    color: #fff;
}

.contact-card-btn-message {
    background: #eef4ff;
    color: #1a4f9c;
}

.contact-card-btn-remove {
    background: #f3f4f6;
    color: #555;
}

.contact-card-btn-disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.seeker-contact-own-note {
    flex: 1 1 100%;
    margin: 0;
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

.seeker-contact-gate {
    font-size: 13px;
    line-height: 1.6;
    color: #555;
}

.seeker-contact-gate a {
    color: #1a4f9c;
    font-weight: 700;
}

.contact-messages-card h1 {
    font-size: 18px;
    margin: 0;
}

.contact-messages-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    text-align: left;
}

.contact-messages-header > div {
    flex: 1;
    min-width: 0;
}

.contact-messages-trade {
    font-size: 12px;
    color: #666;
    margin: 2px 0 0;
}

.contact-messages-origin {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 700;
    color: #1a4f9c;
    line-height: 1.4;
}

.contact-messages-thread {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    background: #fafbfc;
    text-align: left;
}

.contact-messages-older {
    display: block;
    width: 100%;
    margin: 0 0 12px;
    padding: 8px 10px;
    border: 1px solid #d8dee6;
    border-radius: 8px;
    background: #fff;
    color: #1a4f9c;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.contact-messages-older:disabled {
    opacity: 0.7;
    cursor: wait;
}

.contact-message {
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-start;
}

.contact-message-mine {
    justify-content: flex-end;
}

.contact-message-body {
    margin: 0;
    padding: 8px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    font-size: 14px;
    line-height: 1.5;
    max-width: 85%;
    white-space: pre-wrap;
    word-break: break-word;
}

.contact-message-mine .contact-message-body {
    background: #dbeafe;
    border-color: #bfdbfe;
}

.contact-messages-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 8px;
}

.contact-messages-status {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.4;
}

.contact-messages-status.is-success {
    color: #1a7a3a;
}

.contact-messages-status.is-error {
    color: #b42318;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.profile-messages-panel {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.profile-messages-title {
    font-size: 16px;
    margin: 0 0 12px;
    color: #333;
}

.mypage-hub-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.mypage-hub-card {
    display: block;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fafbfc;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.mypage-hub-card:hover {
    background: #f0f4fa;
}

.mypage-hub-card-staff {
    border-color: #c9a227;
    background: rgba(255, 242, 200, 0.5);
}

.mypage-hub-card-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #1a4f9c;
    margin-bottom: 4px;
}

.mypage-hub-card-desc {
    display: block;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.mypage-hub-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}

.mypage-hub-profile {
    margin-bottom: 4px;
}

.mypage-hub-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 0 4px;
    text-align: center;
}

.mypage-hub-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.mypage-hub-nickname {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #222;
    line-height: 1.3;
}

.mypage-hub-nickname-empty {
    font-size: 15px;
    font-weight: 600;
    color: #666;
}

.mypage-hub-legal-name {
    margin: 0;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.contact-inbox-list {
    margin-top: 8px;
}

.member-directory-sub {
    display: block;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.zadan-profile-formal-name {
    margin: 4px 0 0;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.zadan-profile-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.zadan-profile-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.auth-card-mailbox {
    max-width: 920px;
}

.contact-mailbox {
    display: grid;
    grid-template-columns: minmax(220px, 34%) 1fr;
    gap: 16px;
    margin-top: 16px;
    text-align: left;
}

.contact-mailbox-list-panel,
.contact-mailbox-thread-panel {
    min-width: 0;
}

.contact-mailbox-list-panel {
    border-right: 1px solid #e8edf3;
    padding-right: 12px;
}

.contact-mailbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
}

.contact-mailbox-item-active {
    background: #f0f4fa;
    border-radius: 8px;
    margin: 0 -6px;
    padding-left: 6px;
    padding-right: 6px;
}

.contact-mailbox-link {
    padding: 6px 0;
}

.contact-mailbox-remove-form {
    flex-shrink: 0;
}

.contact-mailbox-thread-title {
    font-size: 17px;
    margin: 0;
    color: #1a4f9c;
}

.contact-mailbox-profile-link {
    font-size: 12px;
    color: #1a4f9c;
    font-weight: 700;
    text-decoration: none;
}

.contact-mailbox-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 24px;
    border: 1px dashed #d8dee6;
    border-radius: 10px;
    background: #fafbfc;
}

.contact-mailbox-sp .contact-mailbox-list-panel {
    border-right: none;
    padding-right: 0;
}

/* SP：2カラム grid のままだと戻るリンクとスレッドが横並びになり、
   スレッド列が極端に狭くて縦書きのように見える */
.contact-mailbox.contact-mailbox-sp {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.contact-mailbox.contact-mailbox-sp .contact-mailbox-back,
.contact-mailbox.contact-mailbox-sp .contact-mailbox-list-panel,
.contact-mailbox.contact-mailbox-sp .contact-mailbox-thread-panel {
    width: 100%;
    min-width: 0;
}

.contact-mailbox.contact-mailbox-sp .contact-messages-thread {
    max-height: min(52vh, 420px);
}

.contact-mailbox-back {
    margin: 0 0 12px;
    text-align: left;
}

.contact-mailbox-back a {
    color: #1a4f9c;
    font-weight: 700;
    text-decoration: none;
    font-size: 14px;
}
