:root {
  color-scheme: light;
  --ink: #173438;
  --ink-deep: #0f2d30;
  --muted: #63777a;
  --paper: #f4f1e9;
  --surface: #fffdf8;
  --line: #d8ddd6;
  --teal: #126b68;
  --teal-soft: #dceee9;
  --lime: #d9ee8b;
  --orange: #ef704f;
  --orange-soft: #fff0e9;
  --yellow: #e7ba4a;
  --shadow: 0 20px 60px rgba(25, 55, 55, 0.11);
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", Meiryo, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 52, 56, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 52, 56, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(18, 107, 104, 0.28);
  outline-offset: 3px;
}

.page-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 clamp(20px, 4.5vw, 76px);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
  border-bottom: 1px solid rgba(23, 52, 56, 0.16);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  overflow: hidden;
  border-radius: 12px 12px 12px 4px;
  background: var(--ink-deep);
}

.brand-mark span {
  position: absolute;
  width: 21px;
  height: 3px;
  border-radius: 20px;
  background: var(--lime);
}

.brand-mark span:first-child {
  transform: translateY(-7px);
}

.brand-mark span:last-child {
  width: 12px;
  transform: translate(-4px, 7px);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-en {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.privacy-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid rgba(18, 107, 104, 0.22);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.7);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
}

.privacy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #58a36e;
  box-shadow: 0 0 0 4px rgba(88, 163, 110, 0.14);
}

.intro {
  position: relative;
  max-width: 900px;
  padding: clamp(58px, 7vw, 94px) 0 clamp(40px, 5vw, 64px);
}

.intro::after {
  position: absolute;
  top: 64px;
  right: -28%;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(18, 107, 104, 0.16);
  border-radius: 50%;
  box-shadow:
    0 0 0 34px rgba(18, 107, 104, 0.035),
    0 0 0 68px rgba(18, 107, 104, 0.025);
  content: "";
  pointer-events: none;
}

.eyebrow,
.step-label,
.result-label {
  margin: 0;
  color: var(--teal);
  font-family: Arial, sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.eyebrow span {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink-deep);
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 840px;
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 4.75rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.13;
}

h1 em {
  color: var(--teal);
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: var(--lime);
  text-decoration-thickness: 0.22em;
  text-underline-offset: -0.08em;
  text-decoration-skip-ink: none;
}

.intro-copy {
  max-width: 680px;
  margin: 26px 0 0;
  color: #51676a;
  font-size: clamp(0.98rem, 1.5vw, 1.1rem);
  line-height: 1.9;
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 25px 0 0;
  padding: 0;
  list-style: none;
}

.trust-list li {
  padding: 7px 12px;
  border: 1px solid rgba(23, 52, 56, 0.14);
  border-radius: 4px;
  background: rgba(255, 253, 248, 0.65);
  font-size: 0.76rem;
  font-weight: 700;
}

.trust-list li::before {
  margin-right: 7px;
  color: var(--teal);
  content: "✓";
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: start;
  gap: 20px;
  padding-bottom: 70px;
}

.panel {
  min-width: 0;
  border: 1px solid rgba(23, 52, 56, 0.15);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.input-panel {
  position: sticky;
  top: 20px;
  padding: clamp(22px, 3vw, 34px);
}

.result-panel {
  min-height: 630px;
  overflow: hidden;
}

.panel-heading,
.result-topbar,
.reply-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading {
  margin-bottom: 21px;
}

h2 {
  margin: 5px 0 0;
  color: var(--ink-deep);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  letter-spacing: -0.025em;
}

.text-button,
.copy-button {
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

#inquiryText,
#replyDraft {
  display: block;
  width: 100%;
  resize: vertical;
  border: 1px solid #cbd4cf;
  border-radius: 12px;
  background: #fffefb;
  color: var(--ink-deep);
  line-height: 1.8;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

#inquiryText {
  min-height: 300px;
  padding: 18px;
  font-size: 0.96rem;
}

#replyDraft {
  min-height: 240px;
  padding: 18px;
  border-color: rgba(18, 107, 104, 0.28);
  background: rgba(255, 255, 255, 0.76);
  font-size: 0.92rem;
}

#inquiryText::placeholder {
  color: #91a09c;
}

#inquiryText:hover,
#replyDraft:hover {
  border-color: #9bb0a9;
}

#inquiryText:focus,
#replyDraft:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(18, 107, 104, 0.09);
}

.textarea-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  color: #7c8e8b;
  font-size: 0.69rem;
}

.textarea-meta p {
  margin: 0;
}

.error-message {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--orange);
  background: var(--orange-soft);
  color: #9b3e2c;
  font-size: 0.82rem;
  font-weight: 700;
}

.input-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 19px;
}

.primary-button,
.secondary-button,
.copy-button {
  min-height: 51px;
  border-radius: 10px;
  font-weight: 800;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 18px;
  border: 1px solid var(--ink-deep);
  background: var(--ink-deep);
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 45, 48, 0.16);
}

.primary-button:hover {
  background: var(--teal);
  transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active,
.copy-button:active {
  transform: translateY(1px);
}

.button-arrow {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink-deep);
}

.secondary-button {
  padding: 0 16px;
  border: 1px solid #ccd5d0;
  background: transparent;
  color: #60716f;
}

.secondary-button:hover {
  border-color: #96aaa3;
  background: #f7f7f1;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed #d3d9d4;
}

.privacy-note p {
  margin: 0;
  color: #70817f;
  font-size: 0.74rem;
  line-height: 1.65;
}

