/* Design tokens the Control UI's composer stylesheet expects (openclaw-composer.css), mapped onto
   the ClawChats theme. Shapes/spacing/animation are the Control UI's; colours are ClawChats'.
   Scoped to the input area so nothing else in the app is affected. */
.input-area,
.chat-question-summary,
.chat-selection-popup,
.chat-annotation-editor,
.chat-comment-preview,
.chat-comment-tooltip,
.cc-tip,
.chat-message-reactions,
.chat-reaction-picker,
.cc-hint,
.chat-comment-card,
.message-comments,
.project-sheet,
.chat-position-rail,
.side-panel__header,
.side-panel-popup,
.side-panel__empty-body,
.side-chat,
.chat-context-panel,
.team-bar,
.tag-bar,
.automations-view,
.sidebar-issues-panel,
.approvals-page,
.update-dialog,
.agent-create-modal,
.agents-settings,
.gw-updates,
.subagents-panel,
.processes-panel,
.dashboard-panel,
.session-progress-card--board {
  --text: var(--text-secondary);
  --text-strong: var(--text-primary);
  --muted: var(--text-muted);
  --bg: var(--bg-primary);
  --background: var(--bg-primary);
  --panel: var(--bg-primary);
  --panel-strong: var(--bg-tertiary);
  --card: color-mix(in srgb, var(--popover) 93%, #000);
  /* Elevation follows the Control UI's relationships, not its hues: a popover is the same surface as the
     composer it opens from, panels inside it are a hair darker, hairlines a hair lighter. */
  --popover: var(--input-bg);
  --popover-foreground: var(--text-primary);
  --bg-elevated: var(--input-bg);
  --bg-hover: rgba(255, 255, 255, 0.07);
  --panel-hover: var(--bg-hover);
  --secondary: var(--card);
  --card-highlight: rgba(255, 255, 255, 0.04);
  --danger-subtle: color-mix(in srgb, var(--danger) 8%, transparent);
  --select-chevron: linear-gradient(45deg, transparent 40%, var(--muted) 40% 60%, transparent 60%), linear-gradient(-45deg, transparent 40%, var(--muted) 40% 60%, transparent 60%);
  --border: color-mix(in srgb, var(--popover) 88%, var(--text-primary));
  --border-strong: color-mix(in srgb, var(--popover) 76%, var(--text-primary));
  --input: color-mix(in srgb, var(--popover) 94%, var(--text-primary));
  --accent: var(--accent-color);
  --accent-2: var(--accent-color);
  --accent-subtle: color-mix(in srgb, var(--accent-color) 12%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent-color) 25%, transparent);
  --primary: var(--accent-color);
  --primary-hover: var(--accent-hover);
  --primary-foreground: #fff;
  --ring: var(--accent-color);
  --media-bg: #000;
  --focus-ring: 0 0 0 2px var(--bg-primary), 0 0 0 3px color-mix(in srgb, var(--accent-color) 80%, transparent);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --overlay-border: color-mix(in srgb, var(--border-strong) 64%, transparent);
  --overlay-shadow: 0 1px 2px rgb(0 0 0 / 0.18), 0 8px 24px rgb(0 0 0 / 0.24);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --reasoning-fill: var(--accent-color);
  --brand-codex: #10a37f;
  --brand-claude: #d97757;
  --brand-google: #4285f4;
  /* Full Access is the Control UI's one danger-coloured mode (its --accent is red there). */
  --full-access: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --space-2: 8px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --duration-fast: 100ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --wa-transition-fast: 75ms;
  --cursor-action: default;
  /* Corner scale and shape are the Control UI's progressive enhancement (base.css @supports block): the
     larger radii only apply together with superellipse corners, so they are set together below. */
  --openclaw-corner-radius-scale: 1;
  --control-ui-text-scale: 1;
  --control-ui-text-xs: 11px;
  --control-ui-text-sm: 12px;
  --control-ui-text-md: 14px;
  --menu-radius: var(--radius-md);
  --menu-item-radius: var(--radius-sm);
  --menu-padding: 4px;
  --menu-selected: color-mix(in srgb, var(--text-secondary) 8%, transparent);
  --shell-popup-inline-gutter: 12px;

  --chat-composer-corner-shape: round;
  --chat-composer-popover-max-height: 70vh;
  --chat-composer-side-inset: 0px;
  --chat-mobile-edge-inset: var(--space-4);
  --chat-thread-gutter: 18px;
  --chat-thread-max-width: 48rem;
  --chat-thread-side-inset: clamp(6px, 1vw, 12px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
}

[data-theme="light"] .input-area,
[data-theme="light"] .chat-question-summary,
[data-theme="light"] .chat-selection-popup,
[data-theme="light"] .chat-annotation-editor,
[data-theme="light"] .chat-comment-preview,
[data-theme="light"] .chat-comment-tooltip,
[data-theme="light"] .cc-tip,
[data-theme="light"] .chat-message-reactions,
[data-theme="light"] .chat-reaction-picker,
[data-theme="light"] .cc-hint,
[data-theme="light"] .chat-comment-card,
[data-theme="light"] .message-comments,
[data-theme="light"] .project-sheet,
[data-theme="light"] .chat-context-panel,
[data-theme="light"] .team-bar,
[data-theme="light"] .tag-bar,
[data-theme="light"] .automations-view,
[data-theme="light"] .sidebar-issues-panel,
[data-theme="light"] .approvals-page,
[data-theme="light"] .update-dialog,
[data-theme="light"] .agent-create-modal,
[data-theme="light"] .agents-settings,
[data-theme="light"] .gw-updates,
[data-theme="light"] .subagents-panel,
[data-theme="light"] .processes-panel,
[data-theme="light"] .dashboard-panel,
[data-theme="light"] .session-progress-card--board {
  --bg-hover: rgba(60, 42, 24, 0.06);
  --card-highlight: rgba(60, 42, 24, 0.03);
  --full-access: #dc2626;
  --overlay-border: color-mix(in srgb, var(--border-strong) 64%, transparent);
  --overlay-shadow: 0 1px 2px rgb(60 42 24 / 0.06), 0 8px 24px rgb(60 42 24 / 0.1);
}

/* Light: the Control UI's --accent is an ink dark enough for text in light themes (#bd4531, used as text and fill alike);
   ClawChats' green is not (2.3-3:1 as text). The ported rules colour text with --accent, so in light it's the darker
   accent ink (style.css --accent-text, 5:1+); fills that need the bright green use --accent-color/--primary. */
[data-theme="light"] :is(.input-area, .chat-question-summary, .chat-selection-popup, .chat-annotation-editor, .chat-comment-preview, .chat-comment-tooltip, .cc-tip, .chat-message-reactions, .chat-reaction-picker, .cc-hint, .chat-comment-card, .message-comments, .project-sheet, .chat-position-rail, .side-panel__header, .side-panel-popup, .side-panel__empty-body, .side-chat, .chat-context-panel, .team-bar, .tag-bar, .automations-view, .sidebar-issues-panel, .approvals-page, .update-dialog, .agent-create-modal, .agents-settings, .gw-updates, .subagents-panel, .processes-panel, .dashboard-panel, .session-progress-card--board) {
  --accent: var(--accent-text);
}

/* Status colours, also for the sidebar's session-attention styles (style.css, ported from the Control UI's
   layout.css). Only these and --text reach .sidebar and .project-rail; the rest of this file stays scoped to the input area. */
.input-area,
.chat-question-summary,
.side-chat,
.chat-context-panel,
.sidebar,
.project-rail,
.project-sheet,
.automations-view,
.sidebar-issues-panel,
.approvals-page,
.update-dialog,
.agent-create-modal,
.agents-settings,
.gw-updates,
.subagents-panel,
.processes-panel,
.chat-subagent-wait,
.dashboard-panel,
.session-progress-card--board {
  --text: var(--text-secondary);
  --danger: #ef4444;
  --warn: #f59e0b;
  --ok: #22c55e;
  --info: #60a5fa;
}

[data-theme="light"] .input-area,
[data-theme="light"] .chat-question-summary,
[data-theme="light"] .side-chat,
[data-theme="light"] .chat-context-panel,
[data-theme="light"] .sidebar,
[data-theme="light"] .project-rail,
[data-theme="light"] .project-sheet,
[data-theme="light"] .automations-view,
[data-theme="light"] .sidebar-issues-panel,
[data-theme="light"] .approvals-page,
[data-theme="light"] .update-dialog,
[data-theme="light"] .agent-create-modal,
[data-theme="light"] .agents-settings,
[data-theme="light"] .gw-updates,
[data-theme="light"] .subagents-panel,
[data-theme="light"] .processes-panel,
[data-theme="light"] .dashboard-panel,
[data-theme="light"] .session-progress-card--board {
  --danger: #b91c1c;
  --warn: #92400e;
  --ok: #166534;
  --info: #1d4ed8;
}

/* The Control UI's corner enhancement (base.css): wider radii go together with superellipse corners, and
   only where the engine supports them. */
@supports (corner-shape: superellipse(1.5)) {
  .input-area,
  .chat-question-summary,
  .chat-selection-popup,
  .chat-annotation-editor,
  .chat-comment-preview,
  .chat-comment-tooltip,
  .chat-comment-card,
  .message-comments,
  .project-sheet {
    --openclaw-corner-radius-scale: 1.25;
    --chat-composer-corner-shape: superellipse(1.5);
  }
}
