:root {
    --bg-base: #000000;
    --text-main: #ffffff;
    --text-muted: #737373;
    --border-light: 1px solid rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    overflow: hidden;
    letter-spacing: -0.01em;
    display: grid;
    place-items: center;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.4), 0 0 12px rgba(255, 255, 255, 0.2);
}

.download-btn,
.c-ok,
.hi-badge,
input,
.format-item:active span,
.format-item:active .f-sub {
    text-shadow: none !important;
}

.extract-btn svg,
.menu-btn svg,
.action-btn svg,
.drop-zone svg,
.logout-btn svg {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.6));
}

.ambient-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% -30%, #05162e 0%, #000000 65%);
    z-index: 0;
    pointer-events: none;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes shimmerText {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.led-spin {
    position: relative;
    overflow: hidden;
    z-index: 1;
    background: transparent !important;
    border: none !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.led-spin::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1500px;
    height: 1500px;
    background: conic-gradient(from 0deg, transparent 60%, rgba(255, 255, 255, 0.6) 80%, #ffffff 100%);
    transform-origin: center;
    transform: translate(-50%, -50%);
    animation: spin 1.2s linear infinite;
    z-index: -2;
    will-change: transform;
}

.led-spin::after {
    content: "";
    position: absolute;
    inset: 1.5px;
    border-radius: inherit;
    z-index: -1;
    background: #000;
}

.input-box.led-spin::after {
    background: #050505;
}

.nav-btn.led-spin::after {
    background: #0a0a0a;
}

.sidebar-login-btn.led-spin::after {
    background: #0f0f0f;
}

.sidebar-login-btn.led-spin {
    color: #fff !important;
}

.led-spin > * {
    position: relative;
    z-index: 2;
}

.top-nav {
    position: fixed;
    z-index: 100;
    top: 20px;
    right: 20px;
    left: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.nav-right-group {
    display: flex;
    gap: 10px;
    align-items: center;
    pointer-events: auto;
}

.nav-btn {
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    transition: transform 0.2s ease;
}

.nav-btn:active {
    transform: scale(0.95);
}

.menu-btn {
    width: 44px;
    height: 44px;
    padding: 0;
}

.menu-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #fff;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.google-btn {
    gap: 10px;
    padding: 4px 16px 4px 4px;
    font-weight: 600;
    font-size: 13.5px;
    height: 44px;
}

.user-pic {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logout-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    display: none;
}

.logout-btn svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.view {
    grid-area: 1 / 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    text-align: center;
    z-index: 10;
}

#homeView.blur-bg {
    filter: blur(25px) brightness(0.7);
    opacity: 0.2;
    pointer-events: none;
    transform: scale(0.92);
}

#homeView.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px);
}

#processingView {
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px);
}

#processingView.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

h1 {
    font-size: clamp(42px, 9vw, 56px);
    font-weight: 800;
    letter-spacing: -2.5px;
    margin-bottom: 12px;
    line-height: 1.1;
    background: linear-gradient(90deg, #ffffff 0%, #666666 30%, #ffffff 50%, #666666 70%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerText 5s linear infinite;
    text-shadow: none;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
}

.subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 45px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.input-box {
    border-radius: 999px;
    padding: 7px 7px 7px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.input-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    letter-spacing: -0.01em;
}

.input-box input::placeholder {
    color: #666;
}

.extract-btn {
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    border: none;
    flex-shrink: 0;
}

.extract-btn svg {
    width: 18px;
    height: 18px;
    stroke: #000;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.extract-btn:active {
    transform: scale(0.95);
}

.drop-zone {
    display: none;
    margin-top: 25px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 25px 20px;
    background: rgba(10, 10, 10, 0.4);
    transition: all 0.2s ease;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.drop-zone.dragover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.02);
}

.drop-zone svg {
    width: 22px;
    height: 22px;
    stroke: #666;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    transition: 0.2s;
}

