/* Reset, typography and form baseline. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

/* Scripts Hanken Grotesk does not cover use each platform's font; the lang attribute also picks the right Han glyphs. */
:lang(ja) {
  --font-ui: "Hanken Grotesk", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif;
}

:lang(ko) {
  --font-ui: "Hanken Grotesk", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

:lang(zh-Hans) {
  --font-ui: "Hanken Grotesk", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

:lang(th) {
  --font-ui: "Hanken Grotesk", Thonburi, "Leelawadee UI", "Noto Sans Thai", Tahoma, sans-serif;
  --lh-text: 1.65;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-14);
  line-height: var(--lh-text);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  line-height: var(--lh-heading);
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--fs-32);
}

h2 {
  font-size: var(--fs-24);
}

h3 {
  font-size: var(--fs-20);
}

h4 {
  font-size: var(--fs-16);
}

p {
  margin: 0 0 var(--sp-3);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
svg {
  max-width: 100%;
  display: inline-block;
  vertical-align: middle;
}

code,
kbd,
pre,
.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  font-variant-ligatures: none;
}

code {
  background: var(--panel-2);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
}

pre {
  margin: 0;
  overflow-x: auto;
  tab-size: 4;
}

pre code {
  background: none;
  padding: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-3);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

legend {
  padding: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: var(--z-toast);
  background: var(--panel);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
}

.skip-link:focus {
  left: 8px;
}

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