:root {
  --board: #f7f8f4;
  --board-warm: #fbfaf3;
  --ink: #1f2326;
  --muted: #6f7474;
  --line: #d8ddd8;
  --line-strong: #b6c0bc;
  --red: #d7332f;
  --red-deep: #a52724;
  --teal: #0b8790;
  --teal-deep: #066f78;
  --mint: #a9e0d6;
  --sticky: #ffe56a;
  --sticky-deep: #f3c74e;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --shadow: 0 18px 45px rgba(31, 35, 38, 0.14);
  --hand: "Hiragino Maru Gothic ProN", "Yu Gothic", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.7;
  background:
    linear-gradient(90deg, rgba(17, 25, 30, 0.46) 0 7%, rgba(17, 25, 30, 0.08) 34%, rgba(255, 255, 255, 0.28) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(15, 23, 26, 0.18)),
    url("./assets/office-bg.png") center / cover fixed no-repeat;
}

body::before {
  content: none;
  position: fixed;
  inset: 0 auto 0 0;
  width: 92px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent),
    repeating-linear-gradient(180deg, rgba(33, 43, 49, 0.16) 0 22px, transparent 22px 48px);
  pointer-events: none;
}

::selection {
  background: rgba(12, 135, 144, 0.18);
}

button,
textarea,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.noscript {
  padding: 12px 16px;
  background: #fff3c4;
  color: var(--ink);
  font-weight: 800;
  text-align: center;
}

.app {
  width: min(1600px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0;
}

.whiteboard {
  position: relative;
  min-height: calc(100vh - 40px);
  padding: 26px 30px 44px;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.9), transparent 24%),
    linear-gradient(rgba(26, 32, 34, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 32, 34, 0.022) 1px, transparent 1px),
    var(--board);
  background-size: auto, 36px 36px, 36px 36px, auto;
  border: 8px solid #d5dbdc;
  border-radius: 12px;
  box-shadow:
    inset 0 0 0 2px #eef1f1,
    inset 0 0 60px rgba(80, 92, 92, 0.08),
    0 28px 70px rgba(17, 24, 26, 0.26);
}

.board-rail {
  position: absolute;
  left: 18px;
  right: 18px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7faf9, #aeb8b9 52%, #edf1f0);
  box-shadow: inset 0 1px #fff, 0 2px 7px rgba(35, 45, 48, 0.18);
  pointer-events: none;
}

.board-rail--top {
  top: 0;
}

