/* =========================================================
   apply.css
========================================================= */

body.apply-page {
    background:
        repeating-linear-gradient(-45deg,
            #f1f1f1 0,
            #f1f1f1 20px,
            #e2e2e2 20px,
            #e2e2e2 40px);
    background-attachment: fixed;
}

body.modal-open {
    overflow: hidden;
}

.apply-page main {
    width: min(980px, calc(100% - 40px));
}

.apply-intro {
    margin: 0 0 30px;
    border-left: 6px solid var(--stst-yellow, #ffcf21);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--stst-text-soft, #68707a);
    padding: 15px 17px;
    box-shadow: var(--shadow-sm, 0 3px 10px rgba(0, 0, 0, 0.08));
    font-size: 0.94rem;
    line-height: 1.8;
}

/* =========================================================
   フォーム
========================================================= */

#applyForm {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 20px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-top: 6px solid var(--stst-yellow, #ffcf21);
    border-radius: var(--radius-md, 16px);
    background: rgba(255, 255, 255, 0.97);
    padding: 32px;
    box-shadow: var(--shadow-md, 0 8px 26px rgba(0, 0, 0, 0.1));
}

#applyForm>h2 {
    grid-column: 1 / -1;
    position: relative;
    margin: 24px 0 3px;
    border-bottom: 1px solid var(--stst-border, #e4e0d8);
    color: var(--stst-charcoal, #252525);
    padding: 0 0 13px 15px;
    font-size: 1.18rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}

#applyForm>h2:first-child {
    margin-top: 0;
}

#applyForm>h2::before {
    position: absolute;
    top: 0.15em;
    left: 0;
    width: 7px;
    height: 1.2em;
    border-radius: 999px;
    background: var(--stst-orange, #f26a2a);
    content: "";
}

#applyForm>label {
    display: grid;
    gap: 7px;
    min-width: 0;
    margin: 0;
    color: var(--stst-text, #282828);
    font-size: 0.9rem;
    font-weight: 800;
}

#applyForm>label:has(textarea),
.tag-field,
.image-upload-group,
.private-info-note {
    grid-column: 1 / -1;
}

#applyForm input,
#applyForm textarea,
#applyForm select {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--stst-border-strong, #cfc9bd);
    border-radius: 9px;
    background: #fff;
    color: var(--stst-text, #282828);
    padding: 10px 11px;
    font: inherit;
    font-size: 0.9rem;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

#applyForm input:focus,
#applyForm textarea:focus,
#applyForm select:focus {
    border-color: var(--stst-orange, #f26a2a);
    outline: none;
    box-shadow: 0 0 0 4px rgba(242, 106, 42, 0.13);
}

#applyForm textarea {
    min-height: 112px;
    resize: vertical;
}

#applyForm select {
    min-height: 42px;
    appearance: auto;
}


