@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap");

:root {
  color-scheme: light;
  --bg: #f7f7f7;
  --ink: #3a3a3a;
  --muted: #7c7c7c;
  --card: #ffffff;
  --accent: #f97316;
  --accent-soft: #f3f4f6;
  --warning: #9fa0a2;
  --danger: #333333;
  --info: #4b4b4b;
  --outline: #ececec;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Roboto", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.ambient {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
  pointer-events: none;
  z-index: -1;
}

.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 72px 24px 110px;
  display: grid;
  gap: 48px;
}

.hero {
  display: grid;
  gap: 24px;
  text-align: center;
}

.brand {
  display: grid;
  gap: 16px;
  align-items: center;
  justify-items: center;
}

.logo {
  display: none;
}

h1 {
  font-size: clamp(3rem, 6vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.fr {
  font-style: italic;
}

.tagline {
  color: var(--muted);
  margin-top: 8px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.02rem;
  line-height: 1.7;
}

.icon-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.icon-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #ededed;
  border-radius: 999px;
  background: #fff;
  font-weight: 500;
  color: var(--muted);
}

.icon-chip svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel {
  background: var(--card);
  border: 1px solid #ededed;
  border-radius: 18px;
  padding: 40px 36px;
  display: grid;
  gap: 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.panel-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-bottom: 1px solid #ededed;
  padding-bottom: 22px;
  text-align: center;
}

.panel-header > div {
  flex: 1;
}

.panel-header h2 {
  margin-bottom: 10px;
}

.panel-header p {
  margin-top: 6px;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 500;
}

p {
  line-height: 1.6;
}

.input-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
}

.input-area {
  display: grid;
  gap: 12px;
  font-weight: 600;
  text-align: center;
}

.input-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.link {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  touch-action: manipulation;
}


textarea {
  min-height: 300px;
  resize: vertical;
  padding: 16px;
  border-radius: 6px;
  border: 1px solid #d7d7d7;
  font-family: inherit;
  font-size: 1rem;
  background: #ffffff;
}

.upload-area {
  display: grid;
  gap: 14px;
}

.upload-drop {
  border: 1px dashed #e2e2e2;
  border-radius: 6px;
  padding: 20px;
  background: #ffffff;
  cursor: pointer;
}

.upload-drop input {
  display: none;
}

.upload-content {
  display: grid;
  gap: 10px;
  text-align: center;
  color: var(--muted);
}

.upload-content svg {
  width: 30px;
  height: 30px;
  margin: 0 auto;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
}

.upload-preview img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--outline);
}

.actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-top: 1px solid #ededed;
  padding-top: 22px;
  flex-wrap: wrap;
  text-align: center;
  flex-direction: column;
}

.primary,
.ghost {
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
}

.primary {
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ghost {
  background: transparent;
  border-color: var(--outline);
  color: var(--ink);
}

.results {
  animation: fadeIn 0.4s ease;
  background: #262626;
  color: #f3f3f3;
  border-color: #343434;
}

.ghost.gray {
  color: #5f5f5f;
  border-color: #d8d8d8;
}

.arrow-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary .arrow-icon {
  stroke: #fff;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  border-bottom: 1px solid #343434;
  padding-bottom: 20px;
  text-align: center;
}

.results-header > div {
  flex: 1;
}

.score-block {
  background: #2c2c2c;
  border-radius: 12px;
  padding: 16px 20px;
  text-align: center;
}

.score-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.score {
  font-size: 6.4rem;
  font-weight: 700;
  color: #f08a33;
}

.score-status {
  font-size: 1.05rem;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
  min-width: 200px;
  border: 1px solid transparent;
}

.status-green {
  background: #e6f5d7;
  border-color: #cbe9b0;
  color: #2b5a1e;
}

.status-yellow {
  background: #fff6d6;
  border-color: #f3e2a5;
  color: #7a5a00;
}

.status-orange {
  background: #ffe6cf;
  border-color: #f7c9a2;
  color: #7a3a00;
}

.status-red {
  background: #ffe0e0;
  border-color: #f4b6b6;
  color: #7a1e1e;
}

.score-bar {
  height: 8px;
  background: #343434;
  border-radius: 999px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e);
  transition: width 0.6s ease;
}

.score-note {
  text-align: center;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #f08a33;
  color: #1b1b1b;
  border: 1px solid #f08a33;
  font-weight: 500;
}

.bias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.bias-details {
  margin-top: 12px;
  border: 1px solid #343434;
  border-radius: 12px;
  padding: 12px 16px;
  background: #2b2b2b;
}

.bias-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #f3f3f3;
  list-style: none;
}

.bias-details summary::-webkit-details-marker {
  display: none;
}

.bias-details summary::after {
  content: "▾";
  float: right;
  color: var(--muted);
}

.bias-details[open] summary::after {
  content: "▴";
}

.bias-details .bias-grid {
  margin-top: 12px;
}

.bias-card {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #343434;
  background: #2b2b2b;
  display: grid;
  gap: 6px;
  position: relative;
}

.bias-card.hit {
  background: rgba(240, 138, 51, 0.18);
  border-color: rgba(240, 138, 51, 0.45);
}

.bias-tip {
  position: absolute;
  inset: auto 12px 12px 12px;
  background: #121212;
  border: 1px solid #3f3f3f;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  color: #f1f1f1;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 2;
}

.bias-card:hover .bias-tip {
  opacity: 1;
}

.bias-card strong {
  font-size: 1rem;
}

.analysis {
  display: grid;
  gap: 16px;
}

.sentence {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #343434;
  background: #2b2b2b;
}

.sentence.hit {
  background: rgba(240, 138, 51, 0.18);
  border-color: rgba(240, 138, 51, 0.45);
}

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

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #343434;
  color: #f3f3f3;
}

.highlight {
  background: rgba(240, 138, 51, 0.2);
  padding: 0 3px;
  border-radius: 6px;
  border-bottom: 1px solid rgba(240, 138, 51, 0.45);
}

.explain {
  color: #b5b5b5;
  font-size: 0.95rem;
}

.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tooltip button {
  border: none;
  background: var(--accent);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: 700;
  cursor: pointer;
}

.tooltip span {
  position: absolute;
  bottom: 130%;
  right: 0;
  background: #121212;
  border: 1px solid #3f3f3f;
  padding: 10px 12px;
  border-radius: 12px;
  width: 220px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  font-size: 0.85rem;
  color: #f1f1f1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.tooltip button:focus + span,
.tooltip button:hover + span {
  opacity: 1;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .input-grid {
    grid-template-columns: 1fr;
  }

  .actions,
  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .primary {
    font-size: 1.1rem;
    padding: 16px 28px;
    justify-content: center;
  }

  .score {
    font-size: 4.2rem;
  }
}
