:root {
    --bg: #ffffff;
    --band: #eef3fb;
    --ink: #202124;
    --muted: #5f6368;
    --line: #dadce0;
    --soft-line: #e8eaed;
    --muskan-blue: #17136b;
    --muskan-orange: #f6a33a;
    --muskan-teal: #045b74;
    --accent: #17136b;
    --accent-soft: #dce8fb;
    --paper: #ffffff;
    --shadow: 0 1px 2px rgba(60, 64, 67, 0.16);
    --content-width: 1180px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.docs-home-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 64px;
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(240px, 720px) minmax(190px, 1fr);
    align-items: center;
    gap: 22px;
    padding: 0 22px;
    background: #fff;
    border-bottom: 1px solid var(--soft-line);
}

.header-left,
.header-right,
.search-shell,
.section-head,
.template-actions,
.recent-tools,
.doc-info {
    display: flex;
    align-items: center;
}

.header-left {
    gap: 13px;
    min-width: 0;
}

.header-right {
    justify-content: flex-end;
    gap: 14px;
}

.icon-button {
    width: 36px;
    height: 36px;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: #3c4043;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.icon-button:hover,
.template-actions button:hover,
.owner-filter:hover,
.doc-menu:hover {
    background: #f1f3f4;
}

.docs-file-icon {
    position: relative;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 2px solid transparent;
    border-radius: 10px;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(135deg, var(--muskan-teal) 0 32%, var(--muskan-orange) 32% 72%, var(--muskan-blue) 72%) border-box;
    box-shadow: inset 0 0 0 1px rgba(23, 19, 107, 0.08);
    overflow: hidden;
}

.docs-file-icon::before {
    content: "m";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muskan-orange);
    font-family: Arial Black, Arial, Helvetica, sans-serif;
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 2px 0 0 var(--muskan-blue);
    transform: translateY(-3px);
}

.docs-file-icon::after {
    content: "";
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--muskan-teal);
}

.docs-file-icon span {
    display: none;
}

.docs-wordmark {
    font-size: 22px;
    color: var(--muskan-blue);
    font-weight: 800;
    white-space: nowrap;
}

.search-shell {
    height: 48px;
    gap: 12px;
    padding: 0 18px;
    border-radius: 999px;
    background: #edf2fa;
    color: #3c4043;
}

.search-shell:focus-within {
    background: #fff;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.search-shell input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 15px;
}

.upgrade-button {
    height: 40px;
    border: 0;
    border-radius: 999px;
    padding: 0 20px;
    background: var(--accent-soft);
    color: var(--muskan-blue);
    font-weight: 700;
    cursor: pointer;
}

.apps-button {
    font-size: 22px;
}

.account-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--muskan-teal);
    color: #fff;
    font-weight: 700;
    box-shadow: inset 0 0 0 2px #e6f4ea;
}

.content-width {
    width: min(var(--content-width), calc(100vw - 40px));
    margin: 0 auto;
}

.template-band {
    background: var(--band);
    padding: 22px 0 28px;
}

.section-head {
    justify-content: space-between;
    gap: 18px;
    min-height: 36px;
}

.section-head h1,
.section-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.template-actions {
    gap: 8px;
}

.template-actions button,
.owner-filter {
    height: 34px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #3c4043;
    cursor: pointer;
}

.template-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 18px;
    margin-top: 14px;
}

.template-card-form {
    position: relative;
    min-width: 0;
}

.template-card {
    position: relative;
    width: 100%;
    aspect-ratio: 0.78;
    border: 1px solid #c8ccd1;
    border-radius: 2px;
    background: #fff;
    display: block;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
}

.template-card:hover {
    border-color: var(--accent);
}

.custom-template-card .template-card {
    border-color: rgba(23, 19, 107, 0.35);
}

.custom-template-card .template-card::after {
    content: "Saved";
    position: absolute;
    right: 8px;
    top: 8px;
    border-radius: 999px;
    padding: 3px 8px;
    background: rgba(23, 19, 107, 0.08);
    color: var(--muskan-blue);
    font-size: 11px;
    font-weight: 700;
}

.custom-template-delete-form {
    position: absolute;
    right: 7px;
    top: 7px;
    z-index: 3;
}

.custom-template-delete-form button {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(23, 19, 107, 0.18);
    border-radius: 50%;
    background: #ffffff;
    color: #5f6368;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.16);
}

.custom-template-delete-form button:hover {
    background: #fce8e6;
    color: #b3261e;
}

.blank-template {
    position: relative;
}

.plus-mark,
.plus-mark::before {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 50px;
    height: 10px;
    border-radius: 999px;
    background: var(--muskan-blue);
    content: "";
    transform: translate(-50%, -50%);
}

.plus-mark::before {
    background: var(--muskan-orange);
    transform: translate(-50%, -50%) rotate(90deg);
}

.plus-mark::after {
    content: "";
    position: absolute;
    left: 20px;
    top: -20px;
    width: 10px;
    height: 50px;
    border-radius: 999px;
    background: linear-gradient(to bottom, var(--muskan-teal) 0 35%, var(--muskan-orange) 35% 65%, transparent 65%);
}

