:root {
  color-scheme: light;
  --page: #ffffff;
  --panel: #ffffff;
  --ink: #1f2328;
  --muted: #68707d;
  --line: rgb(31 35 40 / 14%);
  --control: #f6f8fa;
  --focus: #0b5cad;
  font-family:
    "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
}

[hidden] {
  display: none !important;
}

button,
select,
textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
}

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

select,
textarea {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

select {
  min-height: 38px;
  border-radius: 999px;
  padding: 0 34px 0 12px;
}

textarea {
  display: block;
  width: 100%;
  min-height: 8.4rem;
  max-height: 12rem;
  border-radius: 8px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.55;
}

.show-card-shell {
  display: grid;
  min-height: 100dvh;
  width: min(100%, 760px);
  margin: 0 auto;
  background: var(--page);
}

.setup-panel,
.editing-panel {
  align-self: end;
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 16px 14px max(18px, env(safe-area-inset-bottom));
}

.shown-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 100dvh;
}

.language-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.language-row .button {
  grid-column: 1 / -1;
}

.stack-field,
.draft-field {
  display: grid;
  gap: 6px;
}

.show-card-header,
.source-strip,
.action-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.show-card-header {
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
}

.show-card-header .button {
  margin-left: auto;
}

.show-card {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 24px 18px;
}

.show-text {
  margin: 0;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: pre-wrap;
  font-size: clamp(2rem, 10vw, 4.8rem);
  line-height: 1.25;
}

.source-strip {
  display: grid;
  align-items: start;
  border-top: 1px solid var(--line);
  padding: 12px 14px max(16px, env(safe-area-inset-bottom));
}

.source-strip p {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.source-label,
.form-status {
  color: var(--muted);
  font-size: 0.92rem;
}

.action-row {
  justify-content: space-between;
}

.button {
  min-height: 44px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--control);
  color: var(--ink);
  cursor: pointer;
  font-weight: 760;
  padding: 0 14px;
}

.primary-button {
  background: var(--ink);
  color: #fff;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 760;
}

.qr-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: end center;
  background: rgb(31 35 40 / 38%);
  padding: 16px;
  z-index: 10;
}

.qr-sheet {
  display: grid;
  gap: 12px;
  width: min(100%, 380px);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.qr-panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.qr-panel-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 760;
}

.qr-box {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.qr-box svg {
  display: block;
  width: min(100%, 320px);
  height: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
