:root {
	--bg: #121212;
	--key-bg: #ffffff0a;
	
	/* Color Palette */
	--aqua: #73fff1;
	--azure: #67ABCD;
	--orange: #fbb842;
	--forest: #24c339;
	--salmon: #ff9e9e;
	--purple: #9d67cd;
	--delete: #E87979;
	--transparent: #0000;
}

/* ==================== GLOBAL RESET ==================== */
* {
	outline: none;
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
}

body {
	margin: 0;
	color: #eee;
	display: flex;
	height: 100dvh;
	overflow: hidden;
	user-select: none;
	background: var(--bg);
	flex-direction: column;
	-webkit-user-select: none;
	font-family: system-ui, -apple-system, sans-serif;
}

body *::-webkit-scrollbar {
	display: none;
}

/* ==================== NOTEPAD ==================== */
#notepad {
	flex-grow: 1;
	outline: none;
	color: #CDCDCD;
	line-height: 1.5;
	overflow-y: auto;
	font-size: 4.0625vw;
	white-space: pre-wrap;
	padding: 3.125vw 4.6875vw 0;
	-webkit-mask-image: linear-gradient(180deg, black 85%, transparent);
}

/* ==================== FOOT TOOLS CONTAINER ==================== */
.-foot-tools {
	display: flex;
	flex-flow: column;
	height: fit-content;
	bottom: 0;
	background: inherit;
	z-index: 10;
	width: 100%;
	position: relative;
}

/* ==================== FOOT TOOLBAR ==================== */
.-foot-toolbar {
	background: inherit;
	bottom: 0vw;
	position: relative;
	width: auto;
	display: flex;
	scroll-behavior: smooth;
	overflow: auto hidden;
	scroll-snap-type: x mandatory;
	height: fit-content;
	margin: 3.125vw 0;
}

.-foot-toolbar-back,
.-foot-toolbar-next {
	display: flex;
	min-width: 25vw;
	position: relative;
	height: -webkit-fill-available;
}

.-foot-toolbar-back {
	padding: 0vw 0vw 0vw 6.25vw;
}

.-foot-toolbar-next {
	padding: 0vw 6.25vw 0vw 0vw;
}

.-foot-toolbar-tool {
	scroll-snap-align: center;
	padding: 0vw 3.125vw;
	position: relative;
	height: 100%;
	min-width: 100%;
	display: flex;
}

/* Toolbar Find Container */
.-foot-toolbar-find {
	position: relative;
	margin: auto;
	border: 0.9375vw solid transparent;
	color: rgb(255, 255, 255);
	text-align: center;
	display: flex;
	border-radius: 6.25vw;
	height: 12.5vw;
	width: 100%;
	font-size: 3.4375vw;
	letter-spacing: 0.09375vw;
	background: #0000002b;
}

/* Toolbar Menu Button */
.-foot-toolbar-menu {
	background: rgba(255, 255, 255, 0.04);
	border-radius: 50%;
	min-height: 8.75vw;
	border: 0.9375vw solid transparent;
	margin: 0vw 0.9375vw 0vw 0vw;
	position: relative;
	height: 100%;
	display: flex;
	min-width: 10.625vw;
	align-items: center;
	justify-content: center;
	color: var(--azure);
	transition: all 0.2s;
}

.-foot-toolbar-menu:active {
	background: rgba(255, 255, 255, 0.12);
	transform: scale(0.95);
}

/* Toolbar Lens (Search Container) */
.-foot-toolbar-lens {
	transition: width 0.3s;
	background: rgba(255, 255, 255, 0.04);
	width: 100%;
	height: 100%;
	position: relative;
	display: flex;
	min-width: 10.625vw;
	border-radius: inherit;
	z-index: 1;
}

/* Toolbar Search Input */
.-foot-toolbar-search {
	z-index: 2;
	display: flex;
	font-size: 3.75vw;
	color: rgb(221, 194, 114);
	padding: 0vw 10.9375vw 0vw 4.6875vw;
	transition: width 0.3s, opacity 0.3s;
	background: unset;
	border: none;
	height: 100%;
	width: 100%;
	position: absolute;
	left: 0;
	top: 0;
}

