:root {
	--bg: #fdfbf7;
	--fg: #2d2d2d;
	--muted: #e5e0d8;
	--accent: #ff4d4d;
	--blue: #2d5da1;
	--postit: #fff9c4;
	--shadow: 4px 4px 0 var(--fg);
	--border: 2px solid var(--fg);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
}

body {
	margin: 0;
	color: var(--fg);
	background: var(--bg);
	font-family: 'Patrick Hand', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, 'Apple Color Emoji',
		'Segoe UI Emoji';
	letter-spacing: 0.2px;
}

code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
	font-size: 0.95em;
	background: rgba(45, 45, 45, 0.06);
	padding: 0.15em 0.35em;
	border-radius: 8px;
}

.paper {
	max-width: 1160px;
	margin: 0 auto;
	padding: 22px 16px 42px;
	position: relative;
}

.paper::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgba(45, 45, 45, 0.08) 1px, transparent 1px);
	background-size: 18px 18px;
	opacity: 0.35;
	pointer-events: none;
}

.layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	margin-top: 16px;
	position: relative;
	z-index: 1;
}

@media (min-width: 980px) {
	.layout {
		grid-template-columns: 420px 1fr;
		align-items: start;
	}
}

.header {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
	position: relative;
	overflow: hidden;
}

@media (min-width: 780px) {
	.header {
		grid-template-columns: 1fr auto;
		align-items: center;
	}
}

.header__right {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: flex-start;
}

.title {
	font-family: 'Kalam', ui-sans-serif, system-ui;
	font-weight: 700;
	font-size: 44px;
	line-height: 1.05;
	margin: 10px 0 8px;
}

.subtitle {
	margin: 0;
	font-size: 18px;
	color: rgba(45, 45, 45, 0.85);
}

.tag {
	display: inline-block;
	border: var(--border);
	box-shadow: var(--shadow);
	background: white;
	padding: 6px 10px;
	transform: rotate(-1deg);
	border-radius: 18px 12px 16px 10px / 10px 18px 14px 16px;
	font-size: 14px;
}

.scribble {
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 10px;
	height: 70px;
	color: rgba(45, 45, 45, 0.6);
	pointer-events: none;
}

.card {
	background: white;
	border: var(--border);
	box-shadow: var(--shadow);
	padding: 14px;
	position: relative;
}

.note {
	background: var(--postit);
}

.card__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.card__actions {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.card__footer {
	margin-top: 10px;
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
}

.h2 {
	font-family: 'Kalam', ui-sans-serif, system-ui;
	font-size: 24px;
	margin: 0;
}

.hint {
	margin-top: 8px;
	font-size: 14px;
	color: rgba(45, 45, 45, 0.75);
}

.btn {
	appearance: none;
	border: var(--border);
	box-shadow: var(--shadow);
	background: var(--accent);
	color: var(--fg);
	font-family: 'Kalam', ui-sans-serif, system-ui;
	font-weight: 700;
	padding: 10px 14px;
	cursor: pointer;
	border-radius: 14px 22px 12px 18px / 18px 14px 20px 12px;
	transition: transform 120ms;
}

.btn:hover {
	transform: rotate(1deg);
}

.btn:active {
	transform: translate(2px, 2px);
	box-shadow: 2px 2px 0 var(--fg);
}

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

.btn--secondary {
	background: white;
}

.chip {
	appearance: none;
	border: var(--border);
	box-shadow: 3px 3px 0 var(--fg);
	background: white;
	cursor: pointer;
	padding: 6px 10px;
	font-family: 'Patrick Hand', ui-sans-serif, system-ui;
	border-radius: 16px 10px 14px 18px / 12px 18px 12px 16px;
	transition: transform 120ms;
}

.chip:hover {
	transform: rotate(-1deg);
}

.chip:active {
	transform: translate(2px, 2px);
	box-shadow: 1px 1px 0 var(--fg);
}

.chip--danger {
	background: #ffe3e3;
	border-color: var(--accent);
}

.badge {
	min-width: 36px;
	text-align: center;
	border: var(--border);
	box-shadow: 3px 3px 0 var(--fg);
	padding: 4px 10px;
	background: white;
	border-radius: 18px 10px 18px 10px / 10px 18px 10px 18px;
	font-family: 'Kalam', ui-sans-serif, system-ui;
}

.textarea,
.input,
.select {
	width: 100%;
	border: var(--border);
	box-shadow: var(--shadow);
	background: white;
	color: var(--fg);
	padding: 10px 12px;
	font-family: 'Patrick Hand', ui-sans-serif, system-ui;
	font-size: 18px;
	border-radius: 16px 10px 18px 12px / 12px 18px 12px 18px;
}

.textarea {
	resize: vertical;
	min-height: 120px;
}

.textarea:focus,
.input:focus,
.select:focus {
	outline: none;
	border-color: var(--blue);
	box-shadow: 4px 4px 0 var(--fg), 0 0 0 4px rgba(45, 93, 161, 0.18);
}

.field {
	margin-top: 12px;
}

.label {
	display: inline-block;
	margin-bottom: 6px;
	font-family: 'Kalam', ui-sans-serif, system-ui;
	font-weight: 700;
}

.grid2 {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

@media (min-width: 780px) {
	.grid2 {
		grid-template-columns: 1fr 1fr;
	}
}

.filters {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
	margin-top: 12px;
}

@media (min-width: 780px) {
	.filters {
		grid-template-columns: 1.4fr 0.8fr 0.6fr 0.9fr 0.9fr 0.6fr;
	}
}

.toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: var(--border);
	box-shadow: 3px 3px 0 var(--fg);
	padding: 6px 10px;
	background: white;
	border-radius: 16px 10px 14px 18px / 12px 18px 12px 16px;
	user-select: none;
}

.toggle input {
	accent-color: var(--blue);
}

.selected {
	border: var(--border);
	box-shadow: 3px 3px 0 var(--fg);
	padding: 10px 12px;
	background: rgba(45, 45, 45, 0.03);
	border-radius: 16px 10px 18px 12px / 12px 18px 12px 18px;
}

.selected__name {
	font-family: 'Kalam', ui-sans-serif, system-ui;
	font-weight: 700;
	font-size: 18px;
}

.selected__meta {
	margin-top: 4px;
	color: rgba(45, 45, 45, 0.7);
	font-size: 14px;
}

.actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 14px;
}

