/* Word Counter — P0 + P1 panels (limits, density, readability, case, draft, export, flow, SERP) */

/* Main panel: add toolbar row under textarea without breaking shared grid */
.lc-tools-word-counter .lc-tool-panel:not(.lc-wc-extras) {
	grid-template-rows: auto 1fr auto;
}

.lc-tools-word-counter .lc-tool-panel:not(.lc-wc-extras) > .lc-tool-stats {
	grid-row: 1 / span 3;
}

.lc-tools-word-counter .lc-tool-panel:not(.lc-wc-extras) > .lc-wc-toolbar {
	grid-column: 1;
	grid-row: 3;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 14px;
	margin-top: 4px;
}

.lc-wc-case {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.lc-wc-case .lc-btn {
	min-height: 36px;
	padding: 7px 11px;
	font-size: 11.5px;
}

.lc-wc-draft {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	margin-left: auto;
}

.lc-wc-draft__note {
	min-height: 1em;
	color: #34714a;
	font-size: 11.5px;
	font-weight: 650;
}

.lc-wc-draft .lc-btn {
	min-height: 36px;
	padding: 7px 11px;
	font-size: 11.5px;
}

.lc-wc-extras {
	margin-top: 22px;
	display: block;
}

.lc-wc-section + .lc-wc-section {
	margin-top: 28px;
	padding-top: 26px;
	border-top: 1px solid #e4eaee;
}

.lc-wc-section__head {
	margin: 0 0 14px;
}

.lc-wc-section__title {
	margin: 0;
	color: var(--lc-navy-900);
	font-family: 'Sora', sans-serif;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -.02em;
	line-height: 1.3;
}

.lc-wc-section__desc {
	margin: 5px 0 0;
	color: #75818c;
	font-size: 12.5px;
	line-height: 1.55;
	max-width: 54ch;
}

.lc-wc-export-actions {
	margin-top: 0;
}

.lc-wc-settings {
	border-top: 1px solid #dfe5e8;
	border-bottom: 1px solid #dfe5e8;
}

.lc-wc-setting {
	min-height: 72px;
	padding: 14px 0;
	display: grid;
	grid-template-columns: 140px minmax(0, 1fr);
	align-items: center;
	gap: 18px;
}

.lc-wc-setting + .lc-wc-setting {
	border-top: 1px solid #e7ebed;
}

.lc-wc-setting__label > span,
.lc-wc-setting__label > label {
	display: block;
	margin: 0;
	color: #27384c;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.3;
}

.lc-wc-setting__label small {
	display: block;
	margin-top: 3px;
	color: #929ca5;
	font-size: 10.5px;
	font-weight: 500;
	line-height: 1.35;
}

.lc-wc-setting__control {
	min-width: 0;
	display: grid;
	grid-template-columns: minmax(180px, 1fr) auto;
	align-items: center;
	gap: 14px;
}

.lc-wc-setting__control .lc-tool-select {
	min-height: 44px;
	padding: 9px 37px 9px 12px;
	background-color: #fff;
	border-color: #ced8de;
	border-radius: 7px;
	font-size: 12.5px;
}

.lc-wc-setting__value {
	color: var(--lc-navy-900);
	font-family: 'Sora', sans-serif;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: -.02em;
	white-space: nowrap;
}

.lc-wc-limits {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.lc-wc-limit {
	padding: 14px 14px 12px;
	background: #f7f9fa;
	border: 1px solid #e1e7eb;
	border-radius: 8px;
}

.lc-wc-limit__meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
}

.lc-wc-limit__name {
	color: #27384c;
	font-size: 12.5px;
	font-weight: 700;
}

.lc-wc-limit__cap {
	color: #8a959f;
	font-size: 11px;
	font-weight: 600;
}

.lc-wc-limit__bar {
	margin: 10px 0 8px;
	height: 5px;
	overflow: hidden;
	background: #dde4e8;
	border-radius: 999px;
}

.lc-wc-limit__fill {
	display: block;
	height: 100%;
	width: 0;
	background: var(--lc-green-500);
	border-radius: inherit;
	transition: width .15s ease, background .15s ease;
}

.lc-wc-limit.is-warn .lc-wc-limit__fill { background: #d3a222; }
.lc-wc-limit.is-over .lc-wc-limit__fill { background: #c95252; }

.lc-wc-limit__stats {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	color: #5d6a76;
	font-size: 11px;
	font-weight: 600;
}

.lc-wc-limit__stats [data-wc-limit-remain].is-ok { color: #34714a; }
.lc-wc-limit__stats [data-wc-limit-remain].is-warn { color: #80671f; }
.lc-wc-limit__stats [data-wc-limit-remain].is-over { color: #9a4141; }

.lc-wc-section--split .lc-wc-split {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
	gap: 28px;
	align-items: start;
}

.lc-wc-density-toggles {
	margin: 0 0 12px;
}

.lc-wc-density-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 12px;
}

.lc-wc-density-tab {
	padding: 7px 11px;
	color: #465564;
	background: #f3f6f7;
	border: 1px solid #d6dee2;
	border-radius: 6px;
	font-size: 11.5px;
	font-weight: 700;
	cursor: pointer;
}

.lc-wc-density-tab:hover {
	border-color: #9eacb5;
}

.lc-wc-density-tab.is-active {
	color: #0d6630;
	background: #edf8f0;
	border-color: #b9dfc4;
}

.lc-wc-density {
	min-height: 180px;
}

.lc-wc-empty {
	margin: 0;
	padding: 18px 0;
	color: #84919c;
	font-size: 13px;
}

.lc-wc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12.5px;
}

.lc-wc-table th,
.lc-wc-table td {
	padding: 9px 8px;
	border-bottom: 1px solid #e7ebed;
	text-align: left;
}

.lc-wc-table th {
	color: #8a959f;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
}

.lc-wc-table td:first-child {
	color: #27384c;
	font-weight: 650;
}

.lc-wc-table td:nth-child(2),
.lc-wc-table td:nth-child(3),
.lc-wc-table th:nth-child(2),
.lc-wc-table th:nth-child(3) {
	text-align: right;
	white-space: nowrap;
}

.lc-wc-table tbody tr:last-child td {
	border-bottom: 0;
}

.lc-wc-readability {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
}

.lc-wc-read-card {
	padding: 18px 16px;
	background: #0d2853;
	border-radius: 8px;
	text-align: left;
}

.lc-wc-read-card__num {
	color: #fff;
	font-family: 'Sora', sans-serif;
	font-size: 28px;
	font-weight: 750;
	letter-spacing: -.03em;
	line-height: 1.1;
}

.lc-wc-read-card__label {
	margin-top: 8px;
	color: rgba(255, 255, 255, .72);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
}

.lc-wc-read-card__hint {
	margin-top: 5px;
	color: rgba(255, 255, 255, .48);
	font-size: 12px;
	font-weight: 500;
}

/* Sentence length flow */
.lc-wc-flow-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0 0;
}

.lc-wc-flow-swatch {
	display: inline-flex;
	align-items: center;
	padding: 5px 9px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 700;
}

.lc-wc-flow-swatch--short { color: #1f6b3a; background: #e4f5ea; }
.lc-wc-flow-swatch--medium { color: #7a6118; background: #f7efd4; }
.lc-wc-flow-swatch--long { color: #8a4a16; background: #f8e5d4; }
.lc-wc-flow-swatch--verylong { color: #8d3030; background: #f6e0e0; }

.lc-wc-flow {
	margin-top: 12px;
	padding: 16px 16px 14px;
	background: #f7f9fa;
	border: 1px solid #e1e7eb;
	border-radius: 8px;
	line-height: 1.75;
	font-size: 14px;
	color: #27384c;
}

.lc-wc-flow-sent {
	border-radius: 3px;
	padding: 1px 2px;
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
}

.lc-wc-flow-sent--short { background: rgba(52, 160, 90, .18); }
.lc-wc-flow-sent--medium { background: rgba(211, 162, 34, .22); }
.lc-wc-flow-sent--long { background: rgba(220, 120, 48, .22); }
.lc-wc-flow-sent--verylong { background: rgba(201, 82, 82, .22); }

/* SERP preview */
.lc-wc-serp-fields {
	display: grid;
	gap: 14px;
	max-width: 640px;
}

.lc-wc-serp-field-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.lc-wc-serp-field-head .lc-tool-label {
	margin: 0;
}

.lc-wc-serp-count {
	color: #8a959f;
	font-size: 11.5px;
	font-weight: 700;
	white-space: nowrap;
}

.lc-wc-serp-count.is-warn { color: #80671f; }
.lc-wc-serp-count.is-over { color: #9a4141; }

.lc-wc-serp-desc {
	min-height: 88px;
	resize: vertical;
}

.lc-wc-serp-mock {
	margin-top: 18px;
	max-width: 600px;
	padding: 18px 18px 16px;
	background: #fff;
	border: 1px solid #e1e7eb;
	border-radius: 8px;
	font-family: Arial, sans-serif;
}

.lc-wc-serp-mock__url {
	color: #006621;
	font-size: 13px;
	line-height: 1.4;
	margin-bottom: 3px;
}

.lc-wc-serp-mock__title {
	display: inline-block;
	color: #1a0dab;
	font-size: 18px;
	line-height: 1.3;
	text-decoration: none;
	cursor: default;
}

.lc-wc-serp-mock__title:hover {
	text-decoration: underline;
}

.lc-wc-serp-mock__desc {
	margin-top: 4px;
	color: #545454;
	font-size: 13px;
	line-height: 1.5;
}

@media (max-width: 980px) {
	.lc-wc-limits {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.lc-wc-section--split .lc-wc-split {
		grid-template-columns: 1fr;
		gap: 26px;
	}
}

@media (max-width: 640px) {
	.lc-wc-extras {
		margin-top: 18px;
	}

	.lc-tools-word-counter .lc-tool-panel:not(.lc-wc-extras) > .lc-wc-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.lc-wc-draft {
		margin-left: 0;
		justify-content: space-between;
	}

	.lc-wc-setting {
		grid-template-columns: 1fr;
		gap: 10px;
		min-height: 0;
		padding: 14px 0;
	}

	.lc-wc-setting__control {
		grid-template-columns: 1fr;
		justify-items: start;
		gap: 8px;
	}

	.lc-wc-setting__control .lc-tool-select {
		width: 100%;
	}

	.lc-wc-limits {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 390px) {
	.lc-wc-section__title {
		font-size: 14px;
	}

	.lc-wc-limit {
		padding: 12px;
	}

	.lc-wc-read-card__num {
		font-size: 24px;
	}

	.lc-wc-serp-mock__title {
		font-size: 16px;
	}
}
