:root {
  --feedback-paper: #fcfbfd;
  --feedback-ink: #17131c;
  --feedback-muted: #655f69;
  --feedback-purple: #6b238e;
  --feedback-purple-deep: #571d76;
  --feedback-purple-soft: #f4f0f8;
  --feedback-arc: #b79cc8;
  --feedback-line: rgba(107, 35, 142, .17);
  --feedback-green: #137a5a;
  --feedback-red: #b3261e;
}

html { background: var(--feedback-paper); }
body.feedback-page { min-height: 100vh; color: var(--feedback-ink); background: var(--feedback-paper); }
.feedback-page::before {
  position: fixed; z-index: -2; inset: 72px 0 auto; height: 760px; content: ""; pointer-events: none;
  background:
    radial-gradient(circle at 50% 30%, rgba(107,35,142,.09), transparent 36%),
    linear-gradient(180deg, #fff 0%, var(--feedback-paper) 78%);
}
.feedback-page::after {
  position: fixed; z-index: -1; top: 130px; left: 50%; width: min(860px, 90vw); height: 600px; content: ""; pointer-events: none;
  border-radius: 50%; filter: blur(80px); transform: translateX(-50%); background: rgba(183,156,200,.1);
}

.feedback-brand { gap: 10px; }
.site-brand.feedback-brand img { width: 42px; height: 42px; object-fit: contain; }
.feedback-brand .site-brand-name { display: inline; font-weight: 760; }

.feedback-main { width: min(900px, calc(100% - 48px)); margin: 0 auto; padding: clamp(24px, 3vw, 38px) 0 112px; }
.feedback-intro { max-width: 720px; margin: 0 auto 16px; text-align: center; }
.eyebrow { margin: 0 0 12px; color: var(--feedback-purple); font-size: 12px; font-weight: 820; letter-spacing: .16em; text-transform: uppercase; }
.feedback-intro h1 {
  margin: 0; font-family: var(--font-display); font-size: clamp(42px, 4.3vw, 56px); font-weight: 760; line-height: 1.05; letter-spacing: -.055em;
}
.feedback-intro h1 span { color: var(--feedback-purple); }
.feedback-intro > p:last-child { max-width: 560px; margin: 10px auto 0; color: var(--feedback-muted); font-size: 16px; }

.composer-shell { position: relative; width: min(760px, 100%); min-height: 350px; margin: 0 auto; }
.composer-shell::before {
  position: absolute; z-index: -1; top: 70px; right: 8%; left: 8%; height: 360px; border-radius: 50%; content: "";
  background: rgba(107,35,142,.14); filter: blur(60px); opacity: .42;
}
.paper {
  position: relative; overflow: hidden; min-height: 350px; padding: 21px 25px 16px; border: 1px solid var(--feedback-line); border-radius: 26px;
  background: rgba(255,255,255,.96); box-shadow: 0 28px 90px rgba(50,24,61,.13), 0 4px 14px rgba(50,24,61,.05);
  transform: translateY(0); transition: border-color .2s ease, box-shadow .24s ease, transform .24s ease;
}
.paper:focus-within { border-color: rgba(107,35,142,.38); box-shadow: 0 34px 100px rgba(50,24,61,.16), 0 0 0 5px rgba(107,35,142,.055); transform: translateY(-2px); }
.paper.dragging { border-color: var(--feedback-purple); box-shadow: 0 32px 110px rgba(71,28,87,.2), 0 0 0 6px rgba(107,35,142,.08); }
.paper-arc { position: absolute; top: 21px; left: 50%; width: 66px; height: 22px; opacity: .62; transform: translateX(-50%); }
.paper-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--feedback-muted); font-size: 12px; font-weight: 750; }
.connection-state { display: inline-flex; align-items: center; gap: 7px; }
.connection-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--feedback-arc); }
.connection-state.checking i { animation: feedback-pulse 1.35s ease-in-out infinite; }
.connection-state.ready { color: var(--feedback-green); }
.connection-state.ready i { background: var(--feedback-green); }
.connection-state.offline { color: var(--feedback-red); }
.connection-state.offline i { background: var(--feedback-red); }