.audio__player {
	width: min(520px, 100%);
}

.status {
	color: rgba(45, 45, 45, 0.75);
	font-size: 14px;
}

.link {
	color: var(--blue);
	text-decoration: none;
	border-bottom: 2px dashed rgba(45, 93, 161, 0.55);
}

.link:hover {
	color: var(--fg);
	border-bottom-color: rgba(45, 45, 45, 0.6);
}

.list {
	margin-top: 12px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
}

@media (min-width: 780px) {
	.list {
		grid-template-columns: 1fr 1fr;
	}
}

.voice {
	background: white;
	border: var(--border);
	box-shadow: 3px 3px 0 var(--fg);
	padding: 10px 12px;
	cursor: pointer;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 10px;
	align-items: center;
	transition: transform 120ms;
	transform: rotate(var(--rot, 0deg));
}

.voice:hover {
	transform: rotate(calc(var(--rot, 0deg) - 1deg));
}

.voice--selected {
	background: rgba(255, 77, 77, 0.08);
}

.voice__name {
	font-family: 'Kalam', ui-sans-serif, system-ui;
	font-weight: 700;
	font-size: 16px;
	line-height: 1.1;
}

.voice__sub {
	margin-top: 4px;
	font-size: 14px;
	color: rgba(45, 45, 45, 0.75);
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.pill {
	display: inline-block;
	padding: 2px 8px;
	border: 2px dashed rgba(45, 45, 45, 0.6);
	border-radius: 999px;
}

.pill--tag {
	border-color: rgba(45, 93, 161, 0.65);
	background: rgba(45, 93, 161, 0.06);
}

.voice__actions {
	display: flex;
	gap: 8px;
}

.iconbtn {
	appearance: none;
	border: var(--border);
	box-shadow: 3px 3px 0 var(--fg);
	background: white;
	cursor: pointer;
	width: 40px;
	height: 38px;
	display: grid;
	place-items: center;
	font-size: 18px;
	border-radius: 14px 18px 12px 18px / 18px 12px 18px 12px;
	transition: transform 120ms;
}

.iconbtn:hover {
	transform: rotate(1deg);
}

.iconbtn:active {
	transform: translate(2px, 2px);
	box-shadow: 1px 1px 0 var(--fg);
}

.iconbtn--fav {
	color: var(--accent);
}

.footer {
	margin-top: 16px;
	position: relative;
	z-index: 1;
}

.footer__note {
	background: white;
}

.footer__title {
	font-family: 'Kalam', ui-sans-serif, system-ui;
	font-weight: 700;
	font-size: 18px;
}

.footer__list {
	margin: 10px 0 0;
	padding-left: 18px;
}

.toast {
	position: fixed;
	left: 16px;
	bottom: 16px;
	max-width: min(520px, calc(100vw - 32px));
	background: white;
	border: var(--border);
	box-shadow: var(--shadow);
	padding: 12px 14px;
	border-radius: 18px 12px 16px 10px / 10px 18px 14px 16px;
	z-index: 30;
}

.wobble {
	border-radius: 18px 12px 16px 10px / 10px 18px 14px 16px;
	transform: rotate(var(--rot, 0deg));
}
