/**
 * Comic Dekho Coins — front-end styles.
 *
 * Uses the Madara convention: dark theme by default, light theme under
 * body.text-ui-light. All colours are declared as tokens so a child theme can
 * override them without touching the layout rules.
 *
 * The tokens live on :root rather than on .cdc-wrap.
 *
 * A theme can print one of these fragments outside the plugin's own wrapper —
 * the Comic Dekho profile page embeds the wallet (.cdc-wallet, no .cdc-wrap
 * parent) and the chapter reader prints the lock panel straight into the
 * reading area. Scoping the tokens to .cdc-wrap left every var(--cdc-*) empty
 * in those places, which shows up as colourless, borderless elements.
 *
 * They are namespaced --cdc-*, so declaring them at the root cannot affect
 * anything the theme styles.
 */

:root {
	--cdc-bg: #1f1f1f;
	--cdc-bg-2: #262626;
	--cdc-bg-3: #2f2f2f;
	--cdc-border: #3a3a3a;
	--cdc-text: #e8e8e8;
	--cdc-muted: #9a9a9a;
	--cdc-accent: #ffb648;
	--cdc-accent-2: #ff8a00;
	--cdc-green: #4caf7d;
	--cdc-red: #e0575b;
	--cdc-radius: 10px;
}

.cdc-wrap {
	max-width: 1120px;
	margin: 0 auto;
	padding: 28px 16px 56px;
	color: var(--cdc-text);
	font-size: 15px;
	line-height: 1.6;
}

body.text-ui-light {
	--cdc-bg: #ffffff;
	--cdc-bg-2: #f7f7f9;
	--cdc-bg-3: #eeeef2;
	--cdc-border: #e0e0e6;
	--cdc-text: #23232b;
	--cdc-muted: #6b6b78;
	--cdc-accent: #e38b00;
	--cdc-accent-2: #c97400;
}

.cdc-wrap *,
.cdc-wrap *::before,
.cdc-wrap *::after,
.cdc-wallet *,
.cdc-wallet *::before,
.cdc-wallet *::after,
.cdc-lock-panel *,
.cdc-lock-panel *::before,
.cdc-lock-panel *::after {
	box-sizing: border-box;
}

/* ===== Buttons ===== */
.cdc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 20px;
	border: 1px solid transparent;
	border-radius: 8px;
	background: var(--cdc-bg-3);
	color: var(--cdc-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none !important;
	transition: background .15s ease, border-color .15s ease, transform .1s ease;
}

.cdc-btn:hover {
	background: var(--cdc-border);
	color: var(--cdc-text);
}

.cdc-btn:active {
	transform: translateY(1px);
}

.cdc-btn-primary {
	background: linear-gradient(135deg, var(--cdc-accent), var(--cdc-accent-2));
	color: #1a1a1a;
	border-color: transparent;
}

.cdc-btn-primary:hover {
	background: linear-gradient(135deg, var(--cdc-accent-2), var(--cdc-accent));
	color: #1a1a1a;
}

.cdc-btn-outline {
	background: transparent;
	border-color: var(--cdc-border);
	color: var(--cdc-text);
}

.cdc-btn-outline:hover {
	border-color: var(--cdc-accent);
	background: transparent;
	color: var(--cdc-accent);
}

.cdc-btn-ghost {
	background: transparent;
	color: var(--cdc-muted);
}

.cdc-btn-telegram {
	background: #2aabee;
	color: #fff;
}

.cdc-btn-telegram:hover {
	background: #1f97d4;
	color: #fff;
}

.cdc-btn-block {
	width: 100%;
}

.cdc-btn-sm {
	padding: 7px 14px;
	font-size: 13px;
}

.cdc-btn:disabled {
	opacity: .45;
	cursor: not-allowed;
}

/* ===== Hero ===== */
.cdc-hero {
	margin-bottom: 28px;
	text-align: center;
}

.cdc-hero h1 {
	margin: 0 0 8px;
	font-size: 30px;
	line-height: 1.2;
	color: var(--cdc-text);
}

.cdc-hero p {
	margin: 0;
	color: var(--cdc-muted);
	font-size: 15px;
}

.cdc-hero-balance {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 16px;
	padding: 8px 18px;
	border: 1px solid var(--cdc-border);
	border-radius: 999px;
	background: var(--cdc-bg-2);
}

.cdc-hero-balance-label {
	color: var(--cdc-muted);
	font-size: 13px;
}

.cdc-hero-balance-value {
	font-weight: 700;
	color: var(--cdc-accent);
}

.cdc-coin {
	color: var(--cdc-muted);
	font-size: .85em;
	font-weight: 500;
}

/* ===== Notices ===== */
.cdc-notice {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
	margin-bottom: 22px;
	padding: 13px 18px;
	border-radius: var(--cdc-radius);
	border-left: 4px solid var(--cdc-border);
	background: var(--cdc-bg-2);
	font-size: 14px;
}

.cdc-notice-info {
	border-left-color: #4a90d9;
}

.cdc-notice-warn {
	border-left-color: var(--cdc-accent);
}

