:root {
    color-scheme: light;
    --color-ink: #14213d;
    --color-muted: #5f6b7a;
    --color-line: #dce3ea;
    --color-surface: #ffffff;
    --color-canvas: #f3f6f8;
    --color-primary: #075c4c;
    --color-primary-dark: #03483b;
    --color-accent: #f2a900;
    --color-success: #13795b;
    --color-success-soft: #e8f5ef;
    --color-warning: #9a6100;
    --color-warning-soft: #fff5db;
    --color-error: #b42318;
    --color-error-soft: #fff0ee;
    --shadow-card: 0 14px 40px rgba(20, 33, 61, 0.08);
    --radius-large: 22px;
    --radius-medium: 14px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}

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

html {
    min-height: 100%;
    background: var(--color-canvas);
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
    color: var(--color-ink);
    background: var(--color-canvas);
    font-family: var(--font-sans);
    line-height: 1.65;
    text-rendering: optimizeLegibility;
}

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

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

[hidden] {
    display: none !important;
}

.employee-shell {
    width: min(100% - 24px, 680px);
    margin: 0 auto;
    padding: 18px 0 40px;
}

.employee-shell--centered {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding-block: 28px;
}

.employee-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    margin-bottom: 14px;
    gap: 16px;
}

.employee-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.employee-brand__mark {
    display: grid;
    width: 38px;
    height: 38px;
    color: #fff;
    background: var(--color-primary);
    border-radius: 11px;
    place-items: center;
    box-shadow: 0 7px 18px rgba(7, 92, 76, 0.2);
}

.employee-brand__name {
    font-size: 1rem;
}

.employee-topbar__user {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: right;
}

.employee-card {
    padding: 22px 18px;
    background: var(--color-surface);
    border: 1px solid rgba(220, 227, 234, 0.86);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
}

.employee-card + .employee-card,
.employee-card + .employee-notice,
.employee-notice + .employee-card {
    margin-top: 14px;
}

.employee-card--hero {
    overflow: hidden;
    position: relative;
    text-align: center;
}

.employee-card--hero::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), #27a67f);
    content: "";
}

