@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800;900&display=swap');

:root{
  --diary-bg:#f4f6f8;
  --diary-surface:#ffffff;
  --diary-text:#15171a;
  --diary-sub:#6c727d;
  --diary-muted:#9aa0aa;
  --diary-line:#e7e9ee;
  --diary-soft:#f8f9fb;
  --diary-accent:#cdea39;
  --diary-accent-ink:#151a08;
  --diary-blue:#3677f4;
  --diary-orange:#f39b36;
  --diary-green:#3aa66b;
  --diary-shadow:0 12px 32px rgba(20,24,32,.07);
}

*{box-sizing:border-box}
html{background:var(--diary-bg);-webkit-text-size-adjust:100%}
body{margin:0;background:var(--diary-bg);color:var(--diary-text);font-family:'Noto Sans KR',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;-webkit-tap-highlight-color:transparent}
button,input,textarea{font:inherit}
button{color:inherit}
body.is-composing{background:#fff}

.diary-shell{position:relative;max-width:480px;min-height:calc(100dvh - 56px);margin:0 auto;background:var(--diary-bg)}
.diary-view{min-height:calc(100dvh - 56px);padding:24px 18px calc(104px + env(safe-area-inset-bottom))}

.diary-page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:24px}
.diary-kicker{margin:0 0 5px;color:#9197a2;font-size:10px;font-weight:900;letter-spacing:1.35px}
.diary-page-head h1{margin:0;font-size:27px;line-height:1.2;letter-spacing:-1.05px;font-weight:900}
.diary-lead{margin:7px 0 0;color:var(--diary-sub);font-size:13px;line-height:1.55;letter-spacing:-.3px}
.diary-write-inline{flex:none;height:38px;padding:0 13px;border:1px solid #e1e4e9;border-radius:12px;background:#fff;font-size:13px;font-weight:800;box-shadow:0 4px 12px rgba(20,24,32,.04);cursor:pointer}
.diary-write-inline span{margin-right:2px;font-size:16px;font-weight:500}

.diary-tabs{position:sticky;top:56px;z-index:20;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;margin:0 -2px 18px;padding:4px;border:1px solid #e3e6eb;border-radius:13px;background:rgba(239,241,244,.92);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.diary-tab{width:100%;min-width:0;height:36px;padding:0;border:0;border-radius:9px;background:transparent;color:#757b84;font-size:13px;font-weight:800;cursor:pointer;transition:.16s ease}
.diary-tab.is-active{width:100%;background:#fff;color:#15171a;box-shadow:0 1px 5px rgba(20,24,32,.10)}

.diary-summary{display:flex;align-items:center;gap:14px;margin-bottom:18px;padding:16px 17px;border:1px solid #e6e9ed;border-radius:17px;background:#fff}
.diary-summary>div:first-child{display:flex;flex-direction:column;min-width:74px}
.diary-summary-label{color:#8c929c;font-size:11px;font-weight:700}
.diary-summary-value{margin-top:1px;font-size:25px;line-height:1.1;letter-spacing:-.6px}
.diary-summary-line{width:1px;height:30px;background:#e8eaee}
.diary-summary p{margin:0;color:#676d77;font-size:12px;line-height:1.5;word-break:keep-all}
.diary-summary p strong{color:#25282d}

.diary-feed{position:relative;margin-top:2px}
.diary-entry{position:relative;display:grid;grid-template-columns:18px 1fr;gap:8px;padding:4px 0 0;outline:none;cursor:pointer}
.diary-entry+.diary-entry{margin-top:1px}
.entry-rail{position:relative;display:flex;justify-content:center}
.entry-rail::after{content:"";position:absolute;top:22px;bottom:-5px;width:1px;background:#dfe3e7}
.diary-entry:last-child .entry-rail::after{display:none}
.entry-dot{position:relative;z-index:1;width:9px;height:9px;margin-top:16px;border:2px solid var(--diary-bg);border-radius:50%;box-shadow:0 0 0 1px rgba(20,24,32,.08)}
.entry-dot.type-game{background:var(--diary-blue)}
.entry-dot.type-training{background:var(--diary-green)}
.entry-dot.type-free{background:var(--diary-orange)}
.entry-main{min-width:0;margin-bottom:10px;padding:14px 15px 14px;border:1px solid #e6e9ed;border-radius:16px;background:#fff;transition:transform .12s ease,border-color .12s ease,box-shadow .12s ease}
.diary-entry:active .entry-main{transform:scale(.992);border-color:#d8dce2}
.entry-topline{display:flex;align-items:center;gap:7px}
.entry-date{color:#8a9099;font-size:11px;font-weight:700}
.entry-type{padding:2px 6px;border-radius:5px;background:#f1f3f5;color:#747a83;font-size:10px;font-weight:800}
.entry-title-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:8px}
.entry-title-row h2{min-width:0;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px;line-height:1.3;letter-spacing:-.5px;font-weight:900}
.entry-condition{flex:none;font-size:17px;line-height:1}
.entry-meta{margin-top:4px;color:#949aa3;font-size:11px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.entry-preview{display:-webkit-box;margin:10px 0 0;overflow:hidden;color:#4e545d;font-size:13px;line-height:1.58;letter-spacing:-.25px;-webkit-box-orient:vertical;-webkit-line-clamp:2}
.entry-goal{display:flex;align-items:flex-start;gap:8px;margin-top:11px;padding-top:10px;border-top:1px solid #f0f1f3;color:#444a53;font-size:11px;line-height:1.5}
.entry-goal span{flex:none;padding:1px 6px;border-radius:999px;background:#f2f4f6;color:#7b818a;font-size:9px;font-weight:800}

.diary-empty{padding:62px 20px;text-align:center}
.diary-empty-mark{width:42px;height:42px;margin:0 auto 14px;border-radius:13px;background:#e9edf1;color:#727984;display:grid;place-items:center;font-size:21px}
.diary-empty strong{display:block;font-size:16px}
.diary-empty p{max-width:250px;margin:8px auto 18px;color:#8a9099;font-size:12px;line-height:1.6;word-break:keep-all}
.diary-empty-btn{height:40px;padding:0 15px;border:0;border-radius:11px;background:#1b1d21;color:#fff;font-size:12px;font-weight:800}

.diary-fab{position:fixed;left:50%;bottom:calc(18px + env(safe-area-inset-bottom));z-index:40;display:flex;align-items:center;gap:6px;height:48px;padding:0 18px;border:0;border-radius:999px;background:#17191d;color:#fff;box-shadow:0 12px 32px rgba(9,12,18,.24);transform:translateX(-50%);font-size:13px;font-weight:800;cursor:pointer}
.diary-fab>span:first-child{font-size:20px;font-weight:400;line-height:1}

.diary-compose{min-height:calc(100dvh - 56px);background:#fff}
.compose-topbar{position:sticky;top:56px;z-index:45;height:54px;padding:0 13px;display:grid;grid-template-columns:50px 1fr 50px;align-items:center;border-bottom:1px solid #eceef1;background:rgba(255,255,255,.95);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.compose-topbar h1{margin:0;text-align:center;font-size:16px;letter-spacing:-.4px;font-weight:900}
.compose-back,.compose-save-top{height:38px;border:0;background:transparent;cursor:pointer}
.compose-back{padding:0;text-align:left;font-size:23px;font-weight:400}
.compose-save-top{padding:0;text-align:right;color:#246fe5;font-size:13px;font-weight:900}
.compose-form{padding-bottom:calc(34px + env(safe-area-inset-bottom))}
.compose-section{padding:22px 18px;border-bottom:8px solid #f4f5f7}
.compose-section:last-of-type{border-bottom:0}
.compose-intro{padding-top:20px}
.field-block{margin-top:20px}
.field-label{display:block;margin-bottom:8px;color:#2c3036;font-size:12px;font-weight:900;letter-spacing:-.2px}
.optional{color:#a0a5ad;font-size:10px;font-weight:600}
.field-help{margin:2px 0 0;color:#989ea7;font-size:11px;line-height:1.5;word-break:keep-all}
.field-control{width:100%;border:1px solid #dfe3e8;border-radius:12px;background:#fafbfc;color:#15171a;outline:none;transition:border-color .15s ease,background .15s ease,box-shadow .15s ease}
.field-control:focus{border-color:#aeb5bf;background:#fff;box-shadow:0 0 0 3px rgba(38,42,50,.06)}
.date-control{height:48px;padding:0 14px;font-size:14px;font-weight:700}
.type-segment{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:4px;border:1px solid #e1e4e8;border-radius:12px;background:#f1f3f5}
.type-btn{height:38px;border:0;border-radius:8px;background:transparent;color:#797f88;font-size:13px;font-weight:800;cursor:pointer}
.type-btn.is-active{background:#fff;color:#17191d;box-shadow:0 1px 5px rgba(20,24,32,.10)}
.linked-record{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding:13px 14px;border:1px solid #e3e6ea;border-radius:13px;background:#fff}
.linked-record-copy{display:flex;min-width:0;flex-direction:column;gap:2px}
.linked-record-label{color:#969ca5;font-size:10px;font-weight:700}
.linked-record-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;letter-spacing:-.3px}
.linked-record-btn{flex:none;height:32px;padding:0 11px;border:1px solid #dfe3e8;border-radius:9px;background:#f8f9fa;font-size:11px;font-weight:800;cursor:pointer}

.section-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.condition-caption{margin-top:1px;color:#646b75;font-size:11px;font-weight:800}
.condition-scale{display:grid;grid-template-columns:repeat(5,1fr);gap:7px;margin-top:16px}
.condition-btn{min-width:0;height:72px;padding:7px 2px;border:1px solid #e3e6ea;border-radius:14px;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;cursor:pointer;transition:.14s ease}
.condition-btn span{font-size:24px;filter:saturate(.85)}
.condition-btn small{color:#9197a0;font-size:9px;font-weight:700}
.condition-btn.is-active{border-color:#24272d;background:#f7f8f9;box-shadow:inset 0 0 0 1px #24272d}
.condition-btn.is-active small{color:#24272d;font-weight:900}

.compose-notes{display:flex;flex-direction:column;gap:21px}
.note-field{min-width:0}
.textarea-control{min-height:92px;padding:13px 14px;resize:none;font-size:13px;line-height:1.65;letter-spacing:-.2px}
.textarea-control.is-compact{min-height:72px}
.textarea-control::placeholder{color:#afb4bc}
.photo-row{display:flex;align-items:center;justify-content:space-between;gap:14px}
.photo-row>div{min-width:0}
.photo-add-btn{flex:none;height:38px;padding:0 12px;border:1px solid #dfe3e8;border-radius:10px;background:#fff;font-size:11px;font-weight:800;cursor:pointer}
.compose-actions{display:flex;gap:9px;padding:22px 18px 0}
.delete-btn{flex:0 0 88px;height:50px;border:1px solid #e3e5e8;border-radius:13px;background:#fff;color:#d34e4e;font-size:13px;font-weight:800}
.primary-save-btn{flex:1;height:50px;border:0;border-radius:13px;background:#17191d;color:#fff;font-size:14px;font-weight:900;box-shadow:0 9px 22px rgba(17,20,25,.14)}

.record-sheet-backdrop{position:fixed;inset:0;z-index:110;background:rgba(10,12,16,.34);opacity:0;transition:opacity .18s ease}
.record-sheet{position:fixed;left:50%;bottom:0;z-index:120;width:min(480px,100%);max-height:72dvh;padding:8px 18px calc(20px + env(safe-area-inset-bottom));border-radius:22px 22px 0 0;background:#fff;box-shadow:0 -20px 45px rgba(14,18,26,.18);transform:translate(-50%,100%);transition:transform .22s cubic-bezier(.2,.8,.2,1);overflow:auto}
body.sheet-open .record-sheet-backdrop{opacity:1}
body.sheet-open .record-sheet{transform:translate(-50%,0)}
.sheet-grabber{width:38px;height:4px;margin:2px auto 18px;border-radius:999px;background:#d8dce1}
.sheet-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:14px}
.sheet-eyebrow{color:#a0a5ad;font-size:9px;font-weight:900;letter-spacing:.7px}
.sheet-head h2{margin:2px 0 0;font-size:19px;letter-spacing:-.6px}
.sheet-close{width:34px;height:34px;border:0;border-radius:50%;background:#f1f3f5;color:#646a73;font-size:22px;line-height:1;cursor:pointer}
.record-options{border-top:1px solid #eceef1}
.record-option{width:100%;min-height:72px;padding:13px 2px;border:0;border-bottom:1px solid #eceef1;background:#fff;display:grid;grid-template-columns:58px 1fr 18px;align-items:center;gap:10px;text-align:left;cursor:pointer}
.record-option-date{color:#8c929b;font-size:10px;font-weight:700}
.record-option-main{min-width:0;display:flex;flex-direction:column;gap:3px}
.record-option-main strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.record-option-main small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#969ca5;font-size:10px}
.record-option-arrow{color:#b2b7bf;font-size:23px;font-weight:300}

.toast{position:fixed;left:50%;bottom:calc(26px + env(safe-area-inset-bottom));z-index:200;max-width:calc(100% - 40px);padding:11px 15px;border-radius:11px;background:rgba(24,27,32,.94);color:#fff;box-shadow:0 8px 24px rgba(8,10,14,.20);opacity:0;pointer-events:none;transform:translate(-50%,12px);transition:.2s ease;font-size:12px;font-weight:700;white-space:nowrap}
.toast.show{opacity:1;transform:translate(-50%,0)}

@media (hover:hover){
  .diary-entry:hover .entry-main{border-color:#d9dde2;box-shadow:0 8px 20px rgba(20,24,32,.045)}
  .diary-write-inline:hover,.linked-record-btn:hover,.photo-add-btn:hover{background:#f7f8f9}
}

@media (max-width:380px){
  .diary-view{padding-left:14px;padding-right:14px}
  .diary-page-head h1{font-size:25px}
  .diary-lead{font-size:12px}
  .diary-write-inline{height:36px;padding:0 11px;font-size:12px}
  .diary-summary{padding:14px}
  .entry-main{padding:13px}
  .condition-scale{gap:5px}
  .condition-btn{height:66px;border-radius:12px}
  .condition-btn span{font-size:22px}
  .compose-section{padding-left:15px;padding-right:15px}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}
}

 
.diary-list-head,
.compose-page-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:0 0 12px !important;
  padding:0 !important;
}

.diary-list-head>div,
.compose-page-head>div{
  min-width:0;
  flex:1;
}

.diary-list-head .page-title,
.compose-page-head .page-title{
  margin:0;
  color:#101828;
  font-size:22px;
  line-height:1.2;
  font-weight:900;
  letter-spacing:-.5px;
  white-space:nowrap;
}

.diary-list-head .page-sub,
.compose-page-head .page-sub{
  margin-top:5px;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#667085;
  font-size:12px;
  line-height:1.45;
  font-weight:500;
}

.diary-write-inline,
.compose-page-head .back-btn{
  flex:0 0 auto;
  min-width:82px;
  height:42px;
  padding:0 14px;
  border:1px solid #e1e4e9;
  border-radius:12px;
  background:#fff;
  color:#344054;
  font-size:12px;
  font-weight:800;
  box-shadow:0 4px 12px rgba(20,24,32,.04);
  white-space:nowrap;
  cursor:pointer;
}

.diary-write-inline:hover,
.compose-page-head .back-btn:hover{
  background:#f7f8f9;
}

 
.compose-form{
  padding-top:0;
  padding-bottom:calc(34px + env(safe-area-inset-bottom));
}

.compose-intro{
  padding-top:4px;
}

.compose-intro .field-block:first-child{
  margin-top:0;
}

 
.type-segment{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

 
.diary-tabs{
  grid-template-columns:repeat(3,minmax(0,1fr));
}

.diary-tab,
.diary-tab.is-active{
  width:100%;
  min-width:0;
}

 
@media (max-width:380px){
  .diary-list-head,
  .compose-page-head{
    gap:10px;
  }

  .diary-list-head .page-title,
  .compose-page-head .page-title{
    font-size:21px;
  }

  .diary-list-head .page-sub,
  .compose-page-head .page-sub{
    font-size:11px;
  }

  .diary-write-inline,
  .compose-page-head .back-btn{
    min-width:78px;
    height:40px;
    padding:0 12px;
    font-size:11px;
  }
}

 
.diary-view,
.diary-compose{
  padding-left:18px !important;
  padding-right:18px !important;
}

 
.diary-compose{
  padding-top:24px !important;
  padding-bottom:calc(34px + env(safe-area-inset-bottom)) !important;
}

 
.diary-list-head,
.compose-page-head{
  margin:0 0 12px !important;
  padding:0 !important;
}

 
.compose-form{
  margin:0;
  padding-top:0;
}

 
.compose-intro{
  margin-top:0;
  padding-top:6px;
}

 
@media (max-width:380px){
  .diary-view,
  .diary-compose{
    padding-left:14px !important;
    padding-right:14px !important;
  }
}

