/* Diario e Conquistas — acabamento visual e estados funcionais. */
#diary .d-clean{
  display:block!important;
  width:100%!important;
  max-width:none!important;
  background:
    radial-gradient(circle at 8% 4%,rgba(85,139,232,.15),transparent 28%),
    radial-gradient(circle at 94% 18%,rgba(79,190,157,.10),transparent 24%),
    #f3f6fb;
}

#diary .d-top{
  max-width:1120px;
  margin:0 auto 18px!important;
  padding:18px;
  border:1px solid rgba(205,219,239,.82);
  border-radius:22px;
  background:linear-gradient(135deg,rgba(255,255,255,.97),rgba(245,249,255,.92));
  box-shadow:0 14px 34px rgba(22,61,112,.09);
}
.d-title-mark{
  width:52px;height:52px;display:grid;place-items:center;flex:0 0 auto;
  border-radius:16px;color:#fff;font-size:25px;
  background:linear-gradient(145deg,#0b3d91,#2c72dc);
  box-shadow:0 9px 20px rgba(29,95,208,.24);
}
.d-eyebrow,.ach-eyebrow{display:block;margin-bottom:2px;font-size:10px;font-weight:850;letter-spacing:.12em;text-transform:uppercase}
.d-eyebrow{color:#2c68be}
.d-title{letter-spacing:-.035em}
.d-subtitle{color:#64758b}
.d-top-meta{display:flex;flex-direction:column;align-items:flex-end;gap:7px}
.d-private-pill{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border-radius:999px;background:#eaf8f1;color:#14704b;font-size:10px;font-weight:800;white-space:nowrap}
.d-date{background:#eaf1ff;border:1px solid #d7e4fb;color:#174f9f}
.d-workspace{width:100%;max-width:1120px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(340px,.95fr);gap:22px;align-items:start}
.d-compose{min-width:0}
.d-compose .rt-card{border:1px solid #e1e9f4;border-radius:20px;box-shadow:0 8px 22px rgba(30,66,112,.06)}
.d-compose .rt-label{display:flex;align-items:center;gap:8px;color:#203a5e}
.d-compose .rt-label::before{content:'';width:7px;height:7px;border-radius:50%;background:#2d70d3;box-shadow:0 0 0 5px #eaf2ff}
.d-audio-section{margin-top:20px;padding:20px;border:1px solid #dce8f8;border-radius:18px;background:linear-gradient(145deg,#f8fbff,#eef5ff)}
.d-record-btn{width:94px;height:94px;box-shadow:0 10px 28px rgba(21,71,143,.13)}
.d-record-btn.recording{background:#fff4f3;box-shadow:0 0 0 9px rgba(219,65,55,.08),0 12px 28px rgba(148,35,28,.15)}
.d-record-btn.recording .d-record-label{color:#b42f28;font-weight:800}
.d-audio-player{border:1px solid #dbe7f5;box-shadow:none}
.d-save-btn{min-height:54px;border-radius:17px;box-shadow:0 10px 24px rgba(13,67,149,.22)}
.d-history{margin-top:0;padding:18px;border:1px solid #e0e8f2;border-radius:22px;background:rgba(255,255,255,.78);box-shadow:0 12px 30px rgba(30,66,112,.07);backdrop-filter:blur(12px)}
.d-workspace>.d-history{grid-column:auto!important}
.d-history-title{font-size:19px;letter-spacing:-.02em}
.d-history-count{padding:5px 9px;border-radius:999px;background:#edf3fc;color:#49627f;font-weight:750}
.d-filter-grid{padding:12px;border:1px solid #e4ebf4;box-shadow:none;background:#f7f9fc}
.d-entry{border:1px solid #e2e9f2;border-left:4px solid #2b70d1;border-radius:17px;box-shadow:0 7px 18px rgba(34,66,105,.06)}
.d-entry:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(34,66,105,.10)}
.d-entry:active{transform:none}
.d-entry-audio{padding:10px;border-radius:13px;background:#f4f8fe;border:1px solid #dce8f7}
.d-audio-action{display:flex;align-items:center;justify-content:center;gap:8px}
.d-audio-action::before{content:'▶';font-size:10px}
.d-audio-action.loading::before{content:'';width:13px;height:13px;border:2px solid #b8cae4;border-top-color:#1d5fd0;border-radius:50%;animation:spin .8s linear infinite}
.d-entry-actions{justify-content:space-between}
.d-empty{border:1px dashed #cfdbea;border-radius:16px;background:#f8fafd}

#achievements{background:linear-gradient(180deg,#edf3fb 0,#f7f9fc 320px)!important}
#achievements.has-shared-home-header .achievements-header,
#achievements .achievements-header{
  width:calc(100% - 32px)!important;max-width:1120px!important;margin:0 auto 18px!important;
  padding:26px!important;border:1px solid rgba(255,255,255,.18)!important;border-radius:26px!important;
  color:#fff!important;background:linear-gradient(135deg,#092b62 0%,#1553a8 58%,#5a48ba 130%)!important;
  box-shadow:0 20px 44px rgba(9,43,98,.22)!important;
}
#achievements .achievements-header::before{width:340px;height:340px;top:-190px;right:-70px;background:rgba(255,255,255,.09)}
#achievements .achievements-header::after{content:'';position:absolute;width:190px;height:190px;left:-70px;bottom:-125px;border-radius:50%;background:rgba(86,190,255,.13)}
#achievements .achievements-header .back-btn{z-index:2}
#achievements .ach-heading{position:relative;z-index:1;max-width:70%}
#achievements.has-shared-home-header .achievements-header h2,
#achievements .achievements-header h2{padding:0!important;margin:0;color:#fff!important;font-size:30px;font-weight:850;letter-spacing:-.035em}
#achievements.has-shared-home-header .achievements-header p,
#achievements .achievements-header p{padding:0!important;margin:4px 0 0;color:rgba(255,255,255,.72)!important;font-size:13px}
.ach-eyebrow{color:#a9d2ff}
.ach-hero-medal{position:absolute;right:28px;top:25px;z-index:1;width:78px;height:78px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.18);border-radius:24px;background:rgba(255,255,255,.12);font-size:39px;transform:rotate(4deg);box-shadow:inset 0 1px rgba(255,255,255,.2)}
.ach-hero-medal span{filter:drop-shadow(0 7px 9px rgba(0,0,0,.18))}
.ach-summary{position:relative;z-index:1;display:flex;align-items:center;gap:18px;margin-top:25px;padding:15px 18px;border:1px solid rgba(255,255,255,.13);border-radius:18px;background:rgba(2,25,61,.22);backdrop-filter:blur(8px)}
.ach-summary-item{display:flex;flex-direction:column;min-width:72px}
.ach-summary-item strong{font-size:22px;line-height:1;color:#fff}
.ach-summary-item span{margin-top:4px;color:rgba(255,255,255,.63);font-size:10px;font-weight:750;text-transform:uppercase;letter-spacing:.08em}
.ach-summary-divider{width:1px;height:30px;background:rgba(255,255,255,.16)}
.ach-overview{position:relative;z-index:1;margin-top:16px}
.ach-overview-copy{display:flex;justify-content:space-between;color:rgba(255,255,255,.77);font-size:11px;font-weight:700}
.ach-overview-copy strong{color:#fff}
.ach-overview-bar{height:7px;margin-top:7px;overflow:hidden;border-radius:999px;background:rgba(2,21,50,.32)}
.ach-overview-bar span{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#69d7b2,#a5f0d3);transition:width .6s ease}
.achievements-content{width:calc(100% - 32px);max-width:1120px;margin:0 auto;padding-bottom:100px}
.ach-filter{display:flex;gap:7px;margin:0 0 14px;padding:5px;border:1px solid #dce5f0;border-radius:15px;background:#fff;box-shadow:0 7px 18px rgba(28,60,102,.06)}
.ach-filter button{flex:1;min-height:39px;padding:8px 12px;border:0;border-radius:11px;background:transparent;color:#64758a;font:750 12px var(--font);cursor:pointer;transition:.2s ease}
.ach-filter button.active{background:#eaf2ff;color:#1553a8;box-shadow:inset 0 0 0 1px #d4e3fa}
.achievements-body{width:100%!important;max-width:none!important;margin:0!important;padding:0!important;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.ach-card{min-height:145px;margin:0;padding:17px;border:1px solid #dde6f0;border-radius:20px;align-items:flex-start;box-shadow:0 9px 24px rgba(28,60,102,.07)}
.ach-card.locked{opacity:1;filter:none;background:#f8fafd;border-style:dashed}
.ach-card.locked .ach-icon{filter:grayscale(.65);opacity:.66}
.ach-card.unlocked{background:linear-gradient(145deg,#fff,#f8fffc);border-color:#cfe9dd}
.ach-icon{width:58px;height:58px;border-radius:18px;font-size:29px;position:relative;z-index:1}
.ach-info{position:relative;z-index:1}
.ach-title{font-size:15px;font-weight:800;color:#19324f}
.ach-desc{margin-top:4px;min-height:34px;color:#64768b}
.ach-category{display:inline-block;margin-bottom:6px;color:#57708d;font-size:9px;font-weight:850;text-transform:uppercase;letter-spacing:.09em}
.ach-date{margin-top:8px;color:#6c7d90}
.ach-progress-bar{height:6px;background:#e3eaf2}
.ach-progress-fill{background:linear-gradient(90deg,#266dcc,#5b91e1)}
.ach-badge{position:absolute;right:14px;top:14px;z-index:2;background:#178a5b;box-shadow:0 4px 10px rgba(23,138,91,.16)}
.ach-badge.locked-badge{background:#e8eef5;color:#50657d;box-shadow:none}

@media(max-width:820px){
  .d-workspace{grid-template-columns:1fr;max-width:640px}.d-history{margin-top:4px}
  .achievements-body{grid-template-columns:1fr}
}
@media(max-width:520px){
  #diary .d-top{padding:14px;border-radius:18px}.d-title-mark{width:44px;height:44px;border-radius:14px;font-size:21px}.d-title{font-size:23px}.d-top-meta{gap:4px}.d-private-pill{font-size:9px}.d-date{font-size:10px}.d-workspace{gap:16px}.d-history{padding:14px}
  #achievements.has-shared-home-header .achievements-header,#achievements .achievements-header{padding:21px 18px!important;border-radius:21px!important}.ach-hero-medal{width:62px;height:62px;right:18px;top:20px;border-radius:19px;font-size:31px}.ach-summary{gap:10px;padding:13px}.ach-summary-item{min-width:0;flex:1}.ach-summary-item strong{font-size:19px}.ach-summary-divider{height:27px}.achievements-content{width:calc(100% - 24px)}.ach-card{min-height:0}.ach-filter button{padding:7px 5px;font-size:11px}
}
