* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

img,
video {
  max-width: 100%;
  height: auto;
}

input,
textarea,
select,
button {
  font-size: 16px;
}

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f4ef;
  --bg-sidebar: #f5f4ef;
  --text-primary: #1a1a1a;
  --text-secondary: #6b6b6b;
  --border: rgba(0, 0, 0, 0.08);
  --accent: #da7756;
  --btn-primary: #1a1a1a;
  --btn-text: #ffffff;
  --user-bubble: #efefec;
  --input-bg: #f5f4ef;
  --hover-bg: rgba(0, 0, 0, 0.04);
  --sidebar-active: #e8e6e0;
  --claude-orange: #da7756;
  --bg-main: #ffffff;
  --focus-ring: rgba(218, 119, 86, 0.45);
}

[data-theme="dark"] {
  --bg-primary: #1a1917;
  --bg-secondary: #211f1c;
  --bg-sidebar: #1a1917;
  --text-primary: #efefec;
  --text-secondary: #8a8a85;
  --border: rgba(255, 255, 255, 0.08);
  --btn-primary: #efefec;
  --btn-text: #1a1917;
  --user-bubble: #2a2825;
  --input-bg: #2a2825;
  --hover-bg: rgba(255, 255, 255, 0.04);
  --sidebar-active: #2f2d29;
  --bg-main: #1a1917;
}

html {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
}

body {
  background: var(--bg-primary);
  min-width: 0;
}

.tap-target {
  min-height: 44px;
}

.diamond-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--accent);
  transform: rotate(45deg);
  display: inline-block;
  flex: 0 0 auto;
}

.diamond-icon.large {
  width: 36px;
  height: 36px;
  border-radius: 7px;
}

.hidden {
  display: none !important;
}

button,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: none;
  background: transparent;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.app {
  display: flex;
  flex-direction: row;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  width: 100%;
}

.sidebar {
  display: none;
  width: 260px;
  min-width: 260px;
  height: 100dvh;
  max-height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: -280px;
  z-index: 1000;
  transition: left 0.25s ease;
  background: var(--bg-sidebar);
}

.sidebar.open {
  left: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.sidebar-backdrop.visible {
  display: block;
}

.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.chat-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  padding: 16px 12px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.input-shell {
  flex-shrink: 0;
  width: 100%;
  background: var(--bg-primary);
  border-top: 0.5px solid var(--border);
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

@media (min-width: 1024px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    position: relative;
    left: 0;
    width: 260px;
    min-width: 260px;
    transition: none;
  }

  .sidebar.open {
    position: relative;
    left: 0;
  }

  .main-panel {
    width: calc(100% - 260px);
    max-width: calc(100% - 260px);
  }

  .input-shell {
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .topbar {
    display: none;
  }
}