.board-rail--bottom {
  bottom: 5px;
  display: flex;
  justify-content: center;
  gap: 10px;
  height: 18px;
  background: linear-gradient(180deg, #e8eeed, #afb9ba 58%, #f8fbfa);
}

.marker,
.eraser {
  position: relative;
  top: -10px;
  display: block;
  height: 12px;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(35, 45, 48, 0.22);
}

.marker {
  width: 74px;
  background: linear-gradient(90deg, #f5f5f5 0 18%, currentColor 18% 76%, #f5f5f5 76%);
}

.marker--red {
  color: var(--red);
}

.marker--black {
  color: #1e2526;
}

.marker--teal {
  color: var(--teal);
}

.eraser {
  width: 70px;
  height: 18px;
  top: -14px;
  background: linear-gradient(180deg, #20282a, #111719);
}

.hero {
  position: relative;
  min-height: 250px;
  margin-bottom: 14px;
}

.hero-title {
  text-align: center;
  padding: 22px 230px 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
}

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

h1 {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  color: #161a1c;
  font-family: "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  font-size: clamp(2.45rem, 4.55vw, 3.95rem);
  font-weight: 950;
  line-height: 1.02;
  letter-spacing: 0;
  white-space: nowrap;
}

h1::after {
  content: "";
  position: absolute;
  left: -1%;
  right: -1%;
  bottom: -9px;
  height: 8px;
  background: var(--red);
  border-radius: 999px;
  transform: rotate(-1.5deg);
}

.lead {
  margin: 16px 0 0;
  color: #1f2326;
  font-size: clamp(1.15rem, 2.4vw, 1.85rem);
  font-weight: 900;
}

.lead::after {
  content: "";
  display: inline-block;
  width: 36px;
  height: 28px;
  margin-left: 12px;
  border-top: 4px solid var(--red);
  border-right: 4px solid var(--red);
  transform: rotate(18deg) skew(-18deg);
}

.hand-note,
.goal-bubble,
.hand-caption {
  font-family: var(--hand);
}

.hand-note {
  position: relative;
  display: grid;
  gap: 2px;
  width: fit-content;
  max-width: 260px;
  margin: 10px 0 0 12px;
  color: #111719;
  font-size: clamp(1rem, 1.5vw, 1.45rem);
  font-weight: 800;
  line-height: 1.45;
  transform: rotate(-8deg);
}

.hero > .hand-note {
  position: absolute;
  top: 16px;
  left: 10px;
}

.hand-note::before {
  content: "";
  position: absolute;
  inset: -8px auto -8px -22px;
  width: 18px;
  border-left: 3px solid #111719;
  border-radius: 50%;
}

.hand-note strong {
  width: fit-content;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 4px;
  text-underline-offset: 5px;
}

.goal-bubble {
  position: relative;
  justify-self: end;
  max-width: 260px;
  padding: 17px 25px 18px 30px;
  color: #171b1d;
  border: 3px solid #151a1c;
  border-radius: 50% 45% 48% 42% / 36% 48% 42% 54%;
  background: rgba(255, 255, 255, 0.44);
  transform: rotate(4deg);
}

.hero > .goal-bubble {
  position: absolute;
  top: 8px;
  right: 0;
}

.goal-bubble::after {
  content: "";
  position: absolute;
  left: 24px;
  bottom: -20px;
  width: 42px;
  height: 32px;
  border-bottom: 3px solid #151a1c;
  border-left: 3px solid #151a1c;
  border-radius: 0 0 0 100%;
  transform: rotate(8deg);
}

.goal-bubble p {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 1.15rem;
  font-weight: 900;
}

.goal-bubble ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1rem;
  font-weight: 800;
}

.goal-bubble li::before {
  content: "✓";
  margin-right: 8px;
  color: var(--red);
  font-weight: 950;
}

.board-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.62fr) minmax(590px, 1.85fr) minmax(240px, 0.72fr);
  gap: 20px;
  align-items: start;
}

.jargon-wall h2,
.action-wall h2,
.dictionary-strip h2 {
  margin: 0 0 12px;
  color: #1a1f21;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.4;
}

.jargon-wall h2 {
  border-bottom: 3px solid var(--red);
  transform: rotate(-1deg);
}

.action-wall h2 {
  border-bottom: 3px solid var(--teal);
}

.jargon-wall h2 span,
.action-wall h2 span,
.dictionary-strip h2 span {
  color: var(--muted);
  font-size: 0.9em;
}

.sticky-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(90px, 1fr));
  gap: 18px 14px;
  padding: 12px 2px 14px;
}

.sticky-note {
  position: relative;
  display: grid;
  min-height: 74px;
  place-items: center;
  padding: 10px;
  color: #171b1d;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.26), transparent 28%),
    linear-gradient(180deg, var(--sticky), var(--sticky-deep));
  box-shadow:
    0 12px 16px rgba(45, 54, 58, 0.16),
    inset 0 -14px 24px rgba(173, 121, 24, 0.12);
  font-family: var(--hand);
  font-size: clamp(0.9rem, 1.3vw, 1.12rem);
  font-weight: 900;
  line-height: 1.18;
  text-align: center;
  transform: rotate(var(--tilt, -2deg));
}

.sticky-note::before,
.sticky-note::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 9%;
  right: 9%;
  height: 3px;
  background: var(--red);
  border-radius: 999px;
  transform: rotate(28deg);
}

.sticky-note::after {
  transform: rotate(-28deg);
}

.sticky-note:nth-child(2n) {
  --tilt: 2deg;
}

.sticky-note:nth-child(3n) {
  --tilt: -4deg;
}

