/* Medic Notes modern responsive design */
:root{--navy:#123b68;--blue:#2563eb;--pale:#eaf2ff;--ink:#17243b;--muted:#6a7890;--line:#e4eaf2;--bg:#f5f8fc;--shadow:0 12px 32px #14315512}*{box-sizing:border-box}html{scroll-behavior:smooth;scroll-padding-top:90px}body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.6 Inter,system-ui,-apple-system,'Segoe UI',sans-serif}a{color:inherit;text-decoration:none}button,input,textarea{font:inherit}.top{height:70px;position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:13px;padding:0 clamp(14px,4vw,40px);background:#ffffffef;backdrop-filter:blur(12px);border-bottom:1px solid var(--line)}#menubtn{width:41px;height:41px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--navy);font-size:20px}.brand{display:flex;align-items:center;gap:10px}.logo{width:41px;height:41px;display:grid;place-items:center;border-radius:13px;background:linear-gradient(135deg,#123b68,#3478d4);color:white;font-weight:900}.brand b{display:block;font-size:16px}.brand small{display:block;font-size:11px;color:var(--muted)}.tag{margin-left:auto;color:var(--muted);font-size:10px;font-weight:800;letter-spacing:1px}.layout{display:flex;min-height:calc(100vh - 70px)}#sidebar{width:245px;flex-shrink:0;background:#fff;border-right:1px solid var(--line);padding:23px 15px}.navlabel{margin:5px 12px 8px;color:#8b98aa;text-transform:uppercase;letter-spacing:1.2px;font-size:10px;font-weight:850}#sidebar>a{display:block;margin:3px 0;padding:12px;border-radius:12px;color:#52627a;font-size:14px;font-weight:700}#sidebar>a:hover,#sidebar>a.active{background:var(--pale);color:var(--blue)}.tip{margin:26px 5px 0;padding:15px;border-radius:15px;background:#eff6ff;color:#536680;font-size:12px}.tip b{color:var(--navy)}.tip p{margin:5px 0 0}.tip a{color:var(--blue);font-weight:800}.main{min-width:0;flex:1;display:flex;flex-direction:column}.content{width:100%;max-width:1120px;padding:clamp(20px,4vw,40px);margin:auto;flex:1}footer{padding:18px;text-align:center;background:#fff;border-top:1px solid var(--line);color:#7a8799;font-size:12px}footer b{color:#43536b}.eyebrow{color:var(--blue);font-size:11px;font-weight:850;letter-spacing:1.4px;text-transform:uppercase}h1{margin:7px 0;font-size:clamp(27px,4vw,36px);line-height:1.2;letter-spacing:-1px}h2{font-size:19px;margin:0}h3{font-size:15px}.muted,.section-title p{color:var(--muted)}.intro{margin:0 0 25px}.hero{position:relative;overflow:hidden;padding:clamp(25px,4vw,40px);border-radius:23px;background:linear-gradient(115deg,#123b68,#2364aa 70%,#3e84d9);color:#fff;box-shadow:var(--shadow);margin-bottom:25px}.hero:after{content:'✚';position:absolute;right:5%;top:-45px;font-size:200px;color:#ffffff0d}.hero h1{max-width:650px;font-size:clamp(29px,4vw,39px);position:relative}.hero p:not(.eyebrow){max-width:640px;color:#e1edff;position:relative}.hero .eyebrow{color:#c7e0ff}.btn{display:inline-flex;align-items:center;justify-content:center;padding:10px 15px;border:0;border-radius:11px;background:var(--blue);color:#fff;font-size:13px;font-weight:800;cursor:pointer}.btn.white{position:relative;background:white;color:var(--navy)}.btn.secondary{background:white;color:var(--ink);border:1px solid var(--line)}.btn.danger{background:#fff0f1;color:#b52b3a;border:1px solid #ffd6db}.btn.mini{padding:7px 10px;font-size:11px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:28px}.stat{padding:16px;background:#fff;border:1px solid var(--line);border-radius:16px}.stat small{display:block;color:var(--muted);font-size:12px}.stat b{display:block;font-size:27px;margin-top:6px}.section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:28px 0 15px}.section-title p{margin:2px 0;font-size:12px}.year{margin:24px 0 8px}.semester{margin:14px 0 9px;font-size:11px;text-transform:uppercase;letter-spacing:1px;color:#66758b}.course-grid,.topic-grid,.info-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.course,.topic,.info{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 5px 18px #173d6507}.course{padding:17px;transition:.18s}.course:hover,.topic:hover{transform:translateY(-2px);border-color:#b9d1fa}.course-top{display:flex;align-items:start;justify-content:space-between}.course-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:13px;background:var(--pale);font-size:21px}.pill{padding:4px 8px;border-radius:30px;background:#f0f5fb;color:#61728a;font-size:10px;font-weight:800}.course h3{margin:12px 0 4px}.course p,.info p{margin:0;color:var(--muted);font-size:12px}.course-bottom{display:flex;justify-content:space-between;margin-top:15px;padding-top:11px;border-top:1px solid #edf0f5;color:var(--muted)}.arrow{color:var(--blue);font-size:19px}.crumb{display:flex;flex-wrap:wrap;gap:8px;color:var(--muted);font-size:12px;margin-bottom:20px}.crumb a{color:var(--blue);font-weight:750}.topic{display:flex;align-items:center;gap:12px;padding:15px}.topic-icon{width:42px;height:42px;display:grid;place-items:center;flex-shrink:0;border-radius:12px;background:#eef8f5;color:#0f9f78;font-size:20px}.topic small{display:block;color:var(--muted);font-size:11px}.topic .arrow{margin-left:auto}.paper{background:white;border:1px solid var(--line);border-radius:17px;box-shadow:var(--shadow);padding:clamp(20px,4vw,35px);min-height:280px}.paper-meta{border-bottom:1px solid var(--line);padding-bottom:12px;margin-bottom:20px;color:var(--muted);font-size:11px;font-weight:800}.note{font-size:15px;line-height:1.9;overflow-wrap:anywhere}.back{margin-top:20px}.info{padding:20px}.stat-icon{display:inline-grid;place-items:center;width:36px;height:36px;background:var(--pale);border-radius:11px}.info h3{margin:12px 0 5px}.empty{padding:35px;text-align:center;border:1px dashed #cbd7e6;border-radius:16px;color:var(--muted)}.empty b{color:var(--ink)}.empty p{margin:5px 0}.mobile-scrim{display:none}.admin-content{max-width:1100px;padding:clamp(20px,4vw,40px);margin:auto}.admin-content.narrow{max-width:800px}.admin-top .btn{margin-left:auto}.admin-list{display:flex;flex-direction:column;gap:11px}.admin-row{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:15px;background:#fff;border:1px solid var(--line);border-radius:15px}.admin-row small{display:block;color:var(--muted);font-size:11px}.actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}.actions form{display:flex;gap:5px}.form-card,.setup-card{padding:clamp(20px,4vw,30px);background:white;border:1px solid var(--line);border-radius:17px;box-shadow:var(--shadow)}.form label{display:flex;flex-direction:column;gap:7px;margin:0 0 15px;color:#52627a;font-size:12px;font-weight:800}.form input,.form textarea,.inline-form input,.rename-form input{width:100%;min-width:0;border:1px solid var(--line);border-radius:10px;padding:11px;background:#fff;color:var(--ink)}.form textarea{resize:vertical;line-height:1.7}.form-two{display:grid;grid-template-columns:1fr 1fr;gap:13px}.form .btn{margin-top:5px}.inline-form{display:flex;gap:8px;margin:16px 0}.inline-form input[type=number]{max-width:90px}.rename-form{display:flex;gap:5px}.rename-form input{width:130px;padding:7px;font-size:12px}.notes-editor{min-height:48vh;font-family:ui-monospace,monospace;font-size:13px}.setup{min-height:100vh;display:grid;place-items:center;padding:20px;background:linear-gradient(145deg,#edf4ff,#f7f9fc)}.setup-card{width:100%;max-width:460px}.setup-card h1{margin:16px 0}.setup-card .logo{width:54px;height:54px}.setup-card .form{margin-top:20px}.setup-card .form .btn{width:100%}.success,.error{padding:11px 13px;border-radius:10px;font-size:13px}.success{background:#eafaf3;color:#087753}.error{background:#fff0f1;color:#a52333}.setup-card .muted{font-size:13px}.narrow .form-card{margin-top:20px}
@media(max-width:820px){#sidebar{position:fixed;z-index:30;top:70px;bottom:0;left:0;transform:translateX(-105%);transition:transform .2s;box-shadow:var(--shadow);overflow:auto}#sidebar.open{transform:translateX(0)}#scrim.open{display:block;position:fixed;z-index:25;inset:70px 0 0;background:#10233b66}.admin-row{align-items:flex-start;flex-direction:column}.actions{justify-content:flex-start}}
@media(max-width:560px){.top{height:64px;padding:0 12px}.layout{min-height:calc(100vh - 64px)}#sidebar{top:64px}#scrim.open{inset:64px 0 0}.brand small{font-size:10px}.brand b{font-size:15px}.tag{display:none}.stats{gap:7px}.stat{padding:11px}.stat b{font-size:22px}.stat small{font-size:10px}.course-grid,.topic-grid,.info-grid{grid-template-columns:1fr}.hero{border-radius:18px}.hero .btn{width:100%}.form-two{grid-template-columns:1fr;gap:0}.inline-form{flex-wrap:wrap}.inline-form input:first-of-type{flex-basis:100%}.admin-row .actions{width:100%}.rename-form{flex:1}.rename-form input{width:100%}}


/* Rich notes editor */
.editor-toolbar{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 10px;padding:10px;background:#f4f7fc;border:1px solid var(--line);border-radius:12px}
.editor-tool{display:flex;align-items:center;gap:7px;padding:8px 10px;border:1px solid #dce5f1;border-radius:9px;background:#fff;color:var(--ink);font-size:12px;font-weight:800;cursor:pointer}
.editor-tool:hover,.editor-tool:focus{border-color:var(--blue);background:#eef4ff;outline:none}
.editor-tool span{font-size:10px;color:var(--muted);font-weight:700}
.editor-tool .tool-heading{font-size:13px;color:var(--blue);font-weight:900}
.rich-notes-editor{min-height:48vh;max-height:70vh;overflow:auto;padding:16px;border:1px solid #d9e2ef;border-radius:12px;background:#fff;color:var(--ink);font:15px/1.8 system-ui,-apple-system,'Segoe UI',sans-serif;outline:none}
.rich-notes-editor:focus{border-color:var(--blue);box-shadow:0 0 0 3px #2563eb18}
.rich-notes-editor:empty:before{content:attr(data-placeholder);color:#9aa6b7;pointer-events:none}
.rich-notes-editor h2{font-size:1.65em;line-height:1.3;margin:1.1em 0 .45em;font-weight:850}
.rich-notes-editor h3{font-size:1.3em;line-height:1.4;margin:1em 0 .4em;font-weight:800}
.rich-notes-editor h4{font-size:1.12em;margin:.9em 0 .35em;font-weight:800}
.rich-notes-editor ul,.rich-notes-editor ol{padding-left:1.7em}
.note h2{font-size:1.65em;line-height:1.3;margin:1.1em 0 .45em;font-weight:850}
.note h3{font-size:1.3em;line-height:1.4;margin:1em 0 .4em;font-weight:800}
.note h4{font-size:1.12em;margin:.9em 0 .35em;font-weight:800}
.note ul,.note ol{padding-left:1.7em}
.note blockquote{margin:1em 0;padding:.6em 1em;border-left:4px solid var(--blue);background:#f4f7fc;color:#52627a}


/* Phone landscape: keep navigation collapsed behind the menu button */
@media (orientation: landscape) and (max-height: 500px) {
  #menubtn { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 41px; }
  #sidebar {
    position: fixed;
    z-index: 30;
    top: 70px;
    bottom: 0;
    left: 0;
    width: min(270px, 82vw);
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: var(--shadow);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #sidebar.open { transform: translateX(0); }
  #scrim.open {
    display: block;
    position: fixed;
    z-index: 25;
    inset: 70px 0 0;
    background: #10233b66;
  }
  .layout { min-height: calc(100vh - 70px); }
}
@media (orientation: landscape) and (max-height: 500px) and (max-width: 560px) {
  #sidebar { top: 64px; }
  #scrim.open { inset: 64px 0 0; }
}

/* Medic Notes logo image */
.logo { overflow: hidden; flex-shrink: 0; }
.logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}
.setup-card > .logo {
  width: 64px;
  height: 64px;
  padding: 0;
}


/* Logo sizing fix: prevent the full logo artwork from expanding across the page */
.top .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top .brand .logo {
  display: block;
  position: relative;
  flex: 0 0 41px;
  width: 41px !important;
  min-width: 41px;
  max-width: 41px;
  height: 41px !important;
  min-height: 41px;
  max-height: 41px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  line-height: 0;
}
.top .brand .logo img {
  display: block;
  position: static;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  object-fit: contain;
  margin: 0;
}
.setup-card > .logo {
  width: 64px !important;
  min-width: 64px;
  max-width: 64px;
  height: 64px !important;
  min-height: 64px;
  max-height: 64px;
  overflow: hidden;
}
.setup-card > .logo img {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  object-fit: contain;
}
