* { box-sizing: border-box; margin: 0; padding: 0; }
html,body { height: 100%; }

:root{
  --bg: #eef2f5;
  --card: #ffffff;
  --muted: #6b7280;
  --accent: #2563eb; /* blue */
  --accent-2: #10b981; /* green */
  --shadow: 0 8px 24px rgba(15,23,42,0.08);
  --radius: 12px;
  --glass: rgba(255,255,255,0.6);
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(180deg, #f6f8fb 0%, var(--bg) 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
  padding: 40px 20px;
  color: #0f172a;
}

.page {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: stretch;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand h1{
  font-size: 20px;
  font-weight: 700;
  padding: 10px 14px;
  background: var(--card);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display:flex;align-items:center;gap:10px;
}

.brand h1 i{ color: var(--accent); font-size:18px }

.actions {
  display:flex;gap:10px;align-items:center;
}

.btn {
  appearance: none;
  border: none;
  background: linear-gradient(90deg,var(--accent),#4f46e5);
  color: white;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(37,99,235,0.18);
  transition: transform .14s ease, box-shadow .14s ease, opacity .12s;
}
.btn:active{ transform: translateY(1px) }
.btn.secondary{
  background: transparent; color:var(--muted); box-shadow:none; border:1px solid rgba(15,23,42,0.06);
}

/* Bookmark grid */
.bookmark {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  align-items: stretch;
  width: 100%;
}

.bookmark-box {
  background: linear-gradient(180deg, rgba(255,255,255,0.6), var(--card));
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  display:flex;
  align-items:center;
  gap:12px;
  transition: transform .18s ease, box-shadow .18s ease;
  min-height:72px;
  overflow: hidden;
  border: 1px solid rgba(15,23,42,0.03);
}

.bookmark-box:hover{ transform: translateY(-6px); box-shadow: 0 16px 40px rgba(15,23,42,0.12); }

.bookmark-box .icon {
  width:44px;height:44px;flex:0 0 44px;border-radius:10px;display:grid;place-items:center;font-size:18px;background:var(--glass);
}

.bookmark-box h3{ font-size:16px; font-weight:700; color:#111827; }
.bookmark-box a{ color:inherit; text-decoration:none; display:block; width:100% }

/* Modal */
.modal-dialog {
  display:none;
  position:fixed;
  inset:0;
  z-index:1200;
  align-items:center;
  justify-content:center;
  background: rgba(2,6,23,0.45);
  padding:20px
}
.modal-dialog.show { display:flex }

.modal-content{
  width:100%;
  max-width:520px;
  background:var(--card);
  border-radius:14px;
  padding:18px;
  box-shadow: 0 30px 80px rgba(2,6,23,0.2);
}

.modal-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px; }
.modal-header h2{
  font-size:18px;
}
.icon-close{
  cursor:pointer;
  font-size:18px;
  color:var(--muted);
}
.icon-close:focus{ outline:2px solid rgba(37,99,235,0.18); border-radius:8px }

.modal-body{ margin-top:14px; display:flex; flex-direction:column; gap:12px }
.form-group{ display:flex; flex-direction:column; gap:8px }
label{ font-size:13px; color:var(--muted) }

input[type="text"], input[type="url"]{
  width:100%; padding:12px 14px; border-radius:10px; border:1px solid rgba(15,23,42,0.08); background: #fbfdff; font-size:14px; transition: box-shadow .12s, border-color .12s;
}
input[type="text"]:focus, input[type="url"]:focus{ outline:none; box-shadow: 0 8px 30px rgba(37,99,235,0.08); border-color: rgba(37,99,235,0.6) }

.modal-actions{ display:flex; gap:10px; margin-top:6px }
.modal-actions .btn{ width:auto }

/* Responsive tweaks */
@media (max-width:640px){
  .brand h1{ font-size:16px }
  .bookmark { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap:12px }
  body{ padding: 28px 12px }
}

.bookmark-box {
  position: relative;

}

.closing-button {
  position: absolute;
  top: -6px;
  right: -5px;

}