.hand-caption {
  position: relative;
  margin: 12px auto 0;
  width: fit-content;
  color: #171b1d;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.55;
  transform: rotate(-5deg);
}

.hand-caption::before {
  content: "↑";
  position: absolute;
  top: -32px;
  left: 6px;
  font-size: 1.65rem;
}

.tool {
  display: grid;
  grid-template-columns: minmax(245px, 1fr) 28px minmax(245px, 1fr);
  gap: 16px;
  align-items: start;
  padding: 18px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(2px);
}

.board-panel {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow:
    0 8px 24px rgba(36, 45, 47, 0.08),
    inset 0 1px rgba(255, 255, 255, 0.88);
}

.panel-head,
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-head {
  justify-content: flex-start;
}

.textarea-label,
.result-head h2 {
  margin: 0;
  color: #151a1c;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.35;
}

.info-dot {
  display: inline-grid;
  width: 17px;
  height: 17px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 900;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

textarea {
  min-height: 278px;
  padding: 16px;
  resize: vertical;
  line-height: 1.88;
}

textarea::placeholder,
input::placeholder {
  color: #777f7d;
}

input {
  min-height: 44px;
  padding: 8px 10px;
}

textarea:focus-visible,
input:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(11, 135, 144, 0.28);
  outline-offset: 2px;
}

.input-footer {
  display: grid;
  gap: 8px;
}

.button,
.filter-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 900;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
}

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