.privacy-note strong {
  color: var(--teal);
}

.lock-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 7px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.42rem;
}

.empty-state {
  display: flex;
  min-height: 630px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  text-align: center;
}

.empty-graphic {
  position: relative;
  width: 86px;
  height: 86px;
  margin-bottom: 24px;
  border: 1px solid #cbd8d2;
  border-radius: 24px 24px 24px 6px;
  background: var(--teal-soft);
  transform: rotate(-3deg);
}

.empty-graphic span {
  position: absolute;
  left: 20px;
  width: 45px;
  height: 5px;
  border-radius: 20px;
  background: var(--teal);
}

.empty-graphic span:first-child {
  top: 24px;
}

.empty-graphic span:nth-child(2) {
  top: 40px;
}

.empty-graphic span:last-child {
  top: 56px;
  width: 28px;
}

.empty-state > p:not(.step-label) {
  max-width: 400px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

.empty-state ol {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.empty-state li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #dae0dc;
  border-radius: 999px;
  color: #6d7d7b;
  font-size: 0.7rem;
}

.empty-state li span {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #e7ece8;
  color: var(--ink);
  font-family: Arial, sans-serif;
  font-size: 0.6rem;
  font-weight: 800;
}

.result-content {
  animation: reveal 300ms ease both;
}

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

.result-topbar {
  padding: clamp(22px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
}

.copy-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(18, 107, 104, 0.24);
  background: var(--teal-soft);
  text-decoration: none;
}

.copy-button:hover {
  border-color: var(--teal);
  background: #cfebe3;
}

.signal-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  border-bottom: 1px solid var(--line);
}

.signal-card {
  min-width: 0;
  padding: 25px clamp(22px, 3vw, 34px);
}

.signal-card + .signal-card {
  border-left: 1px solid var(--line);
}

.category-value {
  margin: 9px 0 0;
  color: var(--ink-deep);
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.category-value::before {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 9px;
  border-radius: 3px;
  background: var(--teal);
  content: "";
}

.priority-value {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 9px 0 0;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 900;
}

.priority-value::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.priority-high {
  background: var(--orange-soft);
  color: #c84c33;
}

.priority-medium {
  background: #fff6d9;
  color: #9a6b00;
}

.priority-low {
  background: var(--teal-soft);
  color: var(--teal);
}

.result-block {
  padding: 25px clamp(22px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
}

.result-block:last-child {
  border-bottom: 0;
}

.result-block-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-block-heading span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink-deep);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
}

.result-block h3 {
  margin: 0;
  color: #435c5f;
  font-size: 0.81rem;
  letter-spacing: 0.02em;
}

.result-text {
  margin: 14px 0 0 36px;
  color: var(--ink-deep);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.75;
}

.action-block {
  background: #f3f7e8;
}

.action-block .result-block-heading span {
  background: var(--lime);
  color: var(--ink-deep);
}

.reply-block {
  background: #f9fbf7;
}

.reply-heading {
  margin-bottom: 15px;
}

.edit-hint {
  margin: 8px 0 0;
  color: #7d8c89;
  font-size: 0.68rem;
  text-align: right;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0 32px;
  border-top: 1px solid rgba(23, 52, 56, 0.14);
  color: #71817f;
  font-size: 0.68rem;
}

footer p {
  margin: 0;
}

footer p:first-child {
  font-family: Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 0.12em;
}

footer span {
  color: var(--teal);
}

.toast {
  position: fixed;
  z-index: 10;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--ink-deep);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 12px 34px rgba(15, 45, 48, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

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

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .intro::after {
    right: 0;
    opacity: 0.6;
  }

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

  .input-panel {
    position: static;
  }

  #inquiryText {
    min-height: 250px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 0 14px;
  }

  .app-header {
    min-height: 76px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-name {
    font-size: 0.8rem;
  }

  .brand-en {
    display: none;
  }

  .privacy-chip {
    padding: 7px 9px;
    font-size: 0.66rem;
  }

  .intro {
    padding: 46px 4px 34px;
  }

  .intro::after {
    display: none;
  }

  h1 {
    font-size: clamp(2rem, 10.5vw, 3rem);
  }

  .workspace {
    gap: 14px;
    padding-bottom: 44px;
  }

  .panel {
    border-radius: 15px;
  }

  .input-panel {
    padding: 21px 17px;
  }

  .panel-heading,
  .result-topbar {
    align-items: flex-end;
  }

  #inquiryText {
    min-height: 230px;
    padding: 15px;
  }

  .textarea-meta p:first-child {
    display: none;
  }

  .textarea-meta {
    justify-content: flex-end;
  }

  .input-actions {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .empty-state {
    min-height: 500px;
    padding: 35px 20px;
  }

  .result-topbar,
  .signal-card,
  .result-block {
    padding-right: 18px;
    padding-left: 18px;
  }

  .signal-grid {
    grid-template-columns: 1fr 0.8fr;
  }

  .result-text {
    margin-left: 0;
  }

  .reply-heading {
    align-items: flex-start;
  }

  #replyDraft {
    min-height: 280px;
    padding: 15px;
    font-size: 0.88rem;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
    padding-right: 4px;
    padding-left: 4px;
  }

  .toast {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 390px) {
  .privacy-chip {
    width: 34px;
    height: 34px;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    color: transparent;
  }

  .privacy-dot {
    flex: 0 0 auto;
  }

  .panel-heading .text-button {
    font-size: 0.72rem;
  }

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

  .signal-card + .signal-card {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