#message {
  display: block; width: 100%; min-height: 168px; max-height: 460px; margin: 20px 0 4px; padding: 4px 2px; border: 0; resize: none;
  color: var(--feedback-ink); background: transparent; outline: none; font: 500 20px/1.75 var(--font-body); letter-spacing: -.01em;
}
#message::placeholder { color: #a19aa5; opacity: 1; }

.nickname-field {
  display: grid; grid-template-columns: auto minmax(120px, 220px) 1fr; align-items: center; gap: 10px; min-height: 43px;
  margin: 2px 0 12px; padding: 6px 9px 6px 11px; border: 1px solid var(--feedback-line); border-radius: 12px; background: #fbf9fc;
}
.nickname-field > span { color: var(--feedback-ink); font-size: 12px; font-weight: 760; }
.nickname-field > small { color: var(--feedback-muted); font-size: 10px; text-align: right; }
#nickname {
  width: 100%; min-height: 30px; padding: 0 8px; border: 0; border-radius: 8px; color: var(--feedback-ink); background: #fff; outline: none;
  font: 600 13px var(--font-body);
}
#nickname::placeholder { color: #9a929f; opacity: 1; }
#nickname:focus-visible { box-shadow: 0 0 0 3px rgba(107,35,142,.13); }

.attachment-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 5px 0 15px; }
.attachment-list:empty { display: none; }
.attachment-chip {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) 32px; align-items: center; gap: 10px; min-height: 58px; padding: 5px 7px;
  border: 1px solid var(--feedback-line); border-radius: 13px; background: #fbf9fc;
}
.attachment-preview, .attachment-kind { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: var(--feedback-purple-soft); }
.attachment-preview { object-fit: cover; }
.attachment-kind { color: var(--feedback-purple); font-size: 11px; font-style: normal; font-weight: 850; letter-spacing: .04em; }
.attachment-copy { overflow: hidden; }
.attachment-copy strong, .attachment-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-copy strong { font-size: 12px; }
.attachment-copy small { margin-top: 2px; color: var(--feedback-muted); font-size: 10px; }
.attachment-remove { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 9px; color: var(--feedback-muted); background: transparent; cursor: pointer; }
.attachment-remove:hover { color: var(--feedback-red); background: rgba(179,38,30,.06); }

.paper-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 15px; border-top: 1px solid var(--feedback-line); }
.paper-tools { display: flex; align-items: center; gap: 12px; }
.attach-button, .quiet-button {
  min-height: 42px; padding: 0 13px; border: 1px solid var(--feedback-line); border-radius: 11px; color: var(--feedback-ink); background: #fff;
  font: 750 13px var(--font-body); cursor: pointer;
}
.attach-button { display: inline-flex; align-items: center; gap: 7px; }
.attach-button span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 7px; color: #fff; background: var(--feedback-purple); font-size: 17px; font-weight: 400; line-height: 1; }
.content-hint { color: var(--feedback-muted); font-size: 11px; }
.submit-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 20px; min-height: 48px; padding: 0 20px; border: 1px solid var(--feedback-purple);
  border-radius: 12px; color: #fff; background: var(--feedback-purple); font: 800 14px var(--font-body); box-shadow: 0 10px 24px rgba(107,35,142,.18); cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.submit-button:hover:not(:disabled) { color: #fff; background: var(--feedback-purple-deep); box-shadow: 0 13px 30px rgba(107,35,142,.24); transform: translateY(-1px); }
