/* Super App V1.21 — money flow correction + structured travel inputs */

/* Version remains data-driven from src/version.js. */
.v15-version-pill::after,
.v15-settings-row[data-v15-me-open="about"] .v15-settings-status::after,
.v15-about-card h3::after{content:attr(data-app-version)!important}

/* Money quick actions now read as one toolbar, not five separate cards. */
.quick-actions.v21-money-toolbar{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:0!important;
  padding:0!important;
  margin-top:14px!important;
  overflow:hidden!important;
  border:1px solid var(--line)!important;
  border-radius:18px!important;
  background:rgba(255,255,255,.62)!important;
  box-shadow:0 10px 28px rgba(29,55,45,.06)!important;
}
.quick-actions.v21-money-toolbar>button:not(.v19-money-more){
  min-width:0!important;
  min-height:66px!important;
  border:0!important;
  border-right:1px solid var(--line)!important;
  border-radius:0!important;
  background:transparent!important;
  padding:10px 6px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:5px!important;
  font-size:.78rem!important;
  line-height:1.15!important;
  white-space:normal!important;
  box-shadow:none!important;
}
.quick-actions.v21-money-toolbar>button:nth-of-type(4){border-right:0!important}
.quick-actions.v21-money-toolbar>button:not(.v19-money-more):active{background:var(--surface-2)!important}
.quick-actions.v21-money-toolbar .v19-money-more,
.quick-actions.v21-money-toolbar .v19-action-menu{display:none!important}

.v21-reconcile-detail{
  width:100%;
  margin:0 0 14px;
  min-height:44px;
}

/* FD creation mode */
.v21-fd-mode{
  display:grid;
  gap:8px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--surface-2);
}
.v21-fd-mode>span{font-weight:700;color:var(--green)}
.v21-fd-mode>div{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
  padding:4px;
  border-radius:13px;
  background:rgba(255,255,255,.7);
}
.v21-fd-mode button{
  min-width:0;
  min-height:42px;
  border:0;
  border-radius:10px;
  background:transparent;
  color:var(--muted);
  font-weight:700;
}
.v21-fd-mode button.active{
  background:var(--surface);
  color:var(--green);
  box-shadow:0 3px 12px rgba(25,56,44,.08);
}
.v21-fd-mode small{color:var(--muted);line-height:1.35}

/* FD list becomes detail-first instead of exposing CRUD actions in the row. */
.fd-row.v21-fd-row{
  position:relative;
  cursor:pointer;
  padding-right:46px!important;
}
.fd-row.v21-fd-row:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.v21-core-mature-trigger{display:none!important}
.v21-fd-arrow{
  position:absolute;
  right:16px;
  top:50%;
  transform:translateY(-50%);
  color:var(--muted);
  font-size:1.45rem;
  line-height:1;
}

/* Custom detail/edit sheets */
.v21-sheet-backdrop{
  position:fixed;
  inset:0;
  z-index:1200;
  background:rgba(15,35,29,.38);
  backdrop-filter:blur(10px);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:max(14px,env(safe-area-inset-top)) 14px max(14px,env(safe-area-inset-bottom));
}
.v21-sheet{
  width:min(680px,100%);
  max-height:min(88vh,860px);
  overflow:auto;
  border-radius:26px 26px 18px 18px;
  background:var(--surface);
  border:1px solid var(--line);
  box-shadow:0 26px 80px rgba(13,39,31,.24);
  padding:18px;
}
.v21-sheet>header{
  display:grid;
  grid-template-columns:44px minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  margin-bottom:16px;
}
.v21-sheet>header>button:first-child{
  width:44px;
  height:44px;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--surface);
  color:var(--green);
}
.v21-sheet>header>div{min-width:0}
.v21-sheet>header span{display:block;font-size:.72rem;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.v21-sheet>header strong{display:block;font-size:1.35rem;color:var(--green);overflow-wrap:anywhere}
.v21-fd-hero{
  padding:18px;
  border-radius:20px;
  background:linear-gradient(135deg,rgba(19,77,61,.96),rgba(165,129,76,.78));
  color:white;
  display:grid;
  gap:5px;
  margin-bottom:14px;
}
.v21-fd-hero span,.v21-fd-hero small{opacity:.8}
.v21-fd-hero strong{font-size:1.8rem;line-height:1.1;overflow-wrap:anywhere}
.v21-fd-detail-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.v21-fd-detail-grid>div{
  min-width:0;
  padding:13px;
  border:1px solid var(--line);
  border-radius:15px;
  background:var(--surface-2);
}
.v21-fd-detail-grid span{display:block;font-size:.73rem;color:var(--muted);margin-bottom:4px}
.v21-fd-detail-grid strong{display:block;color:var(--green);overflow-wrap:anywhere}
.v21-fd-detail-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:16px}
.v21-fd-editor .form-grid{margin-top:4px}

/* One city / stop per row. Hidden textarea remains the compatibility source for existing Travel logic. */
.v21-destinations-hidden{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  opacity:0!important;
  pointer-events:none!important;
  overflow:hidden!important;
}
.v21-city-field{display:grid!important;gap:8px!important}
.v21-city-list{display:grid;gap:8px}
.v21-city-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 42px;
  gap:7px;
  align-items:center;
}
.v21-city-row input{min-width:0;width:100%}
.v21-city-row button{
  width:42px;
  height:42px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface);
  color:var(--muted);
  font-size:1.1rem;
  padding:0;
}
.v21-add-city{
  justify-self:start;
  min-height:40px;
  padding:0 14px;
  border:1px dashed var(--line);
  border-radius:12px;
  background:transparent;
  color:var(--green);
  font-weight:700;
}
.v21-add-city:disabled{opacity:.45}

@media(max-width:520px){
  .quick-actions.v21-money-toolbar{border-radius:16px!important}
  .quick-actions.v21-money-toolbar>button:not(.v19-money-more){min-height:62px!important;font-size:.72rem!important;padding:9px 3px!important;gap:3px!important}
  .v21-sheet-backdrop{padding-inline:0;align-items:flex-end}
  .v21-sheet{width:100%;border-radius:24px 24px 0 0;padding:16px 16px calc(18px + env(safe-area-inset-bottom));max-height:92vh}
}
@media(max-width:360px){
  .quick-actions.v21-money-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .quick-actions.v21-money-toolbar>button:not(.v19-money-more){border-bottom:1px solid var(--line)!important}
  .quick-actions.v21-money-toolbar>button:nth-of-type(2n){border-right:0!important}
  .quick-actions.v21-money-toolbar>button:nth-of-type(n+3){border-bottom:0!important}
  .v21-fd-mode>div,.v21-fd-detail-grid,.v21-fd-detail-actions{grid-template-columns:1fr}
}