.employee-eyebrow {
    margin: 0 0 3px;
    color: var(--color-primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.employee-title,
.employee-section-title {
    margin: 0;
    color: var(--color-ink);
    line-height: 1.35;
}

.employee-title {
    margin-top: 16px;
    font-size: clamp(1.35rem, 6vw, 1.75rem);
    text-align: center;
}

.employee-title--left {
    margin-top: 0;
    text-align: left;
}

.employee-section-title {
    font-size: 1.35rem;
}

.employee-section-title--small {
    font-size: 1.05rem;
}

.employee-lead {
    max-width: 34rem;
    margin: 12px auto 0;
    color: var(--color-muted);
    font-size: 0.94rem;
    text-align: center;
}

.employee-lead--left {
    margin-inline: 0;
    text-align: left;
}

.employee-help,
.employee-field-help {
    color: var(--color-muted);
    font-size: 0.8rem;
}

.employee-help {
    margin: 18px 0 0;
    text-align: center;
}

.employee-help--compact {
    margin-top: 5px;
}

.live-clock {
    display: block;
    margin-top: 2px;
    color: var(--color-ink);
    font-size: clamp(2.6rem, 14vw, 4.4rem);
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.15;
}

.live-clock__date {
    margin: 2px 0 0;
    color: var(--color-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.work-state {
    display: flex;
    align-items: flex-start;
    margin-top: 18px;
    padding: 14px;
    gap: 12px;
    border-radius: var(--radius-medium);
    text-align: left;
}

.work-state--working {
    background: var(--color-success-soft);
}

.work-state--off {
    background: #eef3f6;
}

.work-state__dot {
    flex: 0 0 auto;
    width: 11px;
    height: 11px;
    margin-top: 7px;
    background: #7a8795;
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(122, 135, 149, 0.22);
}

.work-state--working .work-state__dot {
    background: var(--color-success);
    box-shadow: 0 0 0 2px rgba(19, 121, 91, 0.2);
}

.work-state__label,
.work-state__description {
    margin: 0;
}

.work-state__label {
    font-size: 1rem;
    font-weight: 800;
}

.work-state__description {
    margin-top: 1px;
    color: var(--color-muted);
    font-size: 0.82rem;
}

.employee-notice {
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-medium);
    font-size: 0.88rem;
}

.employee-notice p {
    margin: 0;
}

.employee-notice p + p {
    margin-top: 4px;
}

.employee-notice--info {
    color: #18526b;
    background: #edf7fb;
    border-color: #cde8f2;
}

.employee-notice--warning {
    color: #724c08;
    background: var(--color-warning-soft);
    border-color: #f1d98f;
}

.employee-notice--error {
    color: var(--color-error);
    background: var(--color-error-soft);
    border-color: #f5c8c2;
}

.employee-notice__title {
    margin: 0 0 2px;
    font-size: 0.98rem;
}

.employee-notice__meta {
    font-size: 0.78rem;
}

.clock-panel__heading,
.measurement__labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.device-badge {
    flex: 0 0 auto;
    padding: 5px 9px;
    font-size: 0.72rem;
    font-weight: 800;
    border-radius: 999px;
}

.device-badge--ok {
    color: var(--color-success);
    background: var(--color-success-soft);
}

.device-badge--warning {
    color: var(--color-warning);
    background: var(--color-warning-soft);
}

.clock-steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.clock-step {
    display: flex;
    position: relative;
    align-items: center;
    color: #8893a1;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
}

.clock-step::after {
    position: absolute;
    z-index: 0;
    top: 15px;
    right: 0;
    left: 34px;
    height: 2px;
    background: var(--color-line);
    content: "";
}

.clock-step:last-child {
    justify-content: flex-end;
}

.clock-step:last-child::after {
    display: none;
}

.clock-step__number {
    display: grid;
    z-index: 1;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    background: #e8edf1;
    border-radius: 50%;
    place-items: center;
}

.clock-step--active {
    color: var(--color-primary);
}

.clock-step--active .clock-step__number {
    color: #fff;
    background: var(--color-primary);
}

.clock-step--complete {
    color: var(--color-success);
}

.clock-step--complete .clock-step__number {
    color: transparent;
    background: var(--color-success);
}

.clock-step--complete .clock-step__number::before {
    color: #fff;
    content: "✓";
}

.location-status {
    display: flex;
    align-items: flex-start;
    margin-top: 18px;
    padding: 14px;
    gap: 12px;
    background: #f1f4f6;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-medium);
}

.location-status__icon {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 4px;
    background: #7a8795;
    border: 4px solid #dbe1e6;
    border-radius: 50%;
}

.location-status--checking .location-status__icon {
    background: var(--color-accent);
    border-color: #ffebb7;
    animation: employee-pulse 1.2s ease-in-out infinite;
}

.location-status--ok {
    background: var(--color-success-soft);
    border-color: #bde2d3;
}

.location-status--ok .location-status__icon {
    background: var(--color-success);
    border-color: #bde2d3;
}

.location-status--error {
    background: var(--color-error-soft);
    border-color: #f5c8c2;
}

.location-status--error .location-status__icon {
    background: var(--color-error);
    border-color: #f5c8c2;
}

.location-status__title,
.location-status__detail {
    margin: 0;
}

.location-status__title {
    font-size: 0.92rem;
    font-weight: 800;
}

.location-status__detail {
    margin-top: 2px;
    color: var(--color-muted);
    font-size: 0.8rem;
}

.measurement {
    margin-top: 16px;
}

.measurement__labels {
    color: var(--color-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.measurement__progress {
    display: block;
    width: 100%;
    height: 8px;
    margin-top: 8px;
    overflow: hidden;
    appearance: none;
    background: #e4eaee;
    border: 0;
    border-radius: 999px;
}

.measurement__progress::-webkit-progress-bar {
    background: #e4eaee;
}

.measurement__progress::-webkit-progress-value {
    background: var(--color-primary);
    border-radius: 999px;
}

.measurement__progress::-moz-progress-bar {
    background: var(--color-primary);
    border-radius: 999px;
}

.employee-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    gap: 8px;
    color: var(--color-ink);
    background: #fff;
    border: 1px solid var(--color-line);
    border-radius: 13px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.employee-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.employee-button:focus-visible,
.employee-input:focus-visible,
.employee-select:focus-visible,
.employee-textarea:focus-visible,
.employee-text-link:focus-visible,
.employee-back-link:focus-visible {
    outline: 3px solid rgba(7, 92, 76, 0.28);
    outline-offset: 3px;
}

.employee-button:disabled {
    color: #89939e;
    background: #e7ebee;
    border-color: #e7ebee;
    cursor: not-allowed;
    box-shadow: none;
}

.employee-button--primary {
    width: 100%;
    color: #fff;
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 8px 20px rgba(7, 92, 76, 0.18);
}

.employee-button--primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.employee-button--secondary {
    width: 100%;
    background: #fff;
}

.employee-button--location {
    width: 100%;
    margin-top: 16px;
    color: var(--color-primary);
    background: #f3faf7;
    border-color: #a9d6c4;
}

.employee-button--punch {
    min-height: 60px;
    margin-top: 12px;
    font-size: 1.15rem;
}

.pin-field {
    margin-top: 18px;
    padding: 16px;
    background: var(--color-warning-soft);
    border-radius: var(--radius-medium);
}

.employee-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 800;
}

.employee-input,
.employee-select,
.employee-textarea {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #bac5cf;
    border-radius: 11px;
    font-size: 1rem;
}

.employee-textarea {
    min-height: 130px;
    resize: vertical;
}

.employee-input--pin {
    max-width: 10rem;
    font-size: 1.45rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: 0.3em;
    text-align: center;
}

.employee-field-help {
    margin: 5px 0 0;
}

.punch-result {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-medium);
    font-size: 0.94rem;
    font-weight: 800;
    text-align: center;
}

.punch-result--success {
    color: var(--color-success);
    background: var(--color-success-soft);
    border-color: #bde2d3;
}

.punch-result--error {
    color: var(--color-error);
    background: var(--color-error-soft);
    border-color: #f5c8c2;
}

.after-punch {
    margin-top: 10px;
}

.correction-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.correction-link-card p {
    margin: 5px 0 0;
    color: var(--color-muted);
    font-size: 0.82rem;
}

.employee-text-link,
.employee-back-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    color: var(--color-primary);
    font-weight: 800;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.employee-text-link {
    flex: 0 0 auto;
    gap: 6px;
}

.employee-back-link {
    gap: 7px;
    text-decoration: none;
}

.employee-footer {
    padding: 22px 12px 0;
    color: #7a8795;
    font-size: 0.75rem;
    text-align: center;
}

.employee-footer p {
    margin: 0;
}

.token-exchange {
    width: 100%;
    max-width: 500px;
    padding: 30px 22px;
    text-align: center;
}

.token-exchange .employee-brand {
    justify-content: center;
}

.token-exchange .employee-button {
    margin-top: 14px;
}

.status-illustration {
    display: grid;
    width: 74px;
    height: 74px;
    margin: 28px auto 6px;
    background: #e8f5ef;
    border-radius: 50%;
    place-items: center;
}

.status-illustration span {
    width: 30px;
    height: 30px;
    border: 4px solid #a9d6c4;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: employee-spin 1s linear infinite;
}

.token-exchange .employee-notice {
    margin-top: 22px;
}

.correction-form-card .employee-notice {
    margin-top: 20px;
}

.employee-form {
    margin-top: 24px;
}

.employee-field + .employee-field {
    margin-top: 20px;
}

.employee-form .employee-button {
    margin-top: 22px;
}

.employee-form .employee-button + .employee-button {
    margin-top: 10px;
}

.required-label {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 5px;
    color: var(--color-error);
    background: var(--color-error-soft);
    border-radius: 4px;
    font-size: 0.66rem;
    vertical-align: 1px;
}

@keyframes employee-spin {
    to { transform: rotate(360deg); }
}

@keyframes employee-pulse {
    50% { opacity: 0.45; }
}

@media (min-width: 620px) {
    .employee-shell {
        padding-top: 30px;
    }

    .employee-card {
        padding: 28px;
    }

    .employee-card--hero {
        padding-block: 30px;
    }
}

@media (max-width: 430px) {
    .clock-panel__heading,
    .correction-link-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .correction-link-card {
        gap: 8px;
    }

    .employee-text-link {
        width: 100%;
        justify-content: space-between;
    }
}

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