.template-preview {
    display: block;
    width: 340px;
    height: 436px;
    padding: 34px 36px;
    color: #202124;
    text-align: left;
    transform: scale(0.36);
    transform-origin: top left;
    font: 16px/1.45 Arial, Helvetica, sans-serif;
}

.template-preview h1 {
    margin: 0 0 18px;
    font-size: 31px;
}

.template-preview h2 {
    margin: 20px 0 8px;
    font-size: 21px;
}

.template-preview p,
.template-preview ul,
.template-preview ol {
    margin: 0 0 12px;
}

.template-name,
.template-subtitle {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-name {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 700;
}

.template-subtitle {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.documents-main {
    padding: 24px 0 90px;
}

.recent-head {
    margin-bottom: 26px;
}

.recent-tools {
    gap: 14px;
}

.recent-tools .active {
    color: var(--accent);
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    align-items: start;
    gap: 22px;
}

.doc-card {
    min-width: 0;
    align-self: start;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: #fff;
    overflow: hidden;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.doc-card:hover,
.doc-card:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.doc-thumb {
    display: block;
    height: 230px;
    padding: 16px 18px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}

.thumb-page {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #fff;
}

.thumb-content {
    width: 612px;
    min-height: 792px;
    padding: 58px 68px;
    color: #202124;
    pointer-events: none;
    transform: scale(0.23);
    transform-origin: top left;
    font: 16px/1.45 Arial, Helvetica, sans-serif;
}

.thumb-content h1 {
    margin: 0 0 18px;
    font-size: 34px;
    line-height: 1.2;
}

.thumb-content h2 {
    margin: 22px 0 10px;
    font-size: 25px;
}

.thumb-content h3 {
    margin: 18px 0 8px;
    font-size: 20px;
}

.thumb-content p,
.thumb-content ul,
.thumb-content ol,
.thumb-content blockquote,
.thumb-content pre {
    margin: 0 0 12px;
}

.thumb-content ul,
.thumb-content ol {
    padding-left: 26px;
}

.doc-meta {
    position: relative;
    min-height: 76px;
    padding: 14px 44px 12px 16px;
}

.doc-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
}

.doc-info {
    gap: 5px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.mini-doc-icon {
    position: relative;
    width: 15px;
    height: 18px;
    border-radius: 2px;
    background: linear-gradient(135deg, var(--muskan-teal), var(--muskan-blue));
}

.mini-doc-icon::before,
.mini-doc-icon::after {
    content: "";
    position: absolute;
    left: 4px;
    width: 7px;
    height: 1px;
    background: #fff;
}

.mini-doc-icon::before {
    top: 7px;
}

.mini-doc-icon::after {
    top: 11px;
}

.shared-icon {
    color: #3c4043;
    font-size: 13px;
}

.doc-menu-wrap {
    position: absolute;
    right: 8px;
    bottom: 10px;
}

.doc-menu {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #3c4043;
    cursor: pointer;
}

.doc-menu-wrap.menu-open .doc-menu {
    background: #f1f3f4;
}

.doc-delete-form {
    position: absolute;
    right: 0;
    bottom: 36px;
    z-index: 5;
    min-width: 128px;
    padding: 6px 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(60, 64, 67, 0.24);
    display: none;
}

.doc-menu-wrap.menu-open .doc-delete-form {
    display: block;
}

.doc-delete-action {
    width: 100%;
    height: 34px;
    border: 0;
    background: transparent;
    color: #b3261e;
    text-align: left;
    padding: 0 14px;
    cursor: pointer;
}

.doc-delete-action:hover {
    background: #fce8e6;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 52px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: center;
}

.empty-state h2 {
    margin: 0 0 16px;
}

.empty-state button {
    height: 38px;
    border: 0;
    border-radius: 999px;
    padding: 0 18px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.floating-create {
    position: fixed;
    right: 28px;
    bottom: 26px;
    z-index: 30;
}

.floating-create button {
    position: relative;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.3);
    cursor: pointer;
}

.floating-create span,
.floating-create span::before {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 26px;
    height: 5px;
    border-radius: 999px;
    background: var(--muskan-blue);
    content: "";
    transform: translate(-50%, -50%);
}

.floating-create span::before {
    background: var(--muskan-orange);
    transform: translate(-50%, -50%) rotate(90deg);
}

.hidden-by-search {
    display: none;
}

@media (max-width: 1180px) {
    .template-row {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }

    .documents-grid {
        grid-template-columns: repeat(4, minmax(150px, 1fr));
    }
}

@media (max-width: 860px) {
    .docs-home-header {
        height: auto;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px 16px;
    }

    .header-right {
        justify-content: flex-start;
    }

    .template-row {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .documents-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }
}

@media (max-width: 560px) {
    .content-width {
        width: calc(100vw - 24px);
    }

    .template-row,
    .documents-grid {
        grid-template-columns: 1fr;
    }

    .doc-thumb {
        height: 260px;
    }

    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }
}
