* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background:
    linear-gradient(180deg, var(--blue) 0 260px, transparent 260px),
    var(--rest);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.65;
  min-height: 100dvh;
}

/* ---- アプリシェル(スマホ枠) ---- */
#app {
  max-width: var(--app-max);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--rest);
  position: relative;
  box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(22, 32, 45, 0.25);
  padding-bottom: calc(var(--nav-h) + var(--sp-6));
  overflow: hidden;
}
/* 背景の大きなドット模様(休止面の端だけに) */
#app::before {
  content: '';
  position: absolute; right: -40px; top: 120px;
  width: 220px; height: 320px;
  background: var(--dots); background-size: var(--dots-size);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
main { padding: 0 var(--sp-4); position: relative; z-index: 1; }

h1, h2, h3 { line-height: 1.25; font-weight: 900; }

a { color: var(--blue); text-decoration: none; font-weight: 700; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: var(--text-md);
  color: var(--text);
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: var(--r-md);
  padding: 12px 14px;
  width: 100%;
  transition: box-shadow var(--dur-fast), border-color var(--dur-fast);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
::placeholder { color: var(--text-faint); }

img { max-width: 100%; display: block; }

code { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.06em; background: var(--navy); color: var(--yellow); padding: 1px 7px; border-radius: 4px; font-size: 0.9em; }

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