/* ===============================
   ANPANI AD ENGINE – UI
=============================== */

#anpani-ad-engine{
  max-width: 980px;
  margin: 60px auto;
  padding: 24px;
  background: #0A0F0E;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.22);
}

#anpani-ad-engine h3{
  margin: 0 0 18px;
  font-family: "Playfair Display", serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
}

#anpani-ad-engine label{
  display: block;
  margin: 16px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.84);
}

#anpani-ad-engine select,
#anpani-ad-engine textarea{
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  outline: none;
  font: inherit;
  box-sizing: border-box;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

#anpani-ad-engine select:focus,
#anpani-ad-engine textarea:focus{
  border-color: rgba(205,33,42,0.70);
  box-shadow: 0 0 0 3px rgba(205,33,42,0.16);
  background: rgba(255,255,255,0.07);
}

#anpani-ad-engine option{
  color: #111;
  background: #fff;
}

#anpani-ad-engine textarea{
  min-height: 130px;
  resize: vertical;
}

/* ===============================
   BUTTONS
=============================== */

.anpani-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease,
    background .18s ease,
    color .18s ease,
    opacity .18s ease;
  box-sizing: border-box;
}

.anpani-btn:hover{
  transform: translateY(-1px);
}

.anpani-btn:disabled,
.anpani-btn[disabled]{
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}

.anpani-btn-primary{
  background: linear-gradient(180deg, #CD212A 0%, #A91820 100%);
  color: #fff;
  border-color: rgba(205,33,42,0.95);
  box-shadow: 0 10px 24px rgba(205,33,42,0.22);
}

.anpani-btn-primary:hover{
  box-shadow: 0 14px 28px rgba(205,33,42,0.28);
}

.anpani-btn-secondary{
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-color: rgba(255,255,255,0.12);
}

.anpani-btn-secondary:hover{
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.18);
}

.anpani-btn-ghost{
  background: transparent;
  color: rgba(255,255,255,0.90);
  border-color: rgba(255,255,255,0.18);
}

.anpani-btn-ghost:hover{
  background: rgba(255,255,255,0.05);
  color: #fff;
}

/* hlavní­ generate button */
#anpani-generate{
  margin-top: 20px;
}

/* ===============================
   EXPORT BAR
=============================== */

