* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Malgun Gothic", sans-serif;
  color: #202124;
  background: #f5f7f8;
}

.app {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 100vh;
  max-width: 920px;
  margin: 0 auto;
  padding: 24px;
  gap: 16px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #5f6368;
  font-size: 13px;
}

h1 {
  margin: 0;
  font-size: 24px;
}

.mode-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid #d6dadd;
  border-radius: 6px;
  color: #3c4043;
  background: #fff;
  font-size: 13px;
}

.messages {
  height: clamp(260px, 42vh, 420px);
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 16px;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
  background: #fff;
}

.messages:empty {
  display: none;
}

.message {
  max-width: 760px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.message.user {
  margin-left: auto;
  color: #fff;
  background: #1a73e8;
}

.message.bot {
  color: #202124;
  background: #eef2f5;
}

.sources {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #d6dadd;
  color: #5f6368;
  font-size: 13px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #c8ced3;
  border-radius: 6px;
  color: #3c4043;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.tab-button.is-active {
  border-color: #1a73e8;
  color: #fff;
  background: #1a73e8;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: grid;
  gap: 16px;
}

.search-help {
  padding: 12px 14px;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
  background: #fff;
}

.search-help h2 {
  margin: 0 0 6px;
  font-size: 15px;
}

.search-help p {
  margin: 0;
  color: #5f6368;
  font-size: 14px;
  line-height: 1.5;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.examples button,
.chat-form button,
.checker button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.examples button {
  padding: 0 12px;
  color: #174ea6;
  background: #e8f0fe;
}

.question-guide {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
  background: #fff;
}

.question-guide h2 {
  margin: 0;
  font-size: 16px;
}

.question-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.question-groups article {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid #eef2f5;
  border-radius: 8px;
  background: #f8fafb;
}

.question-groups h3 {
  margin: 0;
  font-size: 15px;
}

.question-groups button {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: #174ea6;
  background: #e8f0fe;
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
}

.chat-form input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #c8ced3;
  border-radius: 6px;
  font-size: 16px;
}

.chat-form button {
  color: #fff;
  background: #188038;
}

.checker {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
  background: #fff;
}

.checker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.checker h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.checker p {
  margin: 0;
  color: #5f6368;
  font-size: 14px;
}

.checker textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  padding: 12px;
  border: 1px solid #c8ced3;
  border-radius: 6px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
}

.url-checker {
  display: grid;
  gap: 6px;
}

.url-checker label {
  color: #3c4043;
  font-weight: 700;
}

.url-row {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 8px;
}

.url-row input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #c8ced3;
  border-radius: 6px;
  font-size: 15px;
}

.checker-actions {
  display: flex;
  gap: 8px;
}

.file-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  width: fit-content;
  padding: 0 12px;
  border-radius: 6px;
  color: #174ea6;
  background: #e8f0fe;
  cursor: pointer;
  font-weight: 700;
}

.checker input[type="file"] {
  max-width: 100%;
}

.checker button {
  padding: 0 12px;
  color: #174ea6;
  background: #e8f0fe;
}

.checker-actions button:first-child {
  color: #fff;
  background: #188038;
}

.check-results {
  display: grid;
  gap: 12px;
}

.result-scope {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
  background: #fff;
}

.result-scope p {
  margin: 0;
  color: #5f6368;
  font-size: 13px;
  line-height: 1.5;
}

.result-target {
  color: #202124;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.check-summary {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
  background: #f8fafb;
  color: #3c4043;
}

.summary-status {
  display: grid;
  gap: 4px;
}

.summary-status h3,
.summary-status p {
  margin: 0;
}

.summary-status h3 {
  font-size: 18px;
}

.summary-status p {
  color: #5f6368;
  font-size: 14px;
  line-height: 1.5;
}

.summary-status.error h3 {
  color: #b3261e;
}

.summary-status.warning h3 {
  color: #8a5a00;
}

.summary-status.success h3 {
  color: #146c2e;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.summary-card {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid #dfe3e6;
  border-radius: 6px;
  background: #fff;
}