.drop-zone.dragover svg {
    stroke: #fff;
}

.drop-text {
    font-size: 13px;
    font-weight: 500;
    color: #777;
    transition: 0.2s;
}

.drop-text-small {
    font-size: 11px;
    color: var(--text-muted);
}

.drop-zone.dragover .drop-text {
    color: #fff;
}

@media (min-width: 768px) {
    .drop-zone {
        display: flex;
    }
}

.sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 360px;
    max-width: 85vw;
    height: 100dvh;
    background: rgba(5, 5, 5, 0.96);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-right: var(--border-light);
    z-index: 1001;
    transition: left 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    padding: 20px 10px;
    touch-action: pan-y;
}

.sidebar.show {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 10px;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff;
}

.close-sidebar-btn,
.close-modal-x {
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

.close-sidebar-btn:hover,
.close-modal-x:hover {
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 1));
    transform: scale(1.1);
}

.sidebar-search {
    background: rgba(255, 255, 255, 0.03);
    border: var(--border-light);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 15px;
    margin-right: 5px;
}

.sidebar-search input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 13px;
    width: 100%;
    font-family: inherit;
}

.sidebar-search input::placeholder {
    color: #555;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
    padding-bottom: 20px;
}

.history-list::-webkit-scrollbar {
    width: 3px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.history-item {
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: 0.2s;
    position: relative;
}

.history-item.led-spin::after {
    background: #0f0f0f;
    transition: 0.2s;
}

.history-item:hover.led-spin::after {
    background: #1a1a1a;
}

.hi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.hi-title {
    font-weight: 500;
    font-size: 14px;
    flex: 1;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 2px 4px;
    margin-left: -4px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: 0.2s;
}

.hi-title.editing {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    outline: none;
    text-overflow: clip;
    overflow: visible;
    white-space: normal;
    word-break: break-all;
}

.hi-badge {
    background: #fff;
    color: #000;
    font-size: 9px;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    height: fit-content;
}

.hi-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 8px;
}

.hi-date {
    font-size: 11px;
    color: #666;
    font-weight: 400;
}

.hi-actions {
    display: flex;
    gap: 6px;
}

.action-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.action-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.action-btn.is-fav {
    color: #fff;
}

.action-btn.is-fav svg {
    fill: #fff;
    stroke: #fff;
}

.action-btn.btn-delete:hover {
    background: rgba(255, 50, 50, 0.15);
    color: #ff4d4d;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    display: none;
    z-index: 1000;
}

.sidebar-overlay.show {
    display: block;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: 0.4s;
    z-index: 998;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 88%;
    max-width: 400px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 26px;
    opacity: 0;
    pointer-events: none;
    transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 1000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    color: #fff;
}

.modal.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: all;
}

.modal h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.2px;
    margin-bottom: 5px;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: -2px;
}

.close-modal-x {
    position: absolute;
    top: 20px;
    right: 20px;
}

.format-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.format-item {
    border-radius: 16px;
    height: 80px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    color: #fff;
}

.format-item.led-spin::after {
    background: #0f0f0f;
    transition: 0.2s;
}

.format-item:hover.led-spin::after {
    background: #1e1e1e;
}

.format-item:active.led-spin::after {
    background: #ffffff;
}

.format-item:hover {
    transform: translateY(-2px);
}

.format-item:active {
    transform: translateY(0);
    color: #000;
}

.format-item:active span {
    color: #000;
}

.f-main {
    font-weight: 700;
    font-size: 18px;
}

