:root {
  --color-bg: #000000;
  --color-surface: #151515;
  --color-surface-2: #1d1d1d;
  --color-surface-3: #242424;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-primary: #a8ff35;
  --color-primary-soft: rgba(168, 255, 53, 0.12);
  --color-text: #ffffff;
  --color-text-muted: rgba(255, 255, 255, 0.68);
  --color-text-disabled: rgba(255, 255, 255, 0.36);
  --color-danger: #ff7b7b;
  --color-warning: #ffd166;
  --color-success: #a8ff35;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --touch-min: 44px;
  --content-max-width: 430px;
  --bottom-nav-height: 78px;
  --visual-viewport-height: 100dvh;
}

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

html,
body {
  width: 100%;
  min-height: 100%;
}

html {
  color-scheme: dark;
  background-color: var(--color-bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 0;
  overflow-x: hidden;
  color: var(--color-text);
  background-color: var(--color-bg);

  font-family:
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Noto Sans KR",
    sans-serif;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  color: inherit;
  border: 0;
  cursor: pointer;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
a,
input,
select,
textarea {
  min-width: 0;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  width: 100%;
  min-height: var(--touch-min);
  font-size: 16px;
}

textarea {
  line-height: 1.55;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.44);
  opacity: 1;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.48;
}

:where(
  button,
  a,
  input,
  select,
  textarea,
  [tabindex]:not([tabindex="-1"])
):focus-visible {
  outline: 3px solid rgba(168, 255, 53, 0.72);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.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;
}

.gymfit-state {
  min-height: 150px;
  padding: var(--space-6) var(--space-4);
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.55;
}

.gymfit-state strong {
  color: var(--color-text);
  font-size: 16px;
}

.gymfit-state p {
  max-width: 30rem;
  font-size: 14px;
}

.gymfit-state-action {
  min-height: var(--touch-min);
  margin-top: var(--space-2);
  padding: 0 var(--space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #050505;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

[aria-busy="true"] {
  cursor: progress;
}

[role="dialog"],
[role="alertdialog"] {
  max-width: 100%;
  overscroll-behavior: contain;
  scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

[role="dialog"] input,
[role="dialog"] select,
[role="dialog"] textarea {
  scroll-margin-block: 96px;
}

:where(
  .profile-sheet,
  .machine-sheet,
  .gym-sheet,
  .schedule-sheet,
  .assignment-sheet,
  .manual-record-sheet
) {
  max-height: calc(var(--visual-viewport-height) - 16px);
}

input::-ms-reveal,
input::-ms-clear {
  display: none;
}

/* =========================
   브라우저 자동완성 스타일
========================= */

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:active {
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff;

  -webkit-box-shadow:
    0 0 0 1000px #292929 inset !important;

  box-shadow:
    0 0 0 1000px #292929 inset !important;

  border-color:
    rgba(255, 255, 255, 0.11) !important;

  outline: none !important;

  transition:
    background-color 9999s ease-out 0s;
}

/* 포커스 상태에서만 초록 테두리 */
input:-webkit-autofill:focus,
textarea:-webkit-autofill:focus,
select:-webkit-autofill:focus {
  border-color:
    rgba(168, 255, 53, 0.72) !important;

  outline: none !important;

  -webkit-box-shadow:
    0 0 0 1000px #292929 inset,
    0 0 0 3px rgba(168, 255, 53, 0.08) !important;

  box-shadow:
    0 0 0 1000px #292929 inset,
    0 0 0 3px rgba(168, 255, 53, 0.08) !important;
}
