.tool-page main {
    overflow: clip;
    background: #fff;
}

.tool-hero {
    padding: 88px 0 82px;
    background:
        radial-gradient(circle at 10% 12%, rgba(99, 212, 231, 0.32), transparent 30%),
        radial-gradient(circle at 90% 84%, rgba(255, 120, 93, 0.2), transparent 34%),
        linear-gradient(135deg, #7367f7, #5352d9 58%, #3e48b8);
    color: #fff;
}

.tool-hero .eyebrow {
    color: rgba(255, 255, 255, 0.72);
}

.tool-hero h1 {
    max-width: 980px;
    font-size: clamp(3rem, 7vw, 6.4rem);
}

.tool-hero p:last-child {
    max-width: 760px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.08rem;
}

.tool-workspace {
    padding: 78px 0 110px;
    background:
        radial-gradient(circle at 50% 0, rgba(105, 92, 246, 0.1), transparent 34%),
        #f5f6fb;
}

.tool-panel {
    padding: 44px;
    border: 1px solid rgba(24, 25, 37, 0.08);
    border-radius: 34px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(54, 49, 112, 0.12);
}

.tool-create-form {
    display: flex;
    align-items: end;
    padding: 24px;
    border: 1px solid rgba(105, 92, 246, 0.13);
    border-radius: 22px;
    background: #f7f7ff;
    gap: 14px;
}

.tool-name-field,
.counter-name-field {
    display: grid;
    min-width: 0;
    gap: 7px;
}

.tool-name-field {
    flex: 1;
}

.tool-name-field span,
.counter-name-field span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 720;
}

.tool-name-field input,
.counter-name-field input {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 10px 13px;
    border: 1px solid rgba(24, 25, 37, 0.17);
    border-radius: 13px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 700;
}

.tool-name-field input:focus,
.counter-name-field input:focus,
.timer-fields input:focus {
    border-color: var(--violet);
    outline: 3px solid rgba(105, 92, 246, 0.16);
}

.timer-create-form {
    display: grid;
    align-items: end;
    grid-template-columns: minmax(220px, 0.8fr) minmax(420px, 1.2fr);
}

.timer-create-form > .tool-name-field {
    grid-column: 1;
    grid-row: 1;
}

.timer-create-form .tool-name-field input {
    min-height: 58px;
}

.timer-create-form .tool-name-field span,
.timer-fields label span {
    font-size: 0.82rem;
    font-weight: 700;
    text-align: left;
}

.timer-create-form .timer-fields {
    margin: 0;
    grid-column: 2;
    grid-row: 1;
}

.timer-create-form .timer-presets {
    justify-content: flex-start;
    margin: 0;
    grid-column: 2;
    grid-row: 2;
}

.timer-create-form > .tool-button-primary {
    width: 100%;
    grid-column: 1;
    grid-row: 2;
}

.tool-form-status {
    min-height: 1.5em;
    margin: 10px 0 0;
    color: #b84040;
    font-size: 0.86rem;
}

.tool-share {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border: 1px solid rgba(105, 92, 246, 0.14);
    border-radius: 18px;
    background: #fbfbff;
    gap: 20px;
}

.tool-share > div {
    display: grid;
    gap: 4px;
}

.tool-share strong {
    font-size: 0.96rem;
}

.tool-share span {
    color: var(--muted);
    font-size: 0.86rem;
}

.tool-share .tool-button {
    min-height: 46px;
    flex: 0 0 auto;
}

