/* Home clock and profile widget */
.widget-replaced {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 20px;
}

.time-block-container {
    width: 100%;
    min-height: 56px;
    display: grid;
    grid-template-columns: minmax(58px, 1fr) auto minmax(58px, 1fr);
    align-items: center;
    gap: 8px;
}

.replaced-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.breathing-led {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #7c8388;
    box-shadow: 0 0 6px rgba(45, 52, 57, 0.24);
    animation: breathe 2s ease-in-out infinite;
}

.alano-text {
    color: #43494d;
    font-size: 0.9rem;
    font-weight: 500;
}

.time-and-seconds-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    min-width: 130px;
}

.paws-area {
    position: absolute;
    inset: -20px -20px -10px;
    z-index: 0;
    pointer-events: none;
}

.paw-print {
    position: absolute;
    fill: rgba(112, 121, 127, 0.4);
    opacity: 0;
    animation: paw-fade 3.5s ease-in-out forwards;
}

.big-time {
    position: relative;
    z-index: 2;
    color: var(--ink);
    font-size: 3.3rem;
    font-weight: 300;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.seconds-display {
    position: relative;
    z-index: 2;
    margin-bottom: 3px;
    color: #555e64;
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.date-replaced {
    color: #555e64;
    font-size: 0.75rem;
    line-height: 1.35;
    text-align: right;
}

.date-replaced > div {
    font-weight: 500;
}

.date-replaced > div:last-child {
    color: #71797f;
}

.photo-record-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.35);
    box-shadow:
        inset 2px 2px 5px rgba(255, 255, 255, 0.82),
        inset -1px -1px 4px rgba(42, 50, 56, 0.03),
        0 3px 8px rgba(42, 50, 56, 0.04);
}

