:root {
	--bg: #1b1e24;
	--pane-bg: #23272f;
	--border: #33394a;
	--accent: #5b8cff;
	--text: #cdd3de;
	--text-dim: #7b8496;
	--divider: #2b303c;
	--divider-hover: #5b8cff;
}
* { box-sizing: border-box; }
html, body {
	margin: 0; padding: 0;
	width: 100%; height: 100%;
	overflow: hidden;
	background: var(--bg);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--text);
}
#app {
	width: 100vw;
	height: 100vh;
	display: flex;
	position: relative; /* anchor for junction dots */
	/* padding: 4px; */ /* pane outer padding disabled — re-enable to inset panes */
}
.pane {
	position: relative;
	min-width: 0;
	min-height: 0;
	display: flex;
}
.split {
	display: flex;
	width: 100%;
	height: 100%;
}
.leaf {
	width: 100%;
	height: 100%;
	background: var(--pane-bg);
	/* border: 1px solid var(--border); */ /* pane border disabled — re-enable to show borders */
	/* border-radius: 6px; */ /* pane rounding disabled — re-enable alongside borders */
	display: flex;
	flex-direction: column;
	overflow: hidden;
	position: relative;
}
.leaf-toolbar {
	display: none;
	align-items: center;
	gap: 4px;
	padding: 6px 8px;
	padding-right: 32px;
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
}
.leaf.show-toolbar .leaf-toolbar {
	display: flex;
}
.leaf-url {
	flex: 1 1 auto;
	min-width: 0;
	background: var(--bg);
	border: 1px solid var(--border);
	color: var(--text);
	border-radius: 4px;
	padding: 3px 6px;
	font-size: 12px;
	height: 22px;
	outline: none;
	transition: border-color .12s;
}
.leaf-url:focus {
	border-color: var(--accent);
}
.btn {
	background: transparent;
	border: 1px solid var(--border);
	color: var(--text-dim);
	border-radius: 4px;
	width: 24px;
	height: 22px;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color .12s, color .12s, background .12s;
	flex-shrink: 0;
}
.btn:hover {
	border-color: var(--accent);
	color: var(--accent);
	background: rgba(91,140,255,0.08);
}
.btn.close-btn:hover {
	border-color: #ff6b6b;
	color: #ff6b6b;
	background: rgba(255,107,107,0.08);
}
.leaf-recent-btn {
	/* inherits .btn */
}
.leaf-recent-menu {
	position: absolute;
	top: 34px; /* just below toolbar */
	left: 8px;
	min-width: 180px;
	max-width: calc(100% - 16px);
	max-height: 240px;
	overflow-y: auto;
	background: var(--pane-bg);
	border: 1px solid var(--border);
	border-radius: 4px;
	z-index: 5;
	box-shadow: 0 4px 12px rgba(0,0,0,0.4);
	display: none;
}
.leaf-recent-menu.open {
	display: block;
}
.leaf-recent-item {
	padding: 6px 10px;
	font-size: 12px;
	color: var(--text);
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	border-bottom: 1px solid var(--border);
}
.leaf-recent-item:last-child {
	border-bottom: 0;
}
.leaf-recent-item:hover {
	background: rgba(91,140,255,0.12);
	color: var(--accent);
}
.leaf-recent-empty {
	padding: 6px 10px;
	font-size: 12px;
	color: var(--text-dim);
	font-style: italic;
}
.leaf-dot {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--divider);
	border: 1px solid var(--border);
	cursor: pointer;
	z-index: 3;
	padding: 0;
	transition: background .12s, border-color .12s, transform .12s;
}
.leaf-dot:hover {
	background: var(--accent);
	border-color: var(--accent);
	transform: scale(1.15);
}
.leaf.show-toolbar .leaf-dot {
	background: var(--accent);
	border-color: var(--accent);
}
.leaf-body {
	flex: 1;
	min-height: 0;
	display: flex;
	overflow: hidden;
	position: relative;
}
.leaf-frame {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	background: #fff;
}
/* Fallback overlay shown when a site refuses to be framed */
.leaf-fallback {
	position: absolute;
	inset: 0;
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 24px;
	background: var(--pane-bg);
	color: var(--text);
	text-align: center;
	z-index: 2;
}
.leaf-fallback.open {
	display: flex;
}
.leaf-fallback-msg {
	font-size: 13px;
	color: var(--text-dim);
	max-width: 420px;
	line-height: 1.4;
}
.leaf-fallback-url {
	font-size: 12px;
	color: var(--accent);
	word-break: break-all;
	max-width: 90%;
	text-decoration: none;
}
.leaf-fallback-url:hover {
	text-decoration: underline;
}
.leaf-fallback-actions {
	display: flex;
	gap: 8px;
}
.leaf-fallback-btn {
	background: transparent;
	border: 1px solid var(--border);
	color: var(--text);
	border-radius: 4px;
	padding: 6px 12px;
	font-size: 12px;
	cursor: pointer;
	text-decoration: none;
	transition: border-color .12s, color .12s, background .12s;
}
.leaf-fallback-btn:hover {
	border-color: var(--accent);
	color: var(--accent);
	background: rgba(91,140,255,0.08);
}
/* Divider is a 1px visible line; ::before provides a wider invisible hit area for easy grabbing */
.divider {
	flex-shrink: 0;
	background: var(--divider);
	position: relative;
	z-index: 2;
	transition: background .12s;
}
.divider::before {
	content: "";
	position: absolute;
	/* transparent expanded hit area, does not consume layout space */
}
.divider-v {
	width: 1px;
	cursor: col-resize;
}
.divider-v::before {
	top: 0; bottom: 0;
	left: -3px; right: -3px; /* 7px wide hit area centered on the 1px line */
}
.divider-h {
	height: 1px;
	cursor: row-resize;
}
.divider-h::before {
	left: 0; right: 0;
	top: -3px; bottom: -3px; /* 7px tall hit area centered on the 1px line */
}
.divider:hover,
.divider.dragging {
	background: var(--divider-hover);
}
/* Junction dot at a T-abutment between two perpendicular dividers.
   Visually invisible — the move cursor on hover indicates interactivity. */
.junction-dot {
	position: absolute;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: transparent;
	border: 0;
	cursor: move;
	z-index: 4;
	padding: 0;
	transform: translate(-50%, -50%);
	touch-action: none;
}