.tool-share-status {
    min-height: 1.5em;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.tool-share-status a {
    color: var(--violet-dark);
    font-weight: 720;
}

.tool-list {
    display: grid;
    margin-top: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.tool-list-empty {
    margin: 24px 0 0;
    padding: 28px;
    border-radius: 18px;
    background: var(--soft);
    color: var(--muted);
    text-align: center;
}

.counter-card {
    min-width: 0;
    padding: 28px;
    border: 1px solid rgba(24, 25, 37, 0.08);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(54, 49, 112, 0.08);
}

.counter-card:only-child {
    width: min(100%, 720px);
    justify-self: center;
    grid-column: 1 / -1;
}

.counter-card-header {
    display: flex;
    align-items: end;
    gap: 12px;
}

.counter-name-field {
    flex: 1;
}

.counter-name-field input {
    min-height: 46px;
    font-size: 1.08rem;
}

.remove-button {
    min-height: 46px;
    padding: 8px 13px;
    border: 1px solid rgba(184, 64, 64, 0.22);
    border-radius: 12px;
    background: #fffafa;
    color: #a63b3b;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 720;
}

.remove-button:hover {
    background: #fff0f0;
}

.counter-card .tool-display {
    padding: 38px 0 20px;
    font-size: clamp(1.8rem, 4vw, 3.4rem);
}

.counter-card .tool-actions {
    margin-top: 18px;
}

.counter-card .tool-button {
    min-height: 46px;
    padding: 8px 16px;
}

.tool-display {
    padding: 38px 12px;
    color: var(--ink);
    font-size: clamp(2.2rem, 9vw, 7.2rem);
    font-variant-numeric: tabular-nums;
    font-weight: 760;
    letter-spacing: -0.065em;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 28px;
    gap: 12px;
}

.tool-button,
.timer-presets button {
    min-height: 52px;
    padding: 10px 24px;
    border: 1px solid rgba(24, 25, 37, 0.13);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 740;
}

.tool-button:hover,
.timer-presets button:hover {
    border-color: rgba(105, 92, 246, 0.45);
    background: #f5f4ff;
}

.tool-button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.tool-button-primary {
    min-width: 138px;
    border-color: transparent;
    background: linear-gradient(135deg, var(--violet), var(--blue));
    box-shadow: 0 14px 30px rgba(87, 73, 235, 0.22);
    color: #fff;
}

.tool-button-primary:hover {
    border-color: transparent;
    background: linear-gradient(135deg, var(--violet-dark), #4058dd);
}

.tool-status {
    min-height: 1.6em;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.lap-section {
    max-width: 900px;
    margin: 48px auto 0;
    padding-top: 34px;
    border-top: 1px solid var(--line);
}

.counter-card .lap-section {
    margin-top: 28px;
    padding-top: 24px;
}

.counter-card .lap-section h2 {
    font-size: 1.45rem;
}

.lap-section h2 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.lap-empty {
    padding: 24px;
    border-radius: 18px;
    background: var(--soft);
    color: var(--muted);
    text-align: center;
}

.lap-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.lap-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.lap-table th,
.lap-table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    white-space: nowrap;
}

.lap-table th:first-child,
.lap-table td:first-child {
    text-align: left;
}

.lap-table th {
    color: var(--muted);
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.lap-table tr:last-child td {
    border-bottom: 0;
}

.timer-fields {
    display: grid;
    max-width: 680px;
    margin: 0 auto 22px;
    padding: 0;
    border: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.timer-fields legend {
    width: 100%;
    margin-bottom: 14px;
    font-weight: 760;
    text-align: left;
}

.timer-fields label {
    display: grid;
    min-width: 0;
    gap: 7px;
}

.timer-fields label span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
}

.timer-fields input {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    padding: 8px;
    border: 1px solid rgba(24, 25, 37, 0.17);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
    font-weight: 740;
    text-align: center;
}

.timer-fields input:disabled {
    background: #f3f3f7;
    color: var(--muted);
}

.timer-presets {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 34px;
    gap: 8px;
}

.timer-presets button {
    min-height: 42px;
    padding: 7px 15px;
    border-radius: 999px;
    font-size: 0.86rem;
}

.timer-presets button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.timer-dial {
    display: grid;
    width: min(100%, 570px);
    aspect-ratio: 1;
    margin-inline: auto;
    padding: 14px;
    border-radius: 50%;
    background: conic-gradient(var(--violet) var(--timer-progress, 100%), #e6e7ef 0);
    box-shadow: 0 24px 60px rgba(54, 49, 112, 0.13);
    place-items: stretch;
}

.timer-display {
    display: grid;
    padding: 20px;
    border-radius: 50%;
    background: #fff;
    font-size: clamp(2.8rem, 10vw, 6.5rem);
    place-items: center;
}

.timer-card .timer-dial {
    width: min(100%, 350px);
    margin-top: 28px;
    padding: 10px;
}

.timer-card .timer-display {
    padding: 14px;
    font-size: clamp(2rem, 5vw, 3.8rem);
}

.tool-about {
    padding: 100px 0;
}

.tool-about-grid {
    display: grid;
    align-items: center;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 72px;
}

.tool-about h2,
.tool-app h2,
.tool-faq h2 {
    font-size: clamp(2.5rem, 5vw, 4.7rem);
}

.tool-about p:not(.eyebrow),
.tool-app p:not(.eyebrow) {
    max-width: 670px;
    color: var(--muted);
}

.tool-other {
    padding: 30px;
    border: 1px solid rgba(105, 92, 246, 0.13);
    border-radius: 24px;
    background: #f6f5ff;
}

.tool-other p {
    margin-bottom: 12px;
    font-weight: 730;
}

.tool-other a {
    color: var(--violet-dark);
    font-weight: 760;
    text-underline-offset: 5px;
}

.tool-app {
    padding-bottom: 40px;
}

.tool-app-grid {
    position: relative;
    display: grid;
    min-height: 540px;
    overflow: hidden;
    align-items: center;
    padding: 70px;
    border-radius: 38px;
    background:
        radial-gradient(circle at 88% 12%, rgba(99, 212, 231, 0.34), transparent 28%),
        linear-gradient(135deg, #eeefff, #f8f8ff);
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.62fr);
}

.tool-app-grid > div {
    position: relative;
    z-index: 2;
}

.tool-app-phone {
    top: 48px;
    right: 9%;
    width: 260px;
    transform: rotate(4deg);
}

.tool-app-note {
    margin: 16px 0 0;
    font-size: 0.82rem;
}

.tool-faq {
    background: #fff;
}

@media (max-width: 840px) {
    .tool-hero {
        padding: 68px 0 64px;
    }

    .tool-panel {
        padding: 32px 24px;
    }

    .timer-create-form {
        grid-template-columns: 1fr;
    }

    .timer-create-form > .tool-name-field,
    .timer-create-form .timer-fields,
    .timer-create-form .timer-presets,
    .timer-create-form > .tool-button-primary {
        grid-column: 1;
        grid-row: auto;
    }

    .timer-create-form .timer-presets {
        margin-top: 4px;
    }

    .tool-list {
        grid-template-columns: 1fr;
    }

    .tool-about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .tool-app-grid {
        min-height: 820px;
        align-items: start;
        padding: 58px 40px;
        grid-template-columns: 1fr;
    }

    .tool-app-phone {
        top: auto;
        right: calc(50% - 130px);
        bottom: -138px;
    }
}

@media (max-width: 560px) {
    .tool-hero h1 {
        font-size: clamp(2.5rem, 13vw, 4rem);
        overflow-wrap: anywhere;
    }

    .tool-workspace {
        padding: 48px 0 78px;
    }

    .tool-panel {
        padding: 26px 16px;
        border-radius: 24px;
    }

    .tool-create-form {
        display: grid;
        padding: 18px;
        grid-template-columns: 1fr;
    }

    .tool-create-form .tool-button-primary {
        width: 100%;
    }

    .tool-share {
        align-items: stretch;
        flex-direction: column;
    }

    .tool-share .tool-button {
        width: 100%;
    }

    .counter-card {
        padding: 18px;
        border-radius: 20px;
    }

    .counter-card-header {
        align-items: stretch;
        flex-direction: column;
    }

    .remove-button {
        align-self: end;
        min-height: 40px;
    }

    .counter-card .tool-display {
        font-size: clamp(1.65rem, 8.5vw, 2.5rem);
    }

    .tool-display {
        padding: 26px 0;
        font-size: clamp(2rem, 11vw, 3.8rem);
    }

    .tool-button {
        flex: 1 1 120px;
        padding-inline: 15px;
    }

    .lap-table th,
    .lap-table td {
        padding: 13px 12px;
    }

    .timer-fields {
        gap: 8px;
    }

    .timer-fields input {
        min-height: 52px;
        font-size: 1rem;
    }

    .timer-dial {
        padding: 10px;
    }

    .timer-display {
        font-size: clamp(2.5rem, 15vw, 4.2rem);
    }

    .timer-card .timer-display {
        font-size: clamp(2rem, 12vw, 3.2rem);
    }

    .tool-about {
        padding: 78px 0;
    }

    .tool-app-grid {
        min-height: 780px;
        padding: 46px 24px;
        border-radius: 28px;
    }

    .tool-app-phone {
        right: calc(50% - 110px);
        bottom: -115px;
        width: 220px;
    }
}