.summary-card.error {
  border-color: #f4c7c3;
  background: #fceeee;
}

.summary-card.warning {
  border-color: #f6d58f;
  background: #fff7e0;
}

.summary-label {
  color: #5f6368;
  font-size: 13px;
}

.summary-card strong {
  color: #202124;
  font-size: 22px;
}

.issue {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-left: 4px solid #fbbc04;
  border-radius: 6px;
  background: #f8fafb;
}

.issue.error {
  border-left-color: #d93025;
}

.issue-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.issue-badge {
  flex: 0 0 auto;
  min-width: 42px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #5f4200;
  background: #fff1c2;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.issue-badge.error {
  color: #b3261e;
  background: #fceeee;
}

.issue-title {
  margin: 2px 0 0;
  font-weight: 700;
  line-height: 1.45;
}

.issue-meta {
  margin: 0;
  color: #5f6368;
  font-size: 13px;
}

.issue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.issue-actions button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: #174ea6;
  background: #e8f0fe;
  cursor: pointer;
  font-weight: 700;
}

.issue-detail {
  margin: 0;
  color: #3c4043;
  font-size: 14px;
  line-height: 1.5;
}

.issue-code,
.issue-fix {
  overflow: auto;
  margin: 0;
  padding: 10px;
  border-radius: 6px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.issue-code {
  border: 1px solid #dfe3e6;
  background: #fff;
  color: #3c4043;
}

.issue-fix {
  background: #202124;
  color: #f8fafb;
}

.checklist {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
  background: #fff;
}

.checklist h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.checklist > p {
  margin: 0 0 4px;
  color: #5f6368;
  font-size: 14px;
  line-height: 1.5;
}

.checklist-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #eef2f5;
  border-radius: 8px;
  background: #f8fafb;
}

.checklist-group h3 {
  margin: 0;
  color: #202124;
  font-size: 16px;
}

.checklist label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.5;
}

.checklist input {
  margin-top: 4px;
}

.checklist-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
  background: #f8fafb;
}

.checklist-progress {
  margin: 0;
  color: #3c4043;
  font-size: 14px;
  line-height: 1.5;
}

.checklist-toolbar button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #c8ced3;
  border-radius: 999px;
  color: #174ea6;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.workflow-tools {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
  background: #fff;
}

.workflow-intro h2,
.workflow-intro p,
.tool-card h3,
.tool-card p {
  margin-top: 0;
}

.workflow-intro h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

.workflow-intro p {
  margin-bottom: 0;
  color: #5f6368;
  line-height: 1.5;
}

.tool-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #eef2f5;
  border-radius: 10px;
  background: #f8fafb;
}

.tool-card__header h3 {
  margin-bottom: 4px;
  font-size: 17px;
}

.tool-card__header p {
  margin-bottom: 0;
  color: #5f6368;
  line-height: 1.5;
}

.template-buttons,
.component-buttons,
.tool-chip-list,
.tool-actions,
.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-buttons button,
.component-buttons button,
.tool-chip-list button,
.tool-actions button,
.review-actions button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #c8ced3;
  border-radius: 999px;
  color: #174ea6;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.template-buttons button.is-active,
.component-buttons button.is-active,
.tool-actions button:first-child,
.review-actions button:last-child {
  border-color: #1a73e8;
  color: #fff;
  background: #1a73e8;
}

.review-actions button:disabled {
  cursor: default;
  opacity: 0.45;
}

.tool-result {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
  background: #fff;
}

.tool-result h4,
.tool-result p,
.tool-result strong,
.tool-result ul,
.tool-result pre {
  margin-top: 0;
}

.tool-result h4 {
  margin-bottom: 0;
  font-size: 16px;
}

.tool-result p,
.tool-result li {
  color: #3c4043;
  line-height: 1.6;
}

.tool-result ul {
  margin-bottom: 0;
  padding-left: 18px;
}

.tool-result pre,
.review-step {
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #202124;
  color: #f8fafb;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.tool-result__section {
  display: grid;
  gap: 8px;
}