.required-marker {
    color: var(--stst-red, #df4e4e);
    font-size: 0.78rem;
    font-weight: 900;
}

.section-private-label {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    border-radius: 999px;
    background: #f0f1f3;
    color: #6c737c;
    padding: 2px 8px;
    font-size: 0.7rem;
    vertical-align: middle;
}

.private-info-note {
    margin: -8px 0 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.82rem;
    line-height: 1.65;
}

/* =========================================================
   タグ
========================================================= */

.tag-field {
    display: grid;
    gap: 8px;
}

.tag-field-heading {
    color: var(--stst-text, #282828);
    font-size: 0.9rem;
    font-weight: 800;
}

.tag-description {
    margin: 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.82rem;
    line-height: 1.7;
}

.tag-editor {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 52px;
    border: 1px solid var(--stst-border-strong, #cfc9bd);
    border-radius: 10px;
    background: #fff;
    padding: 8px;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.tag-editor:focus-within {
    border-color: var(--stst-orange, #f26a2a);
    box-shadow: 0 0 0 4px rgba(242, 106, 42, 0.13);
}

.tag-chip-list {
    display: contents;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    border-radius: 999px;
    background: var(--stst-yellow-soft, #fff2b9);
    color: #725600;
    padding: 4px 6px 4px 10px;
    font-size: 0.82rem;
    font-weight: 800;
}

.tag-chip>span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag-remove-button {
    display: inline-grid;
    width: 22px;
    min-width: 22px;
    min-height: 22px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(114, 86, 0, 0.14);
    color: #725600;
    padding: 0;
    box-shadow: none;
    font-size: 1rem;
    line-height: 1;
}

.tag-remove-button:hover {
    background: rgba(114, 86, 0, 0.26);
    color: #725600;
    transform: none;
    box-shadow: none;
}

#tagInput {
    min-width: 150px;
    flex: 1 1 180px;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--stst-text, #282828);
    padding: 5px;
    font: inherit;
}

#tagInput:disabled {
    cursor: not-allowed;
    color: #9ba1a8;
}

.tag-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

#addTagButton {
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    background: var(--stst-charcoal, #252525);
    color: #fff;
    padding: 7px 12px;
    box-shadow: none;
    font-size: 0.82rem;
    font-weight: 800;
}

#addTagButton:hover:not(:disabled) {
    background: #3a3a3a;
    transform: none;
    box-shadow: none;
}

#addTagButton:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.tag-count {
    color: var(--stst-text-soft, #68707a);
    font-size: 0.8rem;
    font-weight: 800;
}

.form-field-message {
    min-height: 1.35em;
    margin: 0;
    color: var(--stst-red, #df4e4e);
    font-size: 0.8rem;
    font-weight: 700;
}

/* =========================================================
   画像アップロード
========================================================= */

.image-upload-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    border: 1px dashed #d6c88a;
    border-radius: var(--radius-sm, 10px);
    background: #fffdf5;
    padding: 16px;
}

.image-upload-field {
    display: grid;
    gap: 8px;
    min-width: 0;
    color: var(--stst-text, #282828);
    font-size: 0.92rem;
    font-weight: 800;
}

.image-upload-field small {
    color: var(--stst-text-soft, #68707a);
    font-size: 0.8rem;
    font-weight: 600;
}

.image-upload-field input[type="file"] {
    width: 100%;
    border: 1px solid var(--stst-border-strong, #cfc9bd);
    border-radius: 9px;
    background: #fff;
    color: var(--stst-text-soft, #68707a);
    padding: 8px;
    font: inherit;
}

.image-upload-field input[type="file"]::file-selector-button {
    margin-right: 10px;
    border: 0;
    border-radius: 7px;
    background: var(--stst-charcoal, #252525);
    color: #fff;
    padding: 7px 10px;
    font-weight: 800;
    cursor: pointer;
}

.image-status {
    color: var(--stst-text-soft, #68707a);
    font-size: 0.8rem;
    font-weight: 700;
}

.image-preview-tools {
    display: grid;
    justify-items: center;
    gap: 8px;
}

.cropped-image-preview {
    display: block;
    border: 1px solid var(--stst-border, #e4e0d8);
    background-color: #f1eee7;
    background-image:
        linear-gradient(45deg, #e8e4dc 25%, transparent 25%),
        linear-gradient(-45deg, #e8e4dc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e8e4dc 75%),
        linear-gradient(-45deg, transparent 75%, #e8e4dc 75%);
    background-position:
        0 0,
        0 7px,
        7px -7px,
        -7px 0;
    background-size: 14px 14px;
    box-shadow: var(--shadow-sm, 0 3px 10px rgba(0, 0, 0, 0.08));
    object-fit: cover;
}

.cropped-image-preview-thumbnail {
    width: 112px;
    height: 112px;
    border-radius: 14px;
}

.cropped-image-preview-profile {
    width: 92px;
    height: 122px;
    border-radius: 12px;
}

.image-reset-button {
    min-height: auto;
    border: 1px solid #d9a5a5;
    border-radius: 8px;
    background: #fff;
    color: var(--stst-red, #df4e4e);
    padding: 6px 9px;
    box-shadow: none;
    font-size: 0.78rem;
    font-weight: 800;
}

.image-reset-button:hover {
    background: #fff4f4;
    color: var(--stst-red, #df4e4e);
    transform: none;
    box-shadow: none;
}

/* =========================================================
   送信
========================================================= */

#applyForm button[type="submit"] {
    grid-column: 1 / -1;
    width: min(100%, 420px);
    min-height: 54px;
    margin: 14px auto 0;
    border: 0;
    border-radius: 12px;
    background: var(--stst-yellow, #ffcf21);
    color: var(--stst-charcoal, #252525);
    padding: 12px 18px;
    font-size: 1.03rem;
    font-weight: 900;
    letter-spacing: 0.03em;
}

#applyForm button[type="submit"]:hover:not(:disabled) {
    background: var(--stst-yellow-hover, #edbc0c);
}

#applyMessage {
    min-height: 1.8em;
    margin: 18px 0 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.94rem;
    font-weight: 700;
    text-align: center;
}

/* =========================================================
   モーダル共通
========================================================= */

.apply-modal-overlay {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    overflow-y: auto;
    background: rgba(30, 30, 30, 0.64);
    padding: 20px;
}

.apply-modal-overlay.hidden,
.hidden {
    display: none !important;
}

.button-secondary,
.button-orange {
    min-height: 42px;
    border-radius: 9px;
    padding: 9px 14px;
    font-size: 0.86rem;
    font-weight: 800;
}

.button-secondary {
    border: 1px solid var(--stst-border-strong, #cfc9bd);
    background: #fff;
    color: var(--stst-charcoal, #252525);
    box-shadow: none;
}

.button-secondary:hover:not(:disabled) {
    background: #f5f4f1;
    transform: none;
    box-shadow: none;
}

.button-orange {
    border: 0;
    background: var(--stst-orange, #f26a2a);
    color: #fff;
}

.button-orange:hover:not(:disabled) {
    background: #d9551f;
}

.button-secondary:disabled,
.button-orange:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

/* =========================================================
   画像トリミング
========================================================= */

.crop-modal {
    width: min(620px, 100%);
    max-height: min(88vh, 900px);
    overflow-y: auto;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-top: 6px solid var(--stst-yellow, #ffcf21);
    border-radius: var(--radius-md, 16px);
    background: #fff;
    padding: 24px;
    box-shadow: var(--shadow-lg, 0 16px 40px rgba(0, 0, 0, 0.2));
}

.crop-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.crop-modal-header h2 {
    margin: 0;
    color: var(--stst-charcoal, #252525);
}

.crop-modal-header p {
    margin: 5px 0 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.86rem;
}

.crop-close-button {
    min-width: 38px;
    min-height: 38px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 50%;
    background: #fff;
    color: var(--stst-charcoal, #252525);
    padding: 0;
    box-shadow: none;
    font-size: 1.5rem;
    line-height: 1;
}

.crop-close-button:hover {
    background: #f5f4f1;
    transform: none;
    box-shadow: none;
}

.crop-size-warning {
    min-height: 1.4em;
    margin: 16px 0 12px;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.82rem;
    font-weight: 700;
}

.crop-size-warning.is-warning {
    color: #a56d00;
}

.crop-canvas-frame {
    display: grid;
    min-height: 240px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 14px;
    background: #efede7;
    padding: 14px;
}

#cropCanvas {
    display: block;
    max-width: 100%;
    border-radius: 8px;
    cursor: grab;
    touch-action: none;
}

#cropCanvas.is-dragging {
    cursor: grabbing;
}

.crop-zoom-control {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin-top: 18px;
    color: var(--stst-text, #282828);
    font-size: 0.88rem;
    font-weight: 800;
}

.crop-zoom-control input[type="range"] {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    accent-color: var(--stst-orange, #f26a2a);
}

.crop-help {
    margin: 10px 0 0;
    color: #939aa3;
    font-size: 0.8rem;
}

.crop-modal-actions,
.confirm-modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    border-top: 1px solid var(--stst-border, #e4e0d8);
    padding-top: 18px;
}

/* =========================================================
   確認・公開ページプレビュー
========================================================= */

.confirm-modal {
    width: min(960px, 100%);
    max-height: min(90vh, 1000px);
    overflow-y: auto;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-top: 6px solid var(--stst-yellow, #ffcf21);
    border-radius: var(--radius-md, 16px);
    background: #fff;
    padding: 28px;
    box-shadow: var(--shadow-lg, 0 16px 40px rgba(0, 0, 0, 0.2));
}

.confirm-modal>h2 {
    margin: 0 0 12px;
    color: var(--stst-charcoal, #252525);
}

.confirm-modal-lead {
    margin: 0 0 14px;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.94rem;
    line-height: 1.75;
}

.confirm-edit-note {
    margin-bottom: 20px;
    border: 1px solid #eadca8;
    border-left: 6px solid var(--stst-yellow, #ffcf21);
    border-radius: 10px;
    background: #fff9df;
    color: #715500;
    padding: 13px 15px;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.7;
}

.profile-preview {
    display: grid;
    gap: 16px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 16px;
    background: #f2f2f2;
    padding: 14px;
}

/* 一覧・検索結果用 */

.preview-list-card {
    display: grid;
    gap: 10px;
    margin: 0;
    border: 1px solid #d9d3c6;
    border-radius: 12px;
    background: #fffdf5;
    box-shadow: none;
    padding: 14px;
}

.preview-list-heading {
    margin: 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.78rem;
    font-weight: 800;
}

.preview-list-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.preview-list-thumbnail {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    border-radius: 8px;
    background-color: #e7e2d8;
    background-image:
        linear-gradient(45deg, #dcd6cc 25%, transparent 25%),
        linear-gradient(-45deg, #dcd6cc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #dcd6cc 75%),
        linear-gradient(-45deg, transparent 75%, #dcd6cc 75%);
    background-position:
        0 0,
        0 6px,
        6px -6px,
        -6px 0;
    background-size: 12px 12px;
    object-fit: cover;
}

.preview-list-text {
    display: grid;
    min-width: 0;
    gap: 7px;
}

.preview-list-text strong {
    overflow: hidden;
    color: var(--stst-charcoal, #252525);
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-list-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.preview-list-tag {
    border-radius: 999px;
    background: var(--stst-yellow-soft, #fff2b9);
    color: #715500;
    padding: 3px 7px;
    font-size: 0.7rem;
    font-weight: 800;
}

/* プロフィールページ本体 */

.preview-profile-page {
    overflow: hidden;
    border: 1px solid #d6d0c4;
    background: #fff;
    box-shadow: 0 8px 22px rgba(40, 35, 20, 0.08);
}

.preview-profile-page section {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.preview-top-section {
    min-height: 180px;
    border: 0;
    background:
        radial-gradient(circle at top right,
            rgba(255, 207, 33, 0.42),
            transparent 40%),
        linear-gradient(135deg, #fffaf0, #f3eee2);
    padding: 34px 30px;
}

.preview-top-text {
    max-width: 720px;
    margin: 0 auto;
}

.preview-profile-id {
    margin-bottom: 8px;
    color: #806100;
    font-size: 0.8rem;
    font-weight: 800;
}

.preview-profile-name {
    margin: 0;
    color: var(--stst-charcoal, #252525);
    font-size: clamp(1.6rem, 4vw, 2.3rem);
    line-height: 1.3;
}

.preview-catchphrase {
    margin-top: 12px;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.96rem;
}

.preview-content-shell {
    width: min(860px, 100%);
    margin: 0 auto;
    padding: 24px;
}

.preview-profile-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 24px;
    align-items: start;
    margin-bottom: 28px !important;
    border: 0;
    background: transparent;
    padding: 0;
}

.preview-profile-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--stst-border, #e4e0d8);
    background: #fff;
}

.preview-profile-table th,
.preview-profile-table td {
    border-bottom: 1px solid var(--stst-border, #e4e0d8);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.preview-profile-table th {
    width: 35%;
    background: var(--stst-charcoal, #252525);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
}

.preview-profile-table td {
    color: var(--stst-text-soft, #68707a);
    font-size: 0.82rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.preview-profile-table tr:last-child th,
.preview-profile-table tr:last-child td {
    border-bottom: 0;
}

.preview-profile-image-wrap {
    display: grid;
    place-items: center;
}

.preview-profile-image {
    width: 200px;
    aspect-ratio: 3 / 4;
    background-color: #ebe6dc;
    background-image:
        linear-gradient(45deg, #ded8cd 25%, transparent 25%),
        linear-gradient(-45deg, #ded8cd 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ded8cd 75%),
        linear-gradient(-45deg, transparent 75%, #ded8cd 75%);
    background-position:
        0 0,
        0 8px,
        8px -8px,
        -8px 0;
    background-size: 16px 16px;
    box-shadow: 0 8px 18px rgba(50, 40, 20, 0.16);
    object-fit: cover;
}

.preview-dynamic-section {
    margin: 0 0 24px !important;
    border: 1px solid var(--stst-border, #e4e0d8) !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.preview-dynamic-section h4 {
    margin: 0;
    border-bottom: 1px solid var(--stst-border, #e4e0d8);
    background: #f7f5f0;
    color: var(--stst-charcoal, #252525);
    padding: 12px 15px;
    font-size: 0.95rem;
}

.preview-text-content {
    margin: 0;
    color: var(--stst-text-soft, #68707a);
    padding: 15px;
    white-space: pre-wrap;
    font-size: 0.88rem;
    line-height: 1.75;
}

.preview-link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px;
}

.preview-link {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--stst-border-strong, #cfc9bd);
    border-radius: 999px;
    background: #fff;
    color: var(--stst-charcoal, #252525);
    padding: 7px 11px;
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
}

.preview-link:hover {
    border-color: var(--stst-orange, #f26a2a);
    color: var(--stst-orange, #f26a2a);
}

.preview-video-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 15px;
}

.preview-video-card {
    display: grid;
    gap: 6px;
    border: 1px solid #ddd6c7;
    border-radius: 10px;
    background: #fffaf0;
    color: var(--stst-charcoal, #252525);
    padding: 14px;
    text-decoration: none;
}

.preview-video-card:hover {
    border-color: var(--stst-orange, #f26a2a);
    color: var(--stst-charcoal, #252525);
}

.preview-video-platform {
    color: #bd2222;
    font-size: 0.72rem;
    font-weight: 900;
}

.confirm-submit-message {
    min-height: 1.5em;
    margin: 16px 0 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.88rem;
    font-weight: 700;
}

/* =========================================================
   モバイル
========================================================= */

@media (max-width: 720px) {
    .apply-page main {
        width: min(100% - 24px, 980px);
    }

    .apply-intro {
        padding: 13px 14px;
        font-size: 0.88rem;
    }

    #applyForm {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 20px 16px;
        border-radius: 14px;
    }

    #applyForm>h2 {
        margin-top: 16px;
        font-size: 1.04rem;
    }

    #applyForm>label,
    #applyForm>label:has(textarea),
    .tag-field,
    .image-upload-group,
    .private-info-note {
        grid-column: 1;
    }

    .image-upload-group {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .image-preview-tools {
        justify-items: start;
    }

    .tag-actions {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    #applyForm button[type="submit"] {
        width: 100%;
        min-height: 52px;
    }

    .crop-modal,
    .confirm-modal {
        max-height: 90vh;
        border-radius: 14px;
        padding: 20px 16px;
    }

    .crop-zoom-control {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .crop-modal-actions,
    .confirm-modal-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .crop-modal-actions button,
    .confirm-modal-actions button {
        width: 100%;
    }

    .preview-content-shell {
        padding: 16px;
    }

    .preview-top-section {
        min-height: 0;
        padding: 24px 18px;
    }

    .preview-profile-section {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .preview-profile-image-wrap {
        order: -1;
    }

    .preview-profile-image {
        width: 160px;
    }

    .preview-video-list {
        grid-template-columns: 1fr;
    }

    .preview-profile-table {
        display: block;
        overflow-x: auto;
    }
}