@import url("./css/base.css");
@import url("./css/pages/welcome.css");
@import url("./css/pages/reading-progress.css");
@import url("./css/pages/highlights.css");
@import url("./css/pages/reading-challenges.css");
@import url("./css/pages/reading-timer.css");
@import url("./css/responsive.css");

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500;1,600&display=swap');

:root {
	--bookish-plum: #7a6258;
	--bookish-plum-deep: #5e4740;
	--bookish-rose: #b98f88;
	--bookish-cream: #fbf7f4;
	--bookish-paper: #fffaf7;
	--bookish-soft: #f1dfe4;
	--bookish-line: #ddc9c1;
	--bookish-ink: #3d2630;
	--bookish-muted: #755c63;
}
nav.app-surface-opaque form button:hover {
	color: var(--bookish-plum) !important;
}

#drawer-navigation {
	background: var(--bookish-paper) !important;
	border-color: var(--bookish-line) !important;
	box-shadow: 8px 0 24px rgba(77, 38, 57, 0.1);
	pointer-events: auto;
}

#drawer-overlay.hidden {
	display: none !important;
	pointer-events: none !important;
}

#drawer-overlay:not(.hidden) {
	pointer-events: auto;
}

#drawer-navigation a {
	position: relative;
	z-index: 1;
}

.reading-progress-page > h1,
.welcome-title {
	color: var(--bookish-plum) !important;
	font-size: 3.4rem !important;
	font-weight: 500 !important;
	line-height: 1.05 !important;
}

.reading-progress-page > p,
.welcome-container > p {
	color: var(--bookish-muted) !important;
}

.book-genre-section {
	border-color: var(--bookish-line) !important;
}

.book-genre-heading h3 {
	color: var(--bookish-plum) !important;
}

.book-genre-heading p {
	color: var(--bookish-muted) !important;
}

.book-genre-heading h3 span {
	color: var(--bookish-rose) !important;
}

.book-genre-filter-button {
	border-color: var(--bookish-line) !important;
	background: var(--bookish-paper) !important;
	color: var(--bookish-muted) !important;
}

.book-genre-filter-button.is-active,
.book-genre-filter-button:hover {
	border-color: var(--bookish-plum) !important;
	background: var(--bookish-plum) !important;
	color: var(--bookish-paper) !important;
}

