:root {
  color-scheme: light;
  --bg: #f7f7f7;
  --panel: #ffffff;
  --border: #dcdfe6;
  --text: #2c3e50;
  --muted: rgba(44, 62, 80, 0.72);
  --accent: #cc0033;
  --radius: 2px;
  --font-body: Arial, Helvetica, sans-serif;
  --font-mono: Consolas, "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}
button, input, select, textarea { font: inherit; }

.app-shell {
  display: flex;
  min-width: 1250px;
}

#menu {
  width: 240px;
  min-height: 100vh;
  border-right: 1px solid var(--border);
  background: #fff;
}

#top {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 10px;
  background: #fff;
  white-space: nowrap;
  overflow: hidden;
  height: 56px;
  display: flex;
  align-items: center;
}
.logo_span { padding-right: 10px; display: inline-flex; align-items: center; }
.logo_img {
  width: 40px;
  padding-right: 10px;
  vertical-align: middle;
}
.logo_text {
  vertical-align: middle;
  font-size: 20px;
  text-decoration: none;
  font-weight: 700;
  color: var(--accent);
}

.menu-list {
  height: calc(100vh - 56px);
  overflow: auto;
  padding: 0;
  background: #fff;
}
.menu-item {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 0 20px;
  border: 0;
  background: #fff;
  color: #2c3e50;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}
.menu-item:hover { background: #fff; color: #cc0033; }
.menu-item.is-active {
  color: #cc0033;
  background: #fff;
}

.workspace-main {
  flex: 1;
  padding: 10px 14px;
}
.tool-page {
  background: #fff;
  border: 0;
  padding: 4px 10px 18px;
  min-height: calc(100vh - 20px);
}
.tool-page-header h1 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
}
.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.inline-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-label { white-space: nowrap; }
.field { display: grid; gap: 6px; }
.field-header h3, .panel-header h2 { margin: 0; font-size: 14px; }
.field-control, .field-select, .field-input {
  width: 100%;
  border: 1px solid #dcdfe6;
  background: #fff;
  color: var(--text);
  border-radius: 2px;
}
.field-input, .field-select {
  min-height: 32px;
  padding: 5px 8px;
}
.field-control {
  min-height: 420px;
  padding: 8px 10px;
  resize: vertical;
  font-family: var(--font-mono);
  line-height: 1.5;
}
.field-control:focus, .field-select:focus, .field-input:focus {
  outline: none;
  border-color: #409eff;
}
.editor-row {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}
.editor-row.single-editor { grid-template-columns: 1fr; }
.editor-row.double-editor { grid-template-columns: 1fr 1fr; }
.action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.button-row, .status-bar, .meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.button, .button-secondary, .button-ghost, .compact-button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #dcdfe6;
  background: #fff;
  border-radius: 2px;
  cursor: pointer;
}
.button {
  background: #409eff;
  border-color: #409eff;
  color: #fff;
}
.button:hover { filter: brightness(0.97); }
.button-secondary:hover, .button-ghost:hover, .compact-button:hover {
  color: #409eff;
  border-color: #c6e2ff;
  background: #ecf5ff;
}
.muted { color: var(--muted); }
.notice {
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  background: #fff;
}
.notice-success { background: #f0f9eb; border-color: #e1f3d8; }
.notice-error { background: #fef0f0; border-color: #fde2e2; }
.notice-neutral { background: #f4f4f5; border-color: #e9e9eb; }
.result-row { display: grid; gap: 12px; }
.tool-output, .stack { display: grid; gap: 12px; }
.result-panel {
  padding: 12px 0 0;
  border: 0;
  background: #fff;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.output-frame {
  padding: 10px;
  border: 1px solid #dcdfe6;
  background: #fff;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  font-family: var(--font-mono);
}
.table-shell { overflow: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  border: 1px solid #ebeef5;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}
thead th { background: #f5f7fa; }
.preview-pane {
  width: 100%;
  min-height: 320px;
  border: 1px solid #ebeef5;
  background: #fff;
}
.empty-state {
  padding: 14px;
  border: 1px dashed #dcdfe6;
  color: var(--muted);
  background: #fafafa;
}
.badge, .status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #ebeef5;
  background: #f5f7fa;
  font-size: 12px;
}
.error-badge { color: #f56c6c; border-color: #fde2e2; background: #fef0f0; }
.fade-enter { animation: none; }

.triple-pane-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 110px minmax(420px, 1fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
}
.pane { min-width: 0; }
.pane-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.pane-actions .button,
.pane-actions .button-secondary,
.pane-actions .button-ghost {
  width: 100%;
}
.status-stack {
  display: grid;
  gap: 6px;
}
.status-stack .status-pill {
  justify-content: center;
}
.primary-output-frame {
  min-height: 420px;
  overflow: auto;
}
.primary-table-shell {
  min-height: 420px;
  border: 1px solid #dcdfe6;
}
.mini-meta {
  margin-top: 4px;
  font-size: 12px;
  text-align: center;
}
.three-pane-extras {
  margin-top: 8px;
}
.three-pane-extras > .tool-output > .result-panel:first-child {
  display: none;
}
