*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--white);
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}

h1 {
    font-size: 22px;
    line-height: 1.25;
    font-weight: 650;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 16px;
    line-height: 1.35;
    font-weight: 620;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 14px;
    font-weight: 600;
}

a {
    color: inherit;
}

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

button {
    cursor: pointer;
}

img,
svg {
    display: block;
}

[hidden] {
    display: none !important;
}

.num {
    font-variant-numeric: tabular-nums;
}

.muted {
    color: var(--g-500);
}

.small {
    font-size: 13px;
}

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

.wordmark {
    font-weight: 500;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    font-size: 13px;
    padding-left: 0.34em;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: var(--r);
    border: 1px solid transparent;
    background: transparent;
    font-size: 14px;
    font-weight: 550;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color 0.12s, border-color 0.12s, color 0.12s, opacity 0.12s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn svg {
    flex: none;
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--ink);
    color: var(--white);
}

.btn-primary:not(:disabled):hover {
    background: var(--g-800);
}

.btn-secondary {
    background: var(--white);
    border-color: var(--g-300);
    color: var(--ink);
}

.btn-secondary:not(:disabled):hover {
    background: var(--g-50);
    border-color: var(--g-400);
}

.btn-ghost {
    color: var(--g-700);
}

.btn-ghost:not(:disabled):hover {
    background: var(--g-100);
    color: var(--ink);
}

.btn-danger {
    background: var(--white);
    border-color: var(--g-300);
    color: var(--bad);
}

.btn-danger:not(:disabled):hover {
    background: var(--bad-soft);
    border-color: #e9a5a5;
}

.btn-ok {
    background: var(--ink);
    color: var(--white);
}

.btn-ok:not(:disabled):hover {
    background: var(--g-800);
}

.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
    gap: 6px;
}

.btn-lg {
    height: 48px;
    padding: 0 20px;
    font-size: 15px;
}

.btn-block {
    width: 100%;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--r);
    border: 1px solid transparent;
    background: transparent;
    color: var(--g-600);
    -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover {
    background: var(--g-100);
    color: var(--ink);
}

.icon-btn:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

.icon-btn.bordered {
    border-color: var(--g-300);
    background: var(--white);
}

.input,
.select,
.textarea {
    display: block;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--g-300);
    border-radius: var(--r);
    background: var(--white);
    font-size: 15px;
    transition: border-color 0.12s, box-shadow 0.12s;
}

.textarea {
    height: auto;
    min-height: 88px;
    padding: 10px 12px;
    resize: vertical;
    line-height: 1.45;
}

.select {
    appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.input::placeholder,
.textarea::placeholder {
    color: var(--g-400);
}

.input:hover,
.select:hover,
.textarea:hover {
    border-color: var(--g-400);
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: var(--focus);
}

.input[aria-invalid='true'],
.textarea[aria-invalid='true'] {
    border-color: var(--bad);
}

.input:disabled,
.select:disabled {
    background: var(--g-50);
    color: var(--g-500);
}

.input-sm,
.select.input-sm {
    height: 34px;
    font-size: 14px;
}

.field {
    display: grid;
    gap: 6px;
}

.field > label,
.field-label {
    font-size: 13px;
    font-weight: 550;
    color: var(--g-700);
}

.hint {
    font-size: 13px;
    color: var(--g-500);
}

.error-text {
    font-size: 13px;
    color: var(--bad);
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.check input {
    flex: none;
    margin: 1px 0 0;
}

input[type='checkbox'],
input[type='radio'] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--g-400);
    background: var(--white);
    display: inline-grid;
    place-content: center;
    cursor: pointer;
    transition: background-color 0.1s, border-color 0.1s;
}

input[type='checkbox'] {
    border-radius: 4px;
}

input[type='radio'] {
    border-radius: 50%;
}

input[type='checkbox']:checked {
    background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
    border-color: var(--ink);
}

input[type='radio']:checked {
    border-color: var(--ink);
    border-width: 5.5px;
}

input[type='checkbox']:focus-visible,
input[type='radio']:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

.time-select {
    width: 104px;
    font-variant-numeric: tabular-nums;
}

input[type='time'] {
    font-variant-numeric: tabular-nums;
}

input[type='time']::-webkit-calendar-picker-indicator {
    opacity: 0.5;
}

@media (max-width: 720px) {
    .input,
    .select,
    .textarea {
        font-size: 16px;
    }
}
