:root {
  color-scheme: light;
  color: #152e26;
  --green: #086346;
  --green-dark: #064d38;
  --green-soft: #e4f3eb;
  --wash: #f6f9f7;
  --border: #dce7df;
  --muted: #496258;
  --white: #fff;
  --error: #982f29;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--wash); }
a { color: var(--green-dark); }
button, input, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
:focus-visible { outline: 3px solid #15976f; outline-offset: 3px; }
h1,h2,h3,p { margin: 0; }
p { line-height: 1.55; }
img { display: block; max-width: 100%; }
.sr-only, .skip:not(:focus) {
  width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); position: absolute;
}
.skip:focus { display: inline-block; background: white; padding: 10px; }
.container { max-width: 1370px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 52px); }
.topbar { background: var(--white); border-bottom: 1px solid var(--border); }
.top-inner, .top-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.top-inner { min-height: 78px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #18362d; }
.brand img { object-fit: contain; }
.brand strong { font-size: 1.25rem; line-height: 1.1; letter-spacing: -.025em; font-weight: 750; }
.brand b { color: var(--green); }
.brand small { display: block; font-size: .79rem; color: var(--muted); }
.site-link { text-decoration: none; font-weight: 650; font-size: .9rem; }
.login-layout {
  display: grid; grid-template-columns: 1.06fr 1fr; min-height: 525px;
  max-width: 960px; margin: clamp(22px,7vw,100px) auto; border: 1px solid var(--border);
  border-radius: 24px; overflow: hidden; background: white; box-shadow: 0 22px 65px #063e2713;
}
.login-copy {
  display: flex; flex-direction: column; justify-content: end; gap: 13px;
  padding: 50px 38px; color: white;
  background: linear-gradient(175deg, #052c2220 5%, #052e23b3 55%, #062d21 100%), url("https://arsango.com/assets/referencia-portada.webp") center / cover, #0a4a36;
}
.login-copy h1 { font-size: clamp(2.25rem, 4vw, 3.4rem); line-height: 1.05; letter-spacing: -.045em; max-width: 10ch; }
.login-copy p { max-width: 34ch; color: #f0fff5; font-size: 1rem; }
.login-card { padding: clamp(24px, 4.7vw, 56px); align-self: center; }
.login-card h2 { font-size: 1.65rem; line-height: 1.17; letter-spacing: -.03em; }
.login-card > p { color: var(--muted); margin-top: 8px; }
.login-card form { display: grid; gap: 15px; margin-top: 23px; }
.login-links { display: grid; justify-items: start; gap: 9px; margin-top: 18px; }
.auth-status:not(:empty) { border-left: 3px solid #168461; background: var(--green-soft); padding: 10px 12px; margin-top: 18px; }
.auth-status.error { border-color: var(--error); background: #fff2ef; color: var(--error); }
label { display: grid; gap: 7px; font-weight: 630; font-size: .91rem; }
input, textarea {
  color: #172f25; background: #fff; border: 1px solid #cbdcd1;
  padding: 10px 12px; border-radius: 9px; width: 100%; font-size: 1rem;
}
textarea { min-height: 85px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #65786e; font-size: .89rem; }
.primary,.secondary,.quiet {
  border-radius: 10px; min-height: 41px; line-height: 1.22; padding: 9px 13px; font-weight: 680; border: 1px solid transparent;
}
.primary { color: white; background: var(--green); }
.primary:hover:not(:disabled) { background: var(--green-dark); }
.secondary { border-color: #cbded2; color: var(--green-dark); background: white; }
.quiet { color: var(--green-dark); background: #edf5ef; }
.secondary:hover:not(:disabled), .quiet:hover:not(:disabled) { background: #e2f0e7; }
.text-button { background: transparent; border: 0; padding: 0; color: var(--green-dark); text-align: start; font-size: .91rem; font-weight: 680; text-underline-offset: 3px; }
.text-button:hover:not(:disabled) { text-decoration: underline; }

#editor { padding-block: 35px 135px; }
.intro-row, .section-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.intro-row h1 { font-size: clamp(2rem,4vw,3rem); line-height: 1.06; letter-spacing: -.045em; }
.intro-row p { color: var(--muted); margin-top: 8px; }
.version { display: grid; grid-template-columns: 9px auto; gap: 2px 8px; align-items: center; padding: 12px 15px; background: white; border: 1px solid var(--border); border-radius: 10px; font-size: .87rem; }
.version small { grid-column: 2; color: var(--muted); white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #178461; }
.workspace { display: grid; grid-template-columns: minmax(170px,215px) minmax(0,1fr); gap: clamp(22px,3vw,40px); margin-top: 29px; }
aside { min-width: 0; }
#sections { display: grid; gap: 3px; }
.nav-tab {
  padding: 11px 13px; width: 100%; text-align: left; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: #3e5b4f; font-weight: 650; white-space: nowrap;
}
.nav-tab:hover { background: #eaf4ee; }
.nav-tab[aria-current="true"] { background: #dff0e6; color: #065338; border-color: #cce7d6; }
.storage { border: 1px solid var(--border); border-radius: 10px; margin-top: 20px; background: white; }
.storage summary { padding: 12px; display: flex; justify-content: space-between; gap: 5px; font-size: .84rem; color: var(--green-dark); font-weight: 720; }
.storage-body { padding: 0 12px 12px; }
.storage p { font-size: .83rem; color: var(--muted); margin-bottom: 8px; }
.storage button { font-size: .83rem; }
progress { accent-color: #0e8a62; width: 100%; }
.section-work { min-width: 0; }
.section-top { margin-bottom: 15px; }
.section-top h2 { font-size: 1.5rem; letter-spacing: -.025em; }
.section-top p { min-height: 1.2em; color: var(--muted); font-size: .86rem; }
.find { width: min(43%, 265px); }
#groups { display: grid; gap: 11px; }
.edit-group { min-width: 0; border: 1px solid var(--border); border-radius: 13px; background: white; overflow: clip; }
.edit-group > summary { padding: 14px 17px; font-weight: 720; line-height: 1.3; color: #1a3b2e; }
.edit-group[open] > summary { background: #f5faf6; border-bottom: 1px solid var(--border); }
.group-content { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 18px; row-gap: 16px; padding: 17px; }
.wide { grid-column: 1/-1; }
.help { font-weight: 400; margin-top: 0; color: var(--muted); font-size: .83rem; }
.photo-field { display: grid; gap: 9px; align-content: start; color: #1a3b2e; font-weight: 650; font-size: .91rem; }
.photo-frame {
  position: relative; height: clamp(130px,19vw,215px); border-radius: 10px; overflow: hidden;
  background: #eaf1ec; display: grid; place-items: center; color: #496258; font-weight: 500;
}
.photo-frame img { width: 100%; height: 100%; object-fit: contain; }
.photo-actions, .item-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.photo-actions button,.upload-label,.item-actions button { font-size: .84rem; }
.upload-label { display: inline-flex; cursor: pointer; justify-content: center; align-items: center; }
.photo-status { min-height: .25rem; color: var(--muted); font-size: .82rem; font-weight: 450; }
.photo-status.error { color: var(--error); }
.order-tools { display: flex; gap: 8px; grid-column: 1/-1; justify-content: end; }
.order-tools button { min-height: 35px; font-size: .86rem; padding: 6px 11px; }
.add-card { grid-column: 1/-1; border: 1px solid var(--border); border-radius: 10px; padding: 15px; display: grid; gap: 14px; }
.empty-filter { padding: 18px; color: var(--muted); }
.action-bar {
  position: fixed; inset: auto 0 0; z-index: 4; border-top: 1px solid var(--border);
  background: #fffffff7; padding: 12px max(16px, calc((100vw - 1266px)/2)) calc(12px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  box-shadow: 0 -8px 28px #163e2510;
}
.action-text { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: .85rem; }
#save-status.error { color: var(--error); font-weight: 650; }
.actions { display: flex; gap: 8px; align-items: center; }
dialog { width: min(460px,calc(100vw - 32px)); border: 1px solid var(--border); border-radius: 15px; padding: 25px; color: #163529; }
dialog::backdrop { background: #10281ab0; }
dialog h2 { margin-bottom: 9px; }
dialog p { color: var(--muted); }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 18px; }

@media (max-width: 760px) {
  .top-inner { min-height: 62px; }
  .top-actions { gap: 8px; }
  .top-actions .quiet { font-size: .78rem; padding-inline: 8px; }
  .site-link { font-size: .8rem; }
  .brand img { width: 36px; height: 36px; }
  .brand strong { font-size: 1.05rem; }
  .brand small { font-size: .69rem; }
  .login-layout { grid-template-columns: 1fr; min-height: 0; margin-block: 18px 40px; border-radius: 17px; }
  .login-copy { min-height: 175px; padding: 18px 23px; background-position: center 42%; }
  .login-copy h1 { max-width: none; font-size: 1.85rem; }
  .login-copy p { font-size: .9rem; }
  #editor { padding-top: 24px; }
  .intro-row { align-items: start; flex-direction: column; gap: 12px; }
  .version { padding-block: 7px; }
  .workspace { display: block; margin-top: 15px; }
  #sections { display: flex; overflow-x: auto; padding: 3px 3px 6px; gap: 5px; }
  .nav-tab { width: auto; font-size: .88rem; padding: 8px 10px; }
  .storage { margin: 5px 0 15px; }
  .section-top { gap: 9px; }
  .section-top h2 { font-size: 1.27rem; }
  .find { width: 50%; }
  .find input { padding-inline: 8px; min-width: 0; }
  .group-content { grid-template-columns: 1fr; padding: 13px; }
  .edit-group > summary { padding-inline: 13px; }
  .action-bar { flex-direction: column; align-items: stretch; gap: 7px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .action-text { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; }
  .action-text .text-button { font-size: .78rem; }
  .actions { display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 5px; }
  .actions button { min-height: 43px; font-size: .81rem; padding: 5px 6px; }
}
