.lw-web {
	max-width: 1400px;
	margin: 0 auto;
	padding: 24px;
	box-sizing: border-box;
}

.lw-web * {
	box-sizing: border-box;
}


/* Header */

.lw-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 24px;
}

.lw-title {
	margin: 0;
	font-size: 32px;
	line-height: 1.2;
}

.lw-subtitle {
	margin: 8px 0 0;
	color: #666;
}

.lw-usage {
	white-space: nowrap;
	padding: 10px 16px;
	border: 1px solid #ddd;
	border-radius: 10px;
	background: #fff;
}

.lw-usage strong {
	font-size: 22px;
	margin: 0 4px;
}


/* Main */

.lw-main {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.lw-input-panel,
.lw-result-panel {
	padding: 24px;
	background: #fff;
	border: 1px solid #e4e4e4;
	border-radius: 14px;
}

.lw-input-panel h2,
.lw-result-panel h2 {
	margin-top: 0;
	margin-bottom: 24px;
	font-size: 22px;
}


/* Fields */

.lw-field {
	margin-bottom: 20px;
}

.lw-field label {
	display: block;
	margin-bottom: 7px;
	font-weight: 600;
}

.lw-field textarea,
.lw-field select,
.lw-field input {
	display: block;
	width: 100%;
	border: 1px solid #ccc;
	border-radius: 8px;
	padding: 11px 12px;
	font-size: 16px;
	font-family: inherit;
	background: #fff;
}

.lw-field textarea {
	resize: vertical;
	line-height: 1.6;
}

.lw-field textarea:focus,
.lw-field select:focus,
.lw-field input:focus {
	outline: none;
	border-color: #777;
}

.lw-required {
	display: inline-block;
	margin-left: 6px;
	font-size: 12px;
	font-weight: normal;
}

.lw-note {
	margin: 6px 0 0;
	font-size: 12px;
	color: #777;
}

/* Buttons */

.lw-generate-button {
	display: block;
	width: 100%;
	border: 0;
	border-radius: 9px;
	padding: 14px 20px;
	font-size: 17px;
	font-weight: 600;
	cursor: pointer;
}

.lw-result-buttons {
	display: flex;
	gap: 12px;
}

/* コピー・再生成などのサブボタン */
.lw-secondary-button {
    background: #ffffff;
    color: #2271b1;
    border: 1px solid #2271b1;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease,
                color 0.2s ease,
                border-color 0.2s ease;
}

.lw-secondary-button:hover {
    background: #2271b1;
    color: #ffffff;
    border-color: #2271b1;
}

.lw-secondary-button:disabled {
    background: #f3f4f6;
    color: #999999;
    border-color: #dddddd;
    cursor: not-allowed;
}


/* Result */

.lw-result-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 400px;
	border: 1px dashed #ccc;
	border-radius: 10px;
	padding: 30px;
	text-align: center;
	color: #777;
}

#lw-result-body {
	min-height: 430px;
}


/* Ad */

.lw-ad-placeholder {
	margin-top: 26px;
	min-height: 110px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	border: 1px dashed #ccc;
	border-radius: 10px;
	color: #888;
}

.lw-ad-placeholder span {
	font-size: 12px;
}

.lw-ad-placeholder p {
	margin: 5px 0 0;
}


/* Tablet / Smartphone */

@media (max-width: 900px) {

	.lw-web {
		padding: 16px;
	}

	.lw-main {
		grid-template-columns: 1fr;
	}

	.lw-header {
		align-items: flex-start;
	}

}


@media (max-width: 600px) {

    .lw-header {
        flex-direction: column;
    }

    .lw-input-panel,
    .lw-result-panel {
        padding: 18px;
    }

    .lw-title {
        font-size: 27px;
    }

    .lw-result-buttons {
        flex-direction: column;
    }

    .lw-result-buttons .lw-secondary-button {
        width: 100%;
    }

	.lw-result-body-header {
		align-items: flex-start;
		flex-direction: column;
		gap: 3px;
	}

	.lw-char-count {
		font-size: 12px;
	}

	.lw-beta-links {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}

	.lw-beta-links span {
		display: none;
	}

	.lw-beta-message {
		font-size: 13px;
	}
}

.lw-result-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: flex-start;
}

.lw-result-buttons .lw-secondary-button {
    width: auto;
    min-width: 110px;
}

.lw-profile-info {
	margin-top: 10px;
	padding: 12px 14px;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	background: #fafafa;
}

.lw-profile-info-name {
	font-weight: 600;
	margin-bottom: 4px;
}

.lw-profile-info-summary {
	font-size: 13px;
	line-height: 1.6;
	color: #666;
}

/* =========================================================
   Reward
   ========================================================= */

.lw-reward-area {
	margin-top: 18px;
	padding: 18px;
	border: 1px solid #ddd;
	border-radius: 10px;
	background: #fafafa;
	text-align: center;
}

.lw-reward-message {
	margin: 0 0 6px;
	font-weight: 600;
}

.lw-reward-description {
	margin: 0 0 14px;
	font-size: 14px;
	color: #666;
}

.lw-reward-button {
	width: 100%;
	padding: 13px 18px;
	border: 0;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}

.lw-reward-button:disabled {
	opacity: 0.55;
	cursor: default;
}

.lw-reward-status {
	margin: 10px 0 0;
	font-size: 13px;
	color: #666;
}

/* =========================================================
   生成結果：本文文字数
   ========================================================= */

.lw-result-body-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 7px;
}

.lw-result-body-header label {
	margin-bottom: 0;
}

.lw-char-count {
	font-size: 13px;
	color: #666;
	white-space: nowrap;
}

/* ========================================
   β版：広告プレースホルダー非表示
   ======================================== */

.lw-ad-placeholder {
    display: none !important;
}

/* ========================================
   β版：広告関連の開発用表示を非表示
   Reward本番運用開始時に再検討
   ======================================== */

/* 広告プレースホルダー */
.lw-ad-placeholder {
    display: none !important;
}

/* Reward広告エリア */
#lw-reward-area,
.lw-reward-area {
    display: none !important;
}

/* ========================================
   β版フィードバック
   ======================================== */

.lw-beta-feedback {
	margin-top: 32px;
	padding: 20px;
	border: 1px solid #ddd;
	border-radius: 10px;
	background: #fafafa;
	text-align: center;
}

.lw-beta-feedback-title {
	margin: 0 0 8px;
	font-weight: 700;
	font-size: 16px;
}

.lw-beta-feedback-text {
	margin: 0 0 12px;
	font-size: 14px;
	color: #666;
	line-height: 1.7;
}

.lw-feedback-link {
	display: inline-block;
	font-weight: 600;
	text-decoration: none;
}

/* ========================================
   LinguaWriter Web β版 ヘッダー
   ======================================== */

.lw-header-main {
	flex: 1;
}

.lw-beta-message {
	margin: 12px 0 8px;
	font-size: 14px;
	color: #666;
	line-height: 1.7;
}

.lw-beta-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}

.lw-beta-links a {
	font-weight: 600;
	text-decoration: none;
}

.lw-beta-links a:hover {
	text-decoration: underline;
}

.lw-beta-links span {
	color: #aaa;
}