/* #region Reset */
body, body *:where(:not(html, iframe, canvas, img, svg, video, audio, svg, link, script, style)) {
	display: revert;
	all: unset;
}

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

a, button {
	cursor: revert;
}

ol, ul, menu {
	list-style: none;
}

[data-highlight] {
	outline: 1px solid #ff000050;
	background: #ff000025;
}

#fiveserver-info-wrapper {
	display: none ! important;
}

:root {
	interpolate-size: allow-keywords;
}

body {
	display: block;
	background: #eee;
	padding: 10vw;
	color: #222;
	font-family: SF Pro Display, SF Pro, Helvetica Neue, Helvetica, Arial;
}

h1 {
	display: block;
	padding-bottom: 1em;
	font-size: 1.25em;
	font-weight: bold;
}

#rawbox {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	opacity: .5;
	height: 1.1em;
	overflow: auto;
	font-family: monospace;
}

#chatbox {
	display: block;
	flex: 1;
}

/* Message styling */
.message {
	display: block;
	margin-bottom: 1em;
}

.message * {
	font-size: 1em;
	all: revert;
}

.message b {
	font-weight: bold;
}

.message code {
	position: absolute;
	right: 1em;
	float: right;
	opacity: .25;
	text-transform: uppercase;
	color: red;
	font-size: .5em;
}

.loading {
	opacity: .5;
}

.error-message {
	color: #f44336;
	padding: 20px;
	background: #fff0f0;
	border: 1px solid #ffcccb;
	color: #cc0000;
	margin: 10px 0;
}

.input-container {
	display: flex;
	position: fixed;
	bottom: 0;
	left: 0;
	margin: 5em;
	width: 25%;
}

.input-container input,
.input-container button {
	display: block;
	border: 1px solid #888;
	background: #fff;
	padding: 1em;
}

.input-container input {
	flex: 1;
	border-right: none;
}

#visual {
	display: flex;
	position: sticky;
	top: 5vw;
	justify-content: center;
	margin: 2em auto;
	margin-left: 5vw;
	height: fit-content;
}

.table {
	display: flex;
	align-items: flex-start;
	background: #f8f8f8;
	padding: 2em;
	gap: 2em;
}

.col {
	display: flex;
	flex-direction: column;
	min-width: 7.5vw;
}

.colLabels h2 {
	opacity: 0;
}

.colLabels li {
	text-align: right;
	color: purple;
	font-weight: bold;
}

.col > h2 {
	margin-bottom: 1em;
	border-bottom: 1px solid #888;
	padding: 0.5em;
	text-align: center;
	white-space: nowrap;
	font-size: .8em;
	font-weight: bold;
}

.col.active {
	border: 2px solid purple;
	background: rgba(128, 0, 128, 0.1);
}

.row {
	display: block;
	transition: background 0.2s;
	margin-bottom: 0.8em;
	padding: 0.33em;
	text-align: center;
}

#container {
	display: flex;
	flex-wrap: wrap;
}

#roadmap {
	opacity: .8;
	width: 100%;
	text-align: right;
	font-size: .9em;
}

/* Viewer specific styles */
.container {
	display: flex;
	flex-wrap: wrap;
	margin-top: 80px;
}

.frame-container {
	display: flex;
	position: relative;
	flex: 1;
	flex-direction: column;
	border-right: 1px solid #ddd;
	min-width: 400px;
	height: calc(100vh - 80px);
}

.url-bar {
	display: flex;
	align-items: center;
	background: #f1f1f1;
	padding: 8px;
}

.url-input {
	flex: 1;
	margin-right: 5px;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 6px;
	font-size: 14px;
}

.url-go-button {
	border: none;
	border-radius: 4px;
	background: #4285f4;
	cursor: pointer;
	padding: 6px 12px;
	color: white;
	font-weight: bold;
}

.url-go-button:hover {
	background: #3367d6;
}

.frame {
	flex: 1;
	border: none;
}

.proxy-indicator {
	margin-left: 5px;
	color: #666;
	font-size: 12px;
}

.message-control {
	display: flex;
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 1000;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	background: #f1f1f1;
	padding: 10px;
}

.message-input {
	flex: 1;
	margin-right: 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 8px;
}

.send-button {
	border: none;
	border-radius: 4px;
	background: #4285f4;
	cursor: pointer;
	padding: 8px 15px;
	color: white;
}

.send-button:hover {
	background: #3367d6;
}

.floating-source-btn,
.floating-proxy-btn {
	position: absolute;
	right: 20px;
	bottom: 20px;
	z-index: 100;
	border: none;
	border-radius: 50%;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
	cursor: pointer;
	width: 60px;
	height: 60px;
	color: white;
	font-size: 12px;
}

.floating-source-btn {
	display: none;
	background: #4CAF50;
}

.floating-proxy-btn {
	background: #2196F3;
}

.floating-source-btn:hover {
	transform: scale(1.05);
	background: #45a049;
}

.floating-proxy-btn:hover {
	transform: scale(1.05);
	background: #0b7dda;
}

.external-link {
	margin-left: 5px;
	text-decoration: none;
	color: #666;
	font-size: 18px;
}

.external-link:hover {
	color: #333;
}

/* Index page specific styles */
body.index {
	margin: 0 auto;
	padding: 40px 20px;
	max-width: 800px;
}

.index h1 {
	margin-bottom: 1em;
	font-size: 2em;
}

.index h2 {
	margin: 1.5em 0 0.5em;
	font-size: 1.5em;
}

.index ul {
	margin: 1em 0;
	padding-left: 20px;
}

.index li {
	margin: 0.5em 0;
	line-height: 1.4;
}

.index code {
	border-radius: 4px;
	background: #f5f5f5;
	padding: 2px 6px;
	font-family: monospace;
}

.index a {
	text-decoration: none;
	color: #4285f4;
}

.index a:hover {
	text-decoration: underline;
}

/* Viewer page specific styles */
body.viewer {
	margin: 0;
	padding: 0;
	height: 100vh;
	overflow: hidden;
}

body.viewer .container {
	margin: 0;
	padding: 0;
	height: calc(100vh - 60px);
}

.frame-wrapper {
  position: relative;
  width: 100%;
  height: 33% !important;
  min-height: 300px;
}

.content-frame {
  width: 100%;
  height: 33%;
  min-height: 300px;
  border: 1px solid #ccc;
}

.frame-label {
  position: absolute;
  top: -20px;
  left: 0;
  padding: 2px 5px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-bottom: none;
  font-size: 12px;
}

/* Frame execution status and error styles */
.execution-status {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  font-weight: bold;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.frame-error {
  margin-top: 4px;
  padding: 4px 8px;
  background-color: rgba(244, 67, 54, 0.1);
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.3s ease;
}

.frame-label {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0f0f0;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  font-size: 12px;
  font-family: monospace;
}