.cdc-notice-success {
	border-left-color: var(--cdc-green);
}

/* Verification banner: copy on the left, resend button on the right. */
.cdc-verify-banner {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 10px 18px;
	align-items: center;
	margin-bottom: 22px;
}

.cdc-verify-banner .cdc-verify-copy strong {
	display: block;
	margin-bottom: 4px;
	font-size: 15px;
}

.cdc-verify-banner p {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--cdc-muted);
}

.cdc-verify-banner p.cdc-verify-hint {
	margin-top: 4px;
	font-size: 12.5px;
	opacity: .8;
}

.cdc-verify-banner .cdc-reward-msg:empty {
	display: none;
}

/* The message spans both columns under the button. */
.cdc-verify-banner .cdc-reward-msg {
	grid-column: 1 / -1;
	margin: 0;
}

@media (max-width: 560px) {
	.cdc-verify-banner {
		grid-template-columns: 1fr;
	}

	.cdc-verify-banner .cdc-btn {
		width: 100%;
	}
}

/* ===== Package / plan grids ===== */
.cdc-pack-grid,
.cdc-plan-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
	gap: 18px;
	margin-bottom: 40px;
}

.cdc-pack,
.cdc-plan {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 24px 20px;
	border: 1px solid var(--cdc-border);
	border-radius: 14px;
	background: var(--cdc-bg-2);
	text-align: center;
}

.cdc-pack-featured,
.cdc-plan-featured {
	border-color: var(--cdc-accent);
	box-shadow: 0 0 0 1px var(--cdc-accent) inset;
}

.cdc-pack-badge {
	position: absolute;
	top: -11px;
	left: 50%;
	transform: translateX(-50%);
	padding: 3px 12px;
	border-radius: 999px;
	background: var(--cdc-accent);
	color: #1a1a1a;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	white-space: nowrap;
}

.cdc-pack-title,
.cdc-plan-title {
	margin: 6px 0 12px;
	font-size: 16px;
	font-weight: 600;
	color: var(--cdc-text);
}

.cdc-pack-coins,
.cdc-plan-price {
	font-size: 30px;
	font-weight: 800;
	line-height: 1.1;
	color: var(--cdc-text);
}

.cdc-pack-split,
.cdc-pack-rate,
.cdc-plan-rate {
	color: var(--cdc-muted);
	font-size: 13px;
}

.cdc-pack-rate,
.cdc-plan-rate {
	margin-top: 4px;
}

.cdc-pack-price {
	margin: 14px 0 4px;
	font-size: 20px;
	font-weight: 700;
	color: var(--cdc-accent);
}

.cdc-pack .cdc-btn,
.cdc-plan .cdc-btn {
	margin-top: 20px;
}

body.cdc-modal-open {
	overflow: hidden;
}

.cdc-plan-features {
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
	text-align: left;
	font-size: 13.5px;
}

.cdc-plan-features li {
	position: relative;
	padding: 5px 0 5px 22px;
	color: var(--cdc-text);
}

.cdc-plan-features li::before {
	content: "✓";
	position: absolute;
	left: 0;
	color: var(--cdc-green);
	font-weight: 700;
}

.cdc-plan-features .cdc-plan-feature-muted,
.cdc-plan-features .cdc-plan-feature-muted::before {
	color: var(--cdc-muted);
}

.cdc-plan-features .cdc-plan-feature-muted::before {
	content: "–";
}

/* ===== Member banner ===== */
.cdc-member-banner {
	margin-bottom: 26px;
	padding: 18px 22px;
	border: 1px solid var(--cdc-green);
	border-radius: var(--cdc-radius);
	background: rgba(76, 175, 125, .09);
}

.cdc-member-banner strong {
	display: block;
	color: var(--cdc-green);
	font-size: 15px;
}

.cdc-member-banner span {
	color: var(--cdc-muted);
	font-size: 13.5px;
}

/* ===== Section titles ===== */
.cdc-section-title {
	margin: 0 0 16px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--cdc-border);
	font-size: 19px;
	font-weight: 600;
	color: var(--cdc-text);
}

/* ===== Steps ===== */
.cdc-pay-info {
	margin-bottom: 40px;
}

.cdc-steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}

.cdc-step {
	display: flex;
	gap: 12px;
	padding: 16px;
	border: 1px solid var(--cdc-border);
	border-radius: var(--cdc-radius);
	background: var(--cdc-bg-2);
}

.cdc-step-num {
	flex: 0 0 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--cdc-accent);
	color: #1a1a1a;
	font-weight: 700;
	font-size: 14px;
	line-height: 28px;
	text-align: center;
}

.cdc-step-body h3 {
	margin: 2px 0 4px;
	font-size: 14.5px;
	color: var(--cdc-text);
}

.cdc-step-body p {
	margin: 0;
	color: var(--cdc-muted);
	font-size: 13.5px;
}

.cdc-pay-note {
	margin-bottom: 14px;
	padding: 14px 18px;
	border-radius: var(--cdc-radius);
	background: var(--cdc-bg-2);
	border: 1px solid var(--cdc-border);
	color: var(--cdc-muted);
	font-size: 13.5px;
}