.anpani-export-bar{
  margin-top: 24px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.anpani-export-controls{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  align-items: end;
}

.anpani-export-field{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.anpani-export-field label{
  margin: 0;
}

.anpani-export-field select{
  margin: 0;
}

.anpani-export-actions{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.anpani-export-actions .anpani-btn{
  width: 100%;
  min-height: 46px;
}

.anpani-x-export-pack-hint{
  grid-column: 1 / -1;
  margin: 0;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255,255,255,0.55);
}

/* ===============================
   OUTPUT
=============================== */

#anpani-output,
#reply-output{
  margin-top: 22px;
}

.anpani-story-slide-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.anpani-story-slide-item{
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 14px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.anpani-story-slide-index{
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.65;
  white-space: nowrap;
}

.anpani-story-export-panel{
  margin-bottom: 14px;
}

.anpani-story-export-hint{
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.72;
}

.anpani-story-export-slide-list,
.anpani-story-export-aux-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.anpani-story-export-aux-list{
  margin-top: 12px;
}

.anpani-story-export-slide-card,
.anpani-story-export-aux-card{
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
}

.anpani-story-export-slide-card.is-export-slide{
  border-color: rgba(255, 255, 255, 0.14);
}

.anpani-story-export-slide-card.is-fallback,
.anpani-story-export-aux-card.is-fallback{
  border-style: dashed;
  border-color: rgba(205, 33, 42, 0.28);
  opacity: 0.94;
}

.anpani-story-export-slide-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.anpani-story-export-slide-label{
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.7;
}

.anpani-story-export-slide-text{
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.anpani-story-export-slide-note{
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.4;
  opacity: 0.62;
  font-style: italic;
}

.anpani-story-hashtag-chip{
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  font-size: 13px;
}

.anpani-sec{
  margin-top: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
}

.anpani-sec__head{
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  cursor: pointer;
}

.anpani-sec__head::-webkit-details-marker{
  display: none;
}

.anpani-sec__title{
  font-weight: 800;
  letter-spacing: .02em;
  color: #fff;
  line-height: 1.3;

  white-space: normal;
  word-break: break-word;
}

.anpani-sec__row{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.anpani-sec__meta{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: start;
}

.anpani-badge{
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.82);
  font-size: 12px;
  font-weight: 600;
}

.anpani-sec__actions{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  align-self: start;
}

.anpani-sec__actions .anpani-sec__btn{
  width: auto;
  min-width: 110px;
  flex: 0 0 auto;
}

.anpani-sec__btn{
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: .18s ease;
}

.anpani-sec__btn:hover{
  background: rgba(255,255,255,0.08);
}

.anpani-sec--flat .anpani-sec__body{
  padding: 18px 18px 12px;
}

.anpani-sec--flat .anpani-sec__footer{
  padding: 0 18px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.anpani-sec--flat .anpani-post-frame-list{
  list-style: none;
  margin: 0;
  padding: 0;
}

.anpani-sec--flat .anpani-post-frame-item{
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.anpani-sec--flat .anpani-post-frame-item:last-child{
  border-bottom: none;
}

.anpani-sec--flat .anpani-post-frame-label{
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: 0.72;
  margin-bottom: 4px;
}

.anpani-sec__body{
  padding: 0 18px 18px;
  color: rgba(255,255,255,0.92);
}

.anpani-sec__body p,
.anpani-sec__body li{
  line-height: 1.6;
}

.anpani-sec__body ul,
.anpani-sec__body ol{
  padding-left: 22px;
}

.anpani-sec__editor{
  padding: 0 18px 18px;
}

.anpani-sec__textarea{
  width: 100%;
  min-height: 220px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  outline: none;
  font: inherit;
  line-height: 1.55;
  resize: vertical;
  box-sizing: border-box;
}

.anpani-sec__textarea:focus{
  border-color: rgba(205,33,42,0.70);
  box-shadow: 0 0 0 3px rgba(205,33,42,0.16);
  background: rgba(255,255,255,0.07);
}

.anpani-len{
  display: inline-block;
  margin-left: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.82);
  vertical-align: middle;
}

.is-too-long{
  color: #ffb3b8 !important;
}

.anpani-len.is-too-long{
  background: rgba(205,33,42,0.18);
  color: #ffd5d8;
  border: 1px solid rgba(205,33,42,0.35);
}

.anpani-generate-warnings{
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(205,33,42,0.45);
  background: rgba(205,33,42,0.12);
  color: #ffd5d8;
}

.anpani-generate-warnings__title{
  font-weight: 800;
  margin-bottom: 8px;
}

.anpani-generate-warnings__list{
  margin: 0;
  padding-left: 18px;
}

.anpani-generate-warnings__list li{
  margin: 0 0 6px;
  line-height: 1.45;
}

.anpani-generate-warnings--info{
  border-color: rgba(120, 170, 255, 0.45);
  background: rgba(80, 130, 220, 0.12);
  color: #d8e8ff;
}

.anpani-generate-warnings--info .anpani-generate-warnings__title{
  color: #b8d4ff;
}

.anpani-generate-warnings__info{
  line-height: 1.45;
  font-size: 0.95rem;
}

/* ===============================
   REPLY ENGINE
=============================== */

.anpani-reply-engine{
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ===============================
   RESPONSIVE
=============================== */

@media (max-width: 820px){
  #anpani-ad-engine{
    padding: 18px;
    border-radius: 18px;
  }

    .anpani-sec__head{
    align-items: start;
  }

  .anpani-sec__title{
    width: 100%;
    margin-bottom: 4px;
  }

  .anpani-sec__row{
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .anpani-sec__meta{
    width: 100%;
    justify-content: flex-start;
  }

  .anpani-sec__actions{
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

  .anpani-sec__actions .anpani-sec__btn{
    width: 100%;
    min-width: 0;
    flex: unset;
  }

  .anpani-export-controls,
  .anpani-export-actions{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px){
  .anpani-variant-line{
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    column-gap: 8px;
    align-items: start;
  }

  .anpani-variant-line .anpani-best-pick-btn{
    grid-column: 1;
    margin-right: 0;
  }

  .anpani-variant-line .anpani-variant-badge{
    grid-column: 2;
  }

  .anpani-variant-line .anpani-variant-text,
  .anpani-variant-line .anpani-quality-badges{
    grid-column: 3;
    min-width: 0;
  }

  .anpani-variant-line .anpani-len,
  .anpani-variant-line .character-counter{
    grid-column: 4;
    margin-left: 0;
    justify-self: end;
  }
}

.anpani-export-bar[hidden]{
  display: none !important;
}

.anpani-variant-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  margin-right: 0;
  padding: 0;
  border-radius: 999px;
  background: rgba(205,33,42,0.18);
  border: 1px solid rgba(205,33,42,0.35);
  color: #ffd5d8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  vertical-align: top;
  flex: 0 0 24px;
}

.anpani-item-row,
.anpani-variant-row,
.anpani-variant-line{
  position: relative;
  list-style: none;
  margin-left: 0;
  padding-left: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.anpani-item-text,
.anpani-variant-text{
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.anpani-len,
.character-counter{
  flex: 0 0 auto;
  white-space: nowrap;
}

.anpani-best-pick-btn{
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-right: 8px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(205,33,42,0.55);
  background: rgba(205,33,42,0.08);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 22px;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: .18s ease;
  vertical-align: middle;
  box-sizing: border-box;
  transform: translateY(-1px);
}

.anpani-best-pick-btn:hover{
  background: rgba(205,33,42,0.12);
  border-color: rgba(205,33,42,0.35);
  color: #ffd9dc;
}

.anpani-best-pick-btn:focus-visible{
  outline: 2px solid rgba(205,33,42,0.65);
  outline-offset: 2px;
}

.anpani-best-pick-btn.is-pick-active{
  background: rgba(205,33,42,0.20);
  border-color: rgba(205,33,42,0.45);
  color: #fff;
}

.anpani-variant-line.is-best .anpani-variant-text{
  color: #fff;
  font-weight: 700;
}

.anpani-variant-line.is-best{
  background: rgba(205,33,42,0.08);
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  align-items: flex-start;
}

.anpani-variant-line.is-best .anpani-best-pick-btn{
  background: rgba(205,33,42,0.20);
  border-color: rgba(205,33,42,0.45);
  color: #fff;
}

.anpani-variant-line.is-best .anpani-variant-badge{
  background: rgba(205,33,42,0.26);
  border-color: rgba(205,33,42,0.55);
  color: #fff;
}

#anpani-output .anpani-sec__body h3{
  margin: 14px 0 8px;
  font-family: "Playfair Display", serif;
  font-size: 18px;
  line-height: 1.05;
  color: #fff;
}

@media (max-width: 480px){
  #anpani-output .anpani-sec__body h3{
    font-size: 18px;
    margin: 12px 0 6px;
  }
}


/* ===============================
   YT Shorts Sequence – align with variant rows
=============================== */

.anpani-sequence-list{
  list-style: none;
  margin: 0;
  padding: 0;
}

.anpani-sequence-item{
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0 0 14px;
}

.anpani-sequence-item .anpani-variant-text{
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.45;
}

.anpani-sequence-row{
  display: block;
  margin: 0;
}

.anpani-sequence-item .anpani-len + .anpani-len{
  display: none;
}

.anpani-reply-engine .anpani-btn-primary{
  margin-top: 18px;
}

.anpani-sequence-row{
  display: block;
  margin: 0;
  padding: 0;
  border: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.anpani-sequence-row::after{
  display: none !important;
  content: none !important;
}

.anpani-sequence-item p{
  margin: 0;
  border: 0 !important;
}

#preview-audio{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-width: 170px;
  height: 46px;
  margin-top: 10px;
  padding: 0 18px;

  background:
    linear-gradient(180deg,#151515 0%, #0d0d0d 100%);
  border: 1px solid rgba(208,24,42,.65);
  border-radius: 14px;

  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;

  cursor: pointer;
  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease;

  box-shadow:
    0 10px 24px rgba(0,0,0,.28),
    0 0 0 rgba(208,24,42,0);
}

#preview-audio::before{
  content: "▶";
  font-size: 11px;
  transform: translateX(1px);
  opacity: .92;
}

#preview-audio:hover{
  transform: translateY(-1px);

  border-color: rgba(208,24,42,.95);

  background:
    linear-gradient(180deg,#1a1a1a 0%, #101010 100%);

  box-shadow:
    0 14px 30px rgba(0,0,0,.34),
    0 0 22px rgba(208,24,42,.18);
}

#preview-audio:active{
  transform: translateY(0);
}

#preview-audio.playing{
  background:
    linear-gradient(180deg,#CD212A 0%, #A91820 100%);

  border-color: rgba(255,255,255,.12);

  box-shadow:
    0 12px 28px rgba(205,33,42,.35);
}

.anpani-live-preview-modal{
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  overflow: auto;
  overscroll-behavior: contain;
}

.anpani-live-preview-modal[hidden]{
  display: none !important;
}

.anpani-live-preview-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 9, 0.82);
}

.anpani-live-preview-panel{
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(92vw, 320px);
  max-width: 100%;
  margin: auto;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 16px;
  background: #0f1514;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.anpani-live-preview-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  align-self: stretch;
  width: 100%;
  margin-bottom: 12px;
  color: #f4f1ec;
}

.anpani-live-preview-close{
  border: 0;
  background: transparent;
  color: #f4f1ec;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

#anpani-live-preview-canvas{
  display: block;
  width: 100%;
  max-width: 288px;
  height: auto;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: 12px;
  background: #000;
  flex-shrink: 0;
}

.anpani-live-preview-status{
  align-self: stretch;
  width: 100%;
  margin-top: 10px;
  color: rgba(244, 241, 236, 0.78);
  font-size: 13px;
  text-align: center;
}

.anpani-live-preview-actions{
  align-self: stretch;
  width: 100%;
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

@media (max-width: 480px){
  .anpani-live-preview-modal{
    padding: 12px;
  }

  .anpani-live-preview-panel{
    width: min(94vw, 300px);
    padding: 12px;
  }

  #anpani-live-preview-canvas{
    max-width: min(272px, 84vw);
  }
}

#preview-video{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-width: 170px;
  height: 46px;
  margin-top: 10px;
  margin-left: 10px;
  padding: 0 18px;

  background:
    linear-gradient(180deg,#151515 0%, #0d0d0d 100%);
  border: 1px solid rgba(208,24,42,.65);
  border-radius: 14px;

  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;

  cursor: pointer;
  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease;

  box-shadow:
    0 10px 24px rgba(0,0,0,.28),
    0 0 0 rgba(208,24,42,0);
}

#preview-video::before{
  content: "▶";
  font-size: 11px;
  transform: translateX(1px);
  opacity: .92;
}

#preview-video:hover{
  transform: translateY(-1px);

  border-color: rgba(208,24,42,.95);

  background:
    linear-gradient(180deg,#1a1a1a 0%, #101010 100%);

  box-shadow:
    0 14px 30px rgba(0,0,0,.34),
    0 0 22px rgba(208,24,42,.18);
}

#preview-video:active{
  transform: translateY(0);
}

@media (max-width: 480px){
  #preview-audio,
  #preview-video{
    min-width: 0;
    width: auto;
    height: 40px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 12px;
    margin-top: 8px;
  }

  #preview-video{
    margin-left: 8px;
  }
}

