/* ==========================================================================
   Clay — Design aligned with Claude Desktop
   ========================================================================== */

/* --- Pretendard Font --- */
@font-face {
  font-family: 'Pretendard';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Thin.woff2') format('woff2');
  font-weight: 100;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-ExtraLight.woff2') format('woff2');
  font-weight: 200;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Light.woff2') format('woff2');
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Black.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}

/* --- Twemoji COLR Font (cross-platform consistent emoji via font, no JS parsing) --- */
@font-face {
  font-family: 'Twemoji';
  src: url('https://cdn.jsdelivr.net/npm/twemoji-colr-font@15.0.3/twemoji.woff2') format('woff2');
  font-display: swap;
}

/* --- Reset & Variables --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--overlay-rgb),0.15) transparent;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--overlay-rgb),0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--overlay-rgb),0.25); }

/* --- Global Twemoji baseline --- */
img.emoji {
  height: 1.2em;
  width: 1.2em;
  vertical-align: -0.2em;
  margin: 0 1px;
  display: inline;
  pointer-events: none;
}

:root {
  --bg: #282a36;
  --bg-alt: #363447;
  --text: #f0f1f4;
  --text-secondary: #f8f8f2;
  --text-muted: #9ea8c7;
  --text-dimmer: #6272a4;
  --accent: #ffb86c;
  --accent-hover: #ffc17e;
  --accent-bg: rgba(255, 184, 108, 0.12);
  --code-bg: #22242e;
  --border: #44475a;
  --border-subtle: #333644;
  --input-bg: #3d3e51;
  --user-bubble: #404154;
  --error: #ff5555;
  --success: #50fa7b;
  --warning: #f1fa8c;
  --accent-8: rgba(255, 184, 108, 0.08);
  --accent-12: rgba(255, 184, 108, 0.12);
  --accent-15: rgba(255, 184, 108, 0.15);
  --accent-20: rgba(255, 184, 108, 0.20);
  --accent-25: rgba(255, 184, 108, 0.25);
  --accent-30: rgba(255, 184, 108, 0.30);
  --accent2: #80bfff;
  --accent2-hover: #8fc7ff;
  --accent2-bg: rgba(128, 191, 255, 0.12);
  --accent2-8: rgba(128, 191, 255, 0.08);
  --accent2-12: rgba(128, 191, 255, 0.12);
  --accent2-15: rgba(128, 191, 255, 0.15);
  --accent2-20: rgba(128, 191, 255, 0.20);
  --accent2-25: rgba(128, 191, 255, 0.25);
  --accent2-30: rgba(128, 191, 255, 0.30);
  --error-8: rgba(255, 85, 85, 0.08);
  --error-12: rgba(255, 85, 85, 0.12);
  --error-15: rgba(255, 85, 85, 0.15);
  --error-25: rgba(255, 85, 85, 0.25);
  --success-8: rgba(80, 250, 123, 0.08);
  --success-12: rgba(80, 250, 123, 0.12);
  --success-15: rgba(80, 250, 123, 0.15);
  --success-25: rgba(80, 250, 123, 0.25);
  --warning-bg: rgba(241, 250, 140, 0.12);
  --overlay-rgb: 255,255,255;
  --shadow-rgb: 0,0,0;
  --hl-comment: #6272a4;
  --hl-keyword: #ff79c6;
  --hl-string: #50fa7b;
  --hl-number: #ffb86c;
  --hl-function: #80bfff;
  --hl-variable: #ff5555;
  --hl-type: #f1fa8c;
  --hl-constant: #ffb86c;
  --hl-tag: #ff5555;
  --hl-attr: #80bfff;
  --hl-regexp: #8be9fd;
  --hl-meta: #bd93f9;
  --hl-builtin: #ffb86c;
  --hl-symbol: #bd93f9;
  --hl-addition: #50fa7b;
  --hl-deletion: #ff5555;
  --sidebar-bg: #242631;
  --sidebar-hover: #2f2f3f;
  --sidebar-active: #3d3e51;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --content-width: 760px;
}

/* PWA standalone: home indicator safe area still applies on notched devices */

::selection {
  background: rgba(80, 250, 123, 0.25);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Twemoji", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Lucide icons --- */
.lucide {
  vertical-align: middle;
  flex-shrink: 0;
}

.icon-spin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-spin .lucide {
  animation: spin 1s linear infinite;
}

.icon-spin-inline { animation: spin 1s linear infinite; }

/* --- Layout --- */
#layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  position: relative;
}

#layout-body {
  flex: 1;
  display: flex;
  min-height: 0;
  background: var(--sidebar-bg);
  position: relative;
}

#sidebar-column {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 0;
  overflow: hidden;
}

/* --- Main Area (sidebar + resize-handle + main-column) --- */
#main-area {
  flex: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
  background: var(--bg);
  border-top-left-radius: 8px;
  border-top: 1px solid var(--border-subtle);
  border-left: 1px solid var(--border-subtle);
}

/* --- Main Column --- */
#main-column {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* --- Main Panels (app + file-viewer + terminal side-by-side) --- */
#main-panels {
  flex: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  z-index: 400;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(var(--shadow-rgb), 0.3);
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.toast-warn {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--warning);
}