.cdc-pay-note p:last-child {
	margin-bottom: 0;
}

.cdc-pay-note-usdt strong {
	display: block;
	margin-bottom: 6px;
	color: var(--cdc-accent);
}

.cdc-telegram-direct {
	margin-top: 8px;
}

/* ===== Tables ===== */
.cdc-orders {
	margin-bottom: 40px;
}

.cdc-table-wrap {
	overflow-x: auto;
	border: 1px solid var(--cdc-border);
	border-radius: var(--cdc-radius);
}

.cdc-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 14px;
}

.cdc-table th {
	padding: 12px 14px;
	background: var(--cdc-bg-3);
	color: var(--cdc-muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .04em;
	text-align: left;
	text-transform: uppercase;
	white-space: nowrap;
}

.cdc-table td {
	padding: 12px 14px;
	border-top: 1px solid var(--cdc-border);
	color: var(--cdc-text);
	vertical-align: middle;
}

.cdc-table tbody tr:hover {
	background: var(--cdc-bg-2);
}

.cdc-order-code {
	padding: 3px 8px;
	border-radius: 5px;
	background: var(--cdc-bg-3);
	color: var(--cdc-accent);
	font-size: 12.5px;
	white-space: nowrap;
}

.cdc-muted {
	color: var(--cdc-muted);
}

.cdc-pos {
	color: var(--cdc-green);
	font-weight: 600;
}

.cdc-neg {
	color: var(--cdc-red);
	font-weight: 600;
}

.cdc-actions {
	white-space: nowrap;
}

.cdc-actions .cdc-btn {
	margin-right: 6px;
}

.cdc-empty {
	color: var(--cdc-muted);
	font-size: 14px;
}

/* ===== Status pills ===== */
.cdc-status {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

.cdc-status-pending {
	background: rgba(255, 182, 72, .16);
	color: var(--cdc-accent);
}

.cdc-status-approved {
	background: rgba(76, 175, 125, .16);
	color: var(--cdc-green);
}

.cdc-status-rejected,
.cdc-status-cancelled {
	background: rgba(224, 87, 91, .14);
	color: var(--cdc-red);
}

/* ===== Wallet cards ===== */
.cdc-wallet-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 18px;
	margin-bottom: 34px;
}

.cdc-wallet-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	padding: 22px;
	border: 1px solid var(--cdc-border);
	border-radius: 14px;
	background: var(--cdc-bg-2);
}

.cdc-wallet-card-coins {
	border-color: var(--cdc-accent);
}

.cdc-wallet-card-member {
	border-color: var(--cdc-green);
}

.cdc-wallet-card-label {
	color: var(--cdc-muted);
	font-size: 12.5px;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.cdc-wallet-card-value {
	font-size: 26px;
	font-weight: 800;
	color: var(--cdc-text);
}

.cdc-wallet-card-sub {
	color: var(--cdc-muted);
	font-size: 13px;
}

.cdc-wallet-card .cdc-btn {
	margin-top: 10px;
}

/* ===== Pagination ===== */
.cdc-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 16px;
}

.cdc-page {
	display: inline-block;
	min-width: 34px;
	padding: 6px 10px;
	border: 1px solid var(--cdc-border);
	border-radius: 6px;
	color: var(--cdc-text);
	text-align: center;
	text-decoration: none !important;
	font-size: 13.5px;
}

.cdc-page:hover {
	border-color: var(--cdc-accent);
	color: var(--cdc-accent);
}

.cdc-page.is-current {
	background: var(--cdc-accent);
	border-color: var(--cdc-accent);
	color: #1a1a1a;
	font-weight: 700;
}

.cdc-page-gap {
	padding: 6px 4px;
	color: var(--cdc-muted);
}

/* ===== FAQ ===== */
.cdc-faq {
	margin-bottom: 40px;
}

.cdc-faq-item {
	margin-bottom: 8px;
	padding: 14px 18px;
	border: 1px solid var(--cdc-border);
	border-radius: var(--cdc-radius);
	background: var(--cdc-bg-2);
}

.cdc-faq-item summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--cdc-text);
	font-size: 14.5px;
}

.cdc-faq-item p {
	margin: 10px 0 0;
	color: var(--cdc-muted);
	font-size: 13.5px;
}

/* ===== Modal ===== */
.cdc-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.cdc-modal[hidden] {
	display: none;
}

.cdc-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .62);
}

.cdc-modal-box {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 440px;
	padding: 26px 24px;
	border-radius: 14px;
	background: var(--cdc-bg);
	border: 1px solid var(--cdc-border);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

body.text-ui-light .cdc-modal-box {
	background: #fff;
}

.cdc-modal-box h3 {
	margin: 0 0 16px;
	font-size: 19px;
	color: var(--cdc-text);
}

.cdc-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	border: 0;
	background: none;
	color: var(--cdc-muted);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.cdc-modal-close:hover {
	color: var(--cdc-text);
}

.cdc-modal-order {
	margin-bottom: 16px;
	padding: 14px 16px;
	border-radius: var(--cdc-radius);
	background: var(--cdc-bg-2);
}

.cdc-modal-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 5px 0;
	font-size: 14px;
}

