/* Minimal, readable styles */
:root { --bg: #0f172a; --panel: #111827; --text: #e5e7eb; --accent: #60a5fa; --error: #f87171; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; background: var(--bg); color: var(--text); }
header, footer { padding: 16px 20px; }
header h1 { margin: 0 0 8px; font-size: 20px; }
header p { margin: 0; opacity: 0.8; }
main { padding: 0 20px 24px; }
form { background: var(--panel); border: 1px solid #1f2937; border-radius: 12px; padding: 16px; max-width: 900px; margin: 0 auto 16px; }
label { display: block; margin-bottom: 8px; font-weight: 600; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
input[type="url"] { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid #374151; background: #0b1220; color: var(--text); }
button { padding: 10px 14px; border-radius: 10px; border: 1px solid #1f2937; background: #0b1220; color: var(--text); cursor: pointer; }
button:hover { border-color: var(--accent); }
.hint { margin: 8px 0 0; font-size: 12px; opacity: 0.8; }
.viewer { background: var(--panel); border: 1px solid #1f2937; border-radius: 12px; padding: 12px; max-width: 1200px; margin: 0 auto; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.toolbar a { color: var(--accent); text-decoration: none; }
.canvas { display: grid; place-items: center; background: #0b1220; border-radius: 10px; min-height: 50vh; overflow: auto; }
.canvas img { max-width: 100%; max-height: 80vh; object-fit: contain; }
.error { color: var(--error); margin-top: 8px; }
.hidden { display: none; }
footer { opacity: 0.6; text-align: center; }

.gallery { background: var(--panel); border: 1px solid #1f2937; border-radius: 12px; padding: 12px; max-width: 1200px; margin: 0 auto 16px; }
.gallery-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 10px; }

/* Landscape table for 2-up images, full format */
.landscape-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	margin-top: 10px;
}
.landscape-table td {
	padding: 12px;
	vertical-align: middle;
}
.landscape-cell {
	height: clamp(140px, 28vh, 260px);
	border-radius: 12px;
	overflow: hidden;
	background: rgba(255,255,255,0.03);
	display: flex;
	align-items: center;
	justify-content: center;
}
.landscape-cell img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	transform: rotate(-90deg);
}
.thumb { position: relative; border: 1px solid #1f2937; border-radius: 10px; overflow: hidden; background: #0b1220; cursor: pointer; min-height: 140px; display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.landscape img { transform: rotate(-90deg); max-width: 100%; max-height: 100%; }
.thumb .thumb-name { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 4px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.55); color: var(--text); font-size: 12px; backdrop-filter: blur(4px); }
.empty { opacity: 0.8; font-size: 14px; margin: 6px 0; }