.bookish-field-label {
	display: block;
	margin: 0 0 6px;
	color: var(--bookish-ink);
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.bookish-field-group {
	display: flex;
	flex: 1 1 180px;
	min-width: 0;
	flex-direction: column;
	gap: 0;
}

.bookish-field-group .weekly-genre-select,
.bookish-field-group .weekly-year-input {
	width: 100%;
	max-width: none;
	flex: 0 0 40px;
}

.reading-progress-submit,
.booktok-view-button.is-active,
.booktok-view-button:hover {
	border-color: var(--bookish-plum) !important;
	background: var(--bookish-plum) !important;
	color: #fffaf5 !important;
	border-radius: 7px !important;
	box-shadow: none !important;
}

.reading-progress-submit,
.login-button,
.book-reminder-button,
.book-genre-filter-button,
.booktok-view-button,
.booktok-favorite-button,
.rp-back-button {
	font-family: 'DM Sans', sans-serif !important;
	font-weight: 700;
	border-radius: 7px !important;
	box-shadow: none !important;
}

.login-button,
.book-reminder-button,
.book-genre-filter-button,
.booktok-view-button,
.rp-back-button {
	border: 1px solid var(--bookish-plum) !important;
	background: var(--bookish-paper) !important;
	color: var(--bookish-plum-deep) !important;
}

.login-button:hover,
.book-reminder-button:hover,
.book-genre-filter-button:hover,
.booktok-view-button:hover,
.rp-back-button:hover {
	border-color: var(--bookish-plum-deep) !important;
	background: var(--bookish-soft) !important;
	color: var(--bookish-plum-deep) !important;
}

.booktok-view-button {
	border-color: var(--bookish-line) !important;
	background: var(--bookish-paper) !important;
	color: var(--bookish-plum) !important;
	border-radius: 7px !important;
	font-family: 'DM Sans', sans-serif !important;
	text-transform: uppercase;
	letter-spacing: 0.08em !important;
	font-size: 0.72rem;
	min-height: 40px;
	white-space: nowrap;
}

.booktok-page .reading-progress-submit {
	min-height: 40px;
	margin: 10px 0 0;
	padding: 9px 16px;
	font-family: 'DM Sans', sans-serif;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
}

.booktok-page .booktok-view-button:focus-visible,
.booktok-page .reading-progress-submit:focus-visible {
	outline: 3px solid rgba(185, 143, 136, 0.45);
	outline-offset: 2px;
}

.guest-auth-page {
	background-color: var(--bookish-cream) !important;
	background-image: radial-gradient(#ddc9c1 0.7px, transparent 0.7px) !important;
	background-size: 18px 18px !important;
}

.guest-auth-card {
	background: var(--bookish-paper) !important;
	border: 1px solid var(--bookish-line) !important;
	border-radius: 4px !important;
	box-shadow: 0 12px 28px rgba(77, 38, 57, 0.1) !important;
	color: var(--bookish-ink) !important;
}

.guest-auth-card label,
.guest-auth-card span {
	color: var(--bookish-ink) !important;
}

.guest-auth-card a {
	color: var(--bookish-plum) !important;
}

.guest-auth-card a:hover {
	color: var(--bookish-plum-deep) !important;
}

.guest-auth-card button[type='submit'] {
	min-height: 42px;
	padding: 10px 18px;
	border: 1px solid var(--bookish-plum) !important;
	border-radius: 7px !important;
	background: var(--bookish-plum) !important;
	box-shadow: none !important;
	color: #fffaf5 !important;
	font-family: 'DM Sans', sans-serif;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.guest-auth-card button[type='submit']:hover,
.guest-auth-card button[type='submit']:focus {
	background: var(--bookish-plum-deep) !important;
	border-color: var(--bookish-plum-deep) !important;
	color: #fffaf5 !important;
}

.guest-auth-card button[type='submit']:focus-visible {
	outline: 3px solid rgba(185, 143, 136, 0.45);
	outline-offset: 2px;
}

.booktok-author-card {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: start;
	gap: 10px;
	border-color: var(--bookish-line) !important;
	border-radius: 2px !important;
	background: var(--bookish-soft) !important;
	transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.booktok-author-link {
	display: flex;
	align-items: center;
	grid-column: 1;
	grid-row: 1;
	min-width: 0;
	gap: 10px;
	color: inherit;
	text-decoration: none;
}

.booktok-author-info {
	display: grid;
	gap: 3px;
	min-width: 0;
}

.booktok-author-books {
	display: grid !important;
	grid-column: 1;
	grid-row: 2;
	gap: 2px;
	max-height: 104px;
	margin: 0 0 0 44px;
	overflow-y: auto;
}

.booktok-author-books a {
	overflow: hidden;
	min-width: 0;
	color: var(--bookish-plum) !important;
	font-size: 0.72rem;
	text-overflow: ellipsis;
	text-decoration: none;
	white-space: nowrap;
}

.booktok-author-books a:hover {
	text-decoration: underline;
}

.booktok-author-card > form,
.booktok-author-card > .booktok-favorite-button {
	grid-column: 2;
	grid-row: 1;
}

.booktok-author-books-section {
	margin-bottom: 16px;
}

.booktok-author-books-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 10px;
}

.booktok-author-book-card {
	display: grid;
	grid-template-columns: 46px minmax(0, 1fr);
	gap: 10px;
	align-items: center;
	min-height: 66px;
	padding: 8px;
	border: 1px solid var(--bookish-line);
	border-radius: 4px;
	background: var(--bookish-paper);
	color: var(--bookish-ink);
	text-decoration: none;
}

.booktok-author-book-card:hover {
	border-color: var(--bookish-rose);
	background: var(--bookish-alt);
}

.booktok-author-book-card img {
	width: 46px;
	height: 66px;
	object-fit: cover;
	border-radius: 3px;
}

.booktok-author-book-card span {
	display: grid;
	gap: 4px;
	min-width: 0;
}

.booktok-author-book-card strong {
	overflow: hidden;
	font-size: 0.8rem;
	text-overflow: ellipsis;
}

.booktok-author-book-card small {
	color: var(--bookish-muted);
	font-size: 0.7rem;
}

.book-listings-heading {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 20px;
}

.book-listings-heading h1,
.book-listing-form-card h1 {
	margin: 0 0 8px;
	color: var(--bookish-plum);
}

.book-listings-heading p,
.book-listing-form-card > p {
	margin: 0;
	color: var(--bookish-muted);
}

.book-listings-tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 18px;
	border-bottom: 1px solid var(--bookish-line);
}

.book-listings-tabs a {
	padding: 9px 14px;
	border-bottom: 2px solid transparent;
	color: var(--bookish-muted);
	font-size: 0.8rem;
	font-weight: 700;
	text-decoration: none;
}

.book-listings-tabs a:hover,
.book-listings-tabs a.is-active {
	border-bottom-color: var(--bookish-plum);
	color: var(--bookish-plum);
}

.book-listing-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 14px;
}

@media (min-width: 960px) {
	.book-listing-grid-exchange {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 959px) {
	.book-listing-grid-exchange {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.book-listing-grid {
		grid-template-columns: 1fr;
	}

	.book-listing-card {
		padding: 14px;
	}

	.book-listing-card-heading {
		align-items: stretch;
	}

	.book-listing-application-actions {
		flex-direction: column;
	}

	.book-listing-application-actions form,
	.book-listing-application-actions button,
	.book-listing-application-actions .reading-progress-submit,
	.book-listing-message-form button,
	.book-listing-message-form .reading-progress-submit {
		width: 100%;
	}

	.book-listing-application > div {
		flex-direction: column;
		align-items: stretch;
	}
	
	.book-listings-tabs {
		flex-wrap: wrap;
	}

	.book-listings-tabs a {
		flex: 1 1 calc(50% - 8px);
		text-align: center;
	}
}

/* Keep the native date input tappable on mobile while preserving the styled display. */
.rp-date-control {
	min-width: 0;
}

.rp-date-control .rp-date-picker {
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
	opacity: 0;
	pointer-events: auto;
}

.rp-date-control .rp-date-open {
	z-index: 1;
	pointer-events: auto;
}

.rp-calendar {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 20;
	width: min(300px, calc(100vw - 40px));
	padding: 12px;
	border: 1px solid var(--bookish-line, #ddc9c1);
	border-radius: 12px;
	background: var(--bookish-paper, #fffaf7);
	box-shadow: 0 14px 30px rgba(77, 38, 57, 0.22);
	color: var(--bookish-ink, #3d2630);
}

.rp-calendar-header {
	display: grid;
	grid-template-columns: 34px 1fr 34px;
	gap: 8px;
	align-items: center;
	margin-bottom: 10px;
	text-align: center;
}

.rp-calendar-nav {
	width: 34px;
	height: 34px;
	border: 1px solid var(--bookish-line, #ddc9c1);
	border-radius: 7px;
	background: var(--bookish-soft, #f1dfe4);
	color: var(--bookish-plum-deep, #5e4740);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
}

.rp-calendar-nav:hover,
.rp-calendar-nav:focus-visible {
	background: var(--bookish-rose, #b98f88);
	color: var(--bookish-cream, #fbf7f4);
	outline: none;
}

.rp-calendar-weekdays,
.rp-calendar-days {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
	text-align: center;
}

.rp-calendar-weekdays {
	margin-bottom: 5px;
	color: var(--bookish-muted, #755c63);
	font-size: 0.7rem;
	font-weight: 800;
}

.rp-calendar-day {
	display: inline-flex;
	width: 100%;
	aspect-ratio: 1;
	align-items: center;
	justify-content: center;
	border: 1px solid transparent;
	border-radius: 7px;
	background: transparent;
	color: var(--bookish-ink, #3d2630);
	cursor: pointer;
}

button.rp-calendar-day:hover,
button.rp-calendar-day:focus-visible {
	border-color: var(--bookish-rose, #b98f88);
	background: var(--bookish-soft, #f1dfe4);
	outline: none;
}

.rp-calendar-day.is-selected {
	background: var(--bookish-plum, #7a6258);
	color: var(--bookish-cream, #fbf7f4);
	font-weight: 800;
}

.rp-calendar-day.is-today {
	border-color: var(--bookish-rose, #b98f88);
}

.rp-calendar-day.is-empty {
	pointer-events: none;
}

@media (max-width: 480px) {
	.rp-calendar {
		left: 50%;
		transform: translateX(-50%);
		width: min(300px, calc(100vw - 32px));
	}
}

@media (max-width: 1024px) {
	.release-calendar-item {
		grid-template-columns: 58px 72px minmax(0, 1fr);
		width: 100%;
		box-sizing: border-box;
	}

	.release-calendar-item .weekly-top-content {
		min-width: 0;
	}

	.release-calendar-item .weekly-top-title-link,
	.release-calendar-item .weekly-top-meta,
	.release-calendar-item .release-calendar-release {
		overflow-wrap: anywhere;
	}
}

@media (max-width: 640px) {
	.release-calendar-item {
		grid-template-columns: 52px minmax(0, 1fr);
		gap: 10px;
	}

	.release-calendar-item .release-calendar-date {
		grid-row: span 2;
	}

	.release-calendar-item .weekly-top-cover,
	.release-calendar-item .weekly-top-cover--empty {
		width: 64px;
		height: 96px;
	}
}

.book-notification-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 8px;
	align-items: center;
	min-width: 0;
}

.book-notification-link {
	display: grid;
	grid-template-columns: 38px minmax(0, 1fr);
	gap: 10px;
	align-items: center;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

.book-notification-link > span {
	display: grid;
	min-width: 0;
	gap: 3px;
}

.book-notification-delete-form {
	margin: 0;
}

.book-notification-delete {
	display: inline-flex;
	width: 30px;
	height: 30px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--bookish-line, #ddc9c1);
	border-radius: 6px;
	background: var(--bookish-soft, #f1dfe4);
	color: var(--bookish-plum-deep, #5e4740);
	cursor: pointer;
}

.book-notification-delete:hover,
.book-notification-delete:focus-visible {
	background: var(--bookish-rose, #b98f88);
	color: var(--bookish-cream, #fbf7f4);
	outline: none;
}

@media (max-width: 480px) {
	.book-notification-panel {
		right: -52px;
		width: min(330px, calc(100vw - 24px));
		max-width: calc(100vw - 24px);
	}

	.book-notification-item {
		padding-inline: 2px;
	}
}

.book-listing-card {
	display: grid;
	gap: 14px;
	padding: 18px;
	border: 1px solid var(--bookish-line);
	border-radius: 4px;
	background: var(--bookish-paper);
	box-shadow: 0 8px 20px rgba(77, 38, 57, 0.06);
}

.book-listing-card-heading {
	display: flex;
	align-items: start;
	justify-content: space-between;
	gap: 14px;
}

.book-listing-card h2 {
	margin: 0;
	color: var(--bookish-plum);
	font-size: 1.05rem;
}

.book-listing-card-heading p {
	margin: 4px 0 0;
	color: var(--bookish-muted);
	font-size: 0.82rem;
}

.book-listing-price {
	flex: 0 0 auto;
	color: var(--bookish-plum);
	font-size: 1rem;
	white-space: nowrap;
}

.book-listing-details {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	margin: 0;
}

.book-listing-details div {
	padding: 9px;
	border: 1px solid var(--bookish-line);
	background: var(--bookish-alt);
}

.book-listing-details dt {
	color: var(--bookish-muted);
	font-size: 0.68rem;
	text-transform: uppercase;
}

.book-listing-details dd {
	margin: 3px 0 0;
	color: var(--bookish-ink);
	font-size: 0.82rem;
	font-weight: 700;
	overflow-wrap: anywhere;
}

.book-listing-description {
	margin: 0;
	color: var(--bookish-ink);
	font-size: 0.85rem;
	line-height: 1.5;
}

.book-listing-application-form {
	display: grid;
	gap: 8px;
	padding-top: 12px;
	border-top: 1px solid var(--bookish-line);
}

.book-listing-application-form label {
	display: grid;
	gap: 5px;
	color: var(--bookish-muted);
	font-size: 0.72rem;
	font-weight: 700;
}

.book-listing-application-form textarea {
	min-height: 58px;
	padding: 8px 10px !important;
	border: 1px solid var(--bookish-line) !important;
	border-radius: 8px !important;
	background: var(--bookish-paper) !important;
	color: var(--bookish-ink) !important;
	font-size: 0.8rem;
	resize: vertical;
}

.book-listing-application-sent,
.book-listing-owner-note {
	margin: 0;
	padding: 9px 10px;
	background: var(--bookish-alt);
	color: var(--bookish-muted);
	font-size: 0.78rem;
}

.book-listing-applications {
	display: grid;
	gap: 8px;
	padding: 12px;
	border: 1px solid var(--bookish-line);
	background: var(--bookish-alt);
	color: var(--bookish-ink);
	font-size: 0.78rem;
}

.book-listing-application {
	display: grid;
	gap: 3px;
	padding-top: 8px;
	border-top: 1px solid var(--bookish-line);
}

.book-listing-application > div {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	flex-wrap: wrap;
}

.book-listing-application > div span,
.book-listing-application-status {
	color: var(--bookish-muted);
	font-size: 0.72rem;
}

.book-listing-application p {
	margin: 3px 0 0;
	color: var(--bookish-ink);
	line-height: 1.4;
}

.book-listing-application-actions {
	display: flex;
	gap: 8px;
	margin-top: 8px;
}

.book-listing-application-actions form {
	margin: 0;
}

.book-listing-message-thread {
	display: grid;
	gap: 6px;
	margin-top: 8px;
}

.book-listing-message {
	width: min(82%, 420px);
	justify-self: start;
	padding: 8px 10px;
	border: 1px solid var(--bookish-line);
	background: var(--bookish-paper);
	font-size: 0.75rem;
}

.book-listing-message.is-mine {
	justify-self: end;
	background: var(--bookish-alt);
}

.book-listing-message strong {
	color: var(--bookish-plum);
}

.book-listing-message span {
	margin-left: 6px;
	color: var(--bookish-muted);
	font-size: 0.68rem;
}

.book-listing-message p {
	margin: 3px 0 0;
}

.book-listing-message-form {
	display: grid;
	gap: 7px;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid var(--bookish-line);
}

.book-listing-message-form label {
	display: grid;
	gap: 4px;
	color: var(--bookish-muted);
	font-size: 0.72rem;
	font-weight: 700;
}

.book-listing-message-form textarea {
	min-height: 52px;
	padding: 8px 10px;
	border: 1px solid var(--bookish-line);
	border-radius: 8px;
	background: var(--bookish-paper);
	color: var(--bookish-ink);
	font-size: 0.8rem;
	resize: vertical;
}

.book-listing-secondary-action {
	padding: 8px 12px;
	border: 1px solid var(--bookish-line);
	border-radius: 8px;
	background: transparent;
	color: var(--bookish-muted);
	font-size: 0.75rem;
	font-weight: 700;
	cursor: pointer;
}

.book-listing-apply-login {
	color: var(--bookish-plum);
	font-size: 0.8rem;
	font-weight: 700;
}

.book-listing-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding-top: 12px;
	border-top: 1px solid var(--bookish-line);
	color: var(--bookish-muted);
	font-size: 0.75rem;
}

.book-listing-footer a {
	color: var(--bookish-plum);
	font-weight: 700;
}

.book-listing-form-card {
	max-width: 820px;
	min-width: 0;
	margin: 0 auto;
}

.book-listing-form {
	display: grid;
	min-width: 0;
	gap: 16px;
	margin-top: 24px;
}

.book-listing-form label {
	display: grid;
	min-width: 0;
	gap: 6px;
	color: var(--bookish-ink);
	font-size: 0.8rem;
	font-weight: 700;
}

.book-listing-form-row {
	display: grid;
	min-width: 0;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}

.book-listing-form input,
.book-listing-form select,
.book-listing-form textarea {
	width: 100%;
	min-width: 0;
	max-width: 100%;
}

.book-listing-form textarea {
	resize: vertical;
}

.book-listings-empty {
	text-align: center;
}

.book-listings-pagination {
	margin-top: 20px;
}

.booktok-favorite-button {
	display: inline-flex;
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--bookish-line);
	border-radius: 50%;
	background: transparent;
	color: var(--bookish-plum);
	cursor: pointer;
	font-size: 1.25rem;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.booktok-favorite-button:hover,
.booktok-favorite-button.is-favorite {
	background: var(--bookish-rose);
	border-color: var(--bookish-rose);
	color: #fffaf5;
	transform: scale(1.06);
}

.booktok-author-card:hover {
	border-color: var(--bookish-rose) !important;
	box-shadow: 0 8px 18px rgba(77, 38, 57, 0.1);
	transform: translateY(-2px);
}

.booktok-author-avatar {
	border-radius: 50% !important;
	background: var(--bookish-plum) !important;
	color: #fffaf5 !important;
}

.booktok-section-title,
.book-detail-section-title {
	color: var(--bookish-plum) !important;
}

.reading-progress-table th {
	background: var(--bookish-plum) !important;
	color: #fffaf5 !important;
	font-family: 'DM Sans', sans-serif;
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.reading-progress-table td {
	border-color: var(--bookish-line) !important;
}

.reading-progress-table a,
.book-detail-link {
	color: var(--bookish-plum) !important;
}

input,
select,
textarea {
	color: var(--bookish-ink) !important;
	background: var(--bookish-paper) !important;
	border-color: var(--bookish-line) !important;
}

input:not([type='hidden']):not([type='checkbox']):not([type='radio']),
select {
	min-height: 40px;
	padding: 9px 15px !important;
	border: 1px solid var(--bookish-line) !important;
	border-radius: 999px !important;
	background: var(--bookish-paper) !important;
	box-shadow: 0 1px 2px rgba(122, 98, 88, 0.05) !important;
	font-size: 0.88rem;
}

textarea {
	min-height: 96px;
	padding: 12px 15px !important;
	border: 1px solid var(--bookish-line) !important;
	border-radius: 16px !important;
	background: var(--bookish-paper) !important;
	box-shadow: 0 1px 2px rgba(122, 98, 88, 0.05) !important;
	font-size: 0.88rem;
}

input:not([type='hidden']):not([type='checkbox']):not([type='radio']):focus,
select:focus,
textarea:focus {
	outline: none !important;
	border-color: var(--bookish-rose) !important;
	box-shadow: 0 0 0 3px rgba(185, 143, 136, 0.18) !important;
}

input::placeholder,
textarea::placeholder {
	color: var(--bookish-muted) !important;
	opacity: 1;
}

html.dark {
	--bookish-plum: #b88791;
	--bookish-plum-deep: #f7e9e8;
	--bookish-rose: #8a5362;
	--bookish-cream: #351923;
	--bookish-paper: #4d2835;
	--bookish-ink: #f8ece9;
	--bookish-muted: #d9bfc1;
	--bookish-line: #754957;
	--bookish-soft: #6e3d4c;
	--bookish-alt: #432330;
	--bookish-success-bg: #173d2d;
	--bookish-success-text: #c3f2d6;
	--bookish-info-bg: #1d3b4b;
	--bookish-info-text: #cbeafa;
	--bookish-warning-bg: #51421f;
	--bookish-warning-text: #ffedb0;
}

html.dark body {
	background-color: var(--bookish-cream) !important;
	background-image: radial-gradient(#754957 0.7px, transparent 0.7px) !important;
	color: var(--bookish-ink) !important;
}

html.dark .app-surface-opaque,
html.dark .uiverse-container,
html.dark .book-notification-panel {
	background: var(--bookish-paper) !important;
	border-color: var(--bookish-line) !important;
	color: var(--bookish-ink) !important;
}

html.dark nav.app-surface-opaque {
	background: var(--bookish-paper) !important;
	border-bottom-color: var(--bookish-rose) !important;
	box-shadow: 0 5px 18px rgba(0, 0, 0, 0.22);
}

html.dark #drawer-navigation .bg-neutral-tertiary-soft {
	background: var(--bookish-soft) !important;
	color: var(--bookish-muted) !important;
}

html.dark .bookish-brand,
html.dark .reading-progress-page > h1,
html.dark .welcome-title,
html.dark .booktok-section-title,
html.dark .book-detail-section-title,
html.dark .book-detail-title,
html.dark .uiverse-heading,
html.dark .book-notification-heading,
html.dark .book-notification-item strong {
	color: var(--bookish-plum) !important;
}

html.dark .reading-progress-page > p,
html.dark .welcome-container > p,
html.dark .booktok-section-count,
html.dark .booktok-author-card div span,
html.dark .book-notification-heading span,
html.dark .book-notification-item small,
html.dark .book-notification-empty {
	color: var(--bookish-muted) !important;
}

html.dark input,
html.dark select,
html.dark textarea,
html.dark .uiverse-container .form .input {
	background: var(--bookish-cream) !important;
	border-color: var(--bookish-line) !important;
	color: var(--bookish-ink) !important;
}

html.dark input:not([type='hidden']):not([type='checkbox']):not([type='radio']),
html.dark select,
html.dark textarea {
	background: var(--bookish-cream) !important;
	border-color: var(--bookish-line) !important;
	color: var(--bookish-ink) !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder,
html.dark .uiverse-container .form .input::placeholder {
	color: var(--bookish-muted) !important;
}

html.dark .reading-progress-table td,
html.dark .reading-progress-table th {
	border-color: var(--bookish-line) !important;
}

html.dark .reading-progress-table td,
html.dark .reading-progress-table td span,
html.dark .booktok-author-card strong {
	color: var(--bookish-ink) !important;
}

html.dark .reading-progress-table a,
html.dark .book-detail-link {
	color: var(--bookish-plum) !important;
}

html.dark .booktok-author-card {
	background: var(--bookish-paper) !important;
	border-color: var(--bookish-line) !important;
}

html.dark .booktok-author-card:nth-child(3n + 2),
html.dark .book-recommendation-card:nth-child(3n + 2),
html.dark .highlight-card:nth-child(3n + 2),
html.dark .reading-challenge-card:nth-child(3n + 2) {
	background: var(--bookish-soft) !important;
}

html.dark .booktok-author-card:nth-child(3n),
html.dark .book-recommendation-card:nth-child(3n),
html.dark .highlight-card:nth-child(3n),
html.dark .reading-challenge-card:nth-child(3n) {
	background: var(--bookish-alt) !important;
}

html.dark .booktok-author-card:nth-child(3n + 2) .booktok-author-avatar {
	background: #b88791 !important;
}

html.dark .booktok-author-card:nth-child(3n) .booktok-author-avatar {
	background: #8a5362 !important;
}

html.dark .book-recommendation-card,
html.dark .highlight-card,
html.dark .reading-challenge-card,
html.dark .rp-snapshot-col,
html.dark .rp-snapshot-article,
html.dark .reading-progress-overview,
html.dark .reading-progress-history,
html.dark .reading-progress-editor,
html.dark .rp-form-footer,
html.dark .live-progress-preview,
html.dark .status-tag,
html.dark .emotion-tag,
html.dark .rp-emotion-icon {
	background: var(--bookish-paper) !important;
	border-color: var(--bookish-line) !important;
	color: var(--bookish-ink) !important;
}

html.dark .book-recommendation-card h3 a,
html.dark .book-recommendation-card p,
html.dark .book-recommendation-card span,
html.dark .highlight-card p,
html.dark .highlight-card strong,
html.dark .reading-challenge-card p,
html.dark .reading-challenge-card strong,
html.dark .rp-snapshot-meta,
html.dark .status-tag,
html.dark .emotion-tag,
html.dark .rp-back-button,
html.dark #drawer-navigation a,
html.dark #drawer-navigation div,
html.dark #drawer-navigation span {
	color: var(--bookish-muted) !important;
}

html.dark .book-recommendation-card h3 a,
html.dark .highlight-card strong,
html.dark .reading-challenge-card strong,
html.dark #drawer-navigation .text-heading {
	color: var(--bookish-plum) !important;
}

html.dark #drawer-navigation a:hover,
html.dark #drawer-navigation button:hover {
	background: var(--bookish-soft) !important;
	color: var(--bookish-plum) !important;
}

html.dark nav.app-surface-opaque a,
html.dark nav.app-surface-opaque span,
html.dark nav.app-surface-opaque button {
	color: var(--bookish-muted) !important;
}

html.dark nav.app-surface-opaque .bookish-brand,
html.dark nav.app-surface-opaque button:hover {
	color: var(--bookish-plum) !important;
}

html.dark .rp-datetime-row,
html.dark .live-progress-bar-wrap {
	background: var(--bookish-cream) !important;
	border-color: var(--bookish-line) !important;
}

.rp-datetime-row {
	display: flex;
	gap: 12px;
	align-items: end;
}

.rp-datetime-row > label {
	min-width: 0;
}

.rp-date-control {
	position: relative;
	display: flex;
	align-items: center;
	border: 1px solid var(--bookish-line, #ddc9c1);
	border-radius: 8px;
	background: var(--bookish-paper, #fffaf7);
	box-shadow: 0 4px 12px rgba(77, 38, 57, 0.06);
}

.rp-date-display {
	width: 100%;
	padding-right: 44px !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--bookish-ink, #3d2630) !important;
	cursor: pointer;
}

.rp-date-open {
	position: absolute;
	right: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 6px;
	background: var(--bookish-rose, #b98f88);
	color: var(--bookish-cream, #fbf7f4);
	cursor: pointer;
}

.rp-date-open:hover,
.rp-date-open:focus-visible {
	background: var(--bookish-plum-deep, #5e4740);
	outline: none;
}

.rp-date-control:focus-within {
	border-color: var(--bookish-plum, #7a6258);
	box-shadow: 0 0 0 3px rgba(185, 143, 136, 0.24);
}

.rp-date-picker {
	accent-color: var(--bookish-rose, #b98f88);
}

.rp-date-picker {
	position: absolute;
	width: 1px;
	height: 1px;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	opacity: 0;
	pointer-events: none;
}

@media (max-width: 640px) {
	.rp-datetime-row {
		display: grid;
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.rp-datetime-row > label {
		width: 100% !important;
	}

	.rp-date-open {
		width: 40px;
		height: 40px;
		font-size: 1.1rem;
	}
}

html.dark .cancel-edit-btn,
html.dark .edit-mode-banner {
	background: #51421f !important;
	border-color: #b8954a !important;
	color: #ffedb0 !important;
}

html.dark .emotion-tag:hover,
html.dark .status-tag:hover {
	background: var(--bookish-soft) !important;
}

html.dark .emotion-tag.selected {
	background: var(--bookish-rose) !important;
	border-color: var(--bookish-rose) !important;
	color: var(--bookish-cream) !important;
}

html.dark .booktok-author-avatar {
	background: var(--bookish-rose) !important;
	color: var(--bookish-cream) !important;
}

.profile-page {
	max-width: var(--content-max-width);
	width: min(100%, var(--content-max-width));
	margin: 40px auto;
}

.profile-page-heading {
	margin-bottom: 24px;
}

.profile-page-heading h1 {
	margin: 0;
	color: var(--bookish-plum);
	font-size: clamp(2.4rem, 5vw, 3.8rem);
	font-weight: 500;
	line-height: 1.05;
}

.profile-page-heading p:last-child {
	margin: 8px 0 0;
	color: var(--bookish-muted);
}

.profile-statistics {
	background: var(--bookish-paper) !important;
	border: 1px solid var(--bookish-line) !important;
	border-radius: 4px !important;
	box-shadow: 0 12px 28px rgba(77, 38, 57, 0.08) !important;
}

.profile-statistics-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
}

.profile-statistics .uiverse-heading {
	margin: 0;
	color: var(--bookish-plum-deep);
	text-align: left;
}

.profile-statistics-link {
	color: var(--bookish-plum-deep);
	font-weight: 700;
	text-decoration: underline;
}

.profile-statistics-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin-top: 1.5rem;
}

.profile-statistic {
	background: var(--bookish-cream);
	border: 1px solid var(--bookish-line);
	border-radius: 4px;
	padding: 1rem;
}

.profile-statistic strong,
.profile-statistic span {
	display: block;
}

.profile-statistic strong {
	color: var(--bookish-plum-deep);
	font-size: 1.8rem;
}

.profile-statistic span {
	color: var(--bookish-muted);
	font-size: 0.9rem;
	margin-top: 0.25rem;
}

.profile-statistics-shelf {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
	margin-top: 1rem;
	color: var(--bookish-muted);
	font-size: 0.9rem;
}

.profile-settings-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
	margin-top: 18px;
}

.profile-card {
	padding: 24px;
	background: var(--bookish-paper) !important;
	border: 1px solid var(--bookish-line) !important;
	border-radius: 4px !important;
	box-shadow: 0 12px 28px rgba(77, 38, 57, 0.08) !important;
}

.profile-card header {
	margin-bottom: 20px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--bookish-line);
}

.profile-card h2 {
	margin: 0;
	color: var(--bookish-plum-deep) !important;
	font-size: 1.35rem;
}

.profile-card p,
.profile-card label,
.profile-card span {
	color: var(--bookish-muted) !important;
}

.profile-card input {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--bookish-line) !important;
	border-radius: 7px !important;
	background: var(--bookish-cream) !important;
	color: var(--bookish-ink) !important;
	box-shadow: none !important;
}

.profile-card input:focus {
	border-color: var(--bookish-rose) !important;
	box-shadow: 0 0 0 3px rgba(185, 143, 136, 0.18) !important;
}

.profile-card button[type='submit'] {
	border: 1px solid var(--bookish-plum) !important;
	border-radius: 7px !important;
	background: var(--bookish-plum) !important;
	color: var(--bookish-paper) !important;
	font-family: 'DM Sans', sans-serif !important;
	font-weight: 700;
	box-shadow: none !important;
}

.profile-card button[type='submit']:hover {
	background: var(--bookish-plum-deep) !important;
}

.profile-card-danger {
	grid-column: 1 / -1;
	border-color: var(--bookish-rose) !important;
}

@media (max-width: 760px) {
	.profile-page {
		margin: 24px auto;
	}

	.profile-settings-grid,
	.profile-statistics-grid {
		grid-template-columns: 1fr;
	}

	.profile-statistics-heading {
		flex-direction: column;
	}

	.profile-card-danger {
		grid-column: auto;
	}
}

html.dark .reading-progress-submit,
html.dark .booktok-view-button.is-active,
html.dark .booktok-view-button:hover {
	background: var(--bookish-rose) !important;
	border-color: var(--bookish-rose) !important;
	color: var(--bookish-cream) !important;
}

html.dark .booktok-view-button {
	background: var(--bookish-paper) !important;
	border-color: var(--bookish-line) !important;
	color: var(--bookish-plum) !important;
}

html.dark .book-notification-item,
html.dark .book-notification-item:hover {
	border-color: var(--bookish-line) !important;
	background: transparent !important;
}

html.dark .book-notification-button,
html.dark .book-notification-login,
html.dark .theme-toggle-nav {
	background: var(--bookish-paper) !important;
	border-color: var(--bookish-line) !important;
	color: var(--bookish-plum) !important;
}

html.dark .reading-progress-alert-success {
	background: var(--bookish-success-bg) !important;
	color: var(--bookish-success-text) !important;
}

html.dark .book-detail-status--read {
	background: #9a5b6d !important;
	color: #ffffff !important;
}

html.dark .book-detail-status--progress {
	background: #9a5b6d !important;
	color: #ffffff !important;
}

html.dark .book-detail-status--want {
	background: #9a5b6d !important;
	color: #ffffff !important;
}

@keyframes bookishReveal {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
	.bookish-brand {
		font-size: 1.15rem !important;
	}

	.bookish-main {
		padding-top: 82px;
	}

	.reading-progress-page > h1,
	.welcome-title {
		font-size: 2.35rem !important;
	}
}