.cdc-modal-row span {
	color: var(--cdc-muted);
}

.cdc-modal-row strong {
	color: var(--cdc-text);
}

.cdc-modal-help,
.cdc-modal-note {
	color: var(--cdc-muted);
	font-size: 13.5px;
}

.cdc-modal-note {
	margin: 12px 0 0;
	font-size: 12.5px;
}

/* ===== Locked chapter panel ===== */
.cdc-lock-panel {
	max-width: 640px;
	margin: 40px auto;
	padding: 34px 26px;
	border: 1px solid var(--cdc-border);
	border-radius: 16px;
	background: var(--cdc-bg-2);
	color: var(--cdc-text);
	text-align: center;
}

/* Inside the chapter reader the panel sits where the pages would be, between
   the reading toolbar and the end-of-chapter note. At the standalone sizes it
   would push both out of view, so it is scaled down and pulled in. */
.cd-rd .cdc-lock-panel {
	max-width: 520px;
	margin: 24px auto 28px;
	padding: 26px 20px;
	border-radius: 12px;
}

.cdc-lock-panel .cdc-lock-icon {
	width: 62px;
	height: 62px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: rgba(255, 182, 72, .13);
	color: var(--cdc-accent);
	font-size: 24px;
	line-height: 62px;
}

.cdc-lock-title {
	margin: 0 0 10px;
	font-size: 22px;
	color: var(--cdc-text);
}

.cdc-lock-desc {
	margin: 0 auto 14px;
	max-width: 460px;
	color: var(--cdc-muted);
	font-size: 14px;
}

.cdc-lock-countdown {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-bottom: 16px;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--cdc-bg-3);
	color: var(--cdc-accent);
	font-size: 13px;
}

/* The exact release date and the wait this chapter carries, below the
   countdown. */
.cdc-lock-release {
	margin: -6px auto 12px;
	max-width: 460px;
	color: var(--cdc-muted);
	font-size: 12.5px;
	line-height: 1.5;
}

/* How far through the wait this chapter is. Decorative — the countdown above
   carries the same information as text. */
.cdc-lock-progress {
	margin: 0 auto 18px;
	max-width: 320px;
	height: 4px;
	border-radius: 999px;
	background: var(--cdc-bg-3);
	overflow: hidden;
}

.cdc-lock-progress i {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--cdc-accent);
	transition: width 0.6s ease;
}

.cdc-lock-member-option {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	flex-wrap: wrap;
	margin: 0 auto 18px;
	padding: 12px 16px;
	max-width: 480px;
	border: 1px dashed var(--cdc-border);
	border-radius: var(--cdc-radius);
}

.cdc-lock-member-text {
	color: var(--cdc-muted);
	font-size: 13px;
}

.cdc-lock-purchase {
	margin: 0 auto;
	max-width: 380px;
	padding: 20px;
	border-radius: var(--cdc-radius);
	background: var(--cdc-bg);
	border: 1px solid var(--cdc-border);
}

body.text-ui-light .cdc-lock-purchase {
	background: #fbfbfd;
}

.cdc-lock-price-row,
.cdc-lock-balance-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 6px 0;
	font-size: 14px;
}

.cdc-lock-price-label,
.cdc-lock-balance-row span:first-child {
	color: var(--cdc-muted);
}

.cdc-lock-price-value {
	font-size: 20px;
	font-weight: 800;
	color: var(--cdc-accent);
}

.cdc-lock-purchase .cdc-btn {
	margin-top: 14px;
}

.cdc-lock-hint {
	margin: 10px 0 0;
	color: var(--cdc-muted);
	font-size: 12.5px;
}

.cdc-lock-back {
	margin: 22px 0 0;
	font-size: 13.5px;
}

.cdc-lock-back a {
	color: var(--cdc-muted);
	text-decoration: none !important;
}

.cdc-lock-back a:hover {
	color: var(--cdc-accent);
}

.cdc-lock-message {
	margin-top: 12px;
	color: var(--cdc-red);
	font-size: 13.5px;
}

.cdc-lock-message:empty {
	display: none;
}

/* ===== Chapter list badge ===== */
.cdc-lock-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-left: 8px;
	padding: 2px 8px;
	border-radius: 999px;
	background: rgba(255, 182, 72, .15);
	color: var(--cdc-accent);
	font-size: 11.5px;
	font-weight: 600;
	vertical-align: middle;
	white-space: nowrap;
}

.cdc-lock-badge-early {
	background: rgba(74, 144, 217, .16);
	color: #6fb0f0;
}

/* Shown to a member whose plan is letting them read a chapter early. */
.cdc-lock-badge-member {
	background: rgba(255, 182, 72, .16);
	color: var(--cdc-accent);
}

.cdc-lock-price {
	color: var(--cdc-accent);
}

