@font-face {
	font-family: 'Manrope';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('assets/manrope-400.woff2') format('woff2');
}

@font-face {
	font-family: 'Manrope';
	font-style: normal;
	font-weight: 600 800;
	font-display: swap;
	src: url('assets/manrope-600.woff2') format('woff2');
}

@media (prefers-color-scheme: dark) {
	:root {
		--ios-bg: #151619;
		--ios-panel: #202226;
		--ios-panel-2: #2b2e33;
		--ios-separator: #44484f;
		--ios-label: #f3f4f6;
		--ios-secondary: #afb5bf;
		--ios-blue: #75d8ca;
		--ios-red: #ff818a;
		--ios-green: #80d4a4;
		--chrome: #202226ed;
		--control-fill: #ffffff0d;
	}
}

body:not(.page) {
	height: 100dvh;
	min-width: 320px;
}

button, input, textarea, select {
	letter-spacing: 0;
}

button:focus-visible, a:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
	outline: 2px solid var(--ios-blue);
	outline-offset: 3px;
}

.navbar {
	flex-shrink: 0;
}

.nav-action, .sheet-close, .sheet-back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
}

.nav-title[readonly] {
	cursor: default;
}

.editor-dock {
	align-self: center;
	flex-shrink: 0;
	width: min(440px, calc(100% - 24px));
	margin: 8px max(12px, env(safe-area-inset-right))
		max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
	padding: 8px;
	border: 1px solid var(--ios-separator);
	border-radius: 24px;
	background: var(--chrome);
	box-shadow: 0 6px 24px #0000001a;
	backdrop-filter: blur(24px);
}

.mode-switch {
	display: flex;
	width: 184px;
	margin: 0 auto 6px;
	padding: 3px;
	border-radius: 24px;
	background: var(--control-fill);
}

.mode-switch button {
	flex: 1;
	min-height: 44px;
	padding: 8px 12px;
	border: 0;
	border-radius: 22px;
	background: transparent;
	color: var(--ios-secondary);
	font-size: 13px;
	font-weight: 600;
}

.mode-switch [aria-pressed="true"] {
	background: var(--ios-panel);
	color: var(--ios-label);
	box-shadow: 0 1px 4px #00000021;
}

#btn-add {
	background: var(--ios-blue);
	color: var(--ios-bg);
	border-radius: 50%;
}

[data-mode="read"] .tabbar [data-edit],
[data-mode="read"] .node-add,
[data-mode="read"] .node-check,
[data-mode="read"] .node-bar,
[data-mode="read"] .sticky button,
[data-mode="read"] #done-list button,
[data-mode="read"] #btn-clear-done,
[data-mode="read"] #sheet-map-tools .group:first-child {
	display: none !important;
}

.detail-title {
	font-size: 22px;
	font-weight: 600;
	line-height: 1.4;
	margin: 0;
}

#node-details {
	gap: 18px;
	overflow-wrap: anywhere;
	white-space: pre-wrap;
}

#node-details a {
	color: var(--ios-blue);
}

#node-details blockquote {
	margin: 0;
	padding: 12px 0 12px 16px;
	border-left: 3px solid var(--ios-blue);
}

#node-details cite {
	display: block;
	margin-top: 8px;
	color: var(--ios-secondary);
	font-size: 13px;
	font-style: normal;
}

.detail-image {
	padding: 0;
	border: 0;
	background: transparent;
}

.detail-image img {
	display: block;
	max-width: 100%;
	max-height: 320px;
	object-fit: contain;
	margin: auto;
}

.row.action[data-format] {
	justify-content: flex-start;
}

.sheet-body input, .sheet-body textarea, .sheet-body select {
	font-size: 16px;
	max-width: 100%;
}

.sheet-body, .sheet-panel, .row, .choice-copy {
	min-width: 0;
}

.sheet-body p, .sheet-body strong, .sheet-body h2, .row {
	overflow-wrap: anywhere;
}

.sheet-body button, .guest-button, .list button {
	min-height: 44px;
}

.sheet-panel>header {
	flex-shrink: 0;
}

.sheet-body {
	overscroll-behavior: contain;
}

.sheet-close[data-close] {
	border-radius: 50%;
	background: var(--control-fill);
	color: var(--ios-secondary);
}

#dashboard .sheet-panel {
	height: min(86dvh, 840px);
}

.choice-row small {
	display: none;
}

.options-tabs {
	display: flex;
	flex-shrink: 0;
	gap: 4px;
	margin: 0 16px 20px;
	padding: 4px;
	border-radius: 8px;
	background: var(--control-fill);
}

.options-tabs button {
	flex: 1;
	min-height: 44px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--ios-secondary);
	font-size: 14px;
}

.options-tabs [aria-selected="true"] {
	background: var(--ios-panel);
	color: var(--ios-label);
	box-shadow: 0 1px 4px #00000021;
}

.options-panel:not(.group) {
	display: grid;
	gap: 20px;
}

.options-panel[hidden] {
	display: none;
}

@media (pointer: coarse) {
	.node-bar {
		display: none !important;
	}
	.node-toggle, .node-add, .node-check {
		min-width: 44px;
		min-height: 44px;
	}
}

@media (max-height: 500px) and (min-width: 600px) {
	.editor-dock {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		width: min(600px, calc(100% - 80px));
		margin-block: 4px max(4px, env(safe-area-inset-bottom));
		padding: 4px 8px;
	}
	.mode-switch {
		margin: 0;
		flex-shrink: 0;
	}
	.tabbar {
		flex: 1;
	}
	.navbar {
		padding-block: max(4px, env(safe-area-inset-top)) 4px;
	}
	.statusbar {
		display: none;
	}
	.sheet-panel {
		max-height: calc(100dvh - 12px);
	}
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

@media (prefers-reduced-transparency: reduce) {
	.navbar, .editor-dock, .sheet-panel, .zoom-dock {
		background: var(--ios-panel);
		backdrop-filter: none;
	}
}