*{box-sizing:border-box}

:root{
  --bg:#f5f5f2;
  --surface:#fff;
  --text:#202124;
  --muted:#6b6b68;
  --border:rgba(0,0,0,.08);
  --shadow:0 2px 8px rgba(0,0,0,.06);
  --shadow-hover:0 5px 16px rgba(0,0,0,.10);
  --radius:16px;
}

html,body{
  margin:0;
  padding:0;
  min-height:100%;
}

body{
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
}

button,input,textarea{
  font:inherit;
}

button{
  border:0;
  cursor:pointer;
}

header{
  position:sticky;
  top:0;
  z-index:10;
  padding:14px 16px 10px;
  background:rgba(245,245,242,.94);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}

.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  max-width:1100px;
  margin:auto;
}

.top h1{
  margin:0;
  font-size:23px;
  font-weight:700;
  letter-spacing:-.4px;
}

.row{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
}

.search{
  display:block;
  width:100%;
  max-width:1100px;
  margin:12px auto 0;
  padding:11px 15px;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.92);
  color:var(--text);
  outline:none;
  box-shadow:0 1px 4px rgba(0,0,0,.03);
}

.search:focus{
  border-color:rgba(0,0,0,.18);
  box-shadow:0 2px 10px rgba(0,0,0,.07);
}

.tag-filter{
  display:flex;
  gap:6px;
  max-width:1100px;
  margin:7px auto 0;
  padding:0 1px 3px;
  overflow-x:auto;
  scrollbar-width:none;
}

.tag-filter::-webkit-scrollbar{
  display:none;
}

.tag-filter button{
  flex:0 0 auto;
  padding:5px 10px;
  border:1px solid rgba(0,0,0,.08);
  border-radius:8px;
  background:#fff;
  color:#555;
  font-size:11px;
  font-weight:600;
}

.tag-filter button.tag-active{
  background:#202124;
  color:#fff;
  border-color:#202124;
}

.grid{
  width:100%;
  max-width:1100px;
  margin:auto;
  padding:12px 14px 90px;
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(155px,1fr));
  gap:10px;
}

.card{
  position:relative;
  min-height:112px;
  padding:13px 13px 12px;
  border:1px solid rgba(0,0,0,.07);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  cursor:pointer;
  transition:transform .15s ease,box-shadow .15s ease;
  overflow:hidden;
}

.card:hover{
  transform:translateY(-1px);
  box-shadow:var(--shadow-hover);
}

.card h3{
  margin:0 0 7px;
  padding-right:24px;
  font-size:15px;
  line-height:1.25;
  font-weight:700;
  letter-spacing:-.15px;
}

.preview{
  white-space:pre-wrap;
  color:#555;
  font-size:11px;
  line-height:1.45;
}

.card-tags{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin-top:9px;
}

.tag{
  display:inline-block;
  padding:3px 7px;
  border-radius:5px;
  background:rgba(255,255,255,.55);
  color:#444;
  font-size:9px;
  font-weight:700;
  line-height:1.25;
  white-space:nowrap;
}

.select-note{
  position:absolute;
  top:8px;
  right:8px;
  width:25px;
  height:25px;
  padding:0;
  border-radius:50%;
  background:rgba(255,255,255,.55);
  color:#222;
  font-size:13px;
  opacity:1;
  transition:opacity .15s ease;
}

.card:hover .select-note,
.select-note:focus{
  opacity:1;
}

.fab{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:20;
  padding:12px 17px;
  border-radius:15px;
  background:#202124;
  color:#fff;
  font-size:14px;
  font-weight:700;
  box-shadow:0 6px 20px rgba(0,0,0,.20);
}

.screen{
  width:100%;
  max-width:760px;
  margin:auto;
  padding:20px 16px 40px;
}

.editor input,
.editor textarea,
.login input{
  width:100%;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  border-radius:13px;
  padding:12px 14px;
  margin-bottom:10px;
  outline:none;
}

.editor textarea{
  min-height:170px;
  resize:vertical;
  line-height:1.5;
}

.editor input:focus,
.editor textarea:focus,
.login input:focus{
  border-color:rgba(0,0,0,.2);
}

.task{
  display:flex;
  align-items:center;
  gap:9px;
  padding:9px 10px;
  margin:7px 0;
  background:#fff;
  border:1px solid var(--border);
  border-radius:11px;
}

.task input{
  width:20px;
  height:20px;
  margin:0;
}

.task span{
  flex:1;
  font-size:14px;
}

.task.done span{
  text-decoration:line-through;
  color:#888;
}

button:not(.select-note){
  border-radius:11px;
  padding:9px 13px;
  background:#202124;
  color:#fff;
  font-size:13px;
  font-weight:600;
}

.ghost{
  background:#e9e9e6 !important;
  color:#252525 !important;
}

.danger{
  background:#b33b3b !important;
  color:#fff !important;
}

.share{
  background:#5555c9 !important;
}

.back{
  background:transparent !important;
  color:#222 !important;
  padding-left:0 !important;
}

.muted{
  color:var(--muted);
}

.empty{
  grid-column:1/-1;
  text-align:center;
  color:var(--muted);
  padding:60px 20px;
}

.login{
  width:100%;
  max-width:400px;
  margin:12vh auto;
  padding:22px;
}

.login h1{
  margin:0 0 6px;
  font-size:28px;
}

