:root {
  --ink: #203238;
  --muted: #647076;
  --surface: #ffffff;
  --surface-soft: #f7f5ef;
  --line: #dfe4e2;
  --primary: #264653;
  --primary-dark: #1b333d;
  --accent: #2a9d8f;
  --gold: #e9c46a;
  --coral: #e76f51;
  --shadow: 0 18px 50px rgba(32, 50, 56, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(247, 245, 239, 0.95), rgba(255, 255, 255, 0.98)),
    var(--surface-soft);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(223, 228, 226, 0.8);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: var(--surface-soft);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  margin-top: 2px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 650;
}

.main-nav a:hover,
.main-nav a.active {
  background: #edf6f4;
  color: var(--primary);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--primary);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 72px;
}

.usage-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.9rem;
}

.usage-status span {
  color: var(--primary);
  font-weight: 850;
}

.usage-status strong {
  font-weight: 750;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  min-height: calc(100vh - 190px);
}

.hero-copy h1,
.page-heading h1 {
  max-width: 840px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.25rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-text,
.page-heading p {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.eyebrow,
.card-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 760;
  line-height: 1.1;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled,
.button.visually-disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.button:disabled:hover {
  transform: none;
}

.button.primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 12px 24px rgba(38, 70, 83, 0.18);
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--primary);
}

.button.quiet {
  background: transparent;
  color: var(--primary);
}

.button.danger {
  color: #8a3f2d;
}

.coach-panel,
.guidance-card,
.scenario-card,
.pillar-card,
.result-card,
.notice-card,
.price-card,
.coach-workspace,
.filter-panel,
.empty-state,
.settings-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.coach-panel {
  padding: clamp(24px, 4vw, 36px);
}

.panel-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--muted);
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.coach-panel h2,
.guidance-card h2 {
  margin: 0 0 12px;
  font-size: 1.6rem;
  line-height: 1.15;
}

.coach-panel p,
.guidance-card p,
.scenario-card p,
.result-card p,
.price-card p {
  color: var(--muted);
  line-height: 1.6;
}

.mini-score {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.mini-score strong {
  color: var(--primary);
}

.mini-score a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  padding: 0 12px;
  font-weight: 800;
}

.method-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.method-item {
  min-height: 178px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.method-item span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #edf6f4;
  color: var(--primary);
  font-weight: 850;
}

.method-item h3 {
  margin: 14px 0 8px;
  font-size: 1rem;
}

.method-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.page-heading {
  padding: 28px 0 32px;
}

.scenario-grid,
.pricing-grid,
.results-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(180px, 0.72fr) minmax(180px, 0.72fr) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 22px;
  padding: 18px;
}

.filter-panel label {
  display: grid;
  gap: 8px;
}

.filter-panel .search-field {
  min-width: 0;
}

.filter-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.scenario-card,
.price-card,
.result-card {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
}

.scenario-card {
  min-height: 224px;
  padding: 18px;
}

.scenario-card.selected,
.price-card.featured {
  border-color: rgba(42, 157, 143, 0.55);
  box-shadow: 0 20px 54px rgba(42, 157, 143, 0.15);
}

.scenario-card.selected {
  border-color: var(--accent);
  background: #f0faf8;
  box-shadow: 0 20px 54px rgba(42, 157, 143, 0.2);
}

.selected-label {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  padding: 0 10px;
  margin-bottom: 14px;
  font-size: 0.78rem;
  font-weight: 850;
}

.scenario-card h2,
.price-card h2 {
  margin: 0 0 12px;
  font-size: 1.42rem;
}

.scenario-card h2 {
  font-size: 1.18rem;
  line-height: 1.2;
}

.scenario-preview {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
}

.scenario-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.scenario-meta span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--primary);
  padding: 0 10px;
  font-size: 0.85rem;
  font-weight: 750;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
}

.empty-state h2 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.coach-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(320px, 1.25fr);
  gap: 24px;
  margin-top: 26px;
  padding: 28px;
}

.coach-workspace.two-column {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  align-items: start;
}

.selected-practice {
  scroll-margin-top: 96px;
}

.selected-scenario-summary h2 {
  margin: 0 0 10px;
  font-size: 1.75rem;
}

.selected-scenario-summary > p {
  color: var(--muted);
  line-height: 1.65;
}