.submit-button:disabled { border-color: #ded9e1; color: #9d96a1; background: #f1eef2; box-shadow: none; cursor: not-allowed; }
.submit-button b { font-size: 18px; font-weight: 500; }
.form-status { min-height: 20px; margin: 11px 0 0; color: var(--feedback-muted); font-size: 11px; text-align: right; }
.form-status.bad { color: var(--feedback-red); }
.form-status.good { color: var(--feedback-green); }

.drop-hint {
  position: absolute; z-index: 5; inset: 12px; display: grid; align-content: center; justify-items: center; gap: 4px; border: 2px dashed rgba(107,35,142,.48);
  border-radius: 19px; color: var(--feedback-purple); background: rgba(252,251,253,.96); opacity: 0; pointer-events: none; transform: scale(.985); transition: opacity .16s ease, transform .16s ease;
}
.drop-hint strong { font-family: var(--font-display); font-size: 24px; }
.drop-hint span { color: var(--feedback-muted); font-size: 12px; }
.paper.dragging .drop-hint { opacity: 1; transform: scale(1); }

.receipt {
  min-height: 470px; padding: 42px 44px 34px; border: 1px solid rgba(19,122,90,.18); border-radius: 26px; background: #fff;
  box-shadow: 0 28px 90px rgba(50,24,61,.12); animation: receipt-enter .5s cubic-bezier(.2,.8,.2,1) both;
}
.receipt-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 22px; border-radius: 50%; color: #fff; background: var(--feedback-green); box-shadow: 0 10px 24px rgba(19,122,90,.18); font-size: 24px; }
.receipt h2 { max-width: 600px; margin: 0; font-family: var(--font-display); font-size: clamp(34px, 5vw, 52px); line-height: 1.14; letter-spacing: -.045em; }
.receipt-summary { margin: 13px 0 26px; color: var(--feedback-muted); }
.receipt-code { display: inline-flex; align-items: center; gap: 8px; margin: -12px 0 24px; padding: 7px 10px; border-radius: 9px; color: var(--feedback-muted); background: var(--feedback-purple-soft); font-size: 11px; }
.receipt-code strong { color: var(--feedback-purple); font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 12px; letter-spacing: .02em; }
.receipt-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 30px; padding: 0; list-style: none; }
.receipt-progress li { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: start; }
.receipt-progress li::before { position: absolute; top: 8px; right: 0; left: 10px; height: 1px; content: ""; background: var(--feedback-line); }
.receipt-progress i { position: relative; z-index: 1; width: 17px; height: 17px; border: 4px solid #fff; border-radius: 50%; background: #d7d0da; box-shadow: 0 0 0 1px var(--feedback-line); }
.receipt-progress .active i { background: var(--feedback-green); }
.receipt-progress span { display: grid; gap: 2px; padding-right: 10px; }
.receipt-progress strong { font-size: 12px; }
.receipt-progress small { color: var(--feedback-muted); font-size: 10px; line-height: 1.45; }
.receipt-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.receipt-note { margin: 14px 0 0; color: var(--feedback-muted); font-size: 11px; }

.echo-section { width: min(820px, 100%); margin: 112px auto 0; padding-top: 72px; border-top: 1px solid var(--feedback-line); }
.echo-heading { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: end; margin-bottom: 30px; }
.echo-heading h2 { margin: 0; font-family: var(--font-display); font-size: clamp(34px, 5vw, 54px); line-height: 1.12; letter-spacing: -.04em; }
.echo-heading > p { margin: 0 0 4px; color: var(--feedback-muted); }
.echo-list { display: grid; gap: 9px; }
.echo-row, .echo-empty { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 13px; align-items: start; padding: 17px 18px; border: 1px solid var(--feedback-line); border-radius: 15px; background: rgba(255,255,255,.72); }
.echo-row > i, .echo-empty > i { width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--feedback-arc); }
.echo-row.done > i { background: var(--feedback-green); }
.echo-row.reviewing > i { background: var(--feedback-purple); box-shadow: 0 0 0 5px rgba(107,35,142,.07); }
.echo-row span, .echo-empty span { display: grid; gap: 4px; }
.echo-row strong, .echo-empty strong { font-size: 14px; }
.echo-row small, .echo-empty small { color: var(--feedback-muted); font-size: 12px; line-height: 1.55; }
.echo-row time, .echo-status { color: var(--feedback-muted); font-size: 10px; white-space: nowrap; }
.echo-status { display: inline-flex; min-height: 24px; align-items: center; padding: 0 8px; border-radius: 999px; background: var(--feedback-purple-soft); }
.my-echoes { margin-top: 44px; }
.my-echoes-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.my-echoes h3 { margin: 0; font-family: var(--font-display); font-size: 24px; }