@media(max-width:500px){
  .grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    padding:9px 9px 85px;
  }

  .card{
    min-height:105px;
    padding:11px;
    border-radius:14px;
  }

  .card h3{
    font-size:14px;
  }

  .preview{
    font-size:10px;
  }

  .top h1{
    font-size:21px;
  }

  header{
    padding:12px 10px 8px;
  }

  .search{
    margin-top:10px;
  }
}

/* Výběr barvy poznámky */
.colors{
  display:flex;
  align-items:center;
  gap:8px;
  margin:4px 0 16px;
}

.colors button{
  width:30px;
  height:30px;
  min-width:30px;
  padding:0;
  border:2px solid rgba(0,0,0,.10);
  border-radius:9px;
  font-size:0;
  box-shadow:none;
}

.colors button[data-color="default"]{
  background:#ffffff;
}

.colors button[data-color="yellow"]{
  background:#fff3a6;
}

.colors button[data-color="green"]{
  background:#bfe8c5;
}

.colors button[data-color="blue"]{
  background:#bcd8f5;
}

.colors button[data-color="purple"]{
  background:#d8c5f0;
}

.colors button[data-color="red"]{
  background:#f3c0c0;
}

.colors button:hover{
  transform:scale(1.08);
}

.colors button:active{
  transform:scale(.96);
}

/* Plovoucí tlačítko nové poznámky */
.fab{
  width:54px;
  height:54px;
  padding:0 !important;
  border-radius:50% !important;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:28px !important;
  font-weight:400 !important;
  line-height:1;
}

/* Nástěnka – nové plovoucí tlačítko */
button.fab{
  position:fixed !important;
  right:18px !important;
  bottom:18px !important;
  width:52px !important;
  height:52px !important;
  min-width:52px !important;
  max-width:52px !important;
  padding:0 !important;
  margin:0 !important;
  border-radius:50% !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:hidden !important;
  font-size:30px !important;
  line-height:52px !important;
  white-space:nowrap !important;
  text-indent:0 !important;
  letter-spacing:0 !important;
}

button.fab::before,
button.fab::after{
  content:none !important;
  display:none !important;
}

button.fab{
  position:fixed !important;
  right:18px !important;
  bottom:18px !important;
  width:52px !important;
  height:52px !important;
  min-width:52px !important;
  max-width:52px !important;
  padding:0 !important;
  margin:0 !important;
  border-radius:50% !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:hidden !important;
  font-size:30px !important;
  line-height:52px !important;
  white-space:nowrap !important;
}

/* Barva poznámky i při editaci */
.editor{
  background:var(--note-bg, #ffffff) !important;
  transition:background-color .15s ease;
}



/* Obrázkové přílohy v poznámce */
.image-attachment{
  width:100%;
  max-width:100%;
  display:flex;
  justify-content:center;
  overflow:hidden;
}

.image-attachment a{
  display:flex;
  justify-content:center;
  width:100%;
  max-width:100%;
}

.image-attachment img{
  display:block;
  width:auto !important;
  max-width:100% !important;
  height:220px !important;
  max-height:220px !important;
  object-fit:contain !important;
  border-radius:10px;
}



/* KOMPATNI NAHLED PRILOH */
.editor .image-attachment {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.editor .image-attachment img {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 220px !important;
  object-fit: contain !important;
}

/* FINAL IMAGE ATTACHMENT LAYOUT */
.image-attachment {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 8px 0 14px;
}

.image-attachment a {
  display: block;
  width: 100%;
  text-align: center;
}

.image-attachment img {
  display: block !important;
  width: 100% !important;
  max-width: 500px !important;
  height: auto !important;
  max-height: 500px !important;
  object-fit: contain !important;
  border-radius: 10px;
}

.image-attachment .attachment-name {
  display: block !important;
  width: 100%;
  text-align: center;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* CLIPBOARD BETA HEADER */

body {
  background: #8f8f8f !important;
}

.powered-by {
  font-size: 11px;
  line-height: 1.2;
  opacity: .65;
  margin-top: -4px;
  font-weight: 400;
}

/* CLIPBOARD MAIN SCREEN BACKGROUND */
.screen:not(.editor) {
  background: #8f8f8f !important;
}

/* CLIPBOARD MAIN PAGE BACKGROUND FINAL */
html,
body {
  background: #8f8f8f !important;
}

#app {
  background: #8f8f8f !important;
  min-height: 100vh;
}

#app > header {
  background: #8f8f8f !important;
}

#app > .tag-filter {
  background: #8f8f8f !important;
}

#app > .grid {
  background: #8f8f8f !important;
}

.screen.editor {
  background: var(--note-bg, #ffffff) !important;
}

/* CLIPBOARD DEFINITIVE BACKGROUND */

html {
  background: #8f8f8f !important;
}

body {
  background: #8f8f8f !important;
}

#app {
  background: #8f8f8f !important;
  min-height: 100vh !important;
}

#app > header {
  background: #8f8f8f !important;
}

#app > .tag-filter {
  background: #8f8f8f !important;
}

#app > .grid {
  background: #8f8f8f !important;
}

#app > .grid .card {
  background: #ffffff;
}

/* FINAL TAG STYLE */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.card-tags .tag {
  display: inline-flex !important;
  align-items: center;
  padding: 4px 9px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.72) !important;
  border: 1px solid rgba(0,0,0,.08) !important;
  color: #444 !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