.practice-question {
  margin-top: 18px;
  padding: 16px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #edf6f4;
}

.practice-question p {
  margin: 6px 0 0;
  color: var(--ink);
  line-height: 1.55;
}

.response-box,
.situation-form {
  display: grid;
  gap: 12px;
}

.mode-options {
  display: grid;
  gap: 10px;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  scroll-margin-top: 110px;
}

.mode-options.has-validation-error {
  padding: 12px;
  border: 1px solid rgba(231, 111, 81, 0.42);
  background: #fff4ef;
}

.mode-options legend {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
  color: var(--ink);
  font-weight: 800;
}

.mode-options legend .legend-text {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.mode-options legend .legend-text span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.inline-reset {
  border: 0;
  padding: 2px 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.inline-reset:hover,
.inline-reset:focus-visible {
  text-decoration: underline;
}

.mode-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.mode-option.selected {
  border-color: rgba(42, 157, 143, 0.55);
  background: #edf6f4;
}

.mode-option input {
  width: auto;
  margin-top: 4px;
}

.mode-option input[type="radio"] {
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
}

.mode-option strong,
.mode-option small {
  display: block;
}

.mode-option small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.mode-usage-text {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
}

.response-box {
  scroll-margin-top: 96px;
}

.selection-confirmation {
  padding: 16px;
  border: 1px solid rgba(42, 157, 143, 0.28);
  border-radius: 8px;
  background: #edf6f4;
}

.selection-confirmation span {
  display: block;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.selection-confirmation h3 {
  margin: 6px 0 0;
  color: var(--primary);
  font-size: 1.18rem;
  line-height: 1.25;
}

label {
  color: var(--ink);
  font-weight: 750;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 14px;
  resize: vertical;
  scroll-margin-top: 110px;
}

textarea.validation-error,
input.validation-error {
  border-color: rgba(231, 111, 81, 0.68);
  background: #fff8f5;
  box-shadow: 0 0 0 3px rgba(231, 111, 81, 0.09);
}

textarea:focus,
input:focus,
select:focus,
.button:focus,
.main-nav a:focus {
  outline: 3px solid rgba(42, 157, 143, 0.25);
  outline-offset: 2px;
}

label span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.form-message {
  margin: 0 0 4px;
  padding: 12px 14px;
  border: 1px solid rgba(231, 111, 81, 0.28);
  border-radius: 8px;
  background: #fff4ef;
  color: #8a3f2d;
  font-weight: 750;
  line-height: 1.45;
}

.inline-error {
  margin: -2px 0 6px;
  padding: 10px 12px;
  border: 1px solid rgba(231, 111, 81, 0.28);
  border-radius: 8px;
  background: #fff4ef;
  color: #8a3f2d;
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.42;
}

.character-counter {
  display: grid;
  gap: 2px;
  margin: -4px 0 8px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.character-counter span:first-child {
  font-weight: 760;
}

.character-counter.near {
  color: #8a6424;
}

.character-counter.limit {
  color: #8a3f2d;
}

.character-counter strong {
  max-width: 680px;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(231, 111, 81, 0.28);
  border-radius: 8px;
  background: #fff4ef;
  color: #8a3f2d;
  font-weight: 760;
}

.error-card {
  border-color: rgba(231, 111, 81, 0.32);
  background: #fffaf7;
}

.notice-card {
  padding: 20px 22px;
  border-color: rgba(233, 196, 106, 0.62);
  background: #fff9e8;
}

.notice-card p:last-child {
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
}

.guidance-card {
  padding: 24px;
}

.check-list {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.check-list li {
  position: relative;
  padding-left: 28px;
  line-height: 1.5;
}

.check-list li::before {
  position: absolute;
  left: 0;
  top: 2px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: #edf6f4;
  content: "";
}

.check-list li::after {
  position: absolute;
  left: 6px;
  top: 5px;
  width: 5px;
  height: 9px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.draft-preview {
  min-height: 120px;
  padding: 16px;
  border-radius: 8px;
  background: var(--surface-soft);
  white-space: pre-wrap;
}

.feedback-detail {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.feedback-summary-card > p {
  max-width: 860px;
  font-size: 1.05rem;
  line-height: 1.65;
}

.pillar-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.pillar-highlights div {
  padding: 16px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.pillar-highlights.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pillar-highlights.compact div {
  padding: 12px;
}

.pillar-highlights span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-transform: uppercase;
}

.pillar-highlights strong {
  color: var(--primary);
  font-size: 1.12rem;
}

.signal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.signal-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 0.86rem;
  font-weight: 750;
}

.signal-chip.present {
  background: #edf6f4;
  color: var(--primary);
}

.signal-chip.not-present {
  background: var(--surface-soft);
  color: var(--muted);
}

.pillar-feedback-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0;
}

.pillar-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 22px;
}

.pillar-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.pillar-card h2 {
  margin: 0;
  color: var(--primary);
  font-size: 1.9rem;
}

.score-label {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.pillar-card h3 {
  margin: 6px 0 0;
  font-size: 0.95rem;
}

.pillar-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.score-dots {
  display: inline-flex;
  gap: 5px;
  padding-top: 8px;
}

.score-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d7ddd9;
}

.score-dot.filled {
  background: var(--accent);
}

.suggested-language {
  padding: 14px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #edf6f4;
  color: var(--ink);
}

.feedback-actions {
  margin-top: 18px;
}

.situation-response-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0;
}

.response-option-card {
  min-height: auto;
}

.response-option-card p:last-child {
  color: var(--ink);
  line-height: 1.6;
}

.situation-pillar-list {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.situation-pillar-card {
  gap: 10px;
}

.situation-pillar-card h3 {
  margin-top: 10px;
}

.result-card.wide {
  min-height: auto;
}

.result-card h2 {
  margin: 0 0 12px;
  font-size: 1.55rem;
}

.result-card h3 {
  margin: 18px 0 8px;
  font-size: 1rem;
}

.history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.history-heading .button {
  flex: 0 0 auto;
  margin-top: 8px;
}

.history-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.history-stat {
  min-height: 132px;
  justify-content: center;
  gap: 10px;
}

.history-stat span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.history-stat strong {
  color: var(--primary);
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.1;
}

.history-stat.wide-stat {
  grid-column: span 2;
}

.history-list {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.history-session-card {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
}

.history-session-card h2 {
  max-width: 760px;
}

.history-card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: center;
}

.history-empty .form-actions {
  margin-top: 18px;
}

.privacy-note,
.trend-card {
  margin-bottom: 18px;
}

.history-detail .back-button {
  width: fit-content;
  margin-bottom: 14px;
  padding-left: 0;
}

.bottom-back-button {
  width: fit-content;
  margin-top: 18px;
}

.settings-list {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.settings-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
}

.settings-list span {
  color: var(--muted);
  font-weight: 700;
}

.price-card h2 {
  font-size: 2.4rem;
}

@media (max-width: 980px) {
  .hero-section,
  .coach-workspace,
  .coach-workspace.two-column {
    grid-template-columns: 1fr;
  }

  .method-strip,
  .scenario-grid,
  .filter-panel,
  .pricing-grid,
  .pillar-feedback-grid,
  .situation-response-options,
  .results-layout,
  .history-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-panel p {
    grid-column: 1 / -1;
  }

  .filter-panel .search-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-header {
    align-items: flex-start;
  }

  .brand {
    min-width: 0;
  }

  .nav-toggle {
    display: block;
    flex: 0 0 auto;
  }

  .main-nav {
    position: absolute;
    top: 75px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    justify-content: center;
  }

  main {
    width: min(100% - 24px, 1180px);
    padding-top: 28px;
  }

  .hero-section {
    min-height: auto;
  }

  .hero-actions,
  .form-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .method-strip,
  .scenario-grid,
  .filter-panel,
  .pricing-grid,
  .pillar-feedback-grid,
  .situation-response-options,
  .results-layout,
  .history-summary-grid,
  .history-session-card {
    grid-template-columns: 1fr;
  }

  .pillar-highlights {
    grid-template-columns: 1fr;
  }

  .history-heading {
    flex-direction: column;
  }

  .history-card-actions {
    align-self: stretch;
  }

  .bottom-back-button {
    width: 100%;
  }

  .history-stat.wide-stat {
    grid-column: auto;
  }

  .filter-panel p {
    white-space: normal;
  }

  .coach-workspace {
    padding: 20px;
  }

  .settings-list article {
    align-items: flex-start;
    flex-direction: column;
  }

  .mode-option {
    padding: 12px;
  }
}
