/* お問い合わせ（/contact）の画面。css/contact.css と同じ内容。CSS としても SCSS としても有効な形で書く。値は buyer.scss の :root の変数を使う。 */

.tk-ct {
    max-width: 760px;
    margin: 0 auto;
    padding: var(--space-32) 0 var(--space-48);
    display: flex;
    flex-direction: column;
    gap: var(--space-24);
    color: var(--text);
    text-align: left;
    overflow-wrap: anywhere;
}

.tk-ct a {
    color: var(--action);
}

.tk-ct-head {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.tk-ct h1,
.tk-ct p {
    margin: 0;
}

.tk-ct-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.4;
}

.tk-ct-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-24);
    margin: 0;
    padding: var(--space-24);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.tk-ct-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    min-width: 0;
}

.tk-ct-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-16);
}

.tk-ct-label {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

.tk-ct-req {
    padding: 0 var(--space-8);
    border-radius: var(--radius-full);
    background: var(--danger-bg);
    color: var(--danger-ink);
    font-size: 12px;
    font-weight: 700;
}

.tk-ct .tk-ct-input,
.tk-ct .tk-ct-select,
.tk-ct .tk-ct-textarea {
    display: block;
    width: 100%;
    min-height: var(--control-height);
    margin: 0;
    padding: var(--space-8) var(--space-12);
    border: 1px solid var(--border-control);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    line-height: 1.7;
}

.tk-ct .tk-ct-textarea {
    min-height: 180px;
    resize: vertical;
}

.tk-ct .tk-ct-textarea-sm {
    min-height: 96px;
}

.tk-ct .tk-ct-input:focus-visible,
.tk-ct .tk-ct-select:focus-visible,
.tk-ct .tk-ct-textarea:focus-visible {
    outline: var(--focus-width) solid var(--action);
    outline-offset: 1px;
}

.tk-ct .is-invalid {
    border-color: var(--danger-solid);
}

.tk-ct-hint {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.tk-ct-error {
    color: var(--danger-ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}

.tk-ct-notice {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin: 0;
    padding: var(--space-12) var(--space-16);
    border-radius: var(--radius-sm);
    background: var(--info-bg);
    color: var(--info-ink);
    font-size: 14px;
    line-height: 1.6;
}

.tk-ct-notice-warning {
    background: var(--warning-bg);
    color: var(--warning-ink);
}

.tk-ct-notice-danger {
    background: var(--danger-bg);
    color: var(--danger-ink);
}

.tk-ct-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-12);
}

.tk-ct .tk-ct-btn,
.tk-ct a.tk-ct-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-height);
    margin: 0;
    padding: 0 var(--space-24);
    border: 1px solid var(--action);
    border-radius: var(--radius-sm);
    background: var(--action);
    color: var(--on-action);
    font: inherit;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.tk-ct .tk-ct-btn:hover,
.tk-ct a.tk-ct-btn:hover {
    border-color: var(--action-hover);
    background: var(--action-hover);
    color: var(--on-action);
}

.tk-ct .tk-ct-btn:active,
.tk-ct a.tk-ct-btn:active {
    background: var(--action-pressed);
}

.tk-ct .tk-ct-btn:focus-visible,
.tk-ct a.tk-ct-btn:focus-visible {
    outline: var(--focus-width) solid var(--action);
    outline-offset: 2px;
}

.tk-ct .tk-ct-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.tk-ct .tk-ct-btn-lg {
    min-height: 52px;
    min-width: 240px;
}

/* 対象の注文のまとめ（通常は閉じておく） */
.tk-ct-disc {
    min-width: 0;
}

.tk-ct .tk-ct-disc > summary {
    display: inline-flex;
    align-items: center;
    min-height: var(--control-height-sm);
    color: var(--action);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.tk-ct .tk-ct-disc > summary:focus-visible {
    outline: var(--focus-width) solid var(--action);
    outline-offset: 2px;
}

.tk-ct-disc-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    margin-top: var(--space-8);
}

.tk-ct-sum {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    border: 1px solid var(--border-subtle);
    background: var(--surface);
    font-size: 14px;
    line-height: 1.6;
}

.tk-ct-sum caption {
    caption-side: top;
    padding: 0 0 var(--space-4);
    color: var(--text);
    font-weight: 700;
    text-align: left;
}

.tk-ct-sum caption span {
    color: var(--text-muted);
    font-weight: 400;
}

.tk-ct .tk-ct-sum th,
.tk-ct .tk-ct-sum td {
    padding: var(--space-8) var(--space-12);
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 400;
    text-align: left;
    vertical-align: top;
}

.tk-ct .tk-ct-sum thead th {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.tk-ct .tk-ct-sum .is-num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tk-ct .tk-ct-sum tfoot th,
.tk-ct .tk-ct-sum tfoot td {
    border-bottom: 0;
    font-weight: 700;
}

.tk-ct-kv {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: var(--space-8) var(--space-12);
    align-items: start;
    margin: 0;
    font-size: 14px;
}

.tk-ct-kv dt {
    padding-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.tk-ct-kv dd {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    min-width: 0;
    margin: 0;
}

.tk-ct-num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tk-ct-done {
    gap: var(--space-12);
}

/* やり取りのページ */
.tk-ct-statusline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-8) var(--space-12);
}

.tk-ct-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: var(--radius-full);
    background: var(--status-todo-bg);
    color: var(--status-todo-ink);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}

.tk-ct-chip-waiting {
    background: var(--status-waiting-bg);
    color: var(--status-waiting-ink);
}

.tk-ct-chip-done {
    background: var(--status-done-bg);
    color: var(--status-done-ink);
}

.tk-ct-info {
    gap: var(--space-8);
    padding: var(--space-16) var(--space-24);
}

.tk-ct-thread {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
}

.tk-ct-msg {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-width: 86%;
}

.tk-ct-msg-me {
    align-self: flex-end;
}

.tk-ct-msg-staff {
    align-self: flex-start;
}

.tk-ct-msg-meta {
    display: flex;
    align-items: baseline;
    gap: var(--space-8);
    color: var(--text-muted);
    font-size: 12px;
}

.tk-ct-msg-me .tk-ct-msg-meta {
    justify-content: flex-end;
}

.tk-ct-msg-meta b {
    color: var(--text);
    font-size: 14px;
}

.tk-ct-msg-body {
    padding: var(--space-12) var(--space-16);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.tk-ct-msg-me .tk-ct-msg-body {
    border-color: var(--action-subtle);
    background: var(--action-subtle);
}

@media (max-width: 767px) {
    .tk-ct {
        padding: var(--space-24) 0 var(--space-32);
        gap: var(--space-16);
    }

    .tk-ct-title {
        font-size: 24px;
    }

    .tk-ct-card {
        gap: var(--space-20, 20px);
        padding: var(--space-16);
    }

    .tk-ct-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tk-ct-actions {
        align-items: stretch;
    }

    .tk-ct .tk-ct-btn,
    .tk-ct a.tk-ct-btn {
        width: 100%;
    }

    .tk-ct .tk-ct-btn-lg {
        min-width: 0;
    }

    .tk-ct-msg,
    .tk-ct-msg-me,
    .tk-ct-msg-staff {
        max-width: 92%;
    }

    .tk-ct-info {
        padding: var(--space-16);
    }
}
