/* AOSP 4.0.4 Calendar, Music and Gallery2 widgets. hdpi nine-patch sizes are scaled by 0.6 (1dp ≈ 0.9px). */
.home-widget.widget-calendar,.home-widget.widget-music,.home-widget.widget-photo{place-items:stretch}
.calw,.phw{width:100%;height:100%;min-width:0;min-height:0;color:#fff;text-shadow:none;text-align:left}
:where(.calw,.phw,.pmw) button{font:inherit;color:inherit;border:0;margin:0;cursor:pointer}

/* Calendar: appwidget.xml, widget_item.xml, widget_all_day_item.xml and appwidget_day.xml. */
.calw{display:flex;flex-direction:column;padding:0}
.calw-header{flex:none;display:flex;flex-direction:column;justify-content:center;min-height:43px;padding:0 2px 5px 7px;background:none;border-style:solid;border-width:0 7px 4px 5px;border-image:url('assets/calwidget-header_bg_cal_widget_holo.png') 0 12 7 9 fill / 0 7px 4px 5px stretch;margin:0;text-align:left}
/* 4.3 appwidget_header_selector: header_bg_cal_widget_pressed_holo (60% holo blue) shares the normal header's nine-patch. */
.calw-header:active,.calw-header:focus-visible{outline:0;border-image-source:url('assets/calwidget-header_bg_cal_widget_pressed_holo.png')}
.calw-weekday{margin:4px 0 -4px;font-size:11px;font-weight:700;text-transform:uppercase;color:#fff;text-shadow:0 0 3px #ffffff0d}
.calw-date{margin-top:-1px;font-size:22px;line-height:1.2;color:#eee;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.calw-list{flex:1;min-height:0;margin:0 4px;padding:0;display:flex;flex-direction:column;gap:3px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;background:#0006;scrollbar-width:none;touch-action:none}
.calw-list::-webkit-scrollbar{display:none}
.calw-event{flex:none;display:flex;align-items:flex-start;min-height:43px;width:100%;padding:0 4px 2px 0;background:#fff;color:#333!important;text-align:left}
.calw-event.in-progress{background:#ddd}
.calw-event:active,.calw-all-day:active,.calw-empty:active{background:#0099cccc}
.calw-chip{flex:none;width:14px;height:14px;margin:7px 4px 0;background:#4793ba}
.calw-event>span{min-width:0;align-self:center;display:flex;flex-direction:column;padding:2px 0}
.calw-event strong{font-size:13px;line-height:1.25;font-weight:700;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.calw-event small{font-size:11px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.calw-event small+small{padding-bottom:2px}
.calw-all-day{flex:none;height:22px;width:100%;padding:0 4px;background:#4793ba;color:#fff!important;text-align:left;display:flex;align-items:center}
.calw-all-day strong{font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.calw-day{flex:none;margin:2px 2px 0;padding-left:4px;font-size:11px;line-height:1.4;text-transform:uppercase;color:#eee;text-shadow:0 0 1px #0000004d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.calw-empty{flex:1;margin-bottom:9px;padding:6px;background:none;color:#fff!important;font-size:13px!important;font-weight:700;text-align:center;display:flex;align-items:center;justify-content:center}

/* Music: album_appwidget.xml, a 4 × 1 strip with info, play/pause and next. */
.home-widget.widget-music{align-items:center}

/* Gallery2: photo_frame.xml for one picture; appwidget_main.xml's StackView for album/shuffle. */
.phw{display:grid;place-items:center;position:relative;overflow:visible}
.phw-single{padding:4px 11px 21px;place-items:stretch}
.phw-frame{position:relative;width:100%;height:100%;padding:5px;background:none;display:grid;place-items:stretch}
.phw-frame::before{content:'';position:absolute;inset:0;border-style:solid;border-width:14px 13px 13px 14px;border-image:url('assets/gallery-border_photo_frame_widget_holo.png') 23 21 21 23 fill / 14px 13px 13px 14px stretch}
.phw-frame:active::before,.phw-frame:focus-visible::before{border-image-source:url('assets/gallery-border_photo_frame_widget_pressed_holo.png')}
.phw-frame:focus-visible{outline:0}
.phw-card img{position:relative;display:block;max-width:100%;max-height:100%;object-fit:contain}
/* WidgetConfigure crops the chosen picture to the widget's aspect ratio. */
.phw-single .phw-frame img{position:relative;width:100%;height:100%;max-width:none;max-height:none;object-fit:cover}
.phw-stack{isolation:isolate}
.phw-card{grid-area:1/1;position:relative;width:min(144px,88%);aspect-ratio:4/3;padding:4px;background:none;display:grid;place-items:center;transform:translateY(calc(var(--depth) * -13px + 8px)) scale(calc(1 - var(--depth) * .08));opacity:calc(1 - var(--depth) * .18);transition:transform .2s ease-out,opacity .2s ease-out}
.phw-card::before{content:'';position:absolute;inset:0;border:2px solid transparent;border-image:url('assets/gallery-appwidget_photo_border.png') 4 fill / 3px stretch;box-shadow:0 2px 5px #0007}
.phw-card img{width:100%;height:100%;object-fit:contain}
.phw-card:focus-visible{outline:2px solid #33b5e5;outline-offset:1px}
.phw-empty .phw-card{color:#333;font-size:13px;text-align:center;transform:none;opacity:1}
.phw-empty .phw-card::before{z-index:-1}
.stack-next .phw-front{animation:phw-from-back .22s ease-out}
.stack-previous .phw-front{animation:phw-from-below .22s ease-out}
@keyframes phw-from-back{from{transform:translateY(-5px) scale(.92);opacity:.82}}
@keyframes phw-from-below{from{transform:translateY(70px) rotate(4deg);opacity:0}}

/* WidgetTypeChooser, AlbumPicker and the image picker shown while configuring Gallery. */
.phw-dialog{padding-bottom:16px}
.phw-dialog h3{padding-bottom:10px;border-bottom:2px solid #33b5e5;color:#33b5e5}
.phw-choice,.phw-album{width:100%;min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 4px 0 12px;border:0;border-bottom:1px solid #3a3a3a;background:none;color:#f2f2f2;font-size:15px;text-align:left}
.phw-choice img{width:32px;height:32px}
.phw-choice:active,.phw-album:active,.phw-picker button:active{background:#0099cc99}
.phw-album{justify-content:flex-start;padding:6px}
.phw-album img{width:48px;height:48px;object-fit:cover}
.phw-album span{display:flex;flex-direction:column}
.phw-album small{color:#999;font-size:12px}
.phw-picker{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;max-height:min(260px,48vh);overflow-y:auto;overscroll-behavior:contain}
.phw-picker button{border:0;padding:0;background:#111;aspect-ratio:1}
.phw-picker img{width:100%;height:100%;object-fit:cover;display:block}

/* Launcher drawer previews and drag outlines. */
.drawer-widget-preview .widget-preview-image{max-width:100%;max-height:100%;min-height:0;object-fit:contain}

.drag-ghost.widget-span-ghost{display:grid;place-items:stretch;opacity:.85;text-shadow:none;transform:none}
.drag-ghost.widget-span-ghost .widget-preview-image{width:100%;height:100%;object-fit:contain}
.drag-ghost.widget-span-ghost.widget-music{place-items:center stretch}
.drag-ghost.widget-span-ghost>button{position:absolute;inset:0;width:auto;height:auto}
/* Google Play Music widget (KTU84P Music2: widget_nowplaying_small; dp x 0.906): appwidget_bg (xxhdpi 9-patch cut
   72 / 72 / 72 / 66), the 48 dp art and buttons, the 1 dp #33FFFFFF rule and the 14 sp text line. */
.pmw{display:flex;flex-direction:column;height:auto;max-height:none;align-self:center;padding:0 0 1.81px;border:0 solid transparent;border-image:url('assets/pmw-appwidget_bg.png') 72 72 72 66 fill / 21.74px 21.74px 21.74px 19.93px stretch;background:none}
.pmw-top{display:flex;height:43.49px}
.pmw-art{flex:none;width:43.49px;height:43.49px;padding:0;background:#000;overflow:hidden}
.pmw-art svg{display:block;width:100%;height:100%}
.pmw-controls{flex:1;min-width:0;display:flex;align-items:center;padding:0 14.5px}
.pmw-controls>i{flex:1}
.pmw-controls>i.pmw-rating{flex:none;width:43.49px}
.pmw-btn{flex:none;width:43.49px;height:43.49px;padding:7.25px;background:none;display:grid}
.pmw-btn img{width:100%;height:100%;object-fit:contain}
.pmw-btn:active{background:rgba(103,152,255,.24)}
.pmw-rule{flex:none;height:.9px;background:#ffffff33}
.pmw-text{display:flex;align-items:baseline;min-width:0;padding:4.53px 7.25px 3.62px;background:none;font:400 12.68px/1.3 Roboto,sans-serif;text-align:left;white-space:nowrap;overflow:hidden}
.pmw-text b{font-weight:700;color:#fff;overflow:hidden;text-overflow:ellipsis}
.pmw-dash{flex:none;padding:0 4.53px;font-weight:700;color:#999}
.pmw-text span:last-child{color:#999;overflow:hidden;text-overflow:ellipsis}