.f-sub {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.confirm-box {
    background: rgba(12, 14, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 28px 25px;
    width: 85%;
    max-width: 320px;
    text-align: center;
    transform: scale(0.95);
    transition: 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.confirm-overlay.show .confirm-box {
    transform: scale(1);
}

.confirm-box h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 700;
}

.confirm-box p {
    color: var(--text-muted);
    font-size: 13.5px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 10px;
}

.c-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    border: none;
}

.c-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.c-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

.c-ok {
    background: #fff;
    color: #000;
}

.c-ok:hover {
    background: #e0e0e0;
}

.c-ok.destructive {
    background: rgba(255, 60, 60, 0.15);
    color: #ff4d4d;
    border: 1px solid rgba(255, 60, 60, 0.3);
}

.c-ok.destructive:hover {
    background: rgba(255, 60, 60, 0.25);
}

.glass-panel {
    background: rgba(15, 15, 15, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 36px;
    padding: 40px 25px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    color: #fff;
}

.progress-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 25px;
}

.circle-svg {
    transform: rotate(-90deg);
    width: 120px;
    height: 120px;
}

.circle-bar {
    fill: none;
    stroke: #fff;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.3s ease;
}

.pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.process-title {
    font-size: 18px;
    font-weight: 700;
}

.download-btn {
    width: 100%;
    padding: 16px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}

.download-btn:active {
    transform: scale(0.95);
}

.cancel-btn {
    margin-top: 25px;
    padding: 12px 28px;
    background: #000;
    color: #fff;
    border: 1px solid #fff;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    margin-top: 40px;
    padding: 0 15px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
}

.login-card-modern {
    background: rgba(15, 15, 15, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 30px 20px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.login-title-modern {
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.2px;
    margin-bottom: 10px;
}

.login-subtitle-modern {
    color: #777;
    font-weight: 400;
    font-size: 13px;
    max-width: 240px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.sidebar-login-btn {
    border-radius: 999px;
    border: none;
    padding: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
    font-family: inherit;
}

.sidebar-login-btn:active {
    transform: scale(0.95);
}

.finish-group {
    display: none;
}

.finish-icon {
    background: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

.finish-icon svg {
    width: 30px;
    stroke: #000;
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.final-title {
    font-size: 17px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #fff;
}

.extractor-mini-led {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #555 0%, #fff 50%, #555 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerText 3s linear infinite;
    margin: 0;
    text-shadow: none;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.4));
}
/* integrazione invisibile del bottone google ufficiale + input file nascosto */
.google-btn {
    position: relative;
    overflow: hidden;
}

#googleNativeBtn {
    position: absolute;
    inset: 0;
    opacity: 0.01;
    z-index: 3;
}

#googleNativeBtn > div,
#googleNativeBtn iframe {
    width: 100% !important;
    height: 100% !important;
}

#filePicker {
    display: none;
}

.history-item {
  min-height: 86px !important;
  padding: 12px 14px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.history-item .hi-header {
  min-height: 28px !important;
}

.history-item .hi-footer {
  min-height: 28px !important;
  margin-top: 10px !important;
}

.history-item .hi-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

.history-item .hi-title {
  display: block !important;
  line-height: 1.2 !important;
}

.history-item .hi-date {
  line-height: 1.2 !important;
}

/* mobile iphone: abbassa i pulsanti superiori per stare sotto la status bar */
@media (max-width: 768px) {
  .top-nav {
    top: calc(env(safe-area-inset-top, 0px) + 18px) !important;
    left: 16px !important;
    right: 16px !important;
  }

  .top-nav .nav-btn,
  .top-nav .google-btn,
  .top-nav .logout-btn,
  .top-nav .menu-btn {
    transform: translateY(8px);
  }
}

/* iphone con notch / dynamic island: ancora un po' più giù */
@supports (padding-top: env(safe-area-inset-top)) {
  @media (max-width: 768px) {
    .top-nav {
      top: calc(env(safe-area-inset-top) + 22px) !important;
    }

    .top-nav .nav-btn,
    .top-nav .google-btn,
    .top-nav .logout-btn,
    .top-nav .menu-btn {
      transform: translateY(10px);
    }
  }
}

/* abbassa la barra input centrale su mobile */
@media (max-width: 768px) {

  .input-box {
    margin-top: 40px !important;
  }

}

/* iphone con gesture bar */
@supports (padding-bottom: env(safe-area-inset-bottom)) {

  @media (max-width: 768px) {

    .input-box {
      margin-top: 50px !important;
    }

  }

}

/* mobile layout fix */
@media (max-width:768px){

  .view#homeView{
    height:100dvh;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    padding-top:60px;
  }

  /* abbassa la barra input */
  .input-box{
    margin-top:70px !important;
  }

}

/* iphone keyboard fix */
html,body{
  height:100%;
  overflow-x:hidden;
}

body{
  min-height:100dvh;
}


/* evita salto layout quando appare la tastiera su iOS */
@supports (-webkit-touch-callout: none){

  body{
    height:100dvh;
    overflow:hidden;
  }

  #homeView{
    height:100dvh;
    overflow:auto;
  }

}


