:root {
  color-scheme: light;
  font-family: "BIZ UDPGothic", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  color: #14243f;
  background: #eaf0f8;
  --paper: #fff;
  --border: #d6e0ed;
  --subtle: #4b6080;
  --blue: #1848b6;
  --yellow: #fbdc82;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid #b26a00;
  outline-offset: 3px;
}
.shell {
  width: min(100% - 2rem, 58rem);
  margin: 1.5rem auto;
  border: 1px solid var(--border);
  border-radius: 1.4rem;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 12px 40px #27426e12;
}
.masthead {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding: 1.3rem 1.7rem;
  background: #102850;
  color: #fff;
}
.identity { display: flex; gap: .85rem; align-items: center; min-width: 0; }
.mark {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; flex: none;
  border-radius: .7rem; background: var(--yellow); color: #102850; font-weight: 900;
}
.eyebrow { margin: 0 0 .35rem; font-size: .82rem; font-weight: 700; }
.masthead .eyebrow { color: #d3e1ff; }
.masthead h1 { margin: 0; font-size: clamp(1.05rem, 4.2vw, 1.45rem); }
.tag { border: 1px solid #7891bb; border-radius: 1rem; padding: .28rem .65rem; font-size: .875rem; overflow-wrap: anywhere; }
.welcome { max-width: 37rem; margin: auto; padding: clamp(1.5rem, 6vw, 4rem); }
.welcome .eyebrow { color: var(--blue); }
.welcome h2 { font-size: clamp(1.9rem, 6vw, 3.15rem); line-height: 1.22; margin: .45rem 0 1.1rem; letter-spacing: -.045em; }
.welcome > p:not(.eyebrow, .error) { color: var(--subtle); line-height: 1.65; }
.welcome form { display: grid; gap: .55rem; margin-top: 1.7rem; }
label { font-weight: 700; }
input, textarea {
  width: 100%; color: inherit; background: #f8fbff; border: 1px solid #a7b8d0;
  border-radius: .65rem; padding: .7rem .85rem;
}
.welcome input { margin-bottom: .65rem; }
button {
  background: var(--blue); color: white; border: 1px solid transparent;
  border-radius: .65rem; padding: .62rem .95rem; font-weight: 700;
}
button:hover:not(:disabled) { filter: brightness(.9); }
.footnote, .error, .from { font-size: .875rem; }
.error { color: #a12128; margin: 0; }
.error:not(:empty) { margin-top: .55rem; }
.conversation { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: min(74dvh, 47rem); min-height: 26rem; }
.intro { display: flex; gap: .7rem; align-items: center; padding: .85rem 1.55rem; border-bottom: 1px solid var(--border); }
.intro h2 { margin: 0; font-size: 1rem; }
.intro p { color: var(--subtle); margin: .22rem 0 0; font-size: .875rem; }
.presence { background: #287e61; width: .63rem; height: .63rem; border-radius: 50%; }
.messages { overflow: auto; list-style: none; padding: 1rem 1.55rem; margin: 0; background: #f7faff; }
.message { display: table; max-width: 85%; margin: 0 0 .95rem; }
.message.user { margin-left: auto; text-align: right; }
.from { display: block; color: var(--subtle); margin: 0 0 .24rem .3rem; }
.message p {
  padding: .7rem .9rem; margin: 0; border: 1px solid var(--border);
  border-radius: .9rem; background: var(--paper); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere;
}
.message.user p { background: #e5edff; color: #152f68; text-align: left; }
.message.notice p { background: #fff5d7; border-color: #e5c76e; }
.compose { border-top: 1px solid var(--border); padding: .85rem 1.55rem 1rem; }
.suggestions, .decisions, .tools { display: flex; flex-wrap: wrap; gap: .45rem; }
.suggestions, .tools { margin-bottom: .65rem; }
.decisions { margin-top: .45rem; }
.suggestions button, .decisions button + button {
  color: #194798; background: #edf3ff; border-color: #cddbf0; font-size: .875rem; padding: .35rem .65rem;
}
#send { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .55rem; align-items: start; }
textarea { resize: vertical; min-height: 2.65rem; max-height: 8rem; }
.operator-content { padding: 1.5rem; }
.tools a { align-self: center; color: var(--blue); font-weight: 700; padding: .55rem .6rem; }
.entry-qr { display: grid; justify-items: center; padding: clamp(1rem, 4vw, 2rem); text-align: center; }
.entry-qr h2 { font-size: clamp(1.3rem, 3vw, 2.1rem); margin: 0 0 .5rem; }
.entry-qr img { display: block; width: min(58dvh, 25rem, 77vw); height: auto; }
.entry-qr p { margin: .35rem 0; }
.entry-qr a { color: var(--blue); }
.activity { display: grid; gap: .65rem; padding: 0; list-style: none; }
.activity li { padding: 1rem; border: 1px solid var(--border); border-radius: .75rem; background: #f7faff; }
.activity span { color: var(--subtle); margin-left: .65rem; overflow-wrap: anywhere; }
.activity p { margin: .6rem 0 0; overflow-wrap: anywhere; }
#codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .5rem; }
#codes article { min-width: 0; text-align: center; border: 1px solid var(--border); padding: .35rem; border-radius: .55rem; }
#codes img { width: 7rem; max-width: 100%; display: block; margin: auto; }
#codes code { display: block; word-break: break-all; font-size: .8rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 540px) {
  .shell { width: 100%; min-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .masthead, .intro, .messages, .compose { padding-inline: .9rem; }
  .masthead { gap: .5rem; }
  .tag { font-size: .75rem; max-width: 7rem; }
  .conversation { height: calc(100dvh - 4.65rem); min-height: 21rem; }
  .message { max-width: 94%; }
}