@media (max-width: 380px){
  #preview-audio,
  #preview-video{
    width: 100%;
    margin-left: 0;
  }

  #preview-video{
    margin-top: 8px;
  }
}

/* ===============================
   AD WEEK PLANNER (23) — mobile-first
=============================== */

.anpani-ad-header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.anpani-ad-header h3{
  margin: 0;
  flex: 1 1 200px;
  min-width: 0;
}

.anpani-week-planner-open-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  width: auto;
  min-width: min(200px, 100%);
  max-width: 100%;
  flex: 1 1 auto;

  min-height: 46px;
  padding: 0 18px;

  background: linear-gradient(180deg,#151515 0%, #0d0d0d 100%);
  border: 1px solid rgba(208,24,42,.65);
  border-radius: 14px;

  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
  text-align: center;

  cursor: pointer;
  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease;

  box-shadow:
    0 10px 24px rgba(0,0,0,.28),
    0 0 0 rgba(208,24,42,0);

  white-space: normal;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.anpani-week-planner-open-btn:hover{
  transform: translateY(-1px);

  border-color: rgba(208,24,42,.95);

  background:
    linear-gradient(180deg,#1a1a1a 0%, #101010 100%);

  box-shadow:
    0 14px 30px rgba(0,0,0,.34),
    0 0 22px rgba(208,24,42,.18);
}

.anpani-week-planner-open-btn:active{
  transform: translateY(0);
}

body.anpani-week-planner-open{
  overflow: hidden;
  position: fixed;
  left: 0;
  right: 0;
}

.anpani-week-planner{
  position: fixed;
  top: 110px;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 10050;

  display: flex;
  justify-content: flex-end;
  align-items: stretch;

  pointer-events: none;
}

.anpani-week-planner[hidden]{
  display: none !important;
}

.anpani-week-planner-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-tap-highlight-color: transparent;
}

.anpani-week-planner-panel{
  position: relative;
  z-index: 1;
  pointer-events: auto;

  box-sizing: border-box;

  width: min(420px, calc(100vw - 36px));
  max-width: 100%;

  height: auto;
  max-height: calc(100dvh - 190px);

  display: flex;
  flex-direction: column;

  background: linear-gradient(180deg,#0d1412 0%, #0a0f0e 100%);
  color: #fff;

  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;

  box-shadow:
    0 18px 50px rgba(0,0,0,.42),
    0 0 0 1px rgba(255,255,255,.02);

  overflow: hidden;
}

.anpani-week-planner-header{
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.anpani-week-planner-header h2{
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(18px, 4.5vw, 22px);
  font-weight: 700;
  line-height: 1.2;
  min-width: 0;
}

.anpani-week-planner-close{
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.anpani-week-planner-meta{
  flex: 0 0 auto;
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.anpani-week-planner-regions{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
}

.anpani-week-planner-region-caption{
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.72;
}

.anpani-week-planner-region-segment{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.anpani-week-planner-region-btn{
  min-height: 44px;
  padding: 10px 8px;
  margin: 0;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.anpani-week-planner-region-btn:last-child{
  border-right: none;
}

.anpani-week-planner-region-btn.is-active{
  background: rgba(205, 33, 42, 0.22);
  box-shadow: inset 0 0 0 1px rgba(205, 33, 42, 0.75);
}

.anpani-week-planner-progress{
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.4;
  word-break: break-word;
}

.anpani-week-planner-body{
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 16px;
}

.anpani-week-planner-footer{
  flex: 0 0 auto;
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0d1412;
}

.anpani-week-planner-footer .anpani-btn{
  width: 100%;
  min-height: 44px;
  touch-action: manipulation;
}

.anpani-week-planner-day{
  margin-bottom: 18px;
  min-width: 0;
}

.anpani-week-planner-day:last-child{
  margin-bottom: 0;
}

.anpani-week-planner-day-title{
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.35;
  word-break: break-word;
}

.anpani-week-planner-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.anpani-week-planner-item{
  min-width: 0;
}

.anpani-week-planner-item-label{
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.anpani-week-planner-item input[type="checkbox"]{
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  margin: 0;
  accent-color: #cd212a;
  cursor: pointer;
}

.anpani-week-planner-item-text{
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.4;
  font-size: 15px;
  word-break: break-word;
}

.anpani-week-planner-item.is-done .anpani-week-planner-item-label{
  opacity: 0.55;
}

.anpani-week-planner-item.is-done .anpani-week-planner-item-text{
  text-decoration: line-through;
}

@media (max-width: 720px){
  .anpani-ad-header{
    flex-direction: column;
    align-items: stretch;
  }

  .anpani-ad-header h3{
    flex: none;
    width: 100%;
  }

  .anpani-week-planner-open-btn{
    width: 100%;
    max-width: none;
    flex: none;
  }

  .anpani-week-planner{
    justify-content: center;
    align-items: flex-end;
  }

  .anpani-week-planner-panel{
    width: 100%;
    max-width: 100%;
    height: min(94dvh, 100%);
    max-height: 94dvh;
    border-left: none;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  }
}

@media (max-width: 420px){
  .anpani-week-planner-panel{
    height: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }

  .anpani-week-planner{
    align-items: stretch;
  }
}
