body { font-family: ui-sans-serif, system-ui, sans-serif; margin: 0; background: #0f1419; color: #e7ecf1; }
main { max-width: 1180px; margin: 0 auto; padding: 24px; box-sizing: border-box; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}
.page-header-main { flex: 1; min-width: 0; }

.lang-switch {
  display: flex;
  flex-shrink: 0;
  padding-top: 2px;
  position: relative;
}
.lang-dropdown { position: relative; }
.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1a222c;
  border: 1px solid #2b3642;
  border-radius: 999px;
  padding: 6px 10px 6px 8px;
  cursor: pointer;
  color: #e7ecf1;
  min-width: 56px;
}
.lang-trigger:hover { border-color: #4a5a6a; }
.lang-flag { font-size: 1.1rem; line-height: 1; }
.lang-caret { color: #9aa7b5; font-size: 11px; line-height: 1; margin-top: 1px; }
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: #1a222c;
  border: 1px solid #2b3642;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 20;
}
.lang-menu.hidden { display: none; }
.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  color: #e7ecf1;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}
.lang-option:hover,
.lang-option.active { background: #243044; }

h1 { font-size: 1.25rem; margin-bottom: 4px; }
h2 { font-size: 0.95rem; margin: 20px 0 8px; color: #c5d0db; }
h2.section-first { margin-top: 0; }
.tabs { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.tabs button { background: #1a222c; color: #e7ecf1; border: 1px solid #2b3642; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.tabs button.active { background: #3d8bfd; border-color: #3d8bfd; }
.panel { display: none; }
.panel.active { display: block; }

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
  align-items: start;
}
.col { min-width: 0; }

.req-mark { color: #f07178; font-weight: 600; margin-right: 2px; }
h2 .req-mark { font-size: 0.95rem; }
label { display: block; margin: 10px 0 4px; color: #9aa7b5; font-size: 12px; }
input, textarea, select { width: 100%; background: #1a222c; color: #e7ecf1; border: 1px solid #2b3642; border-radius: 6px; padding: 8px; box-sizing: border-box; }
textarea { min-height: 72px; font-family: ui-monospace, monospace; font-size: 12px; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
pre { background: #1a222c; padding: 12px; overflow: auto; font-size: 12px; border-radius: 8px; max-height: 320px; }
.hint { color: #9aa7b5; font-size: 13px; line-height: 1.5; }
.field-hint { color: #7d8b99; font-size: 12px; line-height: 1.45; margin: 0 0 8px; }
.field-hint-inline { color: #7d8b99; font-size: 11px; line-height: 1.4; margin: 4px 0 0; }
.modal-error { color: #f5a8b0; font-size: 13px; margin: 0 0 12px; }
.modal-error.hidden { display: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
button.primary { background: #3d8bfd; color: #fff; border: 0; border-radius: 6px; padding: 10px 16px; cursor: pointer; }
button.secondary { background: #1a222c; color: #e7ecf1; border: 1px solid #2b3642; border-radius: 6px; padding: 10px 16px; cursor: pointer; }
button.danger { background: #3a1f24; color: #f5a8b0; border: 1px solid #6b2d35; border-radius: 6px; padding: 6px 10px; cursor: pointer; font-size: 12px; }
button.small { padding: 6px 10px; font-size: 12px; }
.hidden { display: none !important; }
#importFile { display: none; }

.list-wrap { border: 1px solid #2b3642; border-radius: 8px; background: #151b23; min-height: 48px; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #2b3642; font-size: 13px; }
.list-item:last-child { border-bottom: none; }
.list-item-main { flex: 1; min-width: 0; }
.list-item-title { font-weight: 500; color: #e7ecf1; }
.list-item-sub { color: #9aa7b5; font-size: 12px; margin-top: 2px; word-break: break-all; }
.list-item.skill-item { align-items: flex-start; }
.list-item-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.skill-full-modal {
  display: block;
  padding: 10px 12px;
  background: #0f1419;
  border: 1px solid #2b3642;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: min(60vh, 480px);
  overflow: auto;
  margin: 0;
}
.modal .skill-full-modal { border: none; background: transparent; padding: 0; }
.tool-desc { color: #b8c5d3; margin-top: 4px; word-break: break-word; }
.list-empty { padding: 16px; color: #6b7785; font-size: 13px; text-align: center; }

.settings-card {
  background: #151b23;
  border: 1px solid #2b3642;
  border-radius: 8px;
  padding: 12px 14px;
}
.settings-card label { margin-top: 8px; }
.settings-card label:first-child { margin-top: 0; }
.checkbox-row { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.checkbox-row label { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: #e7ecf1; font-size: 13px; line-height: 1.4; }
.checkbox-row input[type="checkbox"] { width: auto; flex-shrink: 0; margin-top: 2px; }

.intent-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  background: #151b23;
  border: 1px solid #2b3642;
  border-radius: 6px;
}
.intent-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #e7ecf1;
  font-size: 13px;
}
.intent-checks input[type="checkbox"] { width: auto; flex-shrink: 0; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; box-sizing: border-box; }
.modal-backdrop.hidden { display: none; }
.modal { background: #1a222c; border: 1px solid #2b3642; border-radius: 10px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; padding: 20px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45); box-sizing: border-box; }
.modal h3 { margin: 0 0 16px; font-size: 1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

@media (max-width: 900px) {
  main { padding: 16px; }
  .panel-grid,
  .row,
  .row-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  main { padding: 12px; }
  h1 { font-size: 1.1rem; }
  .page-header { flex-direction: column; }
  .lang-switch { align-self: flex-end; }
  .tabs button { flex: 1 1 auto; text-align: center; }
  .actions button { flex: 1 1 100%; }
  .modal-actions button { flex: 1 1 auto; }
}

@media (max-width: 900px) and (orientation: landscape) and (min-width: 640px) {
  .panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