.noscript-note { width: min(760px, 100%); margin: 16px auto 0; padding: 12px 14px; border: 1px solid var(--feedback-line); border-radius: 12px; color: var(--feedback-muted); background: #fff; }
.feedback-footer { padding: 30px 0; border-top: 1px solid var(--feedback-line); background: #fff; }
.feedback-footer .shell-wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.feedback-footer p { display: grid; gap: 2px; margin: 0; }
.feedback-footer p strong { font-size: 14px; }
.feedback-footer p span { color: var(--feedback-muted); font-size: 11px; }
.feedback-footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; }
.feedback-footer nav a { color: var(--feedback-muted); font-size: 12px; }

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

@keyframes feedback-pulse { 0%, 100% { opacity: .45; transform: scale(.86); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes receipt-enter { from { opacity: 0; transform: translateY(12px) scale(.988); } to { opacity: 1; transform: none; } }

@media (max-width: 767px) {
  .feedback-main { width: min(100% - 24px, 520px); padding: 58px 0 78px; }
  .feedback-intro { margin-bottom: 26px; text-align: left; }
  .feedback-intro h1 { font-size: clamp(42px, 13vw, 58px); }
  .feedback-intro > p:last-child { margin: 16px 0 0; font-size: 16px; }
  .composer-shell, .paper, .receipt { min-height: 430px; }
  .paper { padding: 18px 17px 14px; border-radius: 21px; }
  .paper-arc { top: 17px; width: 52px; }
  #message { min-height: 245px; margin-top: 20px; font-size: 18px; line-height: 1.72; }
  .nickname-field { grid-template-columns: auto minmax(0, 1fr); }
  .nickname-field > small { display: none; }
  .attachment-list { grid-template-columns: 1fr; }
  .paper-foot { align-items: stretch; flex-direction: column; }
  .paper-tools { justify-content: space-between; }
  .submit-button { width: 100%; }
  .form-status { text-align: left; }
  .receipt { padding: 30px 23px 24px; border-radius: 21px; }
  .receipt-progress { grid-template-columns: 1fr; gap: 12px; }
  .receipt-progress li::before { top: 8px; bottom: -20px; left: 8px; width: 1px; height: auto; }
  .receipt-progress li:last-child::before { display: none; }
  .echo-section { margin-top: 78px; padding-top: 54px; }
  .echo-heading { grid-template-columns: 1fr; gap: 18px; }
  .echo-row, .echo-empty { grid-template-columns: 14px minmax(0,1fr); padding: 15px; }
  .echo-row time, .echo-status { grid-column: 2; justify-self: start; }
  .feedback-footer .shell-wrap { align-items: flex-start; flex-direction: column; }
  .feedback-footer nav { justify-content: flex-start; }
}

@media (max-width: 360px) {
  .feedback-main { width: calc(100% - 20px); }
  .content-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .paper, .drop-hint, .submit-button, .receipt { animation: none !important; transition: none !important; transform: none !important; }
  .connection-state.checking i { animation: none; }
}

@media (forced-colors: active) {
  .paper, .receipt, .echo-row, .echo-empty { border: 1px solid CanvasText; }
  .submit-button, .attach-button { border: 1px solid ButtonText; }
}
