body {
  --gc-font-11: 10px;
  --gc-font-12: 11px;
  --gc-font-13: 12px;
  --gc-font-14: 13px;
  --gc-font-16: 15px;
}

body[data-font-scale="medium"] {
  --gc-font-11: 11px;
  --gc-font-12: 12px;
  --gc-font-13: 13px;
  --gc-font-14: 14px;
  --gc-font-16: 16px;
}

body[data-font-scale="large"] {
  --gc-font-11: 12px;
  --gc-font-12: 13px;
  --gc-font-13: 14px;
  --gc-font-14: 15px;
  --gc-font-16: 17px;
}

body {
  margin: 0;
  background: #f8fbff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  height: 100vh;
  overflow: hidden;
}

* {
  box-sizing: border-box;
}

.panel {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.panel-header {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, #eef4ff 0%, #f8fbff 100%);
  flex: 0 0 auto;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-toolbar-spacer {
  flex: 1 1 auto;
}

.panel-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-title {
  margin: 0;
  font-size: var(--gc-font-16);
  font-weight: 700;
}

.panel-icon-button,
.panel-tab-button {
  appearance: none;
  border: 1px solid #d6e0f0;
  background: #fff;
  color: #1e3a8a;
  border-radius: 6px;
  padding: 6px 9px;
  font-size: var(--gc-font-12);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.panel-settings {
  margin-top: 8px;
  padding: 10px;
  background: #eef4ff;
  border: 1px solid #dbe3f0;
  border-radius: 6px;
}

.panel-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.panel-tabs {
  display: flex;
  gap: 6px;
}

.panel-tab-button {
  color: #475569;
  padding: 5px 10px;
}

.panel-tab-button.is-active {
  background: #2f55d4;
  border-color: #2f55d4;
  color: #fff;
}

.panel-settings-section + .panel-settings-section {
  margin-top: 10px;
}

.panel-about-card {
  padding: 14px;
  border: 1px solid #d6e0f0;
  border-radius: 8px;
  background:
    radial-gradient(circle at top right, rgba(47, 85, 212, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 251, 255, 0.92) 100%);
}

.panel-about-eyebrow {
  margin: 0 0 6px;
  font-size: var(--gc-font-11);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #2f55d4;
}

.panel-about-title {
  margin: 0;
  font-size: var(--gc-font-16);
  line-height: 1.45;
  color: #172033;
}

.panel-about-text {
  margin: 10px 0 0;
  font-size: var(--gc-font-12);
  line-height: 1.65;
  color: #536076;
}

.panel-about-contact {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #d6e0f0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.panel-about-qr {
  width: 156px;
  height: 156px;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  border: 1px solid #dbe3f0;
  background: #fff;
  flex: 0 0 auto;
  padding: 6px;
}

.panel-about-contact-copy {
  min-width: 0;
}

.panel-about-contact-title {
  margin: 0;
  font-size: var(--gc-font-12);
  font-weight: 700;
  color: #172033;
}

.panel-about-contact-text,
.panel-about-contact-handle {
  margin: 6px 0 0;
  font-size: var(--gc-font-12);
  line-height: 1.6;
  color: #536076;
}

.panel-about-contact-handle {
  color: #334155;
}

.panel-about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.panel-label {
  display: block;
  margin: 0 0 8px;
  font-size: var(--gc-font-12);
  font-weight: 700;
  color: #334155;
}

.panel-label-inline {
  margin: 0;
}

.panel-help {
  margin: 8px 0 12px;
  font-size: var(--gc-font-12);
  line-height: 1.5;
  color: #64748b;
}

.panel-link {
  color: #2f55d4;
  text-decoration: none;
  font-weight: 700;
}

.panel-link:hover {
  text-decoration: underline;
}

.panel-textarea,
.panel-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  padding: 10px 11px;
  font-size: var(--gc-font-13);
  line-height: 1.45;
  color: #0f172a;
}

.panel-textarea {
  min-height: 92px;
  resize: vertical;
}

.panel-textarea-small {
  min-height: 120px;
}

.panel-button {
  appearance: none;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: var(--gc-font-13);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.panel-button.primary {
  background: #2f55d4;
  color: #fff;
}

.panel-button.primary.is-stop {
  background: #dc2626;
}

.panel-button.secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.panel-button-small {
  padding: 6px 9px;
  font-size: var(--gc-font-12);
}

.panel-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.panel-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: var(--gc-font-13);
  color: #334155;
}

.panel-checkbox input {
  margin: 0;
}

.panel-checkbox-inline {
  margin-top: 12px;
}

.panel-checkbox-compact {
  gap: 5px;
  margin-top: 0;
  font-size: var(--gc-font-12);
  color: #475569;
}

.panel-checkbox-compact span {
  line-height: 1.3;
}

.panel-storage-card {
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid #d6e0f0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
}

.panel-storage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.panel-storage-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.panel-storage-summary {
  margin-top: 8px;
  font-size: var(--gc-font-12);
  line-height: 1.5;
  color: #64748b;
}

.panel-storage-breakdown {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-storage-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(214, 224, 240, 0.8);
}

.panel-storage-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.panel-storage-item-name {
  font-size: var(--gc-font-12);
  font-weight: 700;
  color: #172033;
}

.panel-storage-item-desc {
  margin-top: 2px;
  font-size: var(--gc-font-11);
  line-height: 1.45;
  color: #64748b;
}

.panel-storage-item-size {
  flex: 0 0 auto;
  font-size: var(--gc-font-12);
  font-weight: 700;
  color: #334155;
}

.panel-messages-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.panel-messages {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-empty {
  border: 1px dashed #d6e0f0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  padding: 18px;
}

.panel-empty-title {
  margin: 0 0 8px;
  font-size: var(--gc-font-14);
  font-weight: 700;
}

.panel-empty-text {
  margin: 0;
  font-size: var(--gc-font-12);
  line-height: 1.6;
  color: #536076;
}

.panel-empty-text + .panel-empty-text {
  margin-top: 10px;
}

.panel-empty-greeting {
  color: #334155;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.message.user {
  align-items: flex-end;
}

.message.assistant {
  align-items: flex-start;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: var(--gc-font-11);
  color: #64748b;
}

.message-meta-text {
  min-width: 0;
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  width: 100%;
}

.message.assistant .message-actions {
  justify-content: flex-end;
}

.message-runtime-meta {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--gc-font-11);
  line-height: 1.3;
  color: #64748b;
}

.message-copy-button {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: #fff;
  color: #0f172a;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
  flex: 0 0 auto;
}

.message-copy-button:hover {
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.32);
  background: #f8fafc;
}

.message-streaming {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  font-size: var(--gc-font-11);
  color: #64748b;
}

.message-bubble {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: 6px;
  border: 1px solid #dbe3f0;
  padding: 10px 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.message.user .message-bubble {
  background: #2f55d4;
  color: #fff;
  border-color: #2f55d4;
}

.message.user .message-bubble code {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.message-text {
  font-size: var(--gc-font-13);
  line-height: 1.62;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message-text > :first-child {
  margin-top: 0;
}

.message-text > :last-child {
  margin-bottom: 0;
}

.message-text p {
  margin: 0 0 6px;
}

.message-text h1,
.message-text h2,
.message-text h3 {
  margin: 0 0 6px;
  line-height: 1.35;
  font-size: var(--gc-font-14);
}

.message-text ul {
  margin: 0 0 6px;
  padding-left: 18px;
}

.message-text li {
  margin: 0 0 4px;
}

.message-text code {
  display: inline;
  padding: 1px 5px;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--gc-font-12);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message-details {
  margin-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  padding-top: 8px;
}

.message.user .message-details {
  border-top-color: rgba(255, 255, 255, 0.22);
}

.message-details summary {
  cursor: pointer;
  font-size: var(--gc-font-12);
  font-weight: 700;
}

.message-details-body {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-detail-note {
  font-size: var(--gc-font-12);
  color: #64748b;
}

.message-screenshot {
  display: block;
  width: 100%;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.26);
}

.message-context {
  margin: 0;
  white-space: pre-wrap;
  font-size: var(--gc-font-12);
  line-height: 1.5;
  padding: 10px;
  border-radius: 6px;
  background: rgba(248, 250, 252, 0.92);
  color: #334155;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.panel-composer {
  flex: 0 0 auto;
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98) 0%, #f8fbff 100%);
}

.panel-context-summary-hidden,
.panel-status-hidden {
  display: none;
}

#context-summary,
#status {
  margin-bottom: 6px;
  font-size: var(--gc-font-12);
  line-height: 1.5;
  color: #64748b;
}

#status {
  color: #334155;
}

.panel-turn-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  row-gap: 4px;
}

.panel-turn-options-compact {
  margin-bottom: 6px;
  gap: 10px;
  row-gap: 4px;
}

.panel-composer-textarea {
  min-height: 52px;
  max-height: 110px;
  padding: 8px 10px;
}

.panel-composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
}

.panel-composer-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