.button--primary {
  width: 100%;
  color: #fff;
  background: linear-gradient(180deg, #0b9aa3, var(--teal-deep));
  border-color: #087780;
  box-shadow: 0 10px 18px rgba(6, 111, 120, 0.26);
}

.button--secondary,
.button--ghost,
.filter-button {
  color: #1f2a2c;
  background: #fff;
  border-color: var(--line);
}

.button--secondary {
  min-width: 86px;
}

.button--ghost {
  min-height: 38px;
  background: rgba(255, 255, 255, 0.82);
}

.tool-message,
.copy-status {
  min-height: 1.45em;
  margin: 0;
  color: var(--teal-deep);
  font-size: 0.84rem;
  font-weight: 900;
}

.arrow-bridge {
  color: #949b99;
  font-size: 2.6rem;
  font-weight: 500;
  text-align: center;
}

.result-section {
  min-height: 100%;
}

.text-output {
  min-height: 278px;
  padding: 16px;
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  line-height: 1.92;
}

.sample-result-label {
  margin: 0 0 8px;
  color: #8f9694;
  font-size: 0.82rem;
  font-weight: 900;
}

.sample-result-body {
  color: #8f9694;
}

.sample-result-body .highlight-translated,
.sample-result-body .translation-note {
  color: #8f9694;
  background: transparent;
  font-weight: 600;
}

mark {
  color: inherit;
  background: transparent;
}

.highlight-translated {
  color: var(--red-deep);
  font-weight: 950;
  background: rgba(255, 229, 106, 0.46);
  border-radius: 3px;
  padding: 0 3px;
}

.translation-note {
  color: #5d6462;
  font-size: 0.9em;
  font-weight: 750;
}

.action-wall {
  display: grid;
  gap: 12px;
}

.action-card {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 12px 14px;
  color: #153436;
  background: linear-gradient(180deg, #b8eadf, #93d7cb);
  border: 1px solid rgba(28, 135, 128, 0.34);
  box-shadow: 0 8px 15px rgba(31, 56, 58, 0.16);
}

.action-card p {
  margin: 0;
  font-family: var(--hand);
  font-size: clamp(0.93rem, 1.15vw, 1.08rem);
  font-weight: 900;
  line-height: 1.42;
}

.action-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #0f4f56;
  border: 2px solid #0f727a;
  border-radius: 10px;
  font-size: 1.15rem;
  font-weight: 900;
}

.hand-caption--right {
  justify-self: end;
  margin-top: 20px;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  transform: rotate(-8deg);
}

.hand-caption--right::before {
  display: none;
}

.hand-caption--right::after {
  content: "";
  display: block;
  width: 142px;
  height: 4px;
  margin-top: 4px;
  background: var(--red);
  border-radius: 999px;
  transform: rotate(-3deg);
}

.dictionary-strip {
  margin: 20px auto 0;
  max-width: 860px;
  padding: 0 4px;
}

.dictionary-strip__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.mini-dictionary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.mini-term {
  display: grid;
  gap: 4px;
  min-height: 70px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(34, 42, 44, 0.08);
}

.mini-term span {
  color: #485150;
  font-size: 0.86rem;
  font-weight: 800;
}

.mini-term strong {
  color: #1f2326;
  font-size: 0.98rem;
  font-weight: 950;
}

.dictionary-count,
.privacy-note {
  margin: 9px 0 0;
  color: #697170;
  font-size: 0.82rem;
  font-weight: 800;
}

.privacy-note {
  margin-left: 4px;
}

.dictionary-dialog {
  width: min(960px, calc(100% - 24px));
  max-height: min(780px, calc(100% - 24px));
  padding: 22px;
  color: var(--ink);
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(31, 35, 38, 0.34);
}

.dictionary-dialog::backdrop {
  background: rgba(31, 35, 38, 0.48);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.dialog-head h2 {
  margin: 0;
  line-height: 1.3;
}

.icon-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: var(--red-deep);
  background: #fff;
  border-color: var(--line);
  font-size: 1.55rem;
  line-height: 1;
}

.dictionary-controls {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.search-label {
  font-weight: 900;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.filter-button {
  min-height: 38px;
  padding: 0 12px;
}

.filter-button.is-active {
  color: #fff;
  background: var(--teal-deep);
  border-color: var(--teal-deep);
}

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

.dictionary-card {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dictionary-card__category {
  display: inline-flex;
  width: fit-content;
  padding: 2px 8px;
  color: var(--teal-deep);
  border: 1px solid rgba(11, 135, 144, 0.42);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.dictionary-card h3 {
  margin: 12px 0 4px;
  font-size: 1.05rem;
}

.dictionary-card__translation {
  margin: 0 0 8px;
  color: var(--red-deep);
  font-weight: 950;
}

.dictionary-card__example {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.dictionary-empty {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  font-weight: 800;
}

@media (max-width: 1120px) {
  .whiteboard {
    padding: 28px 24px 44px;
  }

  .hero {
    min-height: 0;
    text-align: center;
  }

  .hand-note,
  .goal-bubble {
    justify-self: center;
  }

  .hero > .hand-note,
  .hero > .goal-bubble {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
  }

  .hero-title {
    padding: 16px 0 0;
  }

  h1 {
    white-space: normal;
  }

  .board-grid {
    grid-template-columns: minmax(180px, 0.54fr) minmax(620px, 1.7fr);
  }

  .action-wall {
    grid-column: 1 / -1;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
  }

  .action-wall h2,
  .hand-caption--right {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .app {
    width: min(100% - 18px, 1600px);
  }

  .whiteboard {
    padding: 24px 16px 42px;
  }

  .board-grid,
  .tool {
    grid-template-columns: 1fr;
  }

  .tool {
    order: 1;
  }

  .jargon-wall {
    order: 2;
  }

  .action-wall {
    order: 3;
  }

  .arrow-bridge {
    transform: rotate(90deg);
  }

  .sticky-grid,
  .action-wall,
  .mini-dictionary {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

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

  .whiteboard {
    min-height: 100vh;
    padding: 22px 12px 42px;
    border-width: 5px;
    border-radius: 0;
  }

  h1 {
    font-size: clamp(2.25rem, 13vw, 3.4rem);
  }

  .lead {
    font-size: 1.1rem;
  }

  .hand-note,
  .goal-bubble {
    max-width: 100%;
    transform: rotate(-2deg);
  }

  .tool {
    padding: 12px;
  }

  .board-panel {
    padding: 14px;
  }

  textarea,
  .text-output {
    min-height: 240px;
  }

  .result-head,
  .dictionary-strip__head {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .filter-button {
    width: 100%;
  }

  .dictionary-dialog {
    padding: 16px;
  }
}