.tool-result__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.generator-controls,
.generator-scopes {
  display: grid;
  gap: 8px;
}

.memo-label {
  font-weight: 700;
}

.tool-card textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 12px;
  border: 1px solid #c8ced3;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
}

.generator-controls label {
  font-weight: 700;
}

.generator-controls select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #c8ced3;
  border-radius: 6px;
  font-size: 15px;
  background: #fff;
}

.generator-scopes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.generator-scopes label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: #3c4043;
  line-height: 1.5;
}

.review-step {
  display: grid;
  gap: 8px;
  font-family: inherit;
}

.review-step h4,
.review-step p {
  margin: 0;
}

.review-step__action {
  color: #d2e3fc;
}

.review-step-progress {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  width: fit-content;
  padding: 0 12px;
  border-radius: 999px;
  color: #174ea6;
  background: #e8f0fe;
  font-size: 13px;
  font-weight: 700;
}

.team-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.team-rule-card {
  padding: 12px;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
  background: #fff;
}

.team-rule-card h4,
.team-rule-card p {
  margin-top: 0;
}

.team-rule-card h4 {
  margin-bottom: 6px;
  font-size: 15px;
}

.team-rule-card p {
  margin-bottom: 0;
  color: #5f6368;
  line-height: 1.5;
}

.usage-guide {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
  background: #fff;
}

.usage-guide h2,
.usage-guide h3,
.usage-guide p,
.usage-guide ol,
.usage-guide ul {
  margin-top: 0;
}

.usage-guide h2 {
  margin-bottom: 2px;
  font-size: 18px;
}

.usage-guide article {
  padding-bottom: 12px;
  border-bottom: 1px solid #eef2f5;
}

.usage-guide article:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.usage-guide h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.usage-guide p,
.usage-guide li {
  color: #3c4043;
  line-height: 1.6;
}

.usage-guide pre {
  overflow: auto;
  padding: 12px;
  border-radius: 6px;
  background: #202124;
  color: #f8fafb;
}

.usage-guide code {
  font-family: Consolas, "Courier New", monospace;
}

.standards {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
  background: #fff;
}

.standards h2,
.standards h3,
.standards p {
  margin-top: 0;
}

.standards h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.standards > p {
  color: #5f6368;
}

.standards-tools {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
  background: #f8fafb;
}

.standards-tools label {
  font-weight: 700;
}

.standards-tools input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #c8ced3;
  border-radius: 6px;
  font-size: 15px;
}

.standards-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.standards-filters button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #c8ced3;
  border-radius: 6px;
  color: #3c4043;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.standards-filters button.is-active {
  border-color: #1a73e8;
  color: #fff;
  background: #1a73e8;
}

.standards-count {
  margin: 0;
  color: #5f6368;
  font-size: 14px;
}

.standards-group-title {
  margin: 8px 0 0;
  padding-top: 12px;
  border-top: 1px solid #eef2f5;
  color: #202124;
  font-size: 17px;
}

.snippet-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #eef2f5;
  border-radius: 8px;
  background: #f8fafb;
}

.snippet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.snippet-header h3 {
  margin-bottom: 0;
  font-size: 16px;
}

.snippet-header button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: #174ea6;
  background: #e8f0fe;
  cursor: pointer;
  font-weight: 700;
}

.snippet-card pre {
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  background: #202124;
  color: #f8fafb;
}

.snippet-card code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .question-groups,
  .tool-result__grid,
  .team-rules,
  .generator-scopes,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .chat-form,
  .url-row {
    grid-template-columns: 1fr;
  }

  .checklist-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .app-header,
  .checker-header,
  .snippet-header {
    align-items: stretch;
    flex-direction: column;
  }
}

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

@media (max-width: 640px) {
  .app {
    padding: 16px;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .question-groups {
    grid-template-columns: 1fr;
  }

  .checker-header {
    flex-direction: column;
  }

  .url-row {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .issue-header {
    flex-direction: column;
  }
}
