/* Keep the original desktop layout; refine icons, dialogs and narrow screens. */
html { scrollbar-gutter: stable; }
body.modal-open { overflow: hidden; }
button, a, input, .size-label { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, .size-checkbox:focus-visible + .size-label {
    outline: 3px solid #93c5fd; outline-offset: 3px;
}
.widget-box .fa-solid, .widget-box .fa-regular { font-size: 18px; }
.btn-add .fa-solid, .btn-download .fa-solid { font-size: 21px; margin-right: 5px; }
.btn-delete .fa-solid { font-size: 20px; }
.size-title .fa-solid { font-size: 18px; margin-right: 3px; }
.labels-row .fa-solid { font-size: 16px; margin-right: 3px; }
.widget-interactive { font-family: inherit; line-height: inherit; }
.col-color { min-width: 0; }
.input-custom { min-width: 0; }
.size-options > label { position: relative; }
.size-checkbox { display: block; position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.version-link { display: inline-flex; align-items: center; gap: 5px; background: #0066cc; color: #fff; text-decoration: none; font-size: .85rem; font-weight: 600; padding: 4px 14px; border-radius: 30px; margin-left: 10px; vertical-align: middle; transition: background .2s; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.version-link:hover { background: #0052a3; color: #fff; }
.version-link .fa-solid { font-size: 17px; }
.modal-overlay { width: 100%; height: 100dvh; padding: 18px 0; visibility: hidden; transition: opacity .2s ease, visibility .2s; }
.modal-overlay.show { visibility: visible; transition: opacity .2s ease; }
.modal-glass { max-height: min(85vh, 850px); max-height: min(85dvh, 850px); overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.modal-glass:focus { outline: none; }
.btn-close-modal:hover { transform: none; }
.announcement-dialog { display: flex; flex-direction: column; overflow: hidden; padding: 30px 32px 0; }
.announcement-heading { padding: 0 30px 21px; text-align: center; flex-shrink: 0; }
.announcement-emblem { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; background: #eff6ff; border: 1px solid #dbeafe; }
.announcement-emblem .fa-solid { font-size: 31px; }
.announcement-heading h3 { margin: 0 0 7px; font-size: 24px; font-weight: 800; color: #1e293b; }
.announcement-heading p { margin: 0; font-size: 13px; line-height: 1.6; color: #64748b; }
.announcement-body { overflow-y: auto; min-height: 0; overscroll-behavior: contain; scrollbar-width: thin; padding: 1px 2px 8px; }
.announcement-feature { padding: 20px; background: #f3f8ff; border: 1px solid #dbeafe; border-radius: 16px; margin-bottom: 22px; }
.announcement-feature-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.announcement-feature h4 { margin: 0; color: #1e3a5f; font-size: 17px; font-weight: 750; }
.announcement-badge { background: #dbeafe; color: #2563eb; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 5px; white-space: nowrap; }
.announcement-feature p { margin: 0 0 16px; font-size: 14px; line-height: 1.8; color: #52657b; }
.announcement-link { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-radius: 10px; background: #2563eb; color: #fff; text-decoration: none; font-size: 14px; font-weight: 650; transition: background .2s; }
.announcement-link:hover { color: #fff; background: #1d4ed8; }
.announcement-link .fa-solid { font-size: 19px; }
.announcement-url { display: block; text-align: center; margin-top: 9px; color: #64748b; font-size: 12px; overflow-wrap: anywhere; }
.announcement-log-title { display: flex; align-items: center; gap: 7px; margin: 0 0 17px; color: #334155; font-size: 14px; font-weight: 700; }
.announcement-log { list-style: none; padding: 0; margin: 0 0 0 5px; }
.announcement-log li { position: relative; padding: 0 0 17px 19px; border-left: 1px solid #e2e8f0; }
.announcement-log li::before { content: ''; position: absolute; left: -4px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: #93c5fd; }
.announcement-log li:last-child { padding-bottom: 4px; border-color: transparent; }
.announcement-log strong { display: block; color: #475569; font-size: 12px; margin-bottom: 4px; font-weight: 700; }
.announcement-log p { color: #64748b; font-size: 13px; line-height: 1.8; margin: 0; }
.announcement-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; padding: 17px 0 20px; margin-top: 8px; border-top: 1px solid #edf0f5; }
.announcement-footer small { font-size: 12px; line-height: 1.6; color: #94a3b8; }
.announcement-dismiss { flex-shrink: 0; border: 1px solid #e2e8f0; background: #f8fafc; color: #475569; padding: 8px 17px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.announcement-dismiss:hover { background: #eef2f6; }
#dynamic-island { max-width: calc(100vw - 32px); }
.island-icon { width: 21px; height: 21px; flex-shrink: 0; }
.island-text { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 640px) {
    body { padding: 18px 12px; }
    .app-wrapper { padding: 24px 16px; border-radius: 20px; }
    .top-widgets { position: relative; top: auto; left: auto; right: auto; flex-wrap: wrap; justify-content: space-between; gap: 12px 8px; }
    .widget-left, .widget-right { position: static; }
    .widget-box { padding: 7px 11px; font-size: 12px; gap: 6px; }
    .clock-center { order: 3; margin: 0 auto; padding: 7px 15px; font-size: 12px; }
    .clock-center b { font-size: 14px; }
    .header { margin: 26px 0; }
    .header h2 { font-size: 24px; line-height: 1.5; }
    .version-link { font-size: 12px; padding: 3px 10px; }
    .header p { font-size: 12px; line-height: 1.8; }
    .size-section { padding: 18px 12px; margin-bottom: 24px; }
    .size-options { gap: 8px; }
    .size-label { padding: 7px 12px; font-size: 13px; }
    .col-code, .labels-row > :first-child { width: 90px !important; }
    .col-action, .labels-row > :last-child { width: 36px !important; }
    .input-group-row, .labels-row { gap: 7px; }
    .labels-row { font-size: 11px; align-items: center; }
    .labels-row .fa-solid { font-size: 14px; margin-right: 1px; }
    .input-custom { padding: 11px 7px; font-size: 13px; }
    .btn-delete { width: 36px; height: 42px; }
    .actions-area { margin-top: 25px; gap: 10px; }
    .btn-add, .btn-download { padding: 13px 8px; font-size: 14px; }
    .btn-add .fa-solid, .btn-download .fa-solid { font-size: 18px; margin-right: 1px; }
    .modal-glass { width: calc(100% - 24px); padding: 28px 20px; max-height: calc(100dvh - 36px); border-radius: 20px; }
    .btn-close-modal { top: 15px; right: 15px; }
    .announcement-dialog { padding: 25px 18px 0; }
    .announcement-heading { padding: 0 25px 19px; }
    .announcement-heading h3 { font-size: 22px; }
    .announcement-emblem { width: 46px; height: 46px; }
    .announcement-feature { padding: 16px; }
    .announcement-feature h4 { font-size: 16px; }
    .announcement-footer { padding-bottom: 16px; }
    .tut-desc { padding-left: 0; }
    .step-card { padding: 20px 16px; }
    .step-content { margin-left: 0; }
    .step-header { gap: 10px; }
    .step-title { font-size: 16px; }
}
@media (max-width: 360px) { .version-link { margin: 7px 0 0; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