.-foot-toolbar-search::placeholder {
	/* color: rgba(221, 194, 114, 0.4); */
	color: #CDCDCD;
}

/* Toolbar Cutout (Highlight Effect) */
.-foot-toolbar-cutout {
	opacity: 0;
	z-index: 0;
	margin: 0.9375vw;
	position: absolute;
	line-height: 8.75vw;
	border-radius: inherit;
	background-color: #141414;
	height: calc(100% - 1.875vw);
	width: calc(100% - 10.9375vw);
	transition: z-index 0.3s, opacity 0.3s;
}

.-foot-toolbar-cutout-text {
	color: transparent;
	white-space: pre;
	font-weight: bold;
	font-size: 3.75vw;
	text-overflow: ellipsis;
	letter-spacing: -0.15625vw;
	-webkit-background-clip: text;
	background-image: linear-gradient(45deg, #0089ff, #00ffa1);
}

/* Toolbar Guess (Word Suggestions) */
.-foot-toolbar-guess {
	color: rgb(183, 255, 99);
	height: 100%;
	line-height: 10.625vw;
	position: absolute;
	width: 100%;
	padding: 0vw 10.9375vw 0vw 3.125vw;
	display: flex;
	align-items: center;
	justify-content: space-evenly;
	gap: 1vw;
}

.guess-word {
	flex: 1;
	text-align: center;
	font-size: 3.75vw;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	cursor: pointer;
	transition: all 0.2s;
	animation: wobble 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.guess-word:active {
	transform: scale(1.1);
	color: var(--aqua);
}

.guess-separator {
	width: 1px;
	height: 60%;
	background: rgba(183, 255, 99, 0.3);
}

@keyframes wobble {
	0%, 100% { transform: translateX(0) scale(1); }
	25% { transform: translateX(-3px) scale(1.05); }
	75% { transform: translateX(3px) scale(1.05); }
}

/* Toolbar More Button */
.-foot-toolbar-more {
	z-index: 2;
	position: absolute;
	min-width: 8.75vw;
	display: flex;
	border: 1.25vw solid transparent;
	height: 8.75vw;
	background: #0000002b;
	border-radius: 50%;
	right: 0vw;
	min-height: 8.75vw;
	margin: 0.9375vw;
	align-items: center;
	justify-content: center;
	color: var(--azure);
	transition: all 0.2s;
}

.-foot-toolbar-more:active {
	background: rgba(255, 255, 255, 0.12);
	transform: scale(0.95);
}

/* Toolbar Plus & Go Buttons */
.-foot-toolbar-plus,
.-foot-toolbar-go {
	margin: auto;
	border-radius: 50%;
	position: relative;
	min-width: 12.5vw;
	display: flex;
	height: 12.5vw;
	border: 1.25vw solid transparent;
	background: #0e7f18;
	align-items: center;
	justify-content: center;
	color: #fff;
	transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.-foot-toolbar-plus {
	background: unset;
}

.-foot-toolbar-go {
	height: 10vw;
	min-width: 10vw;
}

.-foot-toolbar-plus:active,
.-foot-toolbar-go:active {
	background: rgba(255, 255, 255, 0.12);
	transform: scale(0.9);
}

/* Close state for plus button */
.-foot-toolbar-plus.close-state {
	color: var(--delete);
}

/* ==================== KEYBOARD AREA ==================== */
.keyboard-area {
	position: relative;
	touch-action: none;
	flex-shrink: 0;
	/* margin: 0 0 6.25vw; */
	margin: 0 0 1.875vw;
}

#glide-canvas {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 150;
}

.keys-wrapper {
	/* gap: 2.5vw; */
	gap: 2.1875vw;
	display: flex;
	flex-flow: column;
	position: relative;
}

/* ==================== KEYBOARD ROWS ==================== */
.row {
	display: flex;
	justify-content: center;
	width: -webkit-fill-available;
	gap: 1.25vw;
}

/* ==================== KEYS ==================== */
.key {
	color: #fff;
	display: flex;
	/* height: 10.9375vw; */
	height: 11.25vw;
	width: 8.565625vw;
	position: relative;
	font-size: 4.6875vw;
	align-items: center;
	min-width: 8.565625vw;
	line-height: 10.9375vw;
	border-radius: 1.875vw;
	justify-content: center;
	background: var(--key-bg);
	box-shadow: 0.5px 0.5px 2.5px #00000026, inset 0px 0px 5px #ffffff14;
	transition: transform 0.1s, background-color 0.15s, color 0.15s, opacity 0.2s;
}

.key-circular {
	border-radius: 50%;
	height: 8.565625vw;
}

.-adjust-key {
	min-width: 12.734375vw;
	background: var(--transparent);
	box-shadow: none;
	width: 100%;
}

.-tall-key {
	min-height: 11.875vw;
}

.key-space {
	width: 100%;
	min-width: 28.196875vw;
}

.key.active {
	background: rgba(255, 255, 255, 0.2);
	transform: scale(0.95);
}

.key-content {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Key States */
.dimmed {
	opacity: 0.3;
}

.key-number {
	color: var(--forest);
	font-family: monospace;
	font-weight: bold;
	background: unset;
	box-shadow: none;
}

.key-number.supersa-mode {
	font-size: 14px !important;
}

.key-number.supersa-mode .key-content {
	color: var(--salmon);
}

/* ==================== COLOR CLASSES ==================== */
.color-azure { color: var(--azure); }
.color-orange { color: var(--orange); }
.color-forest { color: var(--forest); }
.color-salmon { color: var(--salmon); }
.color-purple { color: var(--purple); }
.color-aqua { color: var(--aqua); }
.color-delete { color: var(--delete); }
.color-white { color: #fff; }

.no-bg {
	background: var(--transparent);
	box-shadow: none;
}

.glow-orange {
	text-shadow: 0 0 8px var(--orange), 0 0 12px var(--orange);
}

.glow-purple {
	text-shadow: 0 0 8px var(--purple), 0 0 12px var(--purple);
}

/* ==================== MATERIAL ICONS ==================== */
.material-symbols-outlined {
	font-size: 22px;
	pointer-events: none;
}

/* ==================== PUSH SLIDER ==================== */
.-push-hold {
	/* display: flex; */
	width: 100%;
	min-height: 4.6875vw;
	padding: 0 3.125vw;
	background: inherit;
	z-index: 10;
	position: fixed;
	bottom: 0;
	display: none;
}

.-push-hues {
	width: 93.75vw;
	display: flex;
	background: rgba(0, 0, 0, 0.17);
	height: 0.9375vw;
	position: relative;
	margin: auto;
	border-radius: 0.46875vw;
	overflow: hidden;
}

.-push-hues::after {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: var(--slider-value, 0%);
	background: linear-gradient(90deg, transparent, var(--aqua));
	transition: width 0.1s ease-out;
	border-radius: inherit;
}

.-push-slide {
	user-select: text;
	z-index: 1;
	display: block;
	width: calc(100% - 6.25vw);
	margin: 0vw 3.125vw;
	-webkit-appearance: none;
	background: unset;
	position: absolute;
	border: none;
	top: 0;
	left: 0;
	cursor: pointer;
}

.-push-slide::-webkit-slider-thumb {
	width: 5vw;
	height: 5vw;
	cursor: pointer;
	appearance: none;
	border-radius: 50%;
	background: var(--aqua);
	-webkit-appearance: none;
	border: 0.9375vw solid var(--bg);
	/* box-shadow: 0 0 10px var(--aqua), 0 0 20px rgba(115, 255, 241, 0.5); */
	transition: transform 0.1s;
}

.-push-slide::-webkit-slider-thumb:active {
	transform: scale(1.2);
}

.-push-slide::-moz-range-thumb {
	width: 5vw;
	height: 5vw;
	border-radius: 50%;
	background: var(--aqua);
	cursor: pointer;
	/* box-shadow: 0 0 10px var(--aqua), 0 0 20px rgba(115, 255, 241, 0.5); */
	border: none;
	transition: transform 0.1s;
}

.-push-slide::-moz-range-thumb:active {
	transform: scale(1.2);
}

/* ==================== MODAL SYSTEM ==================== */
.modal-overlay {
	height: 0;
	bottom: 0;
	z-index: 3;
	width: 100%;
	overflow: hidden;
	position: absolute;
	background: #1d1e23;
	transition: height 0.3s ease-in-out;
}

.modal-overlay.active {
	height: 100%;
}

.modal-container {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.modal-content {
	flex: 1;
	overflow-y: auto;
	padding: 0;
}

/* ==================== MODAL COMPONENTS ==================== */

/* Color Picker */
.color-picker-container {
	display: flex;
	flex-direction: column;
	gap: 5vw;
	padding: 4vw;
}

.color-preview {
	height: 20vw;
	border-radius: 3vw;
	border: 2px solid #ffffff20;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	color: #000;
	font-weight: 600;
}

.hex-input-section {
	display: flex;
	flex-direction: column;
	gap: 3vw;
}

.hex-display {
	background: #ffffff0a;
	border: 1px solid #ffffff20;
	border-radius: 2vw;
	padding: 3vw;
	text-align: center;
	font-size: 20px;
	font-family: monospace;
	color: var(--aqua);
	letter-spacing: 2px;
}

.hex-keypad {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 2vw;
}

.hex-key {
	background: #ffffff08;
	border-radius: 2vw;
	height: 15vw;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 600;
	color: var(--forest);
	font-family: monospace;
	cursor: pointer;
	transition: all 0.15s;
}

.hex-key:active {
	background: var(--forest);
	color: #000;
	transform: scale(0.95);
}

.hex-key.special {
	color: var(--orange);
}

.alpha-section {
	display: flex;
	flex-direction: column;
	gap: 2vw;
}

.alpha-label {
	display: flex;
	justify-content: space-between;
	color: #fff;
	font-size: 14px;
}

.alpha-value {
	color: var(--aqua);
	font-weight: 600;
}

.alpha-slider {
	-webkit-appearance: none;
	width: 100%;
	height: 8px;
	border-radius: 5px;
	background: linear-gradient(to right, transparent 0%, rgba(255,255,255,0.2) 25%, rgba(255,255,255,0.5) 50%, rgba(255,255,255,0.8) 75%, #fff 100%);
	outline: none;
	border: 1px solid #ffffff20;
}

.alpha-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 25px;
	height: 25px;
	border-radius: 50%;
	background: var(--aqua);
	cursor: pointer;
	box-shadow: 0 0 10px var(--aqua);
}

.alpha-slider::-moz-range-thumb {
	width: 25px;
	height: 25px;
	border-radius: 50%;
	background: var(--aqua);
	cursor: pointer;
	box-shadow: 0 0 10px var(--aqua);
	border: none;
}

.color-mode-toggle {
	display: flex;
	gap: 2vw;
}

.color-mode-btn {
	flex: 1;
	padding: 3vw;
	background: #ffffff08;
	border: 2px solid transparent;
	border-radius: 2vw;
	color: #fff;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 2vw;
	cursor: pointer;
	transition: all 0.2s;
}

.color-mode-btn.active {
	border-color: var(--purple);
	background: rgba(157, 103, 205, 0.15);
	box-shadow: 0 0 15px rgba(157, 103, 205, 0.3);
}

/* Font Selector */
.font-item {
	background: #ffffff08;
	border: 2px solid transparent;
	border-radius: 0;
	border-bottom: 1px solid #ffffff10;
	padding: 4vw;
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	gap: 3vw;
}

.font-item:active {
	background: #9d67cd20;
}

.font-item-icon {
	font-size: 20px;
	color: var(--purple);
	flex-shrink: 0;
	transition: transform 0.3s;
}

.font-item.expanded .font-item-icon {
	transform: rotate(90deg);
}

.font-item-content {
	flex: 1;
}

.font-item-name {
	font-size: 14px;
	color: #fff;
	margin-bottom: 0;
}

.font-item-preview {
	font-size: 16px;
	color: #aaa;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
	margin-top: 0;
}

.font-item.expanded .font-item-preview {
	max-height: 100px;
	opacity: 1;
	margin-top: 2vw;
}

.font-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	max-height: 100%;
	overflow-y: auto;
}

/* Voice Input */
.voice-input-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6vw;
	min-height: 100%;
}

.voice-animation {
	width: 31.25vw;
	height: 31.25vw;
	border-radius: 50%;
	background: radial-gradient(circle, var(--azure) 0%, transparent 70%);
	display: flex;
	align-items: center;
	justify-content: center;
	animation: pulse 2s infinite;
	position: relative;
	line-height: 31.25vw;
}

@keyframes pulse {
	0%, 100% { 
		transform: scale(1); 
		opacity: 0.6;
		box-shadow: 0 0 0 0 rgba(103, 171, 205, 0.7);
	}
	50% { 
		transform: scale(1.15); 
		opacity: 1;
		box-shadow: 0 0 0 20px rgba(103, 171, 205, 0);
	}
}

.voice-cta {
	background: #00000042;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 2vw;
	position: absolute;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	text-align: center;
	line-height: inherit;
}

.voice-icon {
	font-size: 12.5vw;
	color: #fff;
	width: 100%;
	height: 100%;
	line-height: inherit;
}

.voice-status {
	color: #aaa;
	font-size: 14px;
	height: 12.5vw;
	line-height: 12.5vw;
}

/* Table Builder */
.table-builder-container {
	display: flex;
	flex-direction: column;
	gap: 5vw;
	padding: 4vw;
}

.table-dimension {
	display: flex;
	flex-direction: column;
	gap: 2vw;
}

.table-label {
	color: #fff;
	font-size: 14px;
	font-weight: 600;
}

.table-numpad {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 2vw;
}

.table-num-btn {
	background: #ffffff08;
	border-radius: 2vw;
	height: 15vw;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 600;
	color: var(--aqua);
	cursor: pointer;
	transition: all 0.15s;
}

.table-num-btn:active {
	background: var(--aqua);
	color: #000;
	transform: scale(0.95);
}

.table-preview {
	background: #ffffff05;
	border-radius: 2vw;
	padding: 4vw;
	color: #fff;
	text-align: center;
}

.table-insert-btn {
	padding: 4vw;
	background: var(--forest);
	color: #000;
	border: none;
	border-radius: 2vw;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}

/* Coming Soon */
.coming-soon-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4vw;
	min-height: 40vh;
}

.coming-soon-icon {
	font-size: 64px !important;
	color: var(--purple);
	opacity: 0.5;
}

.coming-soon-text {
	font-size: 18px;
	color: #aaa;
}

/* Inserted Table Styling */
.inserted-table {
	border-collapse: collapse;
	width: 100%;
	margin: 16px 0;
}

.inserted-table td {
	border: 1px solid #ffffff20;
	padding: 8px;
	background: #ffffff05;
	color: #fff;
	min-width: 60px;
	min-height: 40px;
}

.inserted-table td:focus {
	outline: 2px solid var(--azure);
	outline-offset: -2px;
	background: #ffffff0a;
}

/* Annotation */
.annotation-indicator {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	background: var(--purple);
	border-radius: 50%;
	color: #fff;
	font-size: 12px;
	margin-left: 4px;
	cursor: pointer;
	vertical-align: middle;
}

.annotation-card {
	position: absolute;
	background: #2a2b30;
	border: 1px solid #ffffff20;
	border-radius: 12px;
	padding: 16px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.4);
	max-width: 300px;
	z-index: 250;
}

.annotation-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}

.annotation-card-close {
	cursor: pointer;
	color: #aaa;
}

.annotation-card-content {
	color: #fff;
	font-size: 14px;
	line-height: 1.5;
}

/* URL Input */
.url-input-bar {
	width: 100%;
	background: #ffffff0a;
	border: 2px solid var(--azure);
	border-radius: 2vw;
	padding: 3vw;
	color: #fff;
	font-size: 14px;
	outline: none;
	font-family: inherit;
}

.url-input-bar::placeholder {
	color: #ffffff40;
}

/* Emoji Grid */
#emoji-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, 10vw);
	gap: 2vw;
	padding: 2vw;
	overflow-y: auto;
	max-height: 100%;
}

.emoji-item {
	font-size: 7vw;
	text-align: center;
	cursor: pointer;
	user-select: none;
}

.emoji-item:active {
	transform: scale(1.3);
}