.cdc-lock-badge .fa-lock {
	font-size: 10px;
}

/* ===== Header balance pill ===== */
.cdc-header-balance {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	padding: 4px 12px !important;
	border: 1px solid rgba(255, 182, 72, .45);
	border-radius: 999px;
	background: rgba(255, 182, 72, .1);
	color: #ffb648 !important;
	font-size: 12.5px;
	font-weight: 700;
	text-decoration: none !important;
	line-height: 1.6;
}

.cdc-header-balance:hover {
	background: rgba(255, 182, 72, .2);
}

.cdc-coin-icon {
	display: inline-block;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #ffb648;
	text-indent: -9999px;
	overflow: hidden;
}

/* ===== Responsive ===== */
@media (max-width: 767px) {
	.cdc-wrap {
		padding: 20px 12px 44px;
	}

	.cdc-hero h1 {
		font-size: 24px;
	}

	.cdc-pack-coins,
	.cdc-plan-price {
		font-size: 26px;
	}

	.cdc-table thead {
		display: none;
	}

	.cdc-table,
	.cdc-table tbody,
	.cdc-table tr,
	.cdc-table td {
		display: block;
		width: 100%;
	}

	.cdc-table tr {
		padding: 10px 0;
		border-top: 1px solid var(--cdc-border);
	}

	.cdc-table tbody tr:first-child {
		border-top: 0;
	}

	.cdc-table td {
		display: flex;
		justify-content: space-between;
		gap: 14px;
		padding: 6px 14px;
		border: 0;
		text-align: right;
	}

	.cdc-table td::before {
		content: attr(data-label);
		color: var(--cdc-muted);
		font-size: 12px;
		font-weight: 600;
		text-align: left;
	}

	.cdc-table td.cdc-actions {
		justify-content: flex-end;
	}

	.cdc-lock-panel {
		margin: 20px auto;
		padding: 26px 18px;
	}

	.cdc-lock-title {
		font-size: 19px;
	}
}
/* =============================================================================
   Login / register page
   ========================================================================== */

.cdc-auth {
	max-width: 460px;
	margin: 40px auto 60px;
}

.cdc-auth-card {
	background: var(--cdc-bg-2);
	border: 1px solid var(--cdc-border);
	border-radius: var(--cdc-radius);
	padding: 28px 26px 32px;
}

.cdc-auth-head h1 {
	margin: 0 0 8px;
	font-size: 24px;
	color: var(--cdc-text);
}

.cdc-auth-head p {
	margin: 0 0 22px;
	color: var(--cdc-muted);
	font-size: 14px;
	line-height: 1.55;
}

.cdc-auth-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 22px;
	padding: 4px;
	background: var(--cdc-bg-3);
	border-radius: var(--cdc-radius);
}

.cdc-auth-tab {
	flex: 1;
	padding: 10px 12px;
	background: transparent;
	border: 0;
	border-radius: calc(var(--cdc-radius) - 3px);
	color: var(--cdc-muted);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}

.cdc-auth-tab.is-active {
	background: var(--cdc-bg-2);
	color: var(--cdc-text);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

.cdc-auth-pane {
	display: none;
}

.cdc-auth-pane.is-active {
	display: block;
}

.cdc-field {
	margin: 0 0 16px;
}

.cdc-field label {
	display: block;
	margin-bottom: 6px;
	color: var(--cdc-text);
	font-size: 13px;
	font-weight: 600;
}

.cdc-field input[type="text"],
.cdc-field input[type="email"],
.cdc-field input[type="password"] {
	width: 100%;
	box-sizing: border-box;
	padding: 11px 13px;
	background: var(--cdc-bg);
	border: 1px solid var(--cdc-border);
	border-radius: 8px;
	color: var(--cdc-text);
	font-size: 15px;
}

.cdc-field input:focus {
	outline: none;
	border-color: var(--cdc-accent);
	box-shadow: 0 0 0 3px rgba(255, 182, 72, .15);
}

.cdc-field-hint {
	display: block;
	margin-top: 5px;
	color: var(--cdc-muted);
	font-size: 12px;
}

.cdc-field-inline label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 400;
	cursor: pointer;
}

.cdc-auth-form .cdc-btn-block {
	margin-top: 6px;
}

.cdc-auth-links {
	margin: 16px 0 0;
	text-align: center;
	font-size: 13px;
}

.cdc-auth-links a {
	color: var(--cdc-accent);
	text-decoration: none;
}

.cdc-auth-links a:hover {
	text-decoration: underline;
}

/* Thin divider between "sign in with password" and "email me a link". */
.cdc-auth-sep {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 18px 0;
	color: var(--cdc-muted);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .08em;
}

.cdc-auth-sep::before,
.cdc-auth-sep::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--cdc-border);
}

.cdc-auth-terms,
.cdc-auth-note {
	margin: 16px 0 0;
	color: var(--cdc-muted);
	font-size: 12px;
	line-height: 1.5;
	text-align: center;
}

.cdc-auth-note a {
	color: var(--cdc-accent);
	text-decoration: none;
}