.replaced-col-1 {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.image-placeholder {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
    background: rgba(22, 29, 33, 0.025);
    box-shadow: inset 1px 1px 3px rgba(22, 29, 33, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.62);
}

.image-placeholder img,
.record-center-cover img,
.cd-widget-image-container img,
.capsule-item img,
.call-widget-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-icon {
    color: #778087;
    font-size: 2.2rem;
}

.editable-name {
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 6px;
    color: #31373b;
}

.editable-name input {
    width: min(100%, 120px);
    min-width: 0;
    border: 0;
    border-bottom: 1px solid transparent;
    background: transparent;
    color: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
}

.editable-name input:hover,
.editable-name input:focus {
    border-bottom-color: rgba(49, 55, 59, 0.26);
}

.editable-name input:focus {
    outline-offset: 1px;
}

.editable-name i {
    flex: 0 0 auto;
    color: #687178;
    font-size: 0.9rem;
    opacity: 0.65;
}

.replaced-col-2 {
    position: relative;
    flex: 1;
    min-width: 0;
    aspect-ratio: 1;
}

.record-player {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.record-player::after {
    content: "";
    position: absolute;
    z-index: 15;
    top: calc(50% - 5px);
    left: calc(50% - 5px);
    width: 10px;
    height: 10px;
    border: 1px solid #9ba2a7;
    border-radius: 50%;
    background: radial-gradient(circle, #fcfcfc, #a8aeb2 40%, #4e565c);
    box-shadow: 0 2px 4px rgba(22, 29, 33, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.9);
    pointer-events: none;
}

.record-disc {
    position: relative;
    width: 100%;
    height: 100%;
    border: 1.5px solid rgba(255, 255, 255, 0.82);
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.22);
    background-image: conic-gradient(from 45deg, transparent 0deg, rgba(255, 255, 255, 0.72) 20deg, transparent 42deg, transparent 160deg, rgba(255, 255, 255, 0.68) 180deg, transparent 202deg, transparent 360deg);
    box-shadow: 0 6px 14px rgba(22, 29, 33, 0.09), inset 0 0 16px rgba(255, 255, 255, 0.72), inset -2px -2px 6px rgba(22, 29, 33, 0.04);
    animation: rotate-record 8s linear infinite;
}

.record-center-cover {
    position: absolute;
    z-index: 5;
    top: 22%;
    left: 22%;
    width: 56%;
    height: 56%;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    background: rgba(253, 253, 253, 0.86);
    box-shadow: 0 2px 8px rgba(22, 29, 33, 0.1), inset 0 0 4px #fff;
}

.center-placeholder-icon {
    color: #778087;
    font-size: 1.2rem;
}

.tone-arm {
    position: absolute;
    z-index: 20;
    top: -2%;
    right: -4%;
    width: 48%;
    height: 5%;
    min-height: 5px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 4px;
    background: linear-gradient(to bottom, #cbd1d5, #fff 30%, #929ca3 70%, #d4d8db);
    box-shadow: -2px 4px 6px rgba(22, 29, 33, 0.25);
    transform: rotate(30deg);
    transform-origin: 85% 50%;
    pointer-events: none;
}

.tone-arm::before {
    content: "";
    position: absolute;
    top: calc(50% - 6px);
    left: -10px;
    width: 15px;
    height: 12px;
    border: 1px solid #41474b;
    border-radius: 2px;
    background: linear-gradient(135deg, #33393d, #111416);
    box-shadow: -2px 3px 5px rgba(22, 29, 33, 0.38);
    transform: rotate(-15deg);
}

.tone-arm::after {
    content: "";
    position: absolute;
    top: calc(50% - 9px);
    right: 5%;
    width: 18px;
    height: 18px;
    border: 1px solid #707980;
    border-radius: 50%;
    background: radial-gradient(circle, #e4e7e9, #929aa0 70%, #3d4449);
    box-shadow: 0 3px 6px rgba(22, 29, 33, 0.3);
}

/* App launchers and media widget */
.page1-bottom-row,
.page2-middle-row,
.page2-bottom-row {
    width: 100%;
    display: flex;
    gap: 16px;
}

.app-grid-2x2 {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 20px 12px;
}

.app-item {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    background: transparent;
    color: inherit;
    text-decoration: none;
}

.app-icon {
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: var(--ink);
    font-size: 1.8rem;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.app-grid-2x2 .app-icon {
    width: 55px;
    height: 55px;
    flex-basis: 55px;
}

.app-item:active .app-icon {
    transform: scale(0.92);
    box-shadow: inset 3px 3px 8px rgba(22, 29, 33, 0.06), inset -3px -3px 8px rgba(255, 255, 255, 0.82);
}

.app-name {
    max-width: 100%;
    color: #30373c;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25;
    overflow-wrap: anywhere;
    text-align: center;
}

.cd-widget {
    flex: 1;
    min-width: 0;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
}

.cd-widget-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.cd-widget-text {
    display: flex;
    flex-direction: column;
}

.cd-widget-title {
    color: #20262a;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
}

.cd-widget-subtitle {
    color: #727b82;
    font-size: 0.7rem;
    font-weight: 500;
}

.battery-widget-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--ink) 100%, #dbe0e3 100%);
    box-shadow: 0 2px 5px rgba(22, 29, 33, 0.12), inset 0 0 2px #fff;
    transition: background 500ms ease;
}

.battery-widget-inner {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #fafafa, #e7ebed);
    box-shadow: inset 1px 1px 3px #fff, inset -1px -1px 3px rgba(22, 29, 33, 0.1), 0 1px 3px rgba(22, 29, 33, 0.15);
}

.battery-widget-inner i {
    color: #444c51;
    font-size: 0.8rem;
}

.cd-widget-body {
    position: relative;
    flex: 1;
    min-height: 90px;
    display: flex;
    align-items: center;
    margin-top: 4px;
}

.cd-widget-image-container {
    position: absolute;
    z-index: 2;
    left: 0;
    width: 85px;
    height: 85px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1.5px solid rgba(255, 255, 255, 0.82);
    border-radius: 10px;
    background: rgba(22, 29, 33, 0.03);
    box-shadow: 2px 0 10px rgba(22, 29, 33, 0.08);
}

.cd-placeholder-icon {
    color: #778087;
    font-size: 1.4rem;
}

.cd-widget-cd {
    position: absolute;
    z-index: 1;
    left: 60px;
    width: 75px;
    height: 75px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(from 180deg, #ced5d9, #fafafa, #b5bec4, #fafafa, #ced5d9, #fafafa, #b5bec4, #fafafa, #ced5d9);
    clip-path: inset(0 0 0 40%);
}

.cd-widget-cd::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2.5px solid #e4e8ea;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.54);
    box-shadow: inset 1px 1px 2px rgba(22, 29, 33, 0.1);
}

/* Weather and social page */
.weather-scale-wrapper {
    position: relative;
    width: 100%;
    height: 83px;
    flex: 0 0 83px;
}

.widget-weather-replaced {
    position: absolute;
    inset: 0 auto auto 0;
    width: 133.333%;
    height: 110px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    transform: scale(0.75);
    transform-origin: left top;
}

.weather-replaced-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.replaced-city-text {
    font-size: 1.1rem;
    font-weight: 650;
}

.replaced-temp-text {
    color: #41494e;
    font-size: 0.9rem;
    text-align: right;
}

.replaced-weather-forecast {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    text-align: center;
}

.replaced-forecast-day {
    color: #626b72;
    font-size: 0.75rem;
}

.replaced-forecast-icon {
    margin: 2px 0;
    color: #3c6173;
    font-size: 1.2rem;
}

.replaced-forecast-temp {
    font-size: 0.75rem;
    font-weight: 500;
}

.capsule-widget-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0 4px;
}

.capsule-item {
    position: relative;
    width: 31%;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-top: 1.5px solid rgba(255, 255, 255, 0.9);
    border-left: 1.5px solid rgba(255, 255, 255, 0.9);
    border-right: 0.5px solid rgba(255, 255, 255, 0.16);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.16);
    border-radius: 60px;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 4px 4px 12px rgba(22, 29, 33, 0.06), -2px -2px 8px rgba(255, 255, 255, 0.82) inset, 2px 2px 6px rgba(22, 29, 33, 0.025) inset;
}

.capsule-icon {
    color: #778087;
    font-size: 1.6rem;
}

.capsule-1 {
    height: 130px;
    margin-top: 30px;
}

.capsule-2 {
    height: 160px;
}

.capsule-3 {
    height: 140px;
    margin-top: 15px;
}

.call-widget {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 146px;
    display: flex;
    flex-direction: column;
    padding: 12px;
}

.call-widget-image-container {
    position: relative;
    width: 100%;
    min-height: 120px;
    flex: 1;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1.5px solid rgba(255, 255, 255, 0.82);
    border-radius: 14px;
    background: rgba(22, 29, 33, 0.03);
    box-shadow: inset 1px 1px 3px rgba(22, 29, 33, 0.06);
}

.call-placeholder-icon {
    color: #778087;
    font-size: 2.2rem;
}

.call-widget-buttons {
    position: absolute;
    z-index: 10;
    right: 0;
    bottom: 12px;
    left: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 28px;
    pointer-events: none;
}

.call-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(22, 29, 33, 0.18), inset 0 0 4px rgba(255, 255, 255, 0.3);
    transition: transform 150ms ease;
    pointer-events: auto;
}

.hangup-btn {
    background: linear-gradient(135deg, #f44f58, #c82f3a);
    transform: rotate(135deg);
}

.answer-btn {
    background: linear-gradient(135deg, #48b91d, #2d850b);
}

.hangup-btn:active {
    transform: rotate(135deg) scale(0.92);
}

.answer-btn:active {
    transform: scale(0.92);
}

/* Dialogs */
.edit-popup,
.install-popup {
    position: fixed;
    inset: 50% auto auto 50%;
    width: min(calc(100% - 40px), 340px);
    max-height: min(82dvh, 620px);
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    overflow: auto;
    border: 0;
    background: rgba(244, 247, 249, 0.88);
    color: var(--ink);
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.96);
    transition: opacity 160ms ease, transform 160ms ease, overlay 160ms allow-discrete, display 160ms allow-discrete;
}

.edit-popup[open],
.install-popup[open] {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

@starting-style {
    .edit-popup[open],
    .install-popup[open] {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.96);
    }
}

.edit-popup::backdrop,
.install-popup::backdrop {
    background: rgba(23, 29, 33, 0.38);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.popup-header h2 {
    color: #292f33;
    font-size: 1rem;
    font-weight: 650;
}

.close-btn {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: transparent;
    color: #687178;
    font-size: 1.3rem;
}

.close-btn:hover {
    background: rgba(22, 29, 33, 0.06);
}

.edit-option,
.popup-btn-submit {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.edit-option {
    border: 1px solid #d4dadd;
    background: rgba(255, 255, 255, 0.68);
    color: #30373c;
}

.remove-image-option {
    color: #a52a33;
}

.popup-btn-submit {
    background: #15191c;
    color: #fff;
}

.url-input-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.url-input-form label {
    color: #4b545a;
    font-size: 0.8rem;
    font-weight: 600;
}

.url-input-form input {
    width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    border: 1px solid #cbd2d6;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
}

.form-message {
    color: #a52a33;
    font-size: 0.8rem;
    line-height: 1.4;
}

.install-instructions {
    display: grid;
    gap: 12px;
    color: #3d464c;
    font-size: 0.9rem;
    line-height: 1.55;
}

.install-step {
    display: flex;
    align-items: center;
    gap: 10px;
}

.install-step i {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(35, 103, 209, 0.1);
    color: #225dae;
    font-size: 1.1rem;
}

@keyframes breathe {
    0%, 100% {
        opacity: 0.35;
        background: #778087;
        box-shadow: 0 0 4px rgba(72, 82, 89, 0.2);
    }
    50% {
        opacity: 1;
        background: #a4adb3;
        box-shadow: 0 0 10px rgba(115, 126, 133, 0.5);
    }
}

@keyframes paw-fade {
    0% { opacity: 0; transform: scale(0.6) rotate(var(--rotation)); }
    30%, 70% { opacity: 1; transform: scale(1) rotate(var(--rotation)); }
    100% { opacity: 0; transform: scale(0.8) rotate(var(--rotation)); }
}

@keyframes rotate-record {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