/* fix click bottone google */
#googleLoginBtn,
#googleBtn,
.google-btn {
  position: relative !important;
  z-index: 9999 !important;
  pointer-events: auto !important;
}

#userAvatar,
#googleTxt,
#googleNativeBtn {
  pointer-events: none !important;
}

/* bottone google reale nascosto ma cliccabile tramite js */
#googleNativeBtn {
  position: fixed !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 240px !important;
  height: 44px !important;
  opacity: 0 !important;
  pointer-events: auto !important;
  overflow: hidden !important;
}

/* fix posizione tasto chiusura sidebar su iPhone */
@media (max-width:768px){

  .sidebar-header{
    padding-top: calc(env(safe-area-inset-top) + 18px) !important;
  }

  .close-sidebar-btn{
    top: calc(env(safe-area-inset-top) + 8px) !important;
  }

}


/* iPhone: sidebar un po' più in basso con animazione morbida */
@media (max-width: 768px) {
  .sidebar {
    top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
    height: calc(100dvh - env(safe-area-inset-top, 0px) - 10px) !important;
    transition: transform 220ms ease, opacity 220ms ease, top 220ms ease !important;
  }

  .sidebar.show {
    transform: translateX(0) translateY(8px) !important;
  }

  .sidebar-header {
    padding-top: calc(env(safe-area-inset-top, 0px) + 16px) !important;
  }

  .close-sidebar-btn {
    top: calc(env(safe-area-inset-top, 0px) + 12px) !important;
  }
}

/* ===== miglioramento estetico cronologia download ===== */

.history-item{
  border-radius: 22px !important;
  background: rgba(20,20,20,0.55) !important;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.06) !important;

  box-shadow:
  0 10px 30px rgba(0,0,0,0.55),
  inset 0 1px 0 rgba(255,255,255,0.05);

  transition: all .25s ease;
}

/* hover desktop */
.history-item:hover{
  transform: translateY(-2px);
  box-shadow:
  0 18px 45px rgba(0,0,0,0.7),
  inset 0 1px 0 rgba(255,255,255,0.08);
}

/* titolo */
.hi-title{
  font-weight:600;
  letter-spacing:.2px;
}

/* badge formato */
.hi-badge{
  border-radius: 10px !important;
  padding:4px 8px !important;

  background: rgba(255,255,255,0.85);
  color:#000;
  font-weight:600;
  font-size:12px;

  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

/* pulsanti azioni */
.action-btn{
  border-radius: 10px !important;

  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);

  transition: all .2s ease;
}

/* hover pulsanti */
.action-btn:hover{
  background: rgba(255,255,255,0.12);
  transform: scale(1.05);
}

/* preferiti */
.action-btn.is-fav{
  background: rgba(255,255,255,0.18);
}

/* elimina */
.action-btn.btn-delete:hover{
  background: rgba(255,70,70,0.25);
  border-color: rgba(255,70,70,0.3);
}

/* separatore più soft */
.history-item hr,
.history-item::after{
  border-color: rgba(255,255,255,0.05);
}