.cdc-auth-note a:hover {
	text-decoration: underline;
}

/* The reset card carries its own heading strong enough to signal "this is the
   last step", so it gets a little more presence than the sign-in card. */
.cdc-auth-reset .cdc-auth-head h1 {
	font-size: 24px;
}

.cdc-auth-reset .cdc-auth-head p {
	margin-bottom: 4px;
}

.cdc-auth-reset .cdc-auth-head strong {
	color: var(--cdc-text);
	font-weight: 600;
}

.cdc-auth .cdc-notice {
	margin-bottom: 16px;
}

.cdc-notice-error {
	background: rgba(224, 87, 91, .12);
	border: 1px solid rgba(224, 87, 91, .4);
	color: var(--cdc-red);
	border-radius: 8px;
	padding: 10px 13px;
	font-size: 13px;
	line-height: 1.45;
}

body.text-ui-light .cdc-notice-error {
	background: #fdf1f1;
	border-color: #f2c4c5;
	color: #a83236;
}

/* Admin log screen */

.cdc-status-panel {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 16px 0 18px;
}

.cdc-status-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 9px 14px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-left-width: 4px;
	border-radius: 4px;
	font-size: 12px;
	line-height: 1.4;
}

.cdc-status-item.is-ok { border-left-color: #46b450; }
.cdc-status-item.is-bad { border-left-color: #dc3232; }

.cdc-status-label {
	color: #646970;
	font-weight: 600;
	text-transform: uppercase;
	font-size: 10px;
	letter-spacing: .04em;
}

.cdc-status-value { color: #1d2327; }

.cdc-logs-table .cdc-col-time { width: 150px; }
.cdc-logs-table .cdc-col-level { width: 80px; }
.cdc-logs-table .cdc-col-event { width: 180px; }
.cdc-logs-table .cdc-col-user { width: 140px; }

.cdc-log-level {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
}

.cdc-log-level-info { background: #eef4fb; color: #2563a8; }
.cdc-log-level-warn { background: #fdf6e3; color: #8a6300; }
.cdc-log-level-error { background: #fdeeee; color: #b32d2e; }

.cdc-log-context {
	margin-top: 6px;
	font-size: 12px;
}

.cdc-log-context summary {
	cursor: pointer;
	color: #2271b1;
}

.cdc-log-context pre {
	margin: 6px 0 0;
	padding: 8px 10px;
	max-height: 260px;
	overflow: auto;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 3px;
	font-size: 11px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
}

.cdc-result-count {
	color: #646970;
	font-size: 13px;
}

.cdc-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 14px 0;
}

/* ===== Daily check-in =====
 *
 * One gold card holding the seven-slot strip and a single button. The gold is
 * the same accent the chapter list uses for a paywalled row, so a reader who has
 * seen the chapter card already reads this as "the coin thing" without a label.
 *
 * Slots are ordered by state, not by position: done → today → future. Only
 * .is-today pulses; a strip where every slot animates reads as noise.
 */

.cdc-reward-card {
	max-width: 640px;
	margin: 0 auto;
	padding: 26px 24px 24px;
	border: 1px solid rgba(255, 182, 72, .22);
	border-left: 3px solid var(--cdc-accent);
	border-radius: var(--cdc-radius);
	background: linear-gradient(135deg, rgba(255, 182, 72, .10), rgba(255, 182, 72, .02) 55%), #15120e;
	color: #fff;
	box-shadow: 0 16px 40px -22px rgba(255, 182, 72, .5);
}

.cdc-reward-card.is-guest {
	opacity: .85;
}

.cdc-reward-status {
	margin: 0 0 20px;
	text-align: center;
	color: #c8bda9;
	font-size: 14px;
}

.cdc-streak {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 8px;
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
}

.cdc-streak-day {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	padding: 12px 4px 10px;
	border: 1px solid rgba(255, 255, 255, .08);
	border-radius: 9px;
	background: rgba(255, 255, 255, .03);
	text-align: center;
	transition: border-color .18s ease, background .18s ease;
}

.cdc-streak-coin {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .07);
	color: #6f6a60;
	font-size: 13px;
	line-height: 1;
}

.cdc-streak-amount {
	font-size: 13px;
	font-weight: 800;
	color: #8f8676;
	font-variant-numeric: tabular-nums;
}

.cdc-streak-label {
	font-size: 10px;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: #6f6a60;
}

/* Day 7 is the payoff: taller slot, gold everywhere. */
.cdc-streak-day.is-final {
	padding-top: 16px;
	padding-bottom: 14px;
	border-color: rgba(255, 182, 72, .3);
	background: linear-gradient(180deg, rgba(255, 182, 72, .12), rgba(255, 182, 72, .03));
}

.cdc-streak-day.is-final .cdc-streak-amount {
	font-size: 16px;
	color: var(--cdc-accent);
}

.cdc-streak-day.is-final .cdc-streak-coin {
	background: rgba(255, 182, 72, .18);
	color: var(--cdc-accent);
}

/* Collected */
.cdc-streak-day.is-done {
	border-color: rgba(76, 175, 125, .45);
	background: rgba(76, 175, 125, .10);
}

.cdc-streak-day.is-done .cdc-streak-coin {
	background: var(--cdc-green);
	color: #10231a;
}

.cdc-streak-day.is-done .cdc-streak-amount,
.cdc-streak-day.is-done .cdc-streak-label {
	color: #9fd7ba;
}

/* Today, still to collect */
.cdc-streak-day.is-today {
	border-color: var(--cdc-accent);
	background: rgba(255, 182, 72, .16);
	box-shadow: 0 0 0 1px rgba(255, 182, 72, .25), 0 8px 22px -14px rgba(255, 182, 72, .8);
}

.cdc-streak-day.is-today .cdc-streak-coin {
	background: linear-gradient(135deg, #ffd36b, #f29b1d);
	color: #1c1203;
	animation: cdc-slot-pulse 2.2s ease-out infinite;
}

.cdc-streak-day.is-today .cdc-streak-amount,
.cdc-streak-day.is-today .cdc-streak-label {
	color: #fff;
}

@keyframes cdc-slot-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(255, 182, 72, .55); }
	70%  { box-shadow: 0 0 0 8px rgba(255, 182, 72, 0); }
	100% { box-shadow: 0 0 0 0 rgba(255, 182, 72, 0); }
}

.cdc-reward-action {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	text-align: center;
}

.cdc-btn-lg {
	padding: 14px 32px;
	font-size: 15px;
}

.cdc-reward-msg {
	min-height: 18px;
	margin: 0;
	font-size: 13px;
	color: #c8bda9;
}

.cdc-reward-msg.is-success {
	color: #7fe0ad;
	font-weight: 600;
}

.cdc-reward-msg.is-error {
	color: #ff8f8f;
}

.cdc-reward-note {
	max-width: 640px;
	margin: 18px auto 0;
	text-align: center;
	font-size: 13px;
	color: var(--cdc-muted);
}

.cdc-reward-note a {
	color: var(--cdc-accent);
}

.cdc-reward-ad {
	max-width: 640px;
	margin: 24px auto 0;
	padding: 18px;
	border: 1px dashed var(--cdc-border);
	border-radius: var(--cdc-radius);
	text-align: center;
	color: var(--cdc-muted);
}

/* ===== Rewarded links (shortener) =====
 *
 * Sits under the check-in card and deliberately looks calmer than it: the
 * second card is the "if you need more" option, not the daily ritual. The gold
 * left bar is the only thing shared with the card above, so the two read as a
 * family without competing.
 */

.cdc-rw-card {
	margin-top: 22px;
	border-left-color: rgba(255, 182, 72, .45);
	background: linear-gradient(135deg, rgba(255, 182, 72, .05), rgba(255, 182, 72, .01) 55%), #12100d;
	box-shadow: 0 14px 34px -24px rgba(255, 182, 72, .4);
}

.cdc-rw-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 8px;
}

.cdc-rw-title {
	font-size: 16px;
	font-weight: 800;
	color: #fff;
}

.cdc-rw-count {
	font-size: 12px;
	color: #8f8676;
	font-variant-numeric: tabular-nums;
}

.cdc-rw-count span {
	color: var(--cdc-accent);
	font-weight: 700;
}

.cdc-rw-note {
	margin: 0 0 18px;
	font-size: 13px;
	line-height: 1.5;
	color: #a89e8c;
}

.cdc-rw-action {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-align: center;
	margin-top: 4px;
}

/* One row per link: number, what it pays, and the button. The row is the
   whole progress display — solved rows go quiet rather than disappear, so the
   reader can see how much of the day they have used up. */
.cdc-rw-rows {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 18px 0 6px;
	padding: 0;
	list-style: none;
	text-align: left;
}

.cdc-rw-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid rgba(255, 255, 255, .07);
	border-radius: 16px;
	background: rgba(255, 255, 255, .03);
	transition: border-color .2s, background .2s;
}

.cdc-rw-row:not(.is-done):hover {
	border-color: rgba(255, 176, 46, .4);
	background: rgba(255, 176, 46, .05);
}

.cdc-rw-ico {
	flex: 0 0 36px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 2px solid rgba(255, 176, 46, .35);
	border-radius: 50%;
	background: #1b1b20;
	color: #ffb02e;
	font-size: 14px;
	font-weight: 800;
	line-height: 1;
}

.cdc-rw-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.cdc-rw-info b {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	color: #f1e6cf;
}

.cdc-rw-info small {
	font-size: 12px;
	font-weight: 700;
	color: #ffc457;
}

.cdc-rw-go {
	flex: 0 0 auto;
	padding: 9px 18px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, #ffc13d, #ff7a00);
	color: #2a1600;
	font-size: 13px;
	font-weight: 800;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 6px 16px -6px rgba(255, 122, 0, .8);
	transition: transform .15s ease, box-shadow .15s ease;
}

.cdc-rw-go:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 9px 20px -6px rgba(255, 122, 0, .95);
}

.cdc-rw-go:active:not(:disabled) {
	transform: scale(.96);
}

.cdc-rw-go:disabled {
	cursor: not-allowed;
	opacity: .5;
	filter: grayscale(.7);
}

/* A solved link is spent — muted so the eye moves to the rows still open. */
.cdc-rw-row.is-done {
	opacity: .6;
}

.cdc-rw-row.is-done .cdc-rw-ico {
	border-color: transparent;
	background: linear-gradient(135deg, #ffb02e, #ff7a00);
	color: #2a1600;
	font-size: 16px;
}

.cdc-rw-row.is-done .cdc-rw-info small {
	color: #8d8d98;
}

.cdc-rw-row.is-done .cdc-rw-go {
	border: 1px solid rgba(255, 255, 255, .12);
	background: transparent;
	color: #8d8d98;
	box-shadow: none;
}

/* The row whose shortener is open in another tab: dimmed like a done row but
   still marked, so the reader knows which one they are finishing. */
.cdc-rw-row.is-busy {
	border-color: rgba(255, 176, 46, .45);
	background: rgba(255, 176, 46, .07);
}

@media (max-width: 560px) {
	.cdc-rw-card {
		margin-top: 18px;
	}

	.cdc-rw-row {
		gap: 10px;
		padding: 11px 12px;
	}

	.cdc-rw-ico {
		flex-basis: 32px;
		width: 32px;
		height: 32px;
		font-size: 13px;
	}

	.cdc-rw-go {
		padding: 9px 14px;
		font-size: 12.5px;
	}
}

/* Mobile: seven slots across cannot hold a readable day at this width, so the
   cycle becomes a card grid — six days in 3 x 2, day 7 as one wide bonus row
   underneath. Desktop and tablet keep the horizontal strip.
   Scoped under .cdc-reward-card so these beat the base rules without needing
   !important. */
@media (max-width: 560px) {
	.cdc-reward-card {
		padding: 22px 16px 24px;
		border-radius: 22px;
	}

	/* Status reads as a full-width panel rather than a centred line. */
	.cdc-reward-card .cdc-reward-status {
		display: block;
		width: 100%;
		box-sizing: border-box;
		padding: 11px 16px;
		border-radius: 16px;
		text-align: left;
		font-size: 13px;
		line-height: 1.45;
	}

	.cdc-reward-card .cdc-streak {
		grid-template-columns: repeat(3, 1fr);
		gap: 10px;
		margin: 22px 0 24px;
		background: none;
		border: 0;
	}

	.cdc-reward-card .cdc-streak-day {
		gap: 6px;
		padding: 14px 4px 12px;
		border-radius: 16px;
		background: rgba(255, 255, 255, .03);
		border: 1px solid rgba(255, 255, 255, .07);
	}

	.cdc-reward-card .cdc-streak-coin {
		width: 26px;
		height: 26px;
		font-size: 12px;
	}

	.cdc-reward-card .cdc-streak-amount {
		font-size: 15px;
	}

	.cdc-reward-card .cdc-streak-label {
		font-size: 10px;
		letter-spacing: .08em;
	}

	.cdc-reward-card .is-today {
		background: linear-gradient(180deg, rgba(255, 176, 46, .16), rgba(255, 176, 46, .04));
		border-color: rgba(255, 176, 46, .55);
		box-shadow: 0 8px 22px -10px rgba(255, 140, 0, .6);
	}

	/* Day 7 breaks out of the grid: one wide row, laid out horizontally. */
	.cdc-reward-card .is-final {
		grid-column: 1 / -1;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		gap: 12px;
		padding: 14px 16px;
		background: linear-gradient(135deg, rgba(255, 176, 46, .14), rgba(255, 122, 0, .05));
		border-color: rgba(255, 176, 46, .4);
	}

	.cdc-reward-card .is-final .cdc-streak-label {
		color: #f1e6cf;
	}

	.cdc-reward-card .is-final .cdc-streak-label::after {
		content: " · BONUS";
	}

	.cdc-reward-card .is-final .cdc-streak-amount {
		font-size: 16px;
	}

	/* Day 7 can also be today. Without this the .is-final background would win
	   (same specificity, declared later) and the single most valuable slot would
	   lose its "collect now" highlight exactly when it matters. */
	.cdc-reward-card .is-today.is-final {
		background: linear-gradient(135deg, rgba(255, 176, 46, .24), rgba(255, 122, 0, .08));
		border-color: var(--cdc-accent);
		box-shadow: 0 8px 26px -10px rgba(255, 140, 0, .75);
	}

	.cdc-reward-card [data-cdc-claim] {
		width: 100%;
		max-width: 320px;
		padding: 15px 24px;
		font-size: 15px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cdc-streak-day.is-today .cdc-streak-coin {
		animation: none;
	}
}

.cdc-danger {
	color: #b32d2e !important;
	border-color: #b32d2e !important;
}

.cdc-muted { color: #8c8f94; }

@media (max-width: 600px) {
	.cdc-auth {
		margin: 20px auto 40px;
	}

	.cdc-auth-card {
		padding: 22px 18px 26px;
	